public String map(String name) { return super.map(name); } }
private Type mapType(Type t) { switch (t.getSort()) { case Type.ARRAY: String s = mapDesc(t.getElementType().getDescriptor()); for (int i = 0; i < t.getDimensions(); ++i) { s = '[' + s; } return Type.getType(s); case Type.OBJECT: s = map(t.getInternalName()); return s != null ? Type.getObjectType(s) : t; case Type.METHOD: return Type.getMethodType(mapMethodDesc(t.getDescriptor())); } return t; }
public String mapDesc(String desc) { Type t = Type.getType(desc); switch (t.getSort()) { case Type.ARRAY: String s = mapDesc(t.getElementType().getDescriptor()); for (int i = 0; i < t.getDimensions(); ++i) { s = '[' + s; } return s; case Type.OBJECT: String newType = map(t.getInternalName()); if (newType != null) { return 'L' + newType + ';'; } } return desc; }
/** * Returns the given {@link Type}, remapped with {@link #map(String)} or {@link * #mapMethodDesc(String)}. * * @param type a type, which can be a method type. * @return the given type, with its [array element type] internal name remapped with {@link * #map(String)} (if the type is an array or object type, otherwise the type is returned as * is) or, of the type is a method type, with its descriptor remapped with {@link * #mapMethodDesc(String)}. */ private Type mapType(final Type type) { switch (type.getSort()) { case Type.ARRAY: StringBuilder remappedDescriptor = new StringBuilder(); for (int i = 0; i < type.getDimensions(); ++i) { remappedDescriptor.append('['); } remappedDescriptor.append(mapType(type.getElementType()).getDescriptor()); return Type.getType(remappedDescriptor.toString()); case Type.OBJECT: String remappedInternalName = map(type.getInternalName()); return remappedInternalName != null ? Type.getObjectType(remappedInternalName) : type; case Type.METHOD: return Type.getMethodType(mapMethodDesc(type.getDescriptor())); default: return type; } }
String newClassName = reverseMap.map(oldClassName); if (newClassName.equals(oldClassName)) { throw new IOException("Invalid csrg file line, could not be reversed: " + line); String newClassName = reverseMap.map(oldClassName); if (newClassName.equals(oldClassName)) { throw new IOException("Invalid csrg file line, could not be reversed: " + line);
/** * Returns the given {@link Type}, remapped with {@link #map(String)} or {@link * #mapMethodDesc(String)}. * * @param type a type, which can be a method type. * @return the given type, with its [array element type] internal name remapped with {@link * #map(String)} (if the type is an array or object type, otherwise the type is returned as * is) or, of the type is a method type, with its descriptor remapped with {@link * #mapMethodDesc(String)}. */ private Type mapType(final Type type) { switch (type.getSort()) { case Type.ARRAY: StringBuilder remappedDescriptor = new StringBuilder(); for (int i = 0; i < type.getDimensions(); ++i) { remappedDescriptor.append('['); } remappedDescriptor.append(mapType(type.getElementType()).getDescriptor()); return Type.getType(remappedDescriptor.toString()); case Type.OBJECT: String remappedInternalName = map(type.getInternalName()); return remappedInternalName != null ? Type.getObjectType(remappedInternalName) : type; case Type.METHOD: return Type.getMethodType(mapMethodDesc(type.getDescriptor())); default: return type; } }
@Override public String map(String typeName) { if (typeName.equals("org/wildfly/swarm/jaxrs/runtime/DefaultApplication")) { return slashName; } return super.map(typeName); } };
private Type mapType(Type t) { switch (t.getSort()) { case Type.ARRAY: String s = mapDesc(t.getElementType().getDescriptor()); for (int i = 0; i < t.getDimensions(); ++i) { s = '[' + s; } return Type.getType(s); case Type.OBJECT: s = map(t.getInternalName()); return s != null ? Type.getObjectType(s) : t; case Type.METHOD: return Type.getMethodType(mapMethodDesc(t.getDescriptor())); } return t; }
public String mapDesc(String desc) { Type t = Type.getType(desc); switch (t.getSort()) { case Type.ARRAY: String s = mapDesc(t.getElementType().getDescriptor()); for (int i = 0; i < t.getDimensions(); ++i) { s = '[' + s; } return s; case Type.OBJECT: String newType = map(t.getInternalName()); if (newType != null) { return 'L' + newType + ';'; } } return desc; }
/** * Returns the given {@link Type}, remapped with {@link #map(String)} or {@link * #mapMethodDesc(String)}. * * @param type a type, which can be a method type. * @return the given type, with its [array element type] internal name remapped with {@link * #map(String)} (if the type is an array or object type, otherwise the type is returned as * is) or, of the type is a method type, with its descriptor remapped with {@link * #mapMethodDesc(String)}. */ private Type mapType(final Type type) { switch (type.getSort()) { case Type.ARRAY: StringBuilder remappedDescriptor = new StringBuilder(); for (int i = 0; i < type.getDimensions(); ++i) { remappedDescriptor.append('['); } remappedDescriptor.append(mapType(type.getElementType()).getDescriptor()); return Type.getType(remappedDescriptor.toString()); case Type.OBJECT: String remappedInternalName = map(type.getInternalName()); return remappedInternalName != null ? Type.getObjectType(remappedInternalName) : type; case Type.METHOD: return Type.getMethodType(mapMethodDesc(type.getDescriptor())); default: return type; } }
@Override public String map(String typeName) { if (typeName.equals("org/wildfly/swarm/undertow/internal/FaviconErrorHandler")) { return slashName; } return super.map(typeName); } };
@Override public String map(String typeName) { if (typeName.equals("org/wildfly/swarm/jaxrs/FaviconExceptionMapper")) { return "org/wildfly/swarm/generated/FaviconExceptionMapper"; } return super.map(typeName); } };
@Override public String map(String typeName) { if (typeName.equals("org/wildfly/swarm/undertow/internal/FaviconServletExtension")) { return slashName; } return super.map(typeName); } };
@Override public String map(String typeName) { if (typeName.equals("org/wildfly/swarm/jaxrs/internal/FaviconExceptionMapper")) { return "org/wildfly/swarm/generated/FaviconExceptionMapper"; } return super.map(typeName); } };
@Override public String map(String typeName) { if (typeName.equals("org/wildfly/swarm/undertow/internal/FaviconServletExtension")) { return slashName; } return super.map(typeName); } };
@Override public String map(String typeName) { if (typeName.equals("org/wildfly/swarm/undertow/internal/FaviconErrorHandler")) { return slashName; } return super.map(typeName); } };
public String[] mapTypes(String[] types) { String[] newTypes = null; boolean needMapping = false; for (int i = 0; i < types.length; i++) { String type = types[i]; String newType = map(type); if (newType != null && newTypes == null) { newTypes = new String[types.length]; if (i > 0) { System.arraycopy(types, 0, newTypes, 0, i); } needMapping = true; } if (needMapping) { newTypes[i] = newType == null ? type : newType; } } return needMapping ? newTypes : types; }
public String[] mapTypes(String[] types) { String[] newTypes = null; boolean needMapping = false; for (int i = 0; i < types.length; i++) { String type = types[i]; String newType = map(type); if (newType != null && newTypes == null) { newTypes = new String[types.length]; if (i > 0) { System.arraycopy(types, 0, newTypes, 0, i); } needMapping = true; } if (needMapping) { newTypes[i] = newType == null ? type : newType; } } return needMapping ? newTypes : types; }
@Override public void visitSource( final String source, final String debug ) { if ( source == null ) { super.visitSource( source, debug ); } else { final String fqSource = pkg + source; final String mappedSource = remapper.map( fqSource ); final String filename = mappedSource.substring( mappedSource.lastIndexOf( '/' ) + 1 ); super.visitSource( filename, debug ); } } };