This is an automated email from the ASF dual-hosted git repository.

jmclean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new caee8d20f5 [#8731] fix(policy): PolicyUpdateRequest.validate checks 
for null policyType (#8734)
caee8d20f5 is described below

commit caee8d20f5129dc22b7b3e7290091f619f590cbc
Author: Hugo Pexegueiro Salazar <[email protected]>
AuthorDate: Wed Oct 1 00:07:26 2025 +0200

    [#8731] fix(policy): PolicyUpdateRequest.validate checks for null 
policyType (#8734)
    
    **Description:**
    
    This Pull Request implements the improvement requested in issue #8731.
    
    **The change:**
    A validation check has been added to the **`validate()`** method of the
    inner class **`UpdatePolicyContentRequest`** (found in
    `PolicyUpdateRequest.java`) to ensure that the **`policyType` field is
    not null**.
    
    The check uses `Preconditions.checkArgument(policyType != null,
    "\"policyType\" must not be null")` to align with the existing
    validation patterns in the class.
    
    **Closes Issue:** Fixes #8731
    
    Co-authored-by: RealHugoPS <[email protected]>
---
 .../main/java/org/apache/gravitino/dto/requests/PolicyUpdateRequest.java | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/common/src/main/java/org/apache/gravitino/dto/requests/PolicyUpdateRequest.java
 
b/common/src/main/java/org/apache/gravitino/dto/requests/PolicyUpdateRequest.java
index f33236e84f..035ff10490 100644
--- 
a/common/src/main/java/org/apache/gravitino/dto/requests/PolicyUpdateRequest.java
+++ 
b/common/src/main/java/org/apache/gravitino/dto/requests/PolicyUpdateRequest.java
@@ -167,6 +167,7 @@ public interface PolicyUpdateRequest extends RESTRequest {
 
     @Override
     public void validate() throws IllegalArgumentException {
+      Preconditions.checkArgument(policyType != null, "\"policyType\" must not 
be null");
       Preconditions.checkArgument(newContent != null, "\"newContent\" must not 
be null");
       newContent.validate();
     }

Reply via email to