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

19 lines
635 B
HTML

<html>
<body>
Reports references to <code>static</code> methods and fields via a class instance rather than the class itself.
<p>Even though referring to static members via instance variables is allowed by The Java Language Specification,
this makes the code confusing as the reader may think that the result of the method depends on the instance.</p>
<p>The quick-fix replaces the instance variable with the class name.</p>
<p>Example:</p>
<pre><code>
String s1 = s.valueOf(0);
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
String s = String.valueOf(0);
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>