* at the given index.
*/
public int getMethodrefClass(int index) {
- MethodrefInfo minfo = (MethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
return minfo.classIndex;
}
* @return the name of the class at that <code>class_index</code>.
*/
public String getMethodrefClassName(int index) {
- MethodrefInfo minfo = (MethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
if (minfo == null)
return null;
else
* at the given index.
*/
public int getMethodrefNameAndType(int index) {
- MethodrefInfo minfo = (MethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
return minfo.nameAndTypeIndex;
}
* @return the name of the method.
*/
public String getMethodrefName(int index) {
- MethodrefInfo minfo = (MethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
if (minfo == null)
return null;
else {
* @return the descriptor of the method.
*/
public String getMethodrefType(int index) {
- MethodrefInfo minfo = (MethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
if (minfo == null)
return null;
else {
* at the given index.
*/
public int getInterfaceMethodrefClass(int index) {
- InterfaceMethodrefInfo minfo
- = (InterfaceMethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
return minfo.classIndex;
}
* @return the name of the class at that <code>class_index</code>.
*/
public String getInterfaceMethodrefClassName(int index) {
- InterfaceMethodrefInfo minfo
- = (InterfaceMethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
return getClassInfo(minfo.classIndex);
}
* at the given index.
*/
public int getInterfaceMethodrefNameAndType(int index) {
- InterfaceMethodrefInfo minfo
- = (InterfaceMethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
return minfo.nameAndTypeIndex;
}
* @return the name of the method.
*/
public String getInterfaceMethodrefName(int index) {
- InterfaceMethodrefInfo minfo
- = (InterfaceMethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
if (minfo == null)
return null;
else {
* @return the descriptor of the method.
*/
public String getInterfaceMethodrefType(int index) {
- InterfaceMethodrefInfo minfo
- = (InterfaceMethodrefInfo)getItem(index);
+ MemberrefInfo minfo = (MemberrefInfo)getItem(index);
if (minfo == null)
return null;
else {
assertEquals("i", cp.getUtf8Info(attr.name(0)));
assertEquals("s", cp.getUtf8Info(attr.name(1)));
}
+
+ // JIRA JASSIST-220
+ public void testStaticInterfaceMethods() throws Exception {
+ CtClass cc = sloader.get("test4.JIRA220");
+
+ cc.getMethod("foo", "()V").instrument(new ExprEditor() {
+ @Override
+ public void edit(MethodCall m) throws CannotCompileException {
+ try {
+ m.getClassName();
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+ });
+ }
}