There was a small inaccuracy in the commit message of a8217ef280:
Everything I said about "extra mods" also applies to mod directory
mods (FML treats the two sets as one).
As proposed in https://github.com/SpongePowered/Mixin/issues/207
Fixes mods on the class path containing mixins not getting loaded as mods in a
1.7.10 development environment.
Background information:
Discovery of Forge mods roughly happens in the following 2 steps:
1. `findClassPathMods`: Discover Forge mods on the class path which are not in
the coremod list or the reparseable coremod list.
2. `findModDirMods`: Discover Forge mods that are in the mod directory, or
specified as *extra mods* using `--mods`.
It appears that the purpose of the reparseable mod list is to prevent a mod from
being discovered in both of the steps. This would happen with extra mods
containing both a coremod and a Forge mod, since they get injected into the
class path during coremod discovery (but since they get marked as reparseable,
this is avoided.)
Mixin needs to make sure the mod gets discovered in exactly one of the steps. We
can achieve this by only adding it to the reparseable list if it's not on the
boot class path. This causes only extra mods to get added.
In 59db546c22, IRemapper's contract was changed
so that mapMethodName and mapFieldName may be called with null arguments,
but RemapperAdapterFML was not changed to be able to handle this, causing a
NPE to happen in this case.
This commit adds an opt-in way for RemapperAdapter implementations to request
that the remapper should immediately no-op when invoked with null arguments,
and makes RemapperAdapterFML use it.
This was removed in 59db546c22, which caused
refmaps to get mapped to SRG but not back in 1.7.10 development environments.
This commit reimplements it using the remapper chain API.
The previous implementation gathers InjectionInfos for all annotated
methods in the target class, which after a previous injection means that
it'll see injected methods from unrelated mixins if they happen to
target the same class. This caused it to analyze foreign injections
without the proper refmap and mixin association.
Gson and Guava are both used in pre- and post-modular versions in
environments where Mixin is used on the module path, so we have to be
able to link against both in the compile-time module descriptor.
* Account for inheritance when testing for callback use
Fixes#68
* Log a bit less for the expected case
It's expected most of the time there won't be any children to check
* Remove troublesome check
It's the child which will certainly have the detached super
* Fix File/Memory leak in Annotation Processor.
Mixin's AP requires the minecraft jar + deps on the AP classpath to generate a refmap. These files are then opened by the classloader.
TargetMap uses Java's object Serialization to save/load itself from files. When doing so it gets placed into ObjectStreamClass.Caches, this does not get garbage collected enough to allow the Classloader to close, and thus close the file handles it has open.
This commit uses Gson to read/write TargetMap to prevent this class form being added to the global JVM cache.
* Manually build/read json structure
* Fix annotating fields with unique
Whilst other mixins are taken into account for making methods unique, fields previously did not
* Still compiling to Java 6