call type.guessName for abstract methods


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@704 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 87da45e279
commit 54f3f0c2b0
  1. 40
      jode/jode/decompiler/MethodAnalyzer.java

@ -196,24 +196,38 @@ public class MethodAnalyzer implements Analyzer {
else { else {
if (isConstructor) if (isConstructor)
writer.print(imports.getClassString(classAnalyzer.getClazz())); writer.print(imports.getClassString(classAnalyzer.getClazz()));
else else {
writer.print(getReturnType().toString() writer.printType(getReturnType());
+ " " + methodName); writer.print(" " + methodName);
}
writer.print("("); writer.print("(");
Type[] paramTypes = methodType.getParameterTypes(); Type[] paramTypes = methodType.getParameterTypes();
int offset = isStatic()?0:1; int offset = isStatic()?0:1;
LocalInfo[] param = new LocalInfo[paramTypes.length];
for (int i=0; i<paramTypes.length; i++) {
if (code == null) {
param[i] = new LocalInfo(offset);
param[i].setType(paramTypes[i]);
param[i].guessName();
for (int j=0; j < i; j++) {
if (param[j].getName().equals(param[i].getName())) {
/* A name conflict happened. */
param[i].makeNameUnique();
break; /* j */
}
}
} else {
param[i] = code.getParamInfo(offset);
offset++;
}
}
for (int i=0; i<paramTypes.length; i++) { for (int i=0; i<paramTypes.length; i++) {
if (i>0) if (i>0)
writer.print(", "); writer.print(", ");
LocalInfo li; writer.printType(param[i].getType());
if (code == null) { writer.print(" "+param[i].getName());
li = new LocalInfo(offset);
li.setType(paramTypes[i]);
li.makeNameUnique();
} else
li = code.getParamInfo(offset);
writer.print(li.getType().toString()+" "+li.getName());
offset++;
} }
writer.print(")"); writer.print(")");
} }
@ -223,7 +237,7 @@ public class MethodAnalyzer implements Analyzer {
for (int i= 0; i< exceptions.length; i++) { for (int i= 0; i< exceptions.length; i++) {
if (i > 0) if (i > 0)
writer.print(", "); writer.print(", ");
writer.print(exceptions[i].toString()); writer.printType(exceptions[i]);
} }
} }
if (code != null) { if (code != null) {

Loading…
Cancel
Save