Skip the check when parameters have duplicate names - #6092
Open
rootkiller6788 wants to merge 2 commits into
Open
Skip the check when parameters have duplicate names#6092rootkiller6788 wants to merge 2 commits into
rootkiller6788 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
OverridingMethodInconsistentArgumentNamesChecker can crash with 'Multiple entries with same key' when you override a method that was compiled by something which renamed every parameter to the same name (obfuscated Minecraft libs etc. do this). javac happily loads such a class file, but the check then tries to build a name->position ImmutableBiMap for the super method and blows up.
There's nothing to compare when a method has duplicate parameter names, so I made it skip the check in that case.
Added a regression test that compiles a normal superclass, rewrites its MethodParameters attribute so both params are named p1, and overrides it. It failed with the reported stack before the fix.