diff options
author | Stiver <stiver.mail@gmail.com> | 2014-08-17 19:12:27 +0200 |
---|---|---|
committer | Stiver <stiver.mail@gmail.com> | 2014-08-17 19:12:27 +0200 |
commit | 1a8e8ba7a26d19cc96b80eeeb18aed90c766b0c8 (patch) | |
tree | 72bf2e6c918ec2a320d9ca4b1f1caa2e114c6e19 | |
parent | e098fbf6693faf8dae6a9f102f57c32457a84275 (diff) | |
download | fernflower-1a8e8ba7a26d19cc96b80eeeb18aed90c766b0c8.tar fernflower-1a8e8ba7a26d19cc96b80eeeb18aed90c766b0c8.tar.gz fernflower-1a8e8ba7a26d19cc96b80eeeb18aed90c766b0c8.tar.lz fernflower-1a8e8ba7a26d19cc96b80eeeb18aed90c766b0c8.tar.xz fernflower-1a8e8ba7a26d19cc96b80eeeb18aed90c766b0c8.zip |
Fixed wrong order of static initializations (probably part of IDEA-127465)
-rw-r--r-- | src/de/fernflower/main/InitializerProcessor.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/de/fernflower/main/InitializerProcessor.java b/src/de/fernflower/main/InitializerProcessor.java index 97a0e28..e0369cf 100644 --- a/src/de/fernflower/main/InitializerProcessor.java +++ b/src/de/fernflower/main/InitializerProcessor.java @@ -138,12 +138,17 @@ public class InitializerProcessor { AssignmentExprent asexpr = (AssignmentExprent)exprent; if(asexpr.getLeft().type == Exprent.EXPRENT_FIELD) { FieldExprent fexpr = (FieldExprent)asexpr.getLeft(); - if(fexpr.isStatic() && fexpr.getClassname().equals(cl.qualifiedName)) { - String keyField = InterpreterUtil.makeUniqueKey(fexpr.getName(), fexpr.getDescriptor().descriptorString); - if(!wrapper.getStaticFieldInitializers().containsKey(keyField)) { - wrapper.getStaticFieldInitializers().addWithKey(asexpr.getRight(), keyField); - firstdata.getExprents().remove(0); - found = true; + if(fexpr.isStatic() && fexpr.getClassname().equals(cl.qualifiedName) && + cl.hasField(fexpr.getName(), fexpr.getDescriptor().descriptorString)) { + + if(isExprentIndependent(asexpr.getRight(), meth)) { + + String keyField = InterpreterUtil.makeUniqueKey(fexpr.getName(), fexpr.getDescriptor().descriptorString); + if(!wrapper.getStaticFieldInitializers().containsKey(keyField)) { + wrapper.getStaticFieldInitializers().addWithKey(asexpr.getRight(), keyField); + firstdata.getExprents().remove(0); + found = true; + } } } } |