public PrimitiveConstant getPrimitiveConstant(int index) { PrimitiveConstant cn = (PrimitiveConstant)getConstant(index); if (cn != null && interceptor != null) { if (cn.type == CodeConstants.CONSTANT_Class) { String newName = buildNewClassname(cn.getString()); if (newName != null) { cn = new PrimitiveConstant(CodeConstants.CONSTANT_Class, newName); } } } return cn; }
public LinkConstant getLinkConstant(int index) { LinkConstant ln = (LinkConstant)getConstant(index); if (ln != null && interceptor != null && (ln.type == CodeConstants.CONSTANT_Fieldref || ln.type == CodeConstants.CONSTANT_Methodref || ln.type == CodeConstants.CONSTANT_InterfaceMethodref)) { String newClassName = buildNewClassname(ln.classname); String newElement = interceptor.getName(ln.classname + ' ' + ln.elementname + ' ' + ln.descriptor); String newDescriptor = buildNewDescriptor(ln.type == CodeConstants.CONSTANT_Fieldref, ln.descriptor); //TODO: Fix newElement being null caused by ln.classname being a leaf class instead of the class that declared the field/method. //See the comments of IDEA-137253 for more information. if (newClassName != null || newElement != null || newDescriptor != null) { String className = newClassName == null ? ln.classname : newClassName; String elementName = newElement == null ? ln.elementname : newElement.split(" ")[1]; String descriptor = newDescriptor == null ? ln.descriptor : newDescriptor; ln = new LinkConstant(ln.type, className, elementName, descriptor); } } return ln; }
public PrimitiveConstant getPrimitiveConstant(int index) { PrimitiveConstant cn = (PrimitiveConstant)getConstant(index); if (cn != null && interceptor != null) { if (cn.type == CodeConstants.CONSTANT_Class) { String newName = buildNewClassname(cn.getString()); if (newName != null) { cn = new PrimitiveConstant(CodeConstants.CONSTANT_Class, newName); } } } return cn; }
public LinkConstant getLinkConstant(int index) { LinkConstant ln = (LinkConstant)getConstant(index); if (ln != null && interceptor != null && (ln.type == CodeConstants.CONSTANT_Fieldref || ln.type == CodeConstants.CONSTANT_Methodref || ln.type == CodeConstants.CONSTANT_InterfaceMethodref)) { String newClassName = buildNewClassname(ln.classname); String newElement = interceptor.getName(ln.classname + ' ' + ln.elementname + ' ' + ln.descriptor); String newDescriptor = buildNewDescriptor(ln.type == CodeConstants.CONSTANT_Fieldref, ln.descriptor); //TODO: Fix newElement being null caused by ln.classname being a leaf class instead of the class that declared the field/method. //See the comments of IDEA-137253 for more information. if (newClassName != null || newElement != null || newDescriptor != null) { String className = newClassName == null ? ln.classname : newClassName; String elementName = newElement == null ? ln.elementname : newElement.split(" ")[1]; String descriptor = newDescriptor == null ? ln.descriptor : newDescriptor; ln = new LinkConstant(ln.type, className, elementName, descriptor); } } return ln; }