#83 exception in decompilation of <clinit> (some inner classes)

closed-fixed
nobody
decompiler (49)
5
2005-10-04
2005-09-28
andreas salathé
No

lookForConstructorCall() tries to assign the first
parameter ($0) to the implicit $this reference in
non-static inner classes, EVEN in the class-initializer
<clinit>

FIXUP:
REPLACE lines 167..169 in
jode/flow/TransformConstructors.java:

BY
Expression outer;
if ((Options.options & Options.OPTION_CONTRAFO) != 0
&& (outer=clazzAnalyzer.getOuterInstance()) !=
null)

if (! "<clinit>".equals(current.getName()))

current.getParamInfo(1).setExpression(outer);

Error whilst decompiling java.util.Formatter.
java.lang.ArrayIndexOutOfBoundsException: 1
at
net.sf.jode.decompiler.MethodAnalyzer.getParamInfo(MethodAnalyzer.java:405)
at
net.sf.jode.flow.TransformConstructors.lookForConstructorCall(TransformConstructors.java:169)
at
net.sf.jode.flow.TransformConstructors.<init>(TransformConstructors.java:111)
at
net.sf.jode.decompiler.ClassAnalyzer.makeDeclaration(ClassAnalyzer.java:437)
at
net.sf.jode.decompiler.ClassAnalyzer.makeDeclaration(ClassAnalyzer.java:452)
at
net.sf.jode.decompiler.ClassAnalyzer.dumpJavaFile(ClassAnalyzer.java:668)
at
net.sf.jode.decompiler.ClassAnalyzer.dumpJavaFile(ClassAnalyzer.java:654)
at
net.sf.jode.decompiler.Main.decompileClass(Main.java:166)
at
net.sf.jode.decompiler.Main.decompile(Main.java:407)
at net.sf.jode.decompiler.Main.main(Main.java:217)

Discussion

  • Logged In: YES
    user_id=18252

    Patch checked in. I used isStatic instead of comparison for
    <clinit>, though.

     
    • status: open --> closed-fixed