From ab6950d75d6bae6a1574726ee1e7060e001ed23a Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Thu, 28 Jan 2010 01:09:11 +0000 Subject: More Java warning tweaks from Evan Jones. --- java/src/main/java/com/google/protobuf/GeneratedMessage.java | 8 ++++---- java/src/main/java/com/google/protobuf/GeneratedMessageLite.java | 1 + java/src/test/java/com/google/protobuf/DescriptorsTest.java | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'java/src') diff --git a/java/src/main/java/com/google/protobuf/GeneratedMessage.java b/java/src/main/java/com/google/protobuf/GeneratedMessage.java index 5cff6fc6..42ccbfd8 100644 --- a/java/src/main/java/com/google/protobuf/GeneratedMessage.java +++ b/java/src/main/java/com/google/protobuf/GeneratedMessage.java @@ -769,7 +769,7 @@ public abstract class GeneratedMessage extends AbstractMessage { /** For use by generated code only. */ public void internalInit(final FieldDescriptor descriptor, - final Class type) { + final Class type) { if (this.descriptor != null) { throw new IllegalStateException("Already initialized."); } @@ -809,7 +809,7 @@ public abstract class GeneratedMessage extends AbstractMessage { } private FieldDescriptor descriptor; - private Class type; + private Class type; private Method enumValueOf; private Method enumGetValueDescriptor; private Message messageDefaultInstance; @@ -1054,7 +1054,7 @@ public abstract class GeneratedMessage extends AbstractMessage { // Note: We use Java reflection to call public methods rather than // access private fields directly as this avoids runtime security // checks. - protected final Class type; + protected final Class type; protected final Method getMethod; protected final Method setMethod; protected final Method hasMethod; @@ -1118,7 +1118,7 @@ public abstract class GeneratedMessage extends AbstractMessage { clearMethod = getMethodOrDie(builderClass, "clear" + camelCaseName); } - protected final Class type; + protected final Class type; protected final Method getMethod; protected final Method getRepeatedMethod; protected final Method setRepeatedMethod; diff --git a/java/src/main/java/com/google/protobuf/GeneratedMessageLite.java b/java/src/main/java/com/google/protobuf/GeneratedMessageLite.java index 9cdd4e94..9a799b44 100644 --- a/java/src/main/java/com/google/protobuf/GeneratedMessageLite.java +++ b/java/src/main/java/com/google/protobuf/GeneratedMessageLite.java @@ -524,6 +524,7 @@ public abstract class GeneratedMessageLite extends AbstractMessageLite { } /** For use by generated code only. */ + @SuppressWarnings("unchecked") public void internalInitRepeated( final ContainingType containingTypeDefaultInstance, final MessageLite messageDefaultInstance, diff --git a/java/src/test/java/com/google/protobuf/DescriptorsTest.java b/java/src/test/java/com/google/protobuf/DescriptorsTest.java index e60eab39..c77af5d2 100644 --- a/java/src/test/java/com/google/protobuf/DescriptorsTest.java +++ b/java/src/test/java/com/google/protobuf/DescriptorsTest.java @@ -70,6 +70,7 @@ public class DescriptorsTest extends TestCase { // Regression test for bug where referencing a FieldDescriptor.Type value // before a FieldDescriptorProto.Type value would yield a // ExceptionInInitializerError. + @SuppressWarnings("unused") private static final Object STATIC_INIT_TEST = FieldDescriptor.Type.BOOL; public void testFieldTypeEnumMapping() throws Exception { -- cgit v1.2.3