Copilot commented on code in PR #15810:
URL: https://github.com/apache/grails-core/pull/15810#discussion_r3509559858


##########
grails-web-mvc/src/main/groovy/org/grails/web/errors/GrailsExceptionResolver.java:
##########
@@ -429,6 +429,18 @@ protected String getRequestLogMessage(String 
exceptionName, HttpServletRequest r
         return sb.toString();
     }
 
+    protected boolean isExcludedRequestParameter(String parameterName, 
List<String> excludedParameterNames) {
+        if (parameterName == null || excludedParameterNames == null) {
+            return false;
+        }
+        for (String excludedParameterName : excludedParameterNames) {
+            if (parameterName.equalsIgnoreCase(excludedParameterName)) {
+                return true;
+            }
+        }
+        return false;
+    }

Review Comment:
   `isExcludedRequestParameter` can throw a NullPointerException if 
`excludedParameterNames` contains a null entry (e.g., misconfigured YAML list). 
The enhanced for-loop iterates nulls and 
`parameterName.equalsIgnoreCase(excludedParameterName)` will NPE when 
`excludedParameterName` is null.



##########
grails-web-core/src/main/resources/META-INF/spring-configuration-metadata.json:
##########
@@ -115,7 +115,7 @@
         {
             "name": "grails.exceptionresolver.params.exclude",
             "type": "java.util.List<java.lang.String>",
-            "description": "List of parameter names to mask (replace with 
[*****]) in exception stack traces, typically used for password and 
creditCard.",
+            "description": "List of parameter names to mask (replace with 
[*****]) in exception stack traces, typically used for password and creditCard. 
Parameter names are matched case-insensitively.",

Review Comment:
   The metadata description says excluded parameters are replaced with 
`[*****]`, but `GrailsExceptionResolver#getRequestLogMessage` actually uses 
`***`. Since this line is being edited, it would be good to make the metadata 
accurate so IDE config hints match runtime behavior.



-- 
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