Skip to content

Skip the check when parameters have duplicate names - #6092

Open
rootkiller6788 wants to merge 2 commits into
google:masterfrom
rootkiller6788:fix-overriding-method-dup-param-crash
Open

Skip the check when parameters have duplicate names#6092
rootkiller6788 wants to merge 2 commits into
google:masterfrom
rootkiller6788:fix-overriding-method-dup-param-crash

Conversation

@rootkiller6788

Copy link
Copy Markdown

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.

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.

1 participant