mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
TestOnlyInspectionTest -> community
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>5</line>
|
||||
<method>
|
||||
<name>A()</name>
|
||||
<display_name>A()</display_name>
|
||||
<package><default></package>
|
||||
<class>
|
||||
<name>A</name>
|
||||
<display_name>A</display_name>
|
||||
</class>
|
||||
</method>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1,6 @@
|
||||
public class A {
|
||||
@org.jetbrains.annotations.TestOnly
|
||||
public A() {}
|
||||
|
||||
public A(String ignore) {}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
public class B {
|
||||
public void foo() {
|
||||
new A();
|
||||
new A("ignore");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>A.java</file>
|
||||
<line>17</line>
|
||||
<method>
|
||||
<name>void production()</name>
|
||||
<display_name>production()</display_name>
|
||||
<package><default></package>
|
||||
<class>
|
||||
<name>A</name>
|
||||
<display_name>A</display_name>
|
||||
</class>
|
||||
</method>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
public class A {
|
||||
@org.jetbrains.annotations.TestOnly
|
||||
public void foo() {}
|
||||
|
||||
@org.jetbrains.annotations.TestOnly
|
||||
public void test() {
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
foo();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void production() {
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
foo();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
public class C {
|
||||
@org.junit.Test
|
||||
public void foo() {
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
new A().foo();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
public class D {
|
||||
public void test() {
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
new A().foo();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>A.java</file>
|
||||
<line>6</line>
|
||||
<method>
|
||||
<name>void production()</name>
|
||||
<display_name>production()</display_name>
|
||||
<package><default></package>
|
||||
<class>
|
||||
<name>A</name>
|
||||
<display_name>A</display_name>
|
||||
</class>
|
||||
</method>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>3</line>
|
||||
<method>
|
||||
<name>void production()</name>
|
||||
<display_name>production()</display_name>
|
||||
<package><default></package>
|
||||
<class>
|
||||
<name>B</name>
|
||||
<display_name>B</display_name>
|
||||
</class>
|
||||
</method>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
public class A {
|
||||
@org.jetbrains.annotations.TestOnly
|
||||
public void test() {}
|
||||
|
||||
public void production() {
|
||||
test();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
public class B {
|
||||
public void production() {
|
||||
new A().test();
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.TestOnly
|
||||
public void test() {
|
||||
new A().test();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
public class C {
|
||||
@org.junit.Test
|
||||
public void foo() {
|
||||
new A().test();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
public class D {
|
||||
public void foo() {
|
||||
new A().test();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems/>
|
||||
@@ -0,0 +1,7 @@
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
public class A {
|
||||
public void foo() {
|
||||
unresolved();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user