Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 691882071
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Oct 31, 2024
1 parent 721a452 commit 0657eed
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions java/core/src/main/java/com/google/protobuf/Descriptors.java
Original file line number Diff line number Diff line change
Expand Up @@ -2180,9 +2180,9 @@ public FileDescriptor getFile() {
* present in all runtimes; as of writing, we know that:
*
* <ul>
* <li> C++, Java, and C++-based Python share this quirk.
* <li> UPB and UPB-based Python do not.
* <li> PHP and Ruby treat all enums as open regardless of declaration.
* <li>C++, Java, and C++-based Python share this quirk.
* <li>UPB and UPB-based Python do not.
* <li>PHP and Ruby treat all enums as open regardless of declaration.
* </ul>
*
* <p>Care should be taken when using this function to respect the target runtime's enum
Expand Down Expand Up @@ -2890,7 +2890,7 @@ void resolveFeatures(FeatureSet unresolvedFeatures) throws DescriptorValidationE
this, "Failed to parse features with Java feature extension registry.", e);
}
}

FeatureSet.Builder features;
if (this.parent == null) {
Edition edition = getFile().getEdition();
Expand Down Expand Up @@ -2922,6 +2922,13 @@ FeatureSet getFeatures() {
|| getFile().getEdition() == Edition.EDITION_PROTO3)) {
getFile().resolveAllFeaturesImmutable();
}
if (this.features == null) {
throw new NullPointerException(
String.format(
"Features not yet loaded for %s. This may be caused by a known issue for proto2"
+ " dependency descriptors obtained from proto1 (b/362326130)",
getFullName()));
}
return this.features;
}

Expand Down

0 comments on commit 0657eed

Please sign in to comment.