We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f34bc47 commit 1bc2c63Copy full SHA for 1bc2c63
java/core/src/main/java/com/google/protobuf/Descriptors.java
@@ -1768,7 +1768,8 @@ public boolean legacyEnumFieldTreatedAsClosed() {
1768
// This is especially important for descriptor.proto since getting the JavaFeaturesProto
1769
// extension itself involves calling legacyEnumFieldTreatedAsClosed() which would otherwise
1770
// infinite loop.
1771
- if (getFile().getDependencies().isEmpty()) {
+ if (getFile().getDependencies().isEmpty()
1772
+ && getFile().proto.getOptionDependencyCount() == 0) {
1773
return getType() == Type.ENUM && getEnumType().isClosed();
1774
}
1775
0 commit comments