repeatable nameless class names

master
Roman Shevchenko 11 years ago
parent 6e303d8592
commit e39ae1e71d
  1. 10
      src/de/fernflower/main/rels/NestedClassProcessor.java

@ -76,14 +76,18 @@ public class NestedClassProcessor {
checkNotFoundClasses(root, node); checkNotFoundClasses(root, node);
} }
int nameless = 0, synthetics = 0;
for(ClassNode child : node.nested) { for(ClassNode child : node.nested) {
// ensure not-empty class name // ensure not-empty class name
if((child.type == ClassNode.CLASS_LOCAL || child.type == ClassNode.CLASS_MEMBER) && child.simpleName == null) { if((child.type == ClassNode.CLASS_LOCAL || child.type == ClassNode.CLASS_MEMBER) && child.simpleName == null) {
DecompilerContext.getLogger().writeMessage("Nameless local or member class "+child.classStruct.qualifiedName+"!", IFernflowerLogger.WARNING); if((child.classStruct.access_flags & CodeConstants.ACC_SYNTHETIC) == 0) {
child.simpleName = "NamelessClass"+child.hashCode(); DecompilerContext.getLogger().writeMessage("Nameless local or member class " + child.classStruct.qualifiedName + "!", IFernflowerLogger.WARNING);
child.simpleName = "NamelessClass_" + (++nameless);
} else {
child.simpleName = "SyntheticClass_" + (++synthetics);
}
} }
} }
for(ClassNode child : node.nested) { for(ClassNode child : node.nested) {
if(child.type == ClassNode.CLASS_LAMBDA) { if(child.type == ClassNode.CLASS_LAMBDA) {

Loading…
Cancel
Save