You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2018/12/11 18:30:54 UTC

[GitHub] Tibor17 commented on issue #48: [MENFORCER-324] - Shouldn't we use System.lineSeparator() instead?

Tibor17 commented on issue #48: [MENFORCER-324] - Shouldn't we use System.lineSeparator() instead?
URL: https://github.com/apache/maven-enforcer/pull/48#issuecomment-446310033
 
 
   @eolivelli 
   If the user does not want to continue, we can take over.
   Java is quite redundant language and we can make better if we put a public static final constant `NL` in `EnforcerUtils` and replace all these calls. These changes remind me to say that there are these code constructs:
   `stingBuilder.append( "a" + "b" )` which should be transformed to two calls of `append`.
    If we do it, we should do it properly.
   On the other side the reason for these strings is displaying a message on console and the messages are never so big that we have to use `StringBuilder` as performance optimizer. Humans are not able to react on changes below 0.3 seconds and these CPUs can concatenate Kilo bytes of strings within microseconds.
   There I use to make a compromises in my codes because `javac 1.5+` translates simple concatenation `"a" + "b"` to the same code with `StringBuilder` in bytecode except the loops. Making more compact Java code with a slowness cca 1 microsecond is still perfect for creating these Exception messages. And anyway if we construct Exception it means that the build is going to fail and there such delay 1E-6 seconds does not matter at all even if it was 1E-3 seconds.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services