/** * Gets a normal (non-interface) {@link CstMethodRef} that corresponds to * this instance. * * @return {@code non-null;} an appropriate instance */ public CstMethodRef toMethodRef() { if (methodRef == null) { methodRef = new CstMethodRef(getDefiningClass(), getNat()); } return methodRef; } }
private int getTargetIndex(DexFile file) { Constant ref = methodHandle.getRef(); if (methodHandle.isAccessor()) { FieldIdsSection fieldIds = file.getFieldIds(); return fieldIds.indexOf((CstFieldRef) ref); } else if (methodHandle.isInvocation()) { if (ref instanceof CstInterfaceMethodRef) { ref = ((CstInterfaceMethodRef)ref).toMethodRef(); } MethodIdsSection methodIds = file.getMethodIds(); return methodIds.indexOf((CstBaseMethodRef) ref); } else { throw new IllegalStateException("Unhandled invocation type"); } } }
int natIndex = bytes.getUnsignedShort(at + 3); CstNat nat = (CstNat) parse0(natIndex, wasUtf8); cst = new CstInterfaceMethodRef(type, nat); break;
cst = ((CstInterfaceMethodRef) cst).toMethodRef();
int natIndex = bytes.getUnsignedShort(at + 3); CstNat nat = (CstNat) parse0(natIndex, wasUtf8); cst = new CstInterfaceMethodRef(type, nat); break;
/** * Gets a normal (non-interface) {@link CstMethodRef} that corresponds to * this instance. * * @return {@code non-null;} an appropriate instance */ public CstMethodRef toMethodRef() { if (methodRef == null) { methodRef = new CstMethodRef(getDefiningClass(), getNat()); } return methodRef; } }
cst = ((CstInterfaceMethodRef) cst).toMethodRef();
int natIndex = bytes.getUnsignedShort(at + 3); CstNat nat = (CstNat) parse0(natIndex, wasUtf8); cst = new CstInterfaceMethodRef(type, nat); break;
/** * Gets a normal (non-interface) {@link CstMethodRef} that corresponds to * this instance. * * @return {@code non-null;} an appropriate instance */ public CstMethodRef toMethodRef() { if (methodRef == null) { methodRef = new CstMethodRef(getDefiningClass(), getNat()); } return methodRef; } }
cst = ((CstInterfaceMethodRef) cst).toMethodRef();
int natIndex = bytes.getUnsignedShort(at + 3); CstNat nat = (CstNat) parse0(natIndex, wasUtf8); cst = new CstInterfaceMethodRef(type, nat); break;
/** * Gets a normal (non-interface) {@link CstMethodRef} that corresponds to * this instance. * * @return {@code non-null;} an appropriate instance */ public CstMethodRef toMethodRef() { if (methodRef == null) { methodRef = new CstMethodRef(getDefiningClass(), getNat()); } return methodRef; } }
cst = ((CstInterfaceMethodRef) cst).toMethodRef();
int natIndex = bytes.getUnsignedShort(at + 3); CstNat nat = (CstNat) parse0(natIndex, wasUtf8); cst = new CstInterfaceMethodRef(type, nat); break;
/** * Gets a normal (non-interface) {@link CstMethodRef} that corresponds to * this instance. * * @return {@code non-null;} an appropriate instance */ public CstMethodRef toMethodRef() { if (methodRef == null) { methodRef = new CstMethodRef(getDefiningClass(), getNat()); } return methodRef; } }
methodIdsSection.intern((CstBaseMethodRef) constant); } else if (constant instanceof CstInterfaceMethodRef) { methodIdsSection.intern(((CstInterfaceMethodRef) constant).toMethodRef()); } else if (constant instanceof CstFieldRef) { fieldIdsSection.intern((CstFieldRef) constant);
int natIndex = bytes.getUnsignedShort(at + 3); CstNat nat = (CstNat) parse0(natIndex); cst = new CstInterfaceMethodRef(type, nat); break;
/** * Gets a normal (non-interface) {@link CstMethodRef} that corresponds to * this instance. * * @return {@code non-null;} an appropriate instance */ public CstMethodRef toMethodRef() { if (methodRef == null) { methodRef = new CstMethodRef(getDefiningClass(), getNat()); } return methodRef; } }
methodIdsSection.intern((CstBaseMethodRef) constant); } else if (constant instanceof CstInterfaceMethodRef) { methodIdsSection.intern(((CstInterfaceMethodRef) constant).toMethodRef()); } else if (constant instanceof CstFieldRef) { fieldIdsSection.intern((CstFieldRef) constant);
/** * Gets a normal (non-interface) {@link CstMethodRef} that corresponds to * this instance. * * @return {@code non-null;} an appropriate instance */ public CstMethodRef toMethodRef() { if (methodRef == null) { methodRef = new CstMethodRef(getDefiningClass(), getNat()); } return methodRef; } }