gnodet commented on code in PR #3591:
URL: https://github.com/apache/maven-surefire/pull/3591#discussion_r4792290174


##########
surefire-api/src/main/java/org/apache/maven/surefire/api/util/TempFileManager.java:
##########
@@ -148,6 +150,17 @@ public synchronized File createTempFile(String prefix, 
String suffix) {
             throw new UncheckedIOException(new IOException("Unable to create 
temporary file " + tempFile));
         }
 
+        // run with this class' own permissions: under a SecurityManager, 
every frame on the call
+        // stack needs file permissions on the temp directory, including 
whatever unrelated,
+        // possibly restricted code (e.g. a test or an OSGi bundle) merely 
called System.out.println()
+        // and ended up here via ConsoleOutputCapture
+        String finalPrefix = prefix;
+        String finalSuffix = suffix;

Review Comment:
   _Claude Code on behalf of Guillaume Nodet_
   
   **Minor - Variable naming**: The names `finalPrefix` and `finalSuffix` are a 
bit confusing. They're not "final" in a semantic sense—they're just effectively 
final for lambda capture (which `prefix` and `suffix` already are at this 
point).
   
   Consider either:
   - Using `prefix` and `suffix` directly in the lambda (they're already 
effectively final)
   - Using more descriptive names like `sanitizedPrefix` / `sanitizedSuffix` if 
you want to emphasize they've been processed
   
   This is a minor style issue—not critical.



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