mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-02 07:28:24 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
44 lines
1.3 KiB
HTML
44 lines
1.3 KiB
HTML
<html>
|
|
<body>
|
|
Reports empty classes and empty Java files.
|
|
<p>A class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes are sometimes left over
|
|
after significant changes or refactorings.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
class Example {
|
|
List<String> getList() {
|
|
return new ArrayList<>() {
|
|
|
|
};
|
|
}
|
|
}
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
class Example {
|
|
List<String> getList() {
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>Configure the inspection:</p>
|
|
<ul>
|
|
<li>
|
|
Use the <b>Ignore if annotated by</b> option to specify special annotations. The inspection will ignore the classes marked with these
|
|
annotations.
|
|
</li>
|
|
<li><p>
|
|
Use the <b>Ignore class if it is a parametrization of a super type</b> option to ignore classes that parameterize a superclass. For example:
|
|
</p>
|
|
<pre><code>class MyList extends ArrayList<String> {}</code></pre>
|
|
</li>
|
|
<li>
|
|
Use the <b>Ignore subclasses of java.lang.Throwable</b> to ignore classes that extend <code>java.lang.Throwable</code>.
|
|
</li>
|
|
<li>
|
|
Use the <b>Comments count as content</b> option to ignore classes that contain comments.
|
|
</li>
|
|
</ul>
|
|
</body>
|
|
</html> |