Skip to content

Commit

Permalink
Merge pull request #17137 from smowton/smowton/admin/ecj-annotations-…
Browse files Browse the repository at this point in the history
…bug-test

Java: Add test for ECJ compiling an enum with a constructor parameter annotation
  • Loading branch information
smowton authored Aug 2, 2024
2 parents 08bb794 + f891423 commit 62046fa
Show file tree
Hide file tree
Showing 24 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import semmle.code.java.Diagnostics

from Diagnostic d
select d, d.getSeverity(), d.getMessage()
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
public enum Test {

A("A"), B("B"), C("C");

private Test(@Ann String x) { }

}

@interface Ann {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

public class Test2 { Test t; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| Test.java:5:16:5:28 | x | Test.java:5:16:5:19 | Ann |
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import urllib.request
from create_database_utils import *

urllib.request.urlretrieve("https://repo1.maven.org/maven2/org/eclipse/jdt/ecj/3.38.0/ecj-3.38.0.jar", "ecj.jar")

# 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.

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")
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import java

from Parameter p
select p, p.getAnAnnotation()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concurrent Maven processes using ~/.m2/repository is not safe, so this test must run sequentially

0 comments on commit 62046fa

Please sign in to comment.