public GenericMethodDescriptor(List<String> typeParameters, List<List<GenericType>> typeParameterBounds, List<GenericType> parameterTypes, GenericType returnType, List<GenericType> exceptionTypes) { this.typeParameters = substitute(typeParameters); this.typeParameterBounds = substitute(typeParameterBounds); this.parameterTypes = substitute(parameterTypes); this.returnType = returnType; this.exceptionTypes = substitute(exceptionTypes); }
return new GenericMethodDescriptor(typeParameters, typeParameterBounds, parameterTypes, returnType, exceptionTypes);
public static GenericMethodDescriptor parseMethodSignature(String signature) { String original = signature; try { GenericMethodDescriptor descriptor = new GenericMethodDescriptor(); signature = parseFormalParameters(signature, descriptor.fparameters, descriptor.fbounds); int to = signature.indexOf(")"); String pars = signature.substring(1, to); signature = signature.substring(to + 1); while (pars.length() > 0) { String par = GenericType.getNextType(pars); descriptor.params.add(new GenericType(par)); pars = pars.substring(par.length()); } String par = GenericType.getNextType(signature); descriptor.ret = new GenericType(par); signature = signature.substring(par.length()); if (signature.length() > 0) { String[] exceptions = signature.split("\\^"); for (int i = 1; i < exceptions.length; i++) { descriptor.exceptions.add(new GenericType(exceptions[i])); } } return descriptor; } catch (RuntimeException e) { DecompilerContext.getLogger().writeMessage("Invalid signature: " + original, IFernflowerLogger.Severity.WARN); return null; } }