Skip to content

Commit

Permalink
Fix: apply workaround for class names starting with $ (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
bddckr authored Oct 27, 2023
1 parent ea3a0f9 commit ef5d6a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class RefineFactory implements AsmClassVisitorFactory<Instrument
@Override
@Nonnull
public ClassVisitor createClassVisitor(final @Nonnull ClassContext classContext, final @Nonnull ClassVisitor classVisitor) {
return new ClassRemapper(classVisitor, new RefineRemapper(classContext));
return new ClassRemapper(getInstrumentationContext().getApiVersion().get(), classVisitor, new RefineRemapper(classContext)) {};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,15 @@ public String map(final String typeName) {

return typeName;
}

@Override
public String mapInnerClassName(String name, String ownerName, String innerName) {
final String result = super.mapInnerClassName(name, ownerName, innerName);

if (innerName.startsWith("$") && !result.startsWith("$")) {
return "$" + result;
}

return result;
}
}

0 comments on commit ef5d6a8

Please sign in to comment.