Cleanup (formatting; naming)

This commit is contained in:
Roman Shevchenko
2014-10-14 14:14:49 +02:00
parent 848c420977
commit 373ca99e37
4 changed files with 41 additions and 56 deletions

View File

@@ -122,7 +122,7 @@ public class LambdaProcessor {
node_lambda.parent = node;
clprocessor.getMapRootClasses().put(node_lambda.simpleName, node_lambda);
mapMethodsLambda.put(node_lambda.lambda_information.content_method_key, node_lambda.simpleName);
mapMethodsLambda.put(node_lambda.lambdaInformation.content_method_key, node_lambda.simpleName);
}
}
}

View File

@@ -47,10 +47,10 @@ public class NestedClassProcessor {
public void processClass(ClassNode root, ClassNode node) {
// hide synthetic lambda content methods
if (node.type == ClassNode.CLASS_LAMBDA && !node.lambda_information.is_method_reference) {
if (node.type == ClassNode.CLASS_LAMBDA && !node.lambdaInformation.is_method_reference) {
ClassNode node_content = DecompilerContext.getClassProcessor().getMapRootClasses().get(node.classStruct.qualifiedName);
if (node_content != null && node_content.wrapper != null) {
node_content.wrapper.getHiddenMembers().add(node.lambda_information.content_method_key);
node_content.wrapper.getHiddenMembers().add(node.lambdaInformation.content_method_key);
}
}
@@ -75,8 +75,8 @@ public class NestedClassProcessor {
child.simpleName = "SyntheticClass_" + (++synthetics);
}
else {
DecompilerContext.getLogger().writeMessage("Nameless local or member class " + cl.qualifiedName + "!",
IFernflowerLogger.Severity.WARN);
String message = "Nameless local or member class " + cl.qualifiedName + "!";
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN);
child.simpleName = "NamelessClass_" + (++nameless);
}
}
@@ -86,13 +86,11 @@ public class NestedClassProcessor {
if (child.type == ClassNode.CLASS_LAMBDA) {
setLambdaVars(node, child);
}
else {
if (child.type != ClassNode.CLASS_MEMBER || (child.access & CodeConstants.ACC_STATIC) == 0) {
insertLocalVars(node, child);
else if (child.type != ClassNode.CLASS_MEMBER || (child.access & CodeConstants.ACC_STATIC) == 0) {
insertLocalVars(node, child);
if (child.type == ClassNode.CLASS_LOCAL) {
setLocalClassDefinition(node.wrapper.getMethods().getWithKey(child.enclosingMethod), child);
}
if (child.type == ClassNode.CLASS_LOCAL) {
setLocalClassDefinition(node.wrapper.getMethods().getWithKey(child.enclosingMethod), child);
}
}
}
@@ -104,22 +102,22 @@ public class NestedClassProcessor {
private static void setLambdaVars(ClassNode parent, ClassNode child) {
if (child.lambda_information.is_method_reference) { // method reference, no code and no parameters
if (child.lambdaInformation.is_method_reference) { // method reference, no code and no parameters
return;
}
final MethodWrapper meth = parent.wrapper.getMethods().getWithKey(child.lambda_information.content_method_key);
final MethodWrapper meth = parent.wrapper.getMethods().getWithKey(child.lambdaInformation.content_method_key);
final MethodWrapper encmeth = parent.wrapper.getMethods().getWithKey(child.enclosingMethod);
MethodDescriptor md_lambda = MethodDescriptor.parseDescriptor(child.lambda_information.method_descriptor);
final MethodDescriptor md_content = MethodDescriptor.parseDescriptor(child.lambda_information.content_method_descriptor);
MethodDescriptor md_lambda = MethodDescriptor.parseDescriptor(child.lambdaInformation.method_descriptor);
final MethodDescriptor md_content = MethodDescriptor.parseDescriptor(child.lambdaInformation.content_method_descriptor);
final int vars_count = md_content.params.length - md_lambda.params.length;
// if(vars_count < 0) { // should not happen, but just in case...
// vars_count = 0;
// }
final boolean is_static_lambda_content = child.lambda_information.is_content_method_static;
final boolean is_static_lambda_content = child.lambdaInformation.is_content_method_static;
final String parent_class_name = parent.wrapper.getClassStruct().qualifiedName;
final String lambda_class_name = child.simpleName;