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

30 lines
1.1 KiB
HTML

<html>
<body>
Reports methods that can safely be made <code>static</code>.
Making methods static when possible can reduce memory consumption and improve your code quality.
<p>A method can be <code>static</code> if:</p>
<ul>
<li>
it is not <code>synchronized</code>, <code>native</code> or <code>abstract</code>,
</li>
<li>
does not reference any of non-static methods and non-static fields from the containing class,
</li>
<li>
is not an override and is not overridden in a subclass.
</li>
</ul>
<!-- tooltip end -->
<p>Use the following options to configure the inspection:</p>
<ul>
<li>Whether to report only <code>private</code> and <code>final</code> methods, which increases the performance of this inspection.</li>
<li>Whether to ignore empty methods.</li>
<li>Whether to ignore default methods in interface when using Java 8 or higher.</li>
<li>
Whether to let the quick-fix replace instance qualifiers with class references
in calls to methods which are made <code>static</code>,
that is, call <code>myClass.m()</code> would be replaced with <code>MyClass.m()</code>.
</li>
</ul>
</body>
</html>