Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: NoClassDefFoundError on FastUtil's toIntArray #1475

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

Kambet
Copy link
Contributor

@Kambet Kambet commented Dec 14, 2024

Using IntCollection#toIntArray leads to
java.lang.NoClassDefFoundError: it/unimi/dsi/fastutil/ints/IntArrays.

If we look at fast util AbstractIntCollection code, we can see that it is using IntArrays class from the same package when collection is empty:

public int[] toIntArray() {
        int size = this.size();
        if (size == 0) {
            return IntArrays.EMPTY_ARRAY;
        } else {
            int[] a = new int[size];
            IntIterators.unwrap(this.iterator(), a);
            return a;
        }
    }

Velocity does exclude all IntArray* classes, which leads to IntArrays class being excluded as well.

@electronicboy electronicboy merged commit 4aa9ee7 into PaperMC:dev/3.0.0 Dec 14, 2024
1 check passed
@Kambet Kambet deleted the fix/fastutil_exclude branch December 14, 2024 20:50
pull bot pushed a commit to WiIIiam278/Velocity that referenced this pull request Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants