intellij-community icon indicating copy to clipboard operation
intellij-community copied to clipboard

Fix IDEA-247575 Parameter names aren't used in method body when debug info is absent

Open Maccimo opened this issue 5 years ago • 2 comments

Fix for IDEA-247575 Parameter names aren't used in method body when debug info is absent

Maccimo avatar Apr 01 '21 12:04 Maccimo

Sorry for the late reply.

I'm going to implement the fix the other way, because it amends the one made earlier that turned out to be incomplete. Have one question though: in your code, the MethodParameters attribute prevails over debug info. Are there any particular reasons for that? I'd rather make the other way around, because debug info is more extensive.

trespasserw avatar Nov 24 '21 09:11 trespasserw

Sorry for the late reply.

I'm going to implement the fix the other way, because it amends the one made earlier that turned out to be incomplete. Have one question though: in your code, the MethodParameters attribute prevails over debug info. Are there any particular reasons for that? I'd rather make the other way around, because debug info is more extensive.

Debug info is not required for program execution in general and therefore it is often stripped or trashed by ProGuard, obfuscators, etc.

In contrast, MethodParameters is designed to be available in runtime via java.lang.reflect.Parameter and stripping or trashing them may lead to program failure.

So MethodParameters looks more authoritative source for me.

Maccimo avatar Dec 17 '21 00:12 Maccimo