Copilot commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3309448932


##########
hadoop-hdds/dev-support/checkstyle/checkstyle.xml:
##########
@@ -83,6 +83,12 @@
         <property name="matchAcrossLines" value="true"/>
         <property name="message" value="Use Objects.requireNonNull instead of 
Preconditions.checkNotNull"/>
     </module>
+    <module name="RegexpMultiline">
+        <property name="format"
+                  
value="@Override\s+public\s+(?:(?:final|synchronized)\s+)*OMRequest\s+preExecute\s*\([^\)]*\)\s*(?:throws\s+[^{]+)?\s*\{(?!(?:(?!\/\*|\*\/)[\s\S]|\/\*(?:(?!\*\/)[\s\S])*\*\/){0,400}?(?:^|\r?\n|(?&lt;=\{))[
 \t]*(?!\*|\/)(?:return\s+|final\s+(?:[a-zA-Z0-9_]+\s+)*[a-zA-Z0-9_]+[ \t]*=[ 
\t]*)?(?:\([a-zA-Z0-9_]+\)\s*)?super\s*\.\s*preExecute\s*\()"/>

Review Comment:
   This rule does not enforce the invariant described in its message. The 
`return/final ... =` group before `super.preExecute(` is optional, so a bare 
`super.preExecute(ozoneManager);` passes even if the returned request is 
discarded, and the pattern also misses overrides with another annotation 
between `@Override` and `public` (for example `@DisallowedUntilLayoutVersion`). 
Please tighten the regexp or add a more robust check so future `preExecute` 
overrides cannot bypass the resolved S3Authentication fields.
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to