Repository navigation
[#8168] Fix NPE in EntityCombinedFileset by initializing hiddenProperties field - #8238
Merged
Merged
Conversation
Contributor
Author
|
@justinmclean |
diqiu50
pushed a commit
to diqiu50/gravitino
that referenced
this pull request
Sep 15, 2025
…Properties field (apache#8238) ### What changes were proposed in this pull request? In `EntityCombinedFileset.java`, the `properties()` method directly called `hiddenProperties.contains()` without null checking, which could throw a `NullPointerException` if `hiddenProperties` was not initialized. This PR updates the code to initialize `hiddenProperties` with an empty set and adds null-safe handling in the `withHiddenProperties()` method. ### Why are the changes needed? Without this fix, calling `properties()` on an `EntityCombinedFileset` instance before setting hidden properties could cause NPEs, breaking fileset property retrieval. Adding proper initialization ensures that the object is always in a valid state and handles missing hidden properties gracefully. Fixes apache#8168 ### Does this PR introduce any user-facing change? No. Valid requests behave the same. Cases where `hiddenProperties` was not explicitly set are now safely handled without throwing exceptions. ### How was this patch tested? * Added unit tests to verify that calling `properties()` without setting hidden properties does not cause exceptions * Added tests to ensure null input to `withHiddenProperties()` is handled safely * Added tests to verify that hidden property filtering works correctly when properties are set * Verified that existing functionality remains unchanged
bharos
pushed a commit
to bharos/gravitino
that referenced
this pull request
Oct 3, 2025
…Properties field (apache#8238) ### What changes were proposed in this pull request? In `EntityCombinedFileset.java`, the `properties()` method directly called `hiddenProperties.contains()` without null checking, which could throw a `NullPointerException` if `hiddenProperties` was not initialized. This PR updates the code to initialize `hiddenProperties` with an empty set and adds null-safe handling in the `withHiddenProperties()` method. ### Why are the changes needed? Without this fix, calling `properties()` on an `EntityCombinedFileset` instance before setting hidden properties could cause NPEs, breaking fileset property retrieval. Adding proper initialization ensures that the object is always in a valid state and handles missing hidden properties gracefully. Fixes apache#8168 ### Does this PR introduce any user-facing change? No. Valid requests behave the same. Cases where `hiddenProperties` was not explicitly set are now safely handled without throwing exceptions. ### How was this patch tested? * Added unit tests to verify that calling `properties()` without setting hidden properties does not cause exceptions * Added tests to ensure null input to `withHiddenProperties()` is handled safely * Added tests to verify that hidden property filtering works correctly when properties are set * Verified that existing functionality remains unchanged
bharos
pushed a commit
to bharos/gravitino
that referenced
this pull request
Oct 7, 2025
…Properties field (apache#8238) ### What changes were proposed in this pull request? In `EntityCombinedFileset.java`, the `properties()` method directly called `hiddenProperties.contains()` without null checking, which could throw a `NullPointerException` if `hiddenProperties` was not initialized. This PR updates the code to initialize `hiddenProperties` with an empty set and adds null-safe handling in the `withHiddenProperties()` method. ### Why are the changes needed? Without this fix, calling `properties()` on an `EntityCombinedFileset` instance before setting hidden properties could cause NPEs, breaking fileset property retrieval. Adding proper initialization ensures that the object is always in a valid state and handles missing hidden properties gracefully. Fixes apache#8168 ### Does this PR introduce any user-facing change? No. Valid requests behave the same. Cases where `hiddenProperties` was not explicitly set are now safely handled without throwing exceptions. ### How was this patch tested? * Added unit tests to verify that calling `properties()` without setting hidden properties does not cause exceptions * Added tests to ensure null input to `withHiddenProperties()` is handled safely * Added tests to verify that hidden property filtering works correctly when properties are set * Verified that existing functionality remains unchanged
danhuawang
pushed a commit
to danhuawang/gravitino
that referenced
this pull request
Jun 9, 2026
…Properties field (apache#8238) ### What changes were proposed in this pull request? In `EntityCombinedFileset.java`, the `properties()` method directly called `hiddenProperties.contains()` without null checking, which could throw a `NullPointerException` if `hiddenProperties` was not initialized. This PR updates the code to initialize `hiddenProperties` with an empty set and adds null-safe handling in the `withHiddenProperties()` method. ### Why are the changes needed? Without this fix, calling `properties()` on an `EntityCombinedFileset` instance before setting hidden properties could cause NPEs, breaking fileset property retrieval. Adding proper initialization ensures that the object is always in a valid state and handles missing hidden properties gracefully. Fixes apache#8168 ### Does this PR introduce any user-facing change? No. Valid requests behave the same. Cases where `hiddenProperties` was not explicitly set are now safely handled without throwing exceptions. ### How was this patch tested? * Added unit tests to verify that calling `properties()` without setting hidden properties does not cause exceptions * Added tests to ensure null input to `withHiddenProperties()` is handled safely * Added tests to verify that hidden property filtering works correctly when properties are set * Verified that existing functionality remains unchanged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
In
EntityCombinedFileset.java, theproperties()method directly calledhiddenProperties.contains()without null checking, which could throw aNullPointerExceptionifhiddenPropertieswas not initialized. This PR updates the code to initializehiddenPropertieswith an empty set and adds null-safe handling in thewithHiddenProperties()method.Why are the changes needed?
Without this fix, calling
properties()on anEntityCombinedFilesetinstance before setting hidden properties could cause NPEs, breaking fileset property retrieval. Adding proper initialization ensures that the object is always in a valid state and handles missing hidden properties gracefully.Fixes #8168
Does this PR introduce any user-facing change?
No. Valid requests behave the same. Cases where
hiddenPropertieswas not explicitly set are now safely handled without throwing exceptions.How was this patch tested?
properties()without setting hidden properties does not cause exceptionswithHiddenProperties()is handled safely