[
https://issues.apache.org/jira/browse/MENFORCER-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16717722#comment-16717722
]
ASF GitHub Bot commented on MENFORCER-324:
------------------------------------------
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:
[email protected]
> Shouldn't we use System.lineSeparator() instead of \n ?
> -------------------------------------------------------
>
> Key: MENFORCER-324
> URL: https://issues.apache.org/jira/browse/MENFORCER-324
> Project: Maven Enforcer Plugin
> Issue Type: Bug
> Reporter: Josh Soref
> Priority: Trivial
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)