shevek / jarjar

Jar Jar Links is a utility that makes it easy to repackage Java libraries and embed them into your own distribution.
Apache License 2.0
735 stars 93 forks source link

Fix GetNameClassWriter errors during remap on JDK11 classes #23

Open redcape opened 3 years ago

redcape commented 3 years ago

Although the remap process for ASM8 supports higher JDKs, remapping fails on some classes because GetNameClassWriter (which only gets the class name) was throwing an error when processing JDK11 classes with newer features like those from org.jgroups:jgroups.

Example errors:

2021/05/27 04:24:11 WARN ClassTransformerJarProcessor[main]: Failed to read class org/jgroups/protocols/Locking.class: java.lang.UnsupportedOperationException: This feature requires ASM7
2021/05/27 04:24:11 WARN ClassTransformerJarProcessor[main]: Failed to read class org/jgroups/protocols/SSL_KEY_EXCHANGE$SessionVerifier.class: java.lang.UnsupportedOperationException: This feature requires ASM7

The fix here is to simply change ASM5 to ASM8, the highest stable version / matching version of the current depended-on ASM.

Additionally, we change StringReader to use the higher ASM version as well to prevent errors for the strings command, but do not make any specific changes to process/display additional strings for the newer features available since ASM5 in ClassVisitor.

etinquis commented 8 months ago

+1 for merging this, it was invaluable for fixing the linked issue.

redcape commented 8 months ago

@etinquis I think this project is abandoned. I had to do an internal fork with just this commit.

etinquis commented 8 months ago

@redcape Yeah it seems like it, but one can only hope 😄