diff --git a/java/core/src/main/java/com/google/protobuf/Descriptors.java b/java/core/src/main/java/com/google/protobuf/Descriptors.java index 569fa26e0e66a..877cb081037bd 100644 --- a/java/core/src/main/java/com/google/protobuf/Descriptors.java +++ b/java/core/src/main/java/com/google/protobuf/Descriptors.java @@ -2804,7 +2804,7 @@ void resolveFeatures(FeatureSet unresolvedFeatures) throws DescriptorValidationE } } boolean hasPossibleUnknownJavaFeature = - !unresolvedFeatures.getUnknownFields().isEmpty() + !unresolvedFeatures.getUnknownFields().asMap().isEmpty() && unresolvedFeatures .getUnknownFields() .hasField(JavaFeaturesProto.java_.getNumber());