mirror of
https://github.com/moparisthebest/fernflower
synced 2025-01-11 13:28:23 -05:00
repeatable nameless class names
This commit is contained in:
parent
6e303d8592
commit
e39ae1e71d
@ -75,16 +75,20 @@ public class NestedClassProcessor {
|
||||
// for each local or anonymous class ensure not empty enclosing method
|
||||
checkNotFoundClasses(root, node);
|
||||
}
|
||||
|
||||
for(ClassNode child : node.nested) {
|
||||
// ensure not-empty class name
|
||||
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);
|
||||
child.simpleName = "NamelessClass"+child.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int nameless = 0, synthetics = 0;
|
||||
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 {
|
||||
child.simpleName = "SyntheticClass_" + (++synthetics);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(ClassNode child : node.nested) {
|
||||
if(child.type == ClassNode.CLASS_LAMBDA) {
|
||||
setLambdaVars(node, child);
|
||||
|
Loading…
Reference in New Issue
Block a user