summaryrefslogtreecommitdiffstats
path: root/src/de
diff options
context:
space:
mode:
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-06-26 12:42:49 +0200
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-06-26 12:42:49 +0200
commit95476dc36b6560b86994b58c07931157b67388fa (patch)
tree11c06c32b1033bcafeab3ad3f979be94355590fe /src/de
parent879330b55589d3b6b4ccf8f37673718002cdd017 (diff)
downloadfernflower-95476dc36b6560b86994b58c07931157b67388fa.tar
fernflower-95476dc36b6560b86994b58c07931157b67388fa.tar.gz
fernflower-95476dc36b6560b86994b58c07931157b67388fa.tar.lz
fernflower-95476dc36b6560b86994b58c07931157b67388fa.tar.xz
fernflower-95476dc36b6560b86994b58c07931157b67388fa.zip
better filtering of synthetic inner classes
Diffstat (limited to 'src/de')
-rw-r--r--src/de/fernflower/main/ClassWriter.java2
-rw-r--r--src/de/fernflower/main/rels/NestedClassProcessor.java9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/de/fernflower/main/ClassWriter.java b/src/de/fernflower/main/ClassWriter.java
index 72dcf97..6a12cc5 100644
--- a/src/de/fernflower/main/ClassWriter.java
+++ b/src/de/fernflower/main/ClassWriter.java
@@ -296,7 +296,7 @@ public class ClassWriter {
if(inner.type == ClassNode.CLASS_MEMBER) {
StructClass innercl = inner.classStruct;
- boolean isSynthetic = (innercl.access_flags & CodeConstants.ACC_SYNTHETIC) != 0 || innercl.getAttributes().containsKey("Synthetic");
+ boolean isSynthetic = ((inner.access | innercl.access_flags) & CodeConstants.ACC_SYNTHETIC) != 0 || innercl.getAttributes().containsKey("Synthetic");
if((!isSynthetic || !DecompilerContext.getOption(IFernflowerPreferences.REMOVE_SYNTHETIC))
&& !wrapper.getHideMembers().contains(innercl.qualifiedName)) {
writer.write(DecompilerContext.getNewLineSeparator());
diff --git a/src/de/fernflower/main/rels/NestedClassProcessor.java b/src/de/fernflower/main/rels/NestedClassProcessor.java
index 4b7a466..6667f02 100644
--- a/src/de/fernflower/main/rels/NestedClassProcessor.java
+++ b/src/de/fernflower/main/rels/NestedClassProcessor.java
@@ -80,11 +80,12 @@ public class NestedClassProcessor {
for(ClassNode child : node.nested) {
// ensure not-empty class name
if((child.type == ClassNode.CLASS_LOCAL || child.type == ClassNode.CLASS_MEMBER) && child.simpleName == null) {
- if((child.classStruct.access_flags & CodeConstants.ACC_SYNTHETIC) == 0) {
- DecompilerContext.getLogger().writeMessage("Nameless local or member class " + child.classStruct.qualifiedName + "!", IFernflowerLogger.WARNING);
- child.simpleName = "NamelessClass_" + (++nameless);
- } else {
+ StructClass cl = child.classStruct;
+ if(((child.access | cl.access_flags) & CodeConstants.ACC_SYNTHETIC) != 0 || cl.getAttributes().containsKey("Synthetic")) {
child.simpleName = "SyntheticClass_" + (++synthetics);
+ } else {
+ DecompilerContext.getLogger().writeMessage("Nameless local or member class " + cl.qualifiedName + "!", IFernflowerLogger.WARNING);
+ child.simpleName = "NamelessClass_" + (++nameless);
}
}
}