aboutsummaryrefslogtreecommitdiffhomepage
path: root/java
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 16:03:53 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 16:03:53 -0700
commit84f6954ca91e7dbe57e4c972f9ac260361beaa49 (patch)
treed361178fa5a46de2ea88334f7debbea423fdf2e6 /java
parentacde1651b53ddc50f0e37907acd109b2e10e5274 (diff)
Fix Java build.
Diffstat (limited to 'java')
-rw-r--r--java/core/pom.xml5
-rw-r--r--java/core/src/test/java/com/google/protobuf/MapTest.java3
-rw-r--r--java/util/src/main/java/com/google/protobuf/util/JsonFormat.java5
-rw-r--r--java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java2
4 files changed, 11 insertions, 4 deletions
diff --git a/java/core/pom.xml b/java/core/pom.xml
index be0da5ea..79160f2e 100644
--- a/java/core/pom.xml
+++ b/java/core/pom.xml
@@ -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>
diff --git a/java/core/src/test/java/com/google/protobuf/MapTest.java b/java/core/src/test/java/com/google/protobuf/MapTest.java
index 01b371a3..9ce5ebc9 100644
--- a/java/core/src/test/java/com/google/protobuf/MapTest.java
+++ b/java/core/src/test/java/com/google/protobuf/MapTest.java
@@ -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) {
}
diff --git a/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java b/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
index 5e0f5fe3..37fa194a 100644
--- a/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
+++ b/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
@@ -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);
}
diff --git a/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java b/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java
index 6943093f..695176ed 100644
--- a/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java
+++ b/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java
@@ -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.