Fix rawtypes warning suppression in FieldSet

PiperOrigin-RevId: 650106954
pull/17342/head
Mark Hansen 8 months ago committed by Copybara-Service
parent 761d49a270
commit ee96b56e46
  1. 5
      java/core/src/main/java/com/google/protobuf/FieldSet.java

@ -78,7 +78,7 @@ final class FieldSet<T extends FieldSet.FieldDescriptorLite<T>> {
/** Get an immutable empty FieldSet. */
@SuppressWarnings("unchecked")
public static <T extends FieldSet.FieldDescriptorLite<T>> FieldSet<T> emptySet() {
return DEFAULT_INSTANCE;
return (FieldSet<T>) DEFAULT_INSTANCE;
}
/** Construct a new Builder. */
@ -86,8 +86,7 @@ final class FieldSet<T extends FieldSet.FieldDescriptorLite<T>> {
return new Builder<T>();
}
@SuppressWarnings("rawtypes")
private static final FieldSet DEFAULT_INSTANCE = new FieldSet(true);
private static final FieldSet<?> DEFAULT_INSTANCE = new FieldSet<>(true);
/** Returns {@code true} if empty, {@code false} otherwise. */
boolean isEmpty() {

Loading…
Cancel
Save