mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
26 lines
867 B
HTML
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> |