Add some tests for java/unused-reference-type

This commit is contained in:
Owen Mansel-Chan
2024-07-30 16:27:46 +01:00
parent 0d469536ae
commit 050dcb1370
6 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
class ClassWithAnnotatedMethod {
@MyAnnotation
void doNothing() { }
}

View File

@@ -0,0 +1,3 @@
@MyAnnotation
class ClassWithAnnotation {
}

View File

@@ -0,0 +1,2 @@
| ClassWithAnnotatedMethod.java:1:7:1:30 | ClassWithAnnotatedMethod | Unused class: ClassWithAnnotatedMethod is not referenced within this codebase. If not used as an external API it should be removed. |
| UnusedClass.java:1:7:1:17 | UnusedClass | Unused class: UnusedClass is not referenced within this codebase. If not used as an external API it should be removed. |

View File

@@ -0,0 +1 @@
Violations of Best Practice/Dead Code/DeadRefTypes.ql

View File

@@ -0,0 +1,2 @@
public @interface MyAnnotation {
}

View File

@@ -0,0 +1 @@
class UnusedClass {}