-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[core] Javassist sets the generic type of the class but the decompilation is lost #2272
Comments
@Milory please share your sample |
The MainTest.java file in the compressed file is a complete example, but it first depends on Lombok and Javassist, for example: <dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.30.2-GA</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.32</version>
</dependency> The Wrapper.class file in the compressed package is the generated target file。 |
Hm, @Milory looks like you add Comparable interface only to signature and not to actual interfaces list: ctClass.setInterfaces(new CtClass[]{pool.get("java.lang.Comparable")}); Because of this, class doesn't implement Comparable and check at runtime: Object obj = ctClass.toClass().getConstructor().newInstance();
System.out.println("Is instance of Comparable: " + (obj instanceof Comparable));
Comparable cmp = (Comparable) obj; print It is weird that |
Issue details
platform
test code
Decompile and view source code
After decompiling through jadx, it was found that the implemented interfaces content was lost。
However, when the code is decompiled through the javap command, the code can be displayed normally
Relevant log output or stacktrace
No response
Provide sample and class/method full name
No response
Jadx version
1.5.0
The text was updated successfully, but these errors were encountered: