浏览代码

Fix Java build.

Feng Xiao 8 年之前
父节点
当前提交
84f6954ca9

+ 5 - 0
java/core/pom.xml

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

+ 2 - 1
java/core/src/test/java/com/google/protobuf/MapTest.java

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

+ 3 - 2
java/util/src/main/java/com/google/protobuf/util/JsonFormat.java

@@ -104,7 +104,8 @@ public class JsonFormat {
    */
    */
   public static Printer printer() {
   public static Printer printer() {
     return new 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(
       return new Printer(
           registry,
           registry,
           true,
           true,
-          Collections.emptySet(),
+          Collections.<FieldDescriptor>emptySet(),
           preservingProtoFieldNames,
           preservingProtoFieldNames,
           omittingInsignificantWhitespace);
           omittingInsignificantWhitespace);
     }
     }

+ 1 - 1
java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java

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