Skip to content

Commit

Permalink
Use ASM 9.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Sep 19, 2020
1 parent 9723643 commit 4c235f0
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion byte-buddy-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.10.14</version>
<version>1.10.15</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions byte-buddy-dep/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<plugin>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-maven-plugin</artifactId>
<version>1.10.14</version>
<version>1.10.15</version>
<executions>
<execution>
<phase>compile</phase>
Expand All @@ -116,13 +116,13 @@
<transformation>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.10.14</version>
<version>1.10.15</version>
<plugin>net.bytebuddy.build.HashCodeAndEqualsPlugin$WithNonNullableFields</plugin>
</transformation>
<transformation>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.10.14</version>
<version>1.10.15</version>
<plugin>net.bytebuddy.build.CachedReturnPlugin</plugin>
</transformation>
</transformations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class ClassFileVersion implements Comparable<ClassFileVersion> {
/**
* The class file version of Java 16.
*/
public static final ClassFileVersion JAVA_V16 = new ClassFileVersion(Opcodes.V15 + 1);
public static final ClassFileVersion JAVA_V16 = new ClassFileVersion(Opcodes.V16);

/**
* A version locator for the executing JVM.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2323,11 +2323,11 @@ record = false;
super.visit(version, modifiers, name, signature, superName, interfaces);
}

/*@Override
@Override
public void visitPermittedSubclass(String permittedSubclass) {
constraint.assertPermittedSubclass();
super.visitPermittedSubclass(permittedSubclass);
}*/
}

@Override
public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
Expand Down Expand Up @@ -4862,19 +4862,19 @@ protected void onNestHost() {
}
}

/*@Override
@Override
protected void onVisitPermittedSubclass(String permittedSubclass) {
if (permittedSubclasses.remove(permittedSubclass)) {
cv.visitPermittedSubclass(permittedSubclass);
}
}*/
}

/*@Override
@Override
protected void onAfterPermittedSubclasses() {
for (String permittedSubclass : permittedSubclasses) {
cv.visitPermittedSubclass(permittedSubclass);
}
}*/
}

@Override
protected void onVisitOuterClass(String owner, String name, String descriptor) {
Expand Down Expand Up @@ -5729,9 +5729,9 @@ protected UnresolvedType create(TypeInitializer typeInitializer, ClassDumpAction
if (!instrumentedType.isNestHost()) {
classVisitor.visitNestHost(instrumentedType.getNestHost().getInternalName());
}
/*for (TypeDescription typeDescription : instrumentedType.getPermittedSubclasses()) {
for (TypeDescription typeDescription : instrumentedType.getPermittedSubclasses()) {
classVisitor.visitPermittedSubclass(typeDescription.getInternalName());
}*/
}
MethodDescription.InDefinedShape enclosingMethod = instrumentedType.getEnclosingMethod();
if (enclosingMethod != null) {
classVisitor.visitOuterClass(enclosingMethod.getDeclaringType().getInternalName(),
Expand Down
4 changes: 2 additions & 2 deletions byte-buddy-dep/src/main/java/net/bytebuddy/pool/TypePool.java
Original file line number Diff line number Diff line change
Expand Up @@ -7813,10 +7813,10 @@ public RecordComponentVisitor visitRecordComponent(String name, String descripto
return new RecordComponentExtractor(name, descriptor, signature);
}

/*@Override
@Override
public void visitPermittedSubclass(String permittedSubclass) {
permittedSubclasses.add(permittedSubclass);
}*/
}

/**
* Creates a type description from all data that is currently collected. This method should only be invoked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class OpenedClassReader {
experimental = false;
}
EXPERIMENTAL = experimental;
ASM_API = Opcodes.ASM8;
ASM_API = Opcodes.ASM9;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected void onVisitNestHost(String nestHost) {
super.visitNestHost(nestHost);
}

/*@Override
@Override
public final void visitPermittedSubclass(String permittedSubclass) {
onVisitPermittedSubclass(permittedSubclass);
}
Expand All @@ -171,10 +171,10 @@ public final void visitPermittedSubclass(String permittedSubclass) {
* An order-sensitive invocation of {@code ClassVisitor#visitPermittedSubclass}.
*
* @param permittedSubclass The internal name of the permitted subclass.
*//*
*/
protected void onVisitPermittedSubclass(String permittedSubclass) {
super.visitPermittedSubclass(permittedSubclass);
}*/
}

@Override
public final void visitOuterClass(String owner, String name, String descriptor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static Collection<Object[]> data() {
{13, 13, Arrays.asList("1.13", "13"), Opcodes.V13, (short) 57, (short) 0, true, true, true},
{14, 14, Arrays.asList("1.14", "14"), Opcodes.V14, (short) 58, (short) 0, true, true, true},
{15, 15, Arrays.asList("1.15", "15"), Opcodes.V15, (short) 59, (short) 0, true, true, true},
{16, 16, Arrays.asList("1.16", "16"), Opcodes.V15 + 1, (short) 60, (short) 0, true, true, true}
{16, 16, Arrays.asList("1.16", "16"), Opcodes.V16, (short) 60, (short) 0, true, true, true}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected static class GradlePackageVisitor extends ClassVisitor {
* @param names The names being discovered.
*/
protected GradlePackageVisitor(String type, Map<String, String> names) {
super(Opcodes.ASM8);
super(Opcodes.ASM9);
this.type = type;
this.names = names;
}
Expand Down Expand Up @@ -221,7 +221,7 @@ protected class GradleTypeAnnotationVisitor extends AnnotationVisitor {
* Creates a new package annotation visitor.
*/
protected GradleTypeAnnotationVisitor() {
super(Opcodes.ASM8);
super(Opcodes.ASM9);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testJarTransformation() throws Exception {
JarEntry entry = jarInputStream.getNextJarEntry();
assertThat(entry, notNullValue(JarEntry.class));
assertThat(entry.getName(), is(Target.class.getName().replace('.', '/') + ".class"));
new ClassReader(jarInputStream).accept(new ClassVisitor(Opcodes.ASM8) {
new ClassReader(jarInputStream).accept(new ClassVisitor(Opcodes.ASM9) {

private boolean found;

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<bytecode.test.version>1.6</bytecode.test.version>
<pitest.target>net.bytebuddy</pitest.target>
<asm.url>https://asm.ow2.io</asm.url>
<version.asm>8.0.1</version.asm>
<version.asm>9.0-beta</version.asm>
<version.junit>4.13</version.junit>
<version.mockito>2.23.0</version.mockito>
<version.plugin.clean>3.0.0</version.plugin.clean>
Expand Down

0 comments on commit 4c235f0

Please sign in to comment.