String renameEntry(String desc, Map classnames) { return Descriptor.rename(desc, classnames); }
String renameEntry(String desc, String oldname, String newname) { return Descriptor.rename(desc, oldname, newname); }
String renameEntry(String desc, Map<String,String> classnames) { return Descriptor.rename(desc, classnames); }
String renameEntry(String desc, String oldname, String newname) { return Descriptor.rename(desc, oldname, newname); }
public void renameClass(ConstPool cp, String oldName, String newName, HashMap cache) { String type = cp.getUtf8Info(typeDescriptor); String type2 = Descriptor.rename(type, oldName, newName); if (type != type2) if (cache == null) typeDescriptor = cp.addUtf8Info(type2); else { cache.remove(this); typeDescriptor = cp.addUtf8Info(type2); cache.put(this, this); } }
public void renameClass(ConstPool cp, String oldName, String newName, HashMap cache) { String desc = cp.getUtf8Info(descriptor); String desc2 = Descriptor.rename(desc, oldName, newName); if (desc != desc2) if (cache == null) descriptor = cp.addUtf8Info(desc2); else { cache.remove(this); descriptor = cp.addUtf8Info(desc2); cache.put(this, this); } }
public void renameClass(ConstPool cp, Map map, HashMap cache) { String type = cp.getUtf8Info(typeDescriptor); String type2 = Descriptor.rename(type, map); if (type != type2) if (cache == null) typeDescriptor = cp.addUtf8Info(type2); else { cache.remove(this); typeDescriptor = cp.addUtf8Info(type2); cache.put(this, this); } }
public void renameClass(ConstPool cp, Map map, HashMap cache) { String desc = cp.getUtf8Info(descriptor); String desc2 = Descriptor.rename(desc, map); if (desc != desc2) if (cache == null) descriptor = cp.addUtf8Info(desc2); else { cache.remove(this); descriptor = cp.addUtf8Info(desc2); cache.put(this, this); } }
public void renameClass(ConstPool cp, String oldName, String newName, HashMap cache) { String nameStr = cp.getUtf8Info(name); String newNameStr = null; if (nameStr.equals(oldName)) newNameStr = newName; else if (nameStr.charAt(0) == '[') { String s = Descriptor.rename(nameStr, oldName, newName); if (nameStr != s) newNameStr = s; } if (newNameStr != null) if (cache == null) name = cp.addUtf8Info(newNameStr); else { cache.remove(this); name = cp.addUtf8Info(newNameStr); cache.put(this, this); } }
private void renameType(int pos, int index) { String name = cpool.getUtf8Info(index); String newName = Descriptor.rename(name, classnames); if (!name.equals(newName)) { int index2 = cpool.addUtf8Info(newName); ByteArray.write16bit(index2, info, pos); } } }
/** * Copies a constant pool entry into the destination constant pool * and returns the index of the copied entry. That entry must be * a Utf8Info representing a class name in the L<class name>; form. * * @param srcIndex the index of the copied entry into the source * constant pool. * @return the index of the copied item into the destination * constant pool. */ int copyType(int srcIndex) { String name = srcPool.getUtf8Info(srcIndex); String newName = Descriptor.rename(name, classnames); return destPool.addUtf8Info(newName); } }
public void renameClass(ConstPool cp, Map map, HashMap cache) { String oldName = cp.getUtf8Info(name); String newName = null; if (oldName.charAt(0) == '[') { String s = Descriptor.rename(oldName, map); if (oldName != s) newName = s; } else { String s = (String)map.get(oldName); if (s != null && !s.equals(oldName)) newName = s; } if (newName != null) { if (cache == null) name = cp.addUtf8Info(newName); else { cache.remove(this); name = cp.addUtf8Info(newName); cache.put(this, this); } } }
public int copy(ConstPool src, ConstPool dest, Map map) { String desc = src.getUtf8Info(descriptor); desc = Descriptor.rename(desc, map); return dest.addMethodTypeInfo(dest.addUtf8Info(desc)); }
@Override public void renameClass(ConstPool cp, String oldName, String newName, Map<ConstInfo,ConstInfo> cache) { String type = cp.getUtf8Info(typeDescriptor); String type2 = Descriptor.rename(type, oldName, newName); if (type != type2) if (cache == null) typeDescriptor = cp.addUtf8Info(type2); else { cache.remove(this); typeDescriptor = cp.addUtf8Info(type2); cache.put(this, this); } }
private void renameType(int pos, int index) { String name = cpool.getUtf8Info(index); String newName = Descriptor.rename(name, classnames); if (!name.equals(newName)) { int index2 = cpool.addUtf8Info(newName); ByteArray.write16bit(index2, info, pos); } } }
/** * Internal-use only. * <code>CtClass.getRefClasses()</code> calls this method. */ public final void getRefClasses(Map classnames) { constPool.renameClass(classnames); AttributeInfo.getRefClasses(attributes, classnames); ArrayList list = methods; int n = list.size(); for (int i = 0; i < n; ++i) { MethodInfo minfo = (MethodInfo)list.get(i); String desc = minfo.getDescriptor(); Descriptor.rename(desc, classnames); AttributeInfo.getRefClasses(minfo.getAttributes(), classnames); } list = fields; n = list.size(); for (int i = 0; i < n; ++i) { FieldInfo finfo = (FieldInfo)list.get(i); String desc = finfo.getDescriptor(); Descriptor.rename(desc, classnames); AttributeInfo.getRefClasses(finfo.getAttributes(), classnames); } }
private void read(MethodInfo src, String methodname, Map classnames) throws BadBytecode { ConstPool destCp = constPool; accessFlags = src.accessFlags; name = destCp.addUtf8Info(methodname); cachedName = methodname; ConstPool srcCp = src.constPool; String desc = srcCp.getUtf8Info(src.descriptor); String desc2 = Descriptor.rename(desc, classnames); descriptor = destCp.addUtf8Info(desc2); attribute = new ArrayList(); ExceptionsAttribute eattr = src.getExceptionsAttribute(); if (eattr != null) attribute.add(eattr.copy(destCp, classnames)); CodeAttribute cattr = src.getCodeAttribute(); if (cattr != null) attribute.add(cattr.copy(destCp, classnames)); }
@Override public int copy(ConstPool src, ConstPool dest, Map<String,String> map) { String desc = src.getUtf8Info(descriptor); desc = Descriptor.rename(desc, map); return dest.addMethodTypeInfo(dest.addUtf8Info(desc)); }
public int copy(ConstPool src, ConstPool dest, Map map) { String mname = src.getUtf8Info(memberName); String tdesc = src.getUtf8Info(typeDescriptor); tdesc = Descriptor.rename(tdesc, map); return dest.addNameAndTypeInfo(dest.addUtf8Info(mname), dest.addUtf8Info(tdesc)); }
@Override public int copy(ConstPool src, ConstPool dest, Map<String,String> map) { String mname = src.getUtf8Info(memberName); String tdesc = src.getUtf8Info(typeDescriptor); tdesc = Descriptor.rename(tdesc, map); return dest.addNameAndTypeInfo(dest.addUtf8Info(mname), dest.addUtf8Info(tdesc)); }