Rename MethodIdItem.getVirtualMethodString to getShortMethodString

This commit is contained in:
Ben Gruver
2012-05-13 16:32:05 -07:00
parent 94abcd3332
commit 662e425150
3 changed files with 8 additions and 8 deletions

View File

@ -1248,7 +1248,7 @@ public class ClassPath {
if ((encodedMethod.accessFlags & AccessFlags.STATIC.getValue()) != 0) {
staticMethods[i] = true;
}
directMethods[i] = encodedMethod.method.getVirtualMethodString();
directMethods[i] = encodedMethod.method.getShortMethodString();
}
_staticMethods[0] = staticMethods;
return directMethods;
@ -1261,7 +1261,7 @@ public class ClassPath {
if (encodedMethods.size() > 0) {
String[] virtualMethods = new String[encodedMethods.size()];
for (int i=0; i<encodedMethods.size(); i++) {
virtualMethods[i] = encodedMethods.get(i).method.getVirtualMethodString();
virtualMethods[i] = encodedMethods.get(i).method.getShortMethodString();
}
return virtualMethods;
}

View File

@ -3141,7 +3141,7 @@ public class MethodAnalyzer {
encodedMethod.method.getContainingClass().getTypeDescriptor()));
}
if (!currentMethodClassDef.getSuperclass().hasVirtualMethod(methodIdItem.getVirtualMethodString())) {
if (!currentMethodClassDef.getSuperclass().hasVirtualMethod(methodIdItem.getShortMethodString())) {
throw new ValidationException(String.format("Cannot call method %s with %s. The superclass %s has" +
"no such method", methodIdItem.getMethodString(),
analyzedInstruction.instruction.opcode.name, methodClassDef.getSuperclass().getClassType()));

View File

@ -175,21 +175,21 @@ public class MethodIdItem extends Item<MethodIdItem> implements Convertible<Meth
return cachedMethodString;
}
private String cachedVirtualMethodString = null;
private String cachedShortMethodString = null;
/**
* @return a string formatted like methodName(TTTT..)R
*/
public String getVirtualMethodString() {
if (cachedVirtualMethodString == null) {
public String getShortMethodString() {
if (cachedShortMethodString == null) {
String methodName = this.methodName.getStringValue();
String prototypeString = methodPrototype.getPrototypeString();
StringBuilder sb = new StringBuilder(methodName.length() + prototypeString.length());
sb.append(methodName);
sb.append(prototypeString);
cachedVirtualMethodString = sb.toString();
cachedShortMethodString = sb.toString();
}
return cachedVirtualMethodString;
return cachedShortMethodString;
}
/**