java-decompiler: cleanups and fixes

- duplicates eliminated
- immutable fields
- typos
- formatting
This commit is contained in:
Roman Shevchenko
2014-11-04 12:38:11 +01:00
parent 020f5c404b
commit 82a2939271
51 changed files with 1581 additions and 1845 deletions

View File

@@ -136,7 +136,7 @@ public class ClassWriter {
firstParameter = false;
}
index += md_content.params[i].stack_size;
index += md_content.params[i].stackSize;
}
buffer.append(") ->");
@@ -440,7 +440,7 @@ public class ClassWriter {
if (initializer != null) {
if (isEnum && initializer.type == Exprent.EXPRENT_NEW) {
NewExprent nexpr = (NewExprent)initializer;
nexpr.setEnumconst(true);
nexpr.setEnumConst(true);
buffer.append(nexpr.toJava(indent, tracer));
}
else {
@@ -512,7 +512,7 @@ public class ClassWriter {
firstParameter = false;
}
index += md_content.params[i].stack_size;
index += md_content.params[i].stackSize;
}
buffer.append(") {").appendLineSeparator();
@@ -692,16 +692,16 @@ public class ClassWriter {
appendParameterAnnotations(buffer, mt, paramCount);
if (methodWrapper.varproc.getVarFinal(new VarVersionPaar(index, 0)) == VarTypeProcessor.VAR_FINALEXPLICIT) {
if (methodWrapper.varproc.getVarFinal(new VarVersionPaar(index, 0)) == VarTypeProcessor.VAR_EXPLICIT_FINAL) {
buffer.append("final ");
}
if (descriptor != null) {
GenericType parameterType = descriptor.params.get(i);
boolean isVarArg = (i == lastVisibleParameterIndex && mt.hasModifier(CodeConstants.ACC_VARARGS) && parameterType.arraydim > 0);
boolean isVarArg = (i == lastVisibleParameterIndex && mt.hasModifier(CodeConstants.ACC_VARARGS) && parameterType.arrayDim > 0);
if (isVarArg) {
parameterType.arraydim--;
parameterType = parameterType.decreaseArrayDim();
}
String typeName = GenericMain.getGenericCastTypeName(parameterType);
@@ -717,11 +717,11 @@ public class ClassWriter {
}
}
else {
VarType parameterType = md.params[i].copy();
VarType parameterType = md.params[i];
boolean isVarArg = (i == lastVisibleParameterIndex && mt.hasModifier(CodeConstants.ACC_VARARGS) && parameterType.arraydim > 0);
boolean isVarArg = (i == lastVisibleParameterIndex && mt.hasModifier(CodeConstants.ACC_VARARGS) && parameterType.arrayDim > 0);
if (isVarArg) {
parameterType.decArrayDim();
parameterType = parameterType.decreaseArrayDim();
}
String typeName = ExprProcessor.getCastTypeName(parameterType);
@@ -745,7 +745,7 @@ public class ClassWriter {
paramCount++;
}
index += md.params[i].stack_size;
index += md.params[i].stackSize;
}
buffer.append(')');
@@ -839,7 +839,7 @@ public class ClassWriter {
return !hideMethod;
}
private void mapLines(TextBuffer code, StructLineNumberTableAttribute table, BytecodeMappingTracer tracer, int startLine) {
private static void mapLines(TextBuffer code, StructLineNumberTableAttribute table, BytecodeMappingTracer tracer, int startLine) {
// build line start offsets map
HashMap<Integer, Set<Integer>> lineStartOffsets = new HashMap<Integer, Set<Integer>>();
for (Map.Entry<Integer, Integer> entry : tracer.getMapping().entrySet()) {