This was a very strange exception to have in the first place, and the default path works fine.
Notably, you are also allowed to have enums inside Mixins, in which case those would be given different names for each target class and therefore any switch tables referencing them are *not* safe to share.
The verifier will catch this anyway, this just gives us a better error which blames the particular mixin, but it's very expensive to check so best avoided in the default case.
The semantics of staticness are likely not identical, but I haven't been able to find a case where they differ. The old one is horribly heuristic anyway.
This can be expensive to compute since it requires loading ClassInfos for outer classes, and it is a useless warning anyway which only worsens logspam.
* Initial attempt at exposing will-be-transformed-ness of classes via mixin
* Use mixin environment properly
* Fix some ordering
* Make processingCouldTransform default true and log error
* Simplify logic slightly
* Address feedback, sans checkstyle
* Hopefully fix checkstyle
* Log class name as well
* Address feedback
Require that environment passed to `couldTransformClass` be current, and integrate check before `ClassNode` creation in `transformClass` that takes bytes.
* Use locking logic from applyMixins to avoid reentrance issues
* Extract common locking logic
* Add optional byte argument to couldTransform checks
* Revert "Add optional byte argument to couldTransform checks"
This reverts commit 925fa612d02c1001faf54ba6648ccdea6c12b762.
* Revert "Extract common locking logic"
This reverts commit 155fe1568944f72f710ff6895a67b823219378ec.
* Extract common locking logic, but nicer
* Shift around to reduce diff
* Remove unnecessary changes
* Remove more unnecessary format changes
* Update log message to match method name
`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.
The old one did not properly account for discontinuities in the list, leading to double-width types clobbering meaningful locals and causing mysterious VerifyErrors.
These will never match because the LHS is the mixin name and the RHS is the target name.
This restores the 0.8.5 behaviour which does not check the owner at all.
We have never supported assignment expressions in initialisers until now anyway, and even if we check the owner we cannot determine whether the instruction is operating on the current *instance* without proper static analysis, so IMO there's not much point bothering.
Bafflingly, Mixin fails to match a `NEW` instruction whose `<init>` call is outside the slice range, *iff the user specified a descriptor*.
I'm even more surprised that a mod relied on this.
Fixes#152.