elharo commented on code in PR #343:
URL: https://github.com/apache/maven-enforcer/pull/343#discussion_r1913587604


##########
enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/files/TestRequireFilesDontExist.java:
##########
@@ -27,10 +27,7 @@
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.io.TempDir;
 
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.*;

Review Comment:
   no, not intentional. Let me fix it.



##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/files/AbstractRequireFiles.java:
##########
@@ -93,21 +93,36 @@ private void fail(List<File> failures) throws 
EnforcerRuleException {
 
         StringBuilder buf = new StringBuilder();
         if (message != null) {
-            buf.append(message + System.lineSeparator());
+            buf.append(message + '\n');

Review Comment:
   Note that this method does *not* print anything on the console. It throws an 
exception object that should be identical regardless of the platform that 
creates it. Where this message goes is outside the scope of this class. It 
might be written to a log file and never show up on a console. It might be 
suppressed completely.
   
   In 2025 Windows shells behave in the obvious way if you send them a 
linefeed, so this works just fine across platforms if someone does happen to 
print this string to a console. Maybe System.lineSeparator was needed in 
Windows 95. It isn't now. 
   
   



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