errael commented on issue #8240:
URL: https://github.com/apache/netbeans/issues/8240#issuecomment-2658085425
> parts of this might be already customizable by templates. But I agree
there could be likely out-of-the-box improvements made.
In addition to stuff mentioned in the OP, there is also stuff in `Tools >
Options > Editor > Code Templates`. Is this what you're talking about?
In particular, `log, logb, logbp, logbps, loge, logp, logr, logrb`
These could be copied to `slog, slogb, slogbps, ...`
But I notice that none of these templates have/use `Supplier<String>`; so
these templates are often a performance problem. So this probably should be
revisited in general rather than copying the old ones.
Also, there's a hint `Inefficient use of string concatenation in logger`.
It has a fix `convert string concatenation to message template`.
```
LOG.log(Level.SEVERE, "message" + a);
```
is converted to
```
LOG.log(Level.SEVERE, "message{0}", a);
```
Could add an additional, probably better, fix: `convert string concatenation
to Supplier<String>`.
```
LOG.log(Level.SEVERE, () -> "message" + a);
```
--
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]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists