Skip to content

Commit c6e7eac

Browse files
authored
Merge pull request #233 from ebean-orm/feature/232-version-991
Upgrade to ASM 9.9.1
2 parents c085864 + 4b0bb5d commit c6e7eac

21 files changed

+85
-48
lines changed

ebean-agent/src/main/java/io/ebean/enhance/asm/Attribute.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public boolean isCodeAttribute() {
9595
* a Code attribute that contains labels.
9696
* @deprecated no longer used by ASM.
9797
*/
98-
@Deprecated
98+
@Deprecated(forRemoval = false)
9999
protected Label[] getLabels() {
100100
return new Label[0];
101101
}
@@ -174,6 +174,7 @@ public static Attribute read(
174174
* ClassReader overrides {@link ClassReader#readLabel}. Hence {@link #read(ClassReader, int, int,
175175
* char[], int, Label[])} must not manually create {@link Label} instances.
176176
*
177+
* @param classReader the class that contains the attribute to be read.
177178
* @param bytecodeOffset a bytecode offset in a method.
178179
* @param labels the already created labels, indexed by their offset. If a label already exists
179180
* for bytecodeOffset this method does not create a new one. Otherwise it stores the new label

ebean-agent/src/main/java/io/ebean/enhance/asm/ClassReader.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public class ClassReader {
100100
* @deprecated Use {@link #readByte(int)} and the other read methods instead. This field will
101101
* eventually be deleted.
102102
*/
103-
@Deprecated
103+
@Deprecated(forRemoval = false)
104104
// DontCheck(MemberName): can't be renamed (for backward binary compatibility).
105105
public final byte[] b;
106106

@@ -195,7 +195,7 @@ public ClassReader(
195195
this.b = classFileBuffer;
196196
// Check the class' major_version. This field is after the magic and minor_version fields, which
197197
// use 4 and 2 bytes respectively.
198-
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V25) {
198+
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V26) {
199199
throw new IllegalArgumentException(
200200
"Unsupported class file major version " + readShort(classFileOffset + 6));
201201
}
@@ -3539,6 +3539,9 @@ private Attribute readAttribute(
35393539
final char[] charBuffer,
35403540
final int codeAttributeOffset,
35413541
final Label[] labels) {
3542+
if (length > classFileBuffer.length - offset) {
3543+
throw new IllegalArgumentException();
3544+
}
35423545
for (Attribute attributePrototype : attributePrototypes) {
35433546
if (attributePrototype.type.equals(type)) {
35443547
return attributePrototype.read(

ebean-agent/src/main/java/io/ebean/enhance/asm/ClassTooLargeException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public final class ClassTooLargeException extends IndexOutOfBoundsException {
4343
* Constructs a new {@link ClassTooLargeException}.
4444
*
4545
* @param className the internal name of the class (see {@link
46-
* Type#getInternalName()}).
46+
* io.ebean.enhance.asm.Type#getInternalName()}).
4747
* @param constantPoolCount the number of constant pool items of the class.
4848
*/
4949
public ClassTooLargeException(final String className, final int constantPoolCount) {
@@ -53,7 +53,7 @@ public ClassTooLargeException(final String className, final int constantPoolCoun
5353
}
5454

5555
/**
56-
* Returns the internal name of the class (see {@link Type#getInternalName()}).
56+
* Returns the internal name of the class (see {@link io.ebean.enhance.asm.Type#getInternalName()}).
5757
*
5858
* @return the internal name of the class.
5959
*/

ebean-agent/src/main/java/io/ebean/enhance/asm/ClassWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ public int newPackage(final String packageName) {
897897
* @deprecated this method is superseded by {@link #newHandle(int, String, String, String,
898898
* boolean)}.
899899
*/
900-
@Deprecated
900+
@Deprecated(forRemoval = false)
901901
public int newHandle(
902902
final int tag, final String owner, final String name, final String descriptor) {
903903
return newHandle(tag, owner, name, descriptor, tag == Opcodes.H_INVOKEINTERFACE);

ebean-agent/src/main/java/io/ebean/enhance/asm/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static void checkAsmExperimental(final Object caller) {
191191
}
192192

193193
static boolean isWhitelisted(final String internalName) {
194-
if (!internalName.startsWith("io/ebean/enhance/asm/")) {
194+
if (!internalName.startsWith("org/objectweb/asm/")) {
195195
return false;
196196
}
197197
String member = "(Annotation|Class|Field|Method|Module|RecordComponent|Signature)";

ebean-agent/src/main/java/io/ebean/enhance/asm/Handle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public final class Handle {
7171
* @deprecated this constructor has been superseded by {@link #Handle(int, String, String, String,
7272
* boolean)}.
7373
*/
74-
@Deprecated
74+
@Deprecated(forRemoval = false)
7575
public Handle(final int tag, final String owner, final String name, final String descriptor) {
7676
this(tag, owner, name, descriptor, tag == Opcodes.H_INVOKEINTERFACE);
7777
}

ebean-agent/src/main/java/io/ebean/enhance/asm/MethodVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public void visitFieldInsn(
416416
* @param descriptor the method's descriptor (see {@link Type}).
417417
* @deprecated use {@link #visitMethodInsn(int, String, String, String, boolean)} instead.
418418
*/
419-
@Deprecated
419+
@Deprecated(forRemoval = false)
420420
public void visitMethodInsn(
421421
final int opcode, final String owner, final String name, final String descriptor) {
422422
int opcodeAndSource = opcode | (api < Opcodes.ASM5 ? Opcodes.SOURCE_DEPRECATED : 0);

ebean-agent/src/main/java/io/ebean/enhance/asm/ModuleVisitor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public ModuleVisitor getDelegate() {
9393
}
9494

9595
/**
96-
* Visit the main class of the current module.
96+
* Visits the main class of the current module.
9797
*
9898
* @param mainClass the internal name of the main class of the current module (see {@link
9999
* Type#getInternalName()}).
@@ -105,7 +105,7 @@ public void visitMainClass(final String mainClass) {
105105
}
106106

107107
/**
108-
* Visit a package of the current module.
108+
* Visits a package of the current module.
109109
*
110110
* @param packaze the internal name of a package (see {@link Type#getInternalName()}).
111111
*/
@@ -130,7 +130,7 @@ public void visitRequire(final String module, final int access, final String ver
130130
}
131131

132132
/**
133-
* Visit an exported package of the current module.
133+
* Visits an exported package of the current module.
134134
*
135135
* @param packaze the internal name of the exported package (see {@link Type#getInternalName()}).
136136
* @param access the access flag of the exported package, valid values are among {@code
@@ -145,7 +145,7 @@ public void visitExport(final String packaze, final int access, final String...
145145
}
146146

147147
/**
148-
* Visit an open package of the current module.
148+
* Visits an open package of the current module.
149149
*
150150
* @param packaze the internal name of the opened package (see {@link Type#getInternalName()}).
151151
* @param access the access flag of the opened package, valid values are among {@code
@@ -160,7 +160,7 @@ public void visitOpen(final String packaze, final int access, final String... mo
160160
}
161161

162162
/**
163-
* Visit a service used by the current module. The name must be the internal name of an interface
163+
* Visits a service used by the current module. The name must be the internal name of an interface
164164
* or a class.
165165
*
166166
* @param service the internal name of the service (see {@link Type#getInternalName()}).
@@ -172,7 +172,7 @@ public void visitUse(final String service) {
172172
}
173173

174174
/**
175-
* Visit an implementation of a service.
175+
* Visits an implementation of a service.
176176
*
177177
* @param service the internal name of the service (see {@link Type#getInternalName()}).
178178
* @param providers the internal names (see {@link Type#getInternalName()}) of the implementations

ebean-agent/src/main/java/io/ebean/enhance/asm/Opcodes.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public interface Opcodes {
5656
*
5757
* @deprecated This API is experimental.
5858
*/
59-
@Deprecated int ASM10_EXPERIMENTAL = 1 << 24 | 10 << 16 | 0 << 8;
59+
@Deprecated(forRemoval = false)
60+
int ASM10_EXPERIMENTAL = 1 << 24 | 10 << 16 | 0 << 8;
6061

6162
/*
6263
* Internal flags used to redirect calls to deprecated methods. For instance, if a visitOldStuff
@@ -291,6 +292,7 @@ public interface Opcodes {
291292
int V23 = 0 << 16 | 67;
292293
int V24 = 0 << 16 | 68;
293294
int V25 = 0 << 16 | 69;
295+
int V26 = 0 << 16 | 70;
294296

295297
/**
296298
* Version flag indicating that the class is using 'preview' features.

ebean-agent/src/main/java/io/ebean/enhance/asm/SymbolTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ private static final class LabelEntry {
14731473

14741474
/**
14751475
* Another entry (and so on recursively) having the same hash code (modulo the size of {@link
1476-
* SymbolTable#labelEntries}}) as this one.
1476+
* SymbolTable#labelEntries}) as this one.
14771477
*/
14781478
LabelEntry next;
14791479

0 commit comments

Comments
 (0)