TypeRepr (final String descriptor) { final Type t = Type.getType(descriptor); switch (t.getSort()) { case Type.OBJECT: return new ClassType(t.getClassName().replace('.', '/')); case Type.ARRAY: return new ArrayType(getType(t.getElementType().getDescriptor())); default: // todo: support 'method' type? return new PrimitiveType(descriptor); } }