mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Clean test files and add new test cases
This commit is contained in:
@@ -20,6 +20,12 @@ public class Class1 {
|
||||
public void f4() {
|
||||
}
|
||||
|
||||
/**
|
||||
* COMPLIANT - empty method with javadoc
|
||||
*/
|
||||
public void f5() {
|
||||
}
|
||||
|
||||
public abstract class TestInner {
|
||||
|
||||
public abstract void f(); // COMPLIANT - intentionally empty
|
||||
@@ -41,6 +47,8 @@ public class Class1 {
|
||||
|
||||
// NON_COMPLIANT
|
||||
default void method() { } // $ Alert
|
||||
|
||||
void method2(); // COMPLIANT
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
#select
|
||||
| Class1.java:16:15:16:16 | f2 | Empty method found. |
|
||||
| Class1.java:43:18:43:23 | method | Empty method found. |
|
||||
| Test.java:43:18:43:23 | method | Empty method found. |
|
||||
testFailures
|
||||
| Test.java:16:24:16:33 | // $ Alert | Missing result: Alert |
|
||||
| Class1.java:49:18:49:23 | method | Empty method found. |
|
||||
|
||||
@@ -1,46 +1,5 @@
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
|
||||
public class Test {
|
||||
|
||||
// COMPLIANT
|
||||
// COMPLIANT: allow empty method in test class
|
||||
public void f() {
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
// COMPLIANT
|
||||
public void f1() {
|
||||
// intentionally empty
|
||||
}
|
||||
|
||||
// NON_COMPLIANT
|
||||
public void f2() { } // $ Alert
|
||||
|
||||
// COMPLIANT - exception
|
||||
@Pointcut()
|
||||
public void f4() {
|
||||
}
|
||||
|
||||
public abstract class TestInner {
|
||||
|
||||
public abstract void f(); // COMPLIANT - intentionally empty
|
||||
|
||||
}
|
||||
|
||||
public class Derived extends TestInner {
|
||||
|
||||
// COMPLIANT: with annotation
|
||||
@Override
|
||||
public void f() {
|
||||
}
|
||||
|
||||
// COMPLIANT: native
|
||||
public native int nativeMethod();
|
||||
}
|
||||
|
||||
public interface TestInterface {
|
||||
|
||||
// NON_COMPLIANT
|
||||
default void method() { } // $ Alert
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user