mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
37 lines
907 B
HTML
37 lines
907 B
HTML
<html>
|
|
<body>
|
|
Reports <code>private</code> methods which
|
|
are only called from an inner class of the class containing the method. Such
|
|
methods can be safely moved into that inner class.
|
|
<p>Example:</p>
|
|
<pre><code>
|
|
public class Outer {
|
|
public static void main(String[] args) {
|
|
new Inner().run(args[0]);
|
|
}
|
|
|
|
static class Inner {
|
|
void run(String arg) {
|
|
// Method isEmpty() is used from Inner class only
|
|
// consider moving it to the Inner class
|
|
if (!isEmpty(arg)) {
|
|
System.out.println("Argument is supplied");
|
|
}
|
|
}
|
|
}
|
|
|
|
private static boolean isEmpty(String s) {
|
|
return s != null && s.trim().isEmpty();
|
|
}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
Use the first checkbox below to ignore <code>private</code>
|
|
methods which are called from an anonymous or local class.
|
|
<p>
|
|
Use the third checkbox to only report <code>static</code> methods.
|
|
<p>
|
|
|
|
</body>
|
|
</html> |