Skip to content

Commit

Permalink
Merge pull request #15778 from smowton/smowton/admin/test-multi-relea…
Browse files Browse the repository at this point in the history
…se-jars

Java: Add tests for multi-release jars under Java 11 and 17
  • Loading branch information
smowton authored Mar 7, 2024
2 parents 48fcec8 + 2321eec commit e4f680d
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
| Annotation processors enabled: true | 1 |
| Number of calls with call target | 1 |
| Number of calls with missing call target | 0 |
| Number of expressions with known type | 1 |
| Number of expressions with unknown type | 0 |
| Number of files | 543 |
| Number of files with extension class | 538 |
| Number of files with extension jar | 1 |
| Number of files with extension java | 2 |
| Number of files with extension properties | 1 |
| Number of lines of code | 7 |
| Number of lines of code with extension java | 7 |
| Percentage of calls with call target | 100 |
| Percentage of expressions with known type | 100 |
| Total number of lines | 12 |
| Total number of lines with extension java | 12 |
| Used annotation processor: lombok.launch.AnnotationProcessorHider$AnnotationProcessor | 1 |
| Used annotation processor: lombok.launch.AnnotationProcessorHider$ClaimingProcessor | 1 |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Telemetry/ExtractorInformation.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package mod1pkg;

public class Mod1Class { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module moduleone {

exports mod1pkg;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import mod1pkg.Mod1Class;

public class User {

private Mod1Class m1c;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module moduletwo {

requires moduleone;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import sys

from create_database_utils import *
import subprocess
import os

try_use_java11()

os.mkdir("mod1obj")
os.mkdir("mod2obj")

subprocess.check_call(["javac", "mod1/module-info.java", "mod1/mod1pkg/Mod1Class.java", "-d", "mod1obj"])
subprocess.check_call(["jar", "-c", "-f", "mod1.jar", "-C", "mod1obj", "mod1pkg/Mod1Class.class", "--release", "9", "-C", "mod1obj", "module-info.class"])

run_codeql_database_create(["javac mod2/mod2pkg/User.java mod2/module-info.java -d mod2obj -p mod1.jar"], lang="java")
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
| Annotation processors enabled: true | 1 |
| Number of calls with call target | 1 |
| Number of calls with missing call target | 0 |
| Number of expressions with known type | 1 |
| Number of expressions with unknown type | 0 |
| Number of files | 610 |
| Number of files with extension class | 605 |
| Number of files with extension jar | 1 |
| Number of files with extension java | 2 |
| Number of files with extension properties | 1 |
| Number of lines of code | 7 |
| Number of lines of code with extension java | 7 |
| Percentage of calls with call target | 100 |
| Percentage of expressions with known type | 100 |
| Total number of lines | 12 |
| Total number of lines with extension java | 12 |
| Used annotation processor: lombok.launch.AnnotationProcessorHider$AnnotationProcessor | 1 |
| Used annotation processor: lombok.launch.AnnotationProcessorHider$ClaimingProcessor | 1 |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Telemetry/ExtractorInformation.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package mod1pkg;

public class Mod1Class { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module moduleone {

exports mod1pkg;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import mod1pkg.Mod1Class;

public class User {

private Mod1Class m1c;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module moduletwo {

requires moduleone;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import sys

from create_database_utils import *
import subprocess
import os

os.mkdir("mod1obj")
os.mkdir("mod2obj")

subprocess.check_call(["javac", "mod1/module-info.java", "mod1/mod1pkg/Mod1Class.java", "-d", "mod1obj"])
subprocess.check_call(["jar", "-c", "-f", "mod1.jar", "-C", "mod1obj", "mod1pkg/Mod1Class.class", "--release", "9", "-C", "mod1obj", "module-info.class"])

run_codeql_database_create(["javac mod2/mod2pkg/User.java mod2/module-info.java -d mod2obj -p mod1.jar"], lang="java")

0 comments on commit e4f680d

Please sign in to comment.