yossev opened a new pull request, #7965:
URL: https://github.com/apache/gravitino/pull/7965

   ### What changes were proposed in this pull request?
   
   This PR updates the `Namespace.fromString()` method to reject inputs that 
are blank or consist only of whitespace (e.g., `" "`, `"\t"`, `"\n"`).  
   A new precondition was added using `StringUtils.isBlank(...)`, and placed 
early in the validation chain to ensure the method fails fast on invalid input.
   
   ### Why are the changes needed?
   
   Previously, passing a blank or whitespace-only string would bypass 
structural validations and return a namespace unexpectedly (e.g., via 
`.split()` producing an empty array).  
   This could lead to invalid namespace objects or hidden bugs in downstream 
components.
   
   ### Fix: #7958 
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes.  
   Calling `Namespace.fromString(" ")` or similar will now throw an 
`IllegalArgumentException` instead of silently creating an empty namespace.
   
   ### How was this patch tested?
   
   - a test case in `testFromStringInvalidArgs` exists to verify the behavior:
     ```java
     Assertions.assertThrows(IllegalArgumentException.class, () -> 
Namespace.fromString(" "));
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to