Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
xiemalin committed Jun 26, 2019
1 parent 832969f commit 14c8cd8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand All @@ -12,7 +13,7 @@

<groupId>com.baidu</groupId>
<artifactId>jprotobuf</artifactId>
<version>1.11.20</version>
<version>1.11.20</version>

<name>Jprotobuf</name>
<description>A very useful utility library for java programmer using google protobuf.</description>
Expand Down Expand Up @@ -210,7 +211,7 @@
</goals>
</execution>
</executions>
</plugin>
</plugin>


</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* @since 1.0.2
*/
public class ProtobufIDLProxy {

/** Logger for this class. */
private static final Logger LOGGER = LoggerFactory.getLogger(ProtobufIDLProxy.class.getCanonicalName());

Expand Down Expand Up @@ -144,7 +144,7 @@ private boolean isDepndency() {

/** The Constant PACKAGE_SPLIT_CHAR. */
private static final char PACKAGE_SPLIT_CHAR = '.';

/** The Constant PACKAGE_SPLIT. */
private static final String PACKAGE_SPLIT = PACKAGE_SPLIT_CHAR + "";

Expand Down Expand Up @@ -964,7 +964,7 @@ private static List<Class<?>> createMessageClass(ProtoFile protoFile, boolean mu
public static IDLProxyObject createSingle(InputStream is) throws IOException {
return createSingle(is, false);
}

/**
* Creates the single.
*
Expand Down Expand Up @@ -1348,7 +1348,7 @@ private static List<ProtoFile> findRelateProtoFiles(File file, Set<String> depen
protoFiles.addAll(findRelateProtoFiles(dependencyFile, dependencyNames));
}
}

List<String> publicDependencies = protoFile.getPublicDependencies();
if (publicDependencies != null && !publicDependencies.isEmpty()) {
for (String fn : publicDependencies) {
Expand Down Expand Up @@ -1652,8 +1652,11 @@ private static void writeSourceCode(CodeDependent cd, File sourceOutputDir) {
FileOutputStream fos = null;
try {
fos = new FileOutputStream(new File(f, cd.name + ".java"));
fos.write(cd.code.getBytes(UTF_8));

String code = cd.code;
fos.write(code.getBytes(UTF_8));
fos.flush();

} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ protected static <T> Codec<T> doCreate(Class<T> cls, boolean debug, Compiler com
}

String code = cg.getCode();

if (debug) {
String printCode = code;
CodePrinter.printCode(printCode, "generate protobuf proxy code");
Expand Down
4 changes: 2 additions & 2 deletions v3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.baidu</groupId>
<artifactId>jprotobuf</artifactId>
<version>2.2.11</version>
<version>2.2.12</version>

<name>jprotobuf</name>
<description>A very useful utility library for java programmer using google protobuf.</description>
Expand Down Expand Up @@ -108,7 +108,7 @@
<plugin>
<groupId>com.baidu</groupId>
<artifactId>jprotobuf-precompile-plugin</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
<configuration>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
<filterClassPackage>com.baidu</filterClassPackage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.google.protobuf.DescriptorProtos.FileDescriptorProto;
import com.google.protobuf.Descriptors.Descriptor;
import com.google.protobuf.Descriptors.FieldDescriptor;
import com.google.protobuf.Descriptors.FieldDescriptor.JavaType;
import com.google.protobuf.Descriptors.FileDescriptor;
import com.google.protobuf.DynamicMessage;
import com.google.protobuf.InvalidProtocolBufferException;
Expand Down

0 comments on commit 14c8cd8

Please sign in to comment.