Skip to content

fix: make older asm versions support java 24#1653

Merged
0utplay merged 3 commits intonightlyfrom
fix/asm-skip-class-source-check
Jun 13, 2025
Merged

fix: make older asm versions support java 24#1653
0utplay merged 3 commits intonightlyfrom
fix/asm-skip-class-source-check

Conversation

@0utplay
Copy link
Member

@0utplay 0utplay commented Jun 10, 2025

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

@0utplay 0utplay added this to the 4.0.0-RC13 milestone Jun 10, 2025
@0utplay 0utplay requested review from Copilot and derklaro June 10, 2025 15:22
@0utplay 0utplay self-assigned this Jun 10, 2025
@0utplay 0utplay added v: 4.X This pull should be included in the 4.0 release t: fix A pull request introducing a fix for a bug. in: wrapper An issue/pull request releated to the wrapper module code labels Jun 10, 2025
@0utplay 0utplay changed the title fix: support older asm versions fix: make older asm versions support java 24 Jun 10, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BukkitCommodoreTransformer class
  • Adds AsmClassReaderTransformer to remove the IllegalArgumentException throw 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 AsmClassReaderTransformer to verify that both legacy and modern ASM constructor signatures have their version-check throw removed properly.
/*

@github-actions
Copy link

Test Results

 51 files  ±0   51 suites  ±0   1m 12s ⏱️ -18s
452 tests ±0  452 ✅ ±0  0 💤 ±0  0 ❌ ±0 
783 runs  ±0  783 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 3bb2a26. ± Comparison against base commit 1d92e1d.

@0utplay 0utplay merged commit 5b02c06 into nightly Jun 13, 2025
7 checks passed
@0utplay 0utplay deleted the fix/asm-skip-class-source-check branch June 13, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: wrapper An issue/pull request releated to the wrapper module code t: fix A pull request introducing a fix for a bug. v: 4.X This pull should be included in the 4.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants