Fix Java build.

pull/2923/head
Feng Xiao 8 years ago
parent acde1651b5
commit 84f6954ca9
  1. 5
      java/core/pom.xml
  2. 3
      java/core/src/test/java/com/google/protobuf/MapTest.java
  3. 5
      java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
  4. 2
      java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java

@ -34,6 +34,11 @@
<artifactId>easymockclassextension</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>

@ -1516,7 +1516,8 @@ public class MapTest extends TestCase {
}
try {
builder.putAllInt32ToMessageField(newMap(4, null, 5, null));
builder.putAllInt32ToMessageField(
MapTest.<Integer, MessageValue>newMap(4, null, 5, null));
fail();
} catch (NullPointerException expected) {
}

@ -104,7 +104,8 @@ public class JsonFormat {
*/
public static Printer printer() {
return new Printer(
TypeRegistry.getEmptyTypeRegistry(), false, Collections.emptySet(), false, false);
TypeRegistry.getEmptyTypeRegistry(), false, Collections.<FieldDescriptor>emptySet(),
false, false);
}
/**
@ -167,7 +168,7 @@ public class JsonFormat {
return new Printer(
registry,
true,
Collections.emptySet(),
Collections.<FieldDescriptor>emptySet(),
preservingProtoFieldNames,
omittingInsignificantWhitespace);
}

@ -1319,7 +1319,7 @@ public class JsonFormatTest extends TestCase {
}
try {
JsonFormat.printer().includingDefaultValueFields(Collections.emptySet());
JsonFormat.printer().includingDefaultValueFields(Collections.<FieldDescriptor>emptySet());
fail("IllegalArgumentException is expected.");
} catch (IllegalArgumentException e) {
// Expected.

Loading…
Cancel
Save