Skip to content

Commit

Permalink
Remove code formatter need JDK8 required
Browse files Browse the repository at this point in the history
  • Loading branch information
xiemalin authored and xiemalin committed Mar 23, 2017
1 parent d298cfc commit d567b42
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 29 deletions.
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@
<version>3.22.0-CR1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.googlejavaformat</groupId>
<artifactId>google-java-format</artifactId>
<version>1.3</version>
</dependency>
</dependencies>

<build>
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
import com.baidu.bjf.remoting.protobuf.utils.ProtobufProxyUtils;
import com.baidu.bjf.remoting.protobuf.utils.StringUtils;
import com.baidu.bjf.remoting.protobuf.utils.compiler.Compiler;
import com.google.googlejavaformat.java.Formatter;
import com.google.googlejavaformat.java.FormatterException;

/**
* A simple protocol buffer encode and decode utility tool.
Expand Down Expand Up @@ -77,9 +75,6 @@ public final class ProtobufProxy {
/** The Constant OUTPUT_PATH for target directory to create generated source code out. */
public static final ThreadLocal<File> OUTPUT_PATH = new ThreadLocal<File>();

/** The Constant formatter. */
private static final Formatter formatter = new Formatter();

/**
* To generate a protobuf proxy java source code for target class.
*
Expand Down Expand Up @@ -264,13 +259,6 @@ protected static <T> Codec<T> doCreate(Class<T> cls, boolean debug) {
String code = cg.getCode();
if (debug) {
String printCode = code;
// here format code
try {
printCode = formatter.formatSource(printCode);
} catch (FormatterException e) {
LOGGER.warning("format source code failed. " + e.getMessage());
}

CodePrinter.printCode(printCode, "generate protobuf proxy code");
}

Expand Down
2 changes: 2 additions & 0 deletions v3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@
<type>jar</type>
<scope>compile</scope>
</dependency>
<!--
<dependency>
<groupId>com.google.googlejavaformat</groupId>
<artifactId>google-java-format</artifactId>
<version>1.3</version>
</dependency>
-->
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import com.baidu.bjf.remoting.protobuf.utils.JDKCompilerHelper;
import com.baidu.bjf.remoting.protobuf.utils.ProtobufProxyUtils;
import com.baidu.bjf.remoting.protobuf.utils.StringUtils;
import com.google.googlejavaformat.java.Formatter;
import com.google.googlejavaformat.java.FormatterException;

/**
* A simple protocol buffer encode and decode utility tool.
Expand Down Expand Up @@ -75,9 +73,6 @@ public final class ProtobufProxy {

public static final ThreadLocal<File> OUTPUT_PATH = new ThreadLocal<File>();

/** The Constant formatter. */
private static final Formatter formatter = new Formatter();

/**
* To generate a protobuf proxy java source code for target class.
*
Expand Down Expand Up @@ -244,13 +239,6 @@ protected static <T> Codec<T> doCreate(Class<T> cls, boolean debug) {
String code = cg.getCode();
if (debug) {
String printCode = code;
// here format code
try {
printCode = formatter.formatSource(printCode);
} catch (FormatterException e) {
LOGGER.warning("format source code failed. " + e.getMessage());
}

CodePrinter.printCode(printCode, "generate protobuf proxy code");
}

Expand Down

0 comments on commit d567b42

Please sign in to comment.