Fix Java build.

This commit is contained in:
Feng Xiao 2017-03-29 16:03:53 -07:00
parent acde1651b5
commit 84f6954ca9
4 changed files with 11 additions and 4 deletions

View file

@ -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>

View file

@ -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) {
}

View file

@ -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);
}

View file

@ -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.