mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-155323 Bogus "Test-only method is called" inspection
This commit is contained in:
@@ -10,4 +10,15 @@
|
||||
<line>5</line>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>6</line>
|
||||
<description>Test-only class is referenced in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>7</line>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
|
||||
</problems>
|
||||
|
||||
@@ -18,4 +18,16 @@ public class A {
|
||||
void relaxedToPackageLevel(int a) {
|
||||
|
||||
}
|
||||
|
||||
@com.google.common.annotations.VisibleForTesting
|
||||
static class FooException extends RuntimeException {
|
||||
FooException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void usingExceptionPrivately(String[] args) {
|
||||
A.FooException exception =
|
||||
new A.FooException("");
|
||||
}
|
||||
}
|
||||
@@ -3,5 +3,7 @@ public class B {
|
||||
new A().invisibleMethod(2);
|
||||
new A().visibleMethod(2);
|
||||
new A().relaxedToPackageLevel(2);
|
||||
A.FooException exception =
|
||||
new A.FooException("");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user