List<String> typeParameters = new ArrayList<>(); List<List<GenericType>> typeParameterBounds = new ArrayList<>(); signature = parseFormalParameters(signature, typeParameters, typeParameterBounds);
public static GenericClassDescriptor parseClassSignature(String signature) { String original = signature; try { GenericClassDescriptor descriptor = new GenericClassDescriptor(); signature = parseFormalParameters(signature, descriptor.fparameters, descriptor.fbounds); String superCl = GenericType.getNextType(signature); descriptor.superclass = new GenericType(superCl); signature = signature.substring(superCl.length()); while (signature.length() > 0) { String superIf = GenericType.getNextType(signature); descriptor.superinterfaces.add(new GenericType(superIf)); signature = signature.substring(superIf.length()); } return descriptor; } catch (RuntimeException e) { DecompilerContext.getLogger().writeMessage("Invalid signature: " + original, IFernflowerLogger.Severity.WARN); return null; } }
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; } }
public static GenericClassDescriptor parseClassSignature(String signature) { String original = signature; try { GenericClassDescriptor descriptor = new GenericClassDescriptor(); signature = parseFormalParameters(signature, descriptor.fparameters, descriptor.fbounds); String superCl = GenericType.getNextType(signature); descriptor.superclass = new GenericType(superCl); signature = signature.substring(superCl.length()); while (signature.length() > 0) { String superIf = GenericType.getNextType(signature); descriptor.superinterfaces.add(new GenericType(superIf)); signature = signature.substring(superIf.length()); } return descriptor; } catch (RuntimeException e) { DecompilerContext.getLogger().writeMessage("Invalid signature: " + original, IFernflowerLogger.Severity.WARN); return null; } }