Files
openide/java/java-impl/resources/inspectionDescriptions/NonStaticFinalLogger.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

28 lines
1.0 KiB
HTML

<html>
<body>
Reports logger fields that are not declared <code>static</code> and/or <code>final</code>.
Ensuring that every class logger is effectively constant and bound to that class
simplifies the task of providing a unified logging implementation for an application.
<p>A quick-fix is provided to change the logger modifiers to <code>static final</code>.</p>
<p><b>Example:</b></p>
<pre><code>
<b>public class</b> Significant {
<b>private</b> Logger LOG = Logger.getLogger(Critical.class);
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
<b>public class</b> Significant {
<b>private static final</b> Logger LOG = Logger.getLogger(Critical.class);
}
</code></pre>
<!-- tooltip end -->
<p>
Configure the inspection:
</p>
<ul>
<li>Use the <b>Logger class name</b> table to specify logger class names. The inspection will report the fields that are not <code>static</code> and <code>final</code> and are of the type equal to one of the specified class names.
</li>
</ul>
</body>
</html>