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: Fix interface injector visibility checks. #156

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

LlamaLad7
Copy link
Collaborator

InjectionInfo.parse can be very expensive and in the case of some MixinExtras features is not pure. The correct approach would be to use InjectionInfo.getInjectorAnnotation, but the override is no longer needed anyway since we only support Java 8+ so Mixin will already make injector methods private and synthetic. Except, Mixin does it based on the current COMPATIBILITY_LEVEL, which is wrong, because we could be on JAVA_17 and yet a class compiled with JAVA_8 had no choice but to use public methods. The original implementation was also incomplete because it forgot about default methods.

`InjectionInfo.parse` can be very expensive and in the case of some MixinExtras features is not pure.
The correct approach would be to use `InjectionInfo.getInjectorAnnotation`, but the override is no longer needed anyway since we only support Java 8+ so Mixin will already make injector methods private and synthetic.
Except, Mixin does it based on the current `COMPATIBILITY_LEVEL`, which is wrong, because we could be on JAVA_17 and yet a class compiled with JAVA_8 had no choice but to use public methods.
The original implementation was also incomplete because it forgot about default methods.
@modmuss50 modmuss50 merged commit c3e6d66 into main Sep 3, 2024
4 checks passed
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