Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLF4J-related fixes #57

Open
wants to merge 13 commits into
base: trunk
Choose a base branch
from
Open

SLF4J-related fixes #57

wants to merge 13 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 15, 2017

No description provided.

As suggested in the SLF4J FAQ:
https://www.slf4j.org/faq.html#logging_performance
.. parameterized logging can improve the efficiency of logger calls when
logging at the specified level is disabled.

In addition, per the FAQ: https://www.slf4j.org/faq.html#paramException
since SLF4J 1.6.0 it is possible to use parameterized logging and also
log an exception/throwable.

toString() is called automatically:
https://www.slf4j.org/faq.html#string_contents

These changes were suggested by SLF4J Helper for NetBeans IDE:
http://plugins.netbeans.org/plugin/72557/
String concatenations were assigned to local variables which were then
logged, but not used for another purpose. It is more efficient to use
parameterized logging in such cases.
The syntax of a formatting anchor is '{}'.

This issue was found by SLF4J Helper for NetBeans IDE:
http://plugins.netbeans.org/plugin/72557/
Eliminates the need to construct a new (temporary) Object array object.

These changes were suggested by SLF4J Helper for NetBeans IDE:
http://plugins.netbeans.org/plugin/72557/
Since SLF4J 1.6.0, it is possible to use parameterized logging and also
log an exception/throwable.

Log the PathNotFoundExceptions because comments indicates that execution
should not reach the catch blocks; if it does, then the stack traces may
be useful.
Some calls to warn() were guarded by checks that logging at the debug
level is enabled.

These issues were found by SLF4J Helper for NetBeans IDE:
http://plugins.netbeans.org/plugin/72557/
Eliminates the need to construct a new (temporary) Object array object.
Arrays.asList(...).toString() might be an expensive string concatenation.
It appears to be the intention to log the invalid path name rather than
DEFAULT_ACE_NAME.
The result is still a constant expression, and not making the constants
formatting args potentially allows the logger overloads taking at most
two formatting args to be used, avoiding an unnecessary Object array
creation.
SLF4J 1.6.0+ allows one extra exception/throwable at the end of the
format args list. In one case, the extra exception was placed at the
beginning. In three other cases, the exception object's message was
passed.

Two logger calls had more formatting anchor(s) in the format string than
format args.

These issues were found by SLF4J Helper for NetBeans IDE:
http://plugins.netbeans.org/plugin/72557/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant