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

26 lines
867 B
HTML

<html>
<body>
Reports reflective access to fields and methods that don't exist or aren't visible.
<p>Example:</p>
<pre><code>
Field stringHashField() throws NoSuchFieldException {
return String.class.getField("hash");
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
Field stringHashField() throws NoSuchFieldException {
return String.class.getDeclaredField("hash");
}
</code></pre>
<!-- tooltip end -->
<p>
With a <code>final</code> class, it's clear if there is a field or method with the specified name in the class.
</p>
<p>
With non-<code>final</code> classes, it's possible that a subclass has a field or method with that name, so there could be false positives.
Use the inspection's settings to get rid of such false positives everywhere or with specific classes.
</p>
<p><small>New in 2017.2</small></p>
</body>
</html>