Skip to content

Commit

Permalink
ASM tweaks for RIFE2
Browse files Browse the repository at this point in the history
  • Loading branch information
gbevin committed Jan 30, 2024
1 parent 88bd67c commit ddb8135
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/main/java/rife/asm/ClassWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,11 @@ public int newNameType(final String name, final String descriptor) {
* Type#getInternalName()}).
*/
protected String getCommonSuperClass(final String type1, final String type2) {
// TODO : extend ClassWriter and use bytecode analysis for finding the common superclass instead of class loading
if (type1.equals("java/lang/Object") || type2.equals("java/lang/Object")) {
return "java/lang/Object";
}

ClassLoader classLoader = getClassLoader();
Class<?> class1;
try {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/rife/asm/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ static void checkAsmExperimental(final Object caller) {
}

static boolean isWhitelisted(final String internalName) {
if (!internalName.startsWith("org/objectweb/asm/")) {
if (!internalName.startsWith("rife/asm/")) {
return false;
}
String member = "(Annotation|Class|Field|Method|Module|RecordComponent|Signature)";
return internalName.contains("Test$")
|| Pattern.matches(
"org/objectweb/asm/util/Trace" + member + "Visitor(\\$.*)?", internalName)
"rife/asm/util/Trace" + member + "Visitor(\\$.*)?", internalName)
|| Pattern.matches(
"org/objectweb/asm/util/Check" + member + "Adapter(\\$.*)?", internalName);
"rife/asm/util/Check" + member + "Adapter(\\$.*)?", internalName);
}

static void checkIsPreview(final InputStream classInputStream) {
Expand Down

0 comments on commit ddb8135

Please sign in to comment.