summaryrefslogtreecommitdiffstats
path: root/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java
diff options
context:
space:
mode:
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-09-02 20:56:03 +0400
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-09-03 11:39:32 +0400
commit2df49d32a71818227e80a8628688906f2ede8a6a (patch)
treedced5f5ebf2f860d5683abf6910f180a67f9471d /src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java
parentc0c83126a69a0c652f343e972f727ffd7f5f10af (diff)
downloadfernflower-2df49d32a71818227e80a8628688906f2ede8a6a.tar
fernflower-2df49d32a71818227e80a8628688906f2ede8a6a.tar.gz
fernflower-2df49d32a71818227e80a8628688906f2ede8a6a.tar.lz
fernflower-2df49d32a71818227e80a8628688906f2ede8a6a.tar.xz
fernflower-2df49d32a71818227e80a8628688906f2ede8a6a.zip
java-decompiler: fixes and cleanups
- unified attribute loading code - common methods for checking member flags - verifying skip() - correct resource closing - typos
Diffstat (limited to 'src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java')
-rw-r--r--src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java b/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java
index 3eec983..003bdc2 100644
--- a/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java
+++ b/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java
@@ -71,7 +71,7 @@ public class NestedClassProcessor {
// ensure not-empty class name
if ((child.type == ClassNode.CLASS_LOCAL || child.type == ClassNode.CLASS_MEMBER) && child.simpleName == null) {
StructClass cl = child.classStruct;
- if (((child.access | cl.access_flags) & CodeConstants.ACC_SYNTHETIC) != 0 || cl.getAttributes().containsKey("Synthetic")) {
+ if ((child.access & CodeConstants.ACC_SYNTHETIC) != 0 || cl.isSynthetic()) {
child.simpleName = "SyntheticClass_" + (++synthetics);
}
else {
@@ -675,7 +675,7 @@ public class NestedClassProcessor {
return null;
}
- boolean notsynth = DecompilerContext.getOption(IFernflowerPreferences.SYNTHETIC_NOT_SET);
+ boolean noSynthFlag = DecompilerContext.getOption(IFernflowerPreferences.SYNTHETIC_NOT_SET);
// no loop at the begin
DirectNode firstnode = graph.first;
@@ -692,10 +692,8 @@ public class NestedClassProcessor {
if (fd != null) { // local (== not inherited) field
if (cl.qualifiedName.equals(left.getClassname()) &&
- (fd.access_flags & CodeConstants.ACC_FINAL) != 0 &&
- ((fd.access_flags & CodeConstants.ACC_SYNTHETIC) != 0 ||
- fd.getAttributes().containsKey("Synthetic") ||
- (notsynth && (fd.access_flags & CodeConstants.ACC_PRIVATE) != 0))) {
+ fd.hasModifier(CodeConstants.ACC_FINAL) &&
+ (fd.isSynthetic() || (noSynthFlag && fd.hasModifier(CodeConstants.ACC_PRIVATE)))) {
field = InterpreterUtil.makeUniqueKey(left.getName(), left.getDescriptor().descriptorString);
break;
}