NPE in proguard.classfile.ProgramClass.constantPoolEntryAccept
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
Hi,
I get a NPE during optimizing my large jar. I could not track it down to a small example (and it is closed source, so I'm not allowed to upload it)
Therefore, I checked out the source and debugged ProGuard.
The following changed fixed the problem - at proguard.classfile.ProgramClass.constantPoolEntryAccept(int, ConstantVisitor)
public void constantPoolEntryAccept(int index, ConstantVisitor constantVisitor)
{
if (constantPool[index] != null)
{
constantPool[index].accept(this, constantVisitor);
}
}
(index value was 0, and constantPool[0] was null)
Used compiler: Eclipse
I don't know if this null pointer may cause any wrong byte code gereation, but my application run with this change.
We also got a NPE at proguard.classfile.ProgramClass.constantPoolEntryAccept(ProgramClass.java:465). See the stacktrace below. It occured using version 5.2.1 and it still occurs using version 5.3.3.
@Eric: Could you please have a look?! Unfortunately I can't upload our code either. Is there any chance to figure out what code (class, method, whatever) caused the problem?
Thanks in advance,
Maik
Last edit: Maik 2018-01-29
The problem also exists in version 6.0 beta2. Due to this problem we are currently not able to obfuscate. Any chance that you can have a look soon?
Best regards,
Maik
Thanks for your report. The problem is triggered by a MethodParameters attribute with a nameless parameter. I've now fixed it for the upcoming ProGuard 6.0. Fro now, you can probably work around it by disabling the generation of these (optional) MethodParameters attributes in the compiler.
Thank you very much Eric!