Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support compiling with java level 11 #29

Merged
merged 1 commit into from
Dec 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion access-modifier-annotation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-debug-all</artifactId>
<artifactId>asm</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void invoked(Location loc, RestrictedElement target, ErrorListener errorL
ClassReader cr = new ClassReader(is);
final AtomicBoolean ok = new AtomicBoolean();
final String supe = target.toString().replaceFirst("[.].+$", "");
cr.accept(new ClassVisitor(Opcodes.ASM5) {
cr.accept(new ClassVisitor(Opcodes.ASM9) {
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
// TODO traverse supertype hierarchy recursively
Expand Down
4 changes: 2 additions & 2 deletions access-modifier-checker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-debug-all</artifactId>
<artifactId>asm</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down Expand Up @@ -81,7 +81,7 @@
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>2.0.0</version>
<version>3.2.1</version>
<executions>
<execution>
<id>integration-test</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void loadRestrictions(InputStream stream, final boolean isInTheInspectedM
}

try {
new ClassReader(is).accept(new ClassVisitor(Opcodes.ASM5) {
new ClassReader(is).accept(new ClassVisitor(Opcodes.ASM9) {
private String className;

@Override
Expand All @@ -169,7 +169,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {

@Override
public FieldVisitor visitField(int access, final String name, String desc, String signature, Object value) {
return new FieldVisitor(Opcodes.ASM5) {
return new FieldVisitor(Opcodes.ASM9) {
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
return onAnnotationFor(className+'.'+name,desc);
Expand All @@ -179,7 +179,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {

@Override
public MethodVisitor visitMethod(int access, final String methodName, final String methodDesc, String signature, String[] exceptions) {
return new MethodVisitor(Opcodes.ASM5) {
return new MethodVisitor(Opcodes.ASM9) {
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
return onAnnotationFor(className+'.'+methodName+methodDesc,desc);
Expand Down Expand Up @@ -298,7 +298,7 @@ private Set<Type> getSkippedTypes() {
}

public RestrictedClassVisitor() {
super(Opcodes.ASM5);
super(Opcodes.ASM9);
}

@Override
Expand Down Expand Up @@ -396,7 +396,7 @@ private Set<Type> getSkippedTypes() {
}

public RestrictedMethodVisitor(Location currentLocation, Set<Type> skippedTypes) {
super(Opcodes.ASM5);
super(Opcodes.ASM9);
log.debug(String.format("New method visitor at %s#%s",
currentLocation.getClassName(), currentLocation.getMethodName()));
this.currentLocation = currentLocation;
Expand Down Expand Up @@ -460,7 +460,7 @@ private class RestrictedAnnotationVisitor extends AnnotationVisitor {
private Set<Type> skippedRestrictedClasses = new HashSet<>();

public RestrictedAnnotationVisitor() {
super(Opcodes.ASM5);
super(Opcodes.ASM9);
}

public Set<Type> getSkippedTypes() {
Expand All @@ -469,7 +469,7 @@ public Set<Type> getSkippedTypes() {

@Override
public AnnotationVisitor visitArray(String name) {
return new AnnotationVisitor(Opcodes.ASM5) {
return new AnnotationVisitor(Opcodes.ASM9) {

@Override
public void visit(String name, Object value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ abstract static class Parser extends AnnotationVisitor {
private final RestrictedElement target;

protected Parser(RestrictedElement target) {
super(Opcodes.ASM5);
super(Opcodes.ASM9);
this.target = target;
}

Expand Down
15 changes: 12 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.kohsuke</groupId>
<artifactId>pom</artifactId>
<version>19</version>
<version>21</version>
<relativePath />
</parent>

Expand All @@ -15,6 +15,10 @@
<packaging>pom</packaging>
<description>Extensible application-specific access modifiers for Java</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<modules>
<module>access-modifier-annotation</module>
<module>access-modifier-checker</module>
Expand Down Expand Up @@ -70,6 +74,11 @@
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down Expand Up @@ -99,8 +108,8 @@
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-debug-all</artifactId>
<version>5.0.3</version>
<artifactId>asm</artifactId>
<version>9.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down