Add a reflective name fixer, used for various calls in Class and MethodHandles.Lookup #458
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This currently handles class names with mixed mappings, so doing:
Class.forName(ServerPlayerEntity.class.getName() + "$2");
now works correctly even if the inner class has been mapped differently.
This also supports field and method lookups using
Class.get[Declared](Field/Method)
, as well as theMethodHandle.Lookup
methodsfind[Static](Getter/Setter/VarHandle), and
find(Static/Virtual/Special)`This only works if the mappings are present for it - using proper names will never work outside of a development environment. In addition, we still encourage developers to use the MappingResolver to be sure the names will always be mapped correctly.
This commit also adds a somewhat unrelated change:
(I hadn't checked the order that visitMaxs is called in - and since it must be called last, just before visitEnd, we can wait and see if we've needed to emit code that requires an additional stack element, whereas I previously thought it was called first)