diff options
| author | 2014-09-22 23:35:02 -0400 | |
|---|---|---|
| committer | 2014-09-22 23:35:02 -0400 | |
| commit | 89c287f39f432385febf97779f51c45a6c3eb51b (patch) | |
| tree | 7d9230d50bfebb5987c910ccaed6a008e0384c19 | |
| parent | fixed bugs with anonymous/inner classes (diff) | |
| download | enigma-89c287f39f432385febf97779f51c45a6c3eb51b.tar.gz enigma-89c287f39f432385febf97779f51c45a6c3eb51b.tar.xz enigma-89c287f39f432385febf97779f51c45a6c3eb51b.zip | |
fix bug with anonymous classes in class initializers
| -rw-r--r-- | src/cuchaz/enigma/bytecode/InnerClassWriter.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/cuchaz/enigma/bytecode/InnerClassWriter.java b/src/cuchaz/enigma/bytecode/InnerClassWriter.java index f94a85d7..a0617925 100644 --- a/src/cuchaz/enigma/bytecode/InnerClassWriter.java +++ b/src/cuchaz/enigma/bytecode/InnerClassWriter.java | |||
| @@ -51,12 +51,22 @@ public class InnerClassWriter | |||
| 51 | if( caller != null ) | 51 | if( caller != null ) |
| 52 | { | 52 | { |
| 53 | // write the enclosing method attribute | 53 | // write the enclosing method attribute |
| 54 | c.getClassFile().addAttribute( new EnclosingMethodAttribute( | 54 | if( caller.getName().equals( "<clinit>" ) ) |
| 55 | c.getClassFile().getConstPool(), | 55 | { |
| 56 | caller.getClassName(), | 56 | c.getClassFile().addAttribute( new EnclosingMethodAttribute( |
| 57 | caller.getName(), | 57 | c.getClassFile().getConstPool(), |
| 58 | caller.getSignature() | 58 | caller.getClassName() |
| 59 | ) ); | 59 | ) ); |
| 60 | } | ||
| 61 | else | ||
| 62 | { | ||
| 63 | c.getClassFile().addAttribute( new EnclosingMethodAttribute( | ||
| 64 | c.getClassFile().getConstPool(), | ||
| 65 | caller.getClassName(), | ||
| 66 | caller.getName(), | ||
| 67 | caller.getSignature() | ||
| 68 | ) ); | ||
| 69 | } | ||
| 60 | } | 70 | } |
| 61 | } | 71 | } |
| 62 | 72 | ||