fix: make older asm versions support java 24#1653
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new ASM-based transformer to strip out the built-in class version check from ASM’s ClassReader constructor, allowing remapping to work on older Paper/Spigot bundles under Java 24.
- Replaces the old Bukkit-specific Commodore transformer with a generic ASM version-check stripper
- Drops the now-unused
BukkitCommodoreTransformerclass - Adds
AsmClassReaderTransformerto remove theIllegalArgumentExceptionthrow in ASM’s constructor
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| wrapper-jvm/impl/src/main/resources/META-INF/services/.../ClassTransformer | Replaced BukkitCommodoreTransformer SPI entry with AsmClassReaderTransformer |
| wrapper-jvm/impl/src/main/java/eu/cloudnetservice/wrapper/impl/transform/bukkit/BukkitCommodoreTransformer.java | Deleted obsolete Commodore transformer |
| wrapper-jvm/impl/src/main/java/eu/cloudnetservice/wrapper/impl/transform/asm/AsmClassReaderTransformer.java | Added transformer that drops the version-check throw in ClassReader |
Comments suppressed due to low confidence (2)
wrapper-jvm/impl/src/main/java/eu/cloudnetservice/wrapper/impl/transform/asm/AsmClassReaderTransformer.java:2
- Update the license header to include the current year (e.g., 2025) so it reflects the date of this new addition.
* Copyright 2019-2024 CloudNetService team & contributors
wrapper-jvm/impl/src/main/java/eu/cloudnetservice/wrapper/impl/transform/asm/AsmClassReaderTransformer.java:36
- Add unit tests for
AsmClassReaderTransformerto verify that both legacy and modern ASM constructor signatures have their version-check throw removed properly.
/*
...l/src/main/resources/META-INF/services/eu.cloudnetservice.wrapper.transform.ClassTransformer
Show resolved
Hide resolved
derklaro
approved these changes
Jun 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Older paper & spigot versions bundle asm versions that do not support java 24. Paper uses asm to remap plugins which are spigot mapped to mojang mappings. This fails due to the asm version mismatch. This PR fixes that.
Modification
Added a class transformer for the asm ClassReader which removes the Java version check. The check is not needed as ASM is able to still rewrite newer classes.
Result
Remapping on older paper versions with older asm versions works on Java 24