#3701 - fix MissingStaticMethodInNonInstantiatableClass for method local classes
This commit is contained in:
parent
4ae7e40bad
commit
420505a344
@ -2547,7 +2547,7 @@ See the property `annotations`.
|
||||
<property name="xpath">
|
||||
<value>
|
||||
<![CDATA[
|
||||
//ClassOrInterfaceDeclaration[@Nested= false()]
|
||||
//ClassOrInterfaceDeclaration[@Nested= false() and @Local= false()]
|
||||
[
|
||||
(
|
||||
(: at least one constructor :)
|
||||
|
@ -346,6 +346,36 @@ public abstract class MyADT {
|
||||
return onInt.apply(integer);
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>#3701 - false positive with method inner class</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Scratch {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Scratch scratch = new Scratch();
|
||||
|
||||
scratch.callMethod();
|
||||
}
|
||||
|
||||
void callMethod() {
|
||||
|
||||
class InnerClass {
|
||||
private InnerClass() {
|
||||
}
|
||||
|
||||
void display() {
|
||||
System.out.println("Works OK!");
|
||||
}
|
||||
}
|
||||
|
||||
InnerClass innerClass = new InnerClass();
|
||||
innerClass.display();
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
Loading…
x
Reference in New Issue
Block a user