Skip to content

Commit ee11307

Browse files
committed
Add test for ECJ compiling an enum with a constructor parameter annotation
1 parent 08bb794 commit ee11307

File tree

7 files changed

+42
-0
lines changed

7 files changed

+42
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
| Annotation processors enabled: true | 1 |
2+
| Number of calls with call target | 5 |
3+
| Number of calls with missing call target | 0 |
4+
| Number of expressions with known type | 21 |
5+
| Number of expressions with unknown type | 0 |
6+
| Number of files | 697 |
7+
| Number of files with extension class | 692 |
8+
| Number of files with extension java | 2 |
9+
| Number of files with extension properties | 2 |
10+
| Number of lines of code | 6 |
11+
| Number of lines of code with extension java | 6 |
12+
| Percentage of calls with call target | 100 |
13+
| Percentage of expressions with known type | 100 |
14+
| Total number of lines | 11 |
15+
| Total number of lines with extension java | 11 |
16+
| Used annotation processor: lombok.launch.AnnotationProcessorHider$AnnotationProcessor | 1 |
17+
| Used annotation processor: lombok.launch.AnnotationProcessorHider$ClaimingProcessor | 1 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Telemetry/ExtractorInformation.ql
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
public enum Test {
2+
3+
A("A"), B("B"), C("C");
4+
5+
private Test(@Ann String x) { }
6+
7+
}
8+
9+
@interface Ann {}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
public class Test2 { Test t; }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| Test.java:5:16:5:28 | x | Test.java:5:16:5:19 | Ann |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import urllib.request
2+
from create_database_utils import *
3+
4+
urllib.request.urlretrieve("https://repo1.maven.org/maven2/org/eclipse/jdt/ecj/3.38.0/ecj-3.38.0.jar", "ecj.jar")
5+
6+
# This tests the case where ECJ emits a RuntimeIn/VisibleAnnotations attribute that isn't the same size as the corresponding method argument list, in particular due to forgetting to include the synthetic parameters added to explicit enumeration constructors.
7+
8+
run_codeql_database_create(["java -cp ecj.jar org.eclipse.jdt.internal.compiler.batch.Main Test.java -d out -source 8", "java -cp ecj.jar org.eclipse.jdt.internal.compiler.batch.Main Test2.java -cp out -source 8"], lang="java")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import java
2+
3+
from Parameter p
4+
select p, p.getAnAnnotation()

0 commit comments

Comments
 (0)