public String variableNameByIndex(int index) {
for (int i = 0; i < tableLength(); i++) {
if (index(i) == index) {
- return getConstPool().getUtf8Info(nameIndex(i));
+ return variableName(i);
}
}
throw new ArrayIndexOutOfBoundsException();
assertEquals(2, attr.size());
assertEquals("i", cp.getUtf8Info(attr.name(0)));
assertEquals("s", cp.getUtf8Info(attr.name(1)));
+ assertEquals("i", attr.parameterName(0));
+ assertEquals("s", attr.parameterName(1));
attr = (MethodParametersAttribute)attr.copy(cp, null);
assertEquals(2, attr.size());
assertEquals("i", cp.getUtf8Info(attr.name(0)));
assertEquals("s", cp.getUtf8Info(attr.name(1)));
+ assertEquals("i", attr.parameterName(0));
+ assertEquals("s", attr.parameterName(1));
}
// JIRA JASSIST-220
assertEquals("I", ainfo2.descriptor(i));
}
print("**** end ***");
+
+ assertEquals("this", ainfo2.variableNameByIndex(0));
+ assertEquals("i", ainfo2.variableNameByIndex(1));
}
public void testAnnotations() throws Exception {