Cleanup (formatting)

This commit is contained in:
Roman Shevchenko 2014-10-07 21:45:26 +02:00
parent 9bd8af2b43
commit d96104bdec
4 changed files with 22 additions and 29 deletions

View File

@ -48,10 +48,8 @@ public class ClassesProcessor {
public ClassesProcessor(StructContext context) {
HashMap<String, Object[]> mapInnerClasses = new HashMap<String, Object[]>();
HashMap<String, HashSet<String>> mapNestedClassReferences = new HashMap<String, HashSet<String>>();
HashMap<String, HashSet<String>> mapEnclosingClassReferences = new HashMap<String, HashSet<String>>();
HashMap<String, String> mapNewSimpleNames = new HashMap<String, String>();
boolean bDecompileInner = DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_INNER);
@ -113,11 +111,9 @@ public class ClassesProcessor {
if (arrold == null) {
mapInnerClasses.put(innername, arr);
}
else {
if (!InterpreterUtil.equalObjectArrays(arrold, arr)) {
DecompilerContext.getLogger()
.writeMessage("Inconsistent inner class entries for " + innername + "!", IFernflowerLogger.Severity.WARN);
}
else if (!InterpreterUtil.equalObjectArrays(arrold, arr)) {
String message = "Inconsistent inner class entries for " + innername + "!";
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN);
}
// reference to the nested class
@ -174,15 +170,13 @@ public class ClassesProcessor {
continue;
}
if (setVisited.contains(nestedClass)) {
if (!setVisited.add(nestedClass)) {
continue;
}
setVisited.add(nestedClass);
ClassNode nestednode = mapRootClasses.get(nestedClass);
if (nestednode == null) {
DecompilerContext.getLogger().writeMessage("Nested class " + nestedClass + " missing!",
IFernflowerLogger.Severity.WARN);
DecompilerContext.getLogger().writeMessage("Nested class " + nestedClass + " missing!", IFernflowerLogger.Severity.WARN);
continue;
}
@ -207,13 +201,13 @@ public class ClassesProcessor {
if (interfaces.length > 0) {
if (interfaces.length > 1) {
DecompilerContext.getLogger()
.writeMessage("Inconsistent anonymous class definition: " + cl.qualifiedName, IFernflowerLogger.Severity.WARN);
String message = "Inconsistent anonymous class definition: " + cl.qualifiedName;
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN);
}
nestednode.anonimousClassType = new VarType(cl.getInterface(0), true);
nestednode.anonymousClassType = new VarType(cl.getInterface(0), true);
}
else {
nestednode.anonimousClassType = new VarType(cl.superClass.getString(), true);
nestednode.anonymousClassType = new VarType(cl.superClass.getString(), true);
}
}
else if (nestednode.type == ClassNode.CLASS_LOCAL) {
@ -366,7 +360,7 @@ public class ClassesProcessor {
public HashMap<String, VarVersionPaar> mapFieldsToVars = new HashMap<String, VarVersionPaar>();
public VarType anonimousClassType;
public VarType anonymousClassType;
public List<ClassNode> nested = new ArrayList<ClassNode>();
@ -401,7 +395,7 @@ public class ClassesProcessor {
lambda_information.content_method_key =
InterpreterUtil.makeUniqueKey(lambda_information.content_method_name, lambda_information.content_method_descriptor);
anonimousClassType = new VarType(lambda_class_name, true);
anonymousClassType = new VarType(lambda_class_name, true);
boolean is_method_reference = (content_class_name != classStruct.qualifiedName);
if (!is_method_reference) { // content method in the same class, check synthetic flag

View File

@ -221,12 +221,12 @@ public class NestedClassProcessor {
if (!hasEnclosing) {
if (child.type == ClassNode.CLASS_ANONYMOUS) {
DecompilerContext.getLogger()
.writeMessage("Unreferenced anonymous class " + child.classStruct.qualifiedName + "!", IFernflowerLogger.Severity.WARN);
String message = "Unreferenced anonymous class " + child.classStruct.qualifiedName + "!";
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN);
}
else if (child.type == ClassNode.CLASS_LOCAL) {
DecompilerContext.getLogger()
.writeMessage("Unreferenced local class " + child.classStruct.qualifiedName + "!", IFernflowerLogger.Severity.WARN);
String message = "Unreferenced local class " + child.classStruct.qualifiedName + "!";
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN);
}
}
}
@ -275,8 +275,8 @@ public class NestedClassProcessor {
HashMap<String, List<VarFieldPair>> mask = getMaskLocalVars(nd.wrapper);
if (mask.isEmpty()) {
DecompilerContext.getLogger()
.writeMessage("Nested class " + nd.classStruct.qualifiedName + " has no constructor!", IFernflowerLogger.Severity.WARN);
String message = "Nested class " + nd.classStruct.qualifiedName + " has no constructor!";
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN);
}
else {
mapVarMasks.put(nd.classStruct.qualifiedName, mask);

View File

@ -347,8 +347,7 @@ public class DomHelper {
}
else {
if (mapstage == 2 || mapRefreshed) { // last chance lost
DecompilerContext.getLogger().writeMessage("Statement cannot be decomposed although reducible!",
IFernflowerLogger.Severity.ERROR);
DecompilerContext.getLogger().writeMessage("Statement cannot be decomposed although reducible!", IFernflowerLogger.Severity.ERROR);
}
break;
}

View File

@ -95,7 +95,7 @@ public class NewExprent extends Exprent {
if (anonymous) {
ClassNode node = DecompilerContext.getClassProcessor().getMapRootClasses().get(newtype.value);
return node.anonimousClassType;
return node.anonymousClassType;
}
else {
return newtype;
@ -233,13 +233,13 @@ public class NewExprent extends Exprent {
if (!enumconst) {
String enclosing = null;
if (!lambda && constructor != null) {
enclosing = getQualifiedNewInstance(child.anonimousClassType.value, constructor.getLstParameters(), indent, tracer);
enclosing = getQualifiedNewInstance(child.anonymousClassType.value, constructor.getLstParameters(), indent, tracer);
}
String typename = ExprProcessor.getCastTypeName(child.anonimousClassType);
String typename = ExprProcessor.getCastTypeName(child.anonymousClassType);
if (enclosing != null) {
ClassNode anonimousNode = DecompilerContext.getClassProcessor().getMapRootClasses().get(child.anonimousClassType.value);
ClassNode anonimousNode = DecompilerContext.getClassProcessor().getMapRootClasses().get(child.anonymousClassType.value);
if (anonimousNode != null) {
typename = anonimousNode.simpleName;
}