(String sig, ClassEnv env)
| 10 | public final class Signature { |
| 11 | public static final class ClassSignature implements PotentialComparable<ClassSignature> { |
| 12 | public static ClassSignature parse(String sig, ClassEnv env) { |
| 13 | // [<TypeParameter+>] ClassTypeSignature ClassTypeSignature* |
| 14 | ClassSignature ret = new ClassSignature(); |
| 15 | MutableInt pos = new MutableInt(); |
| 16 | |
| 17 | if (sig.startsWith("<")) { |
| 18 | pos.val++; |
| 19 | ret.typeParameters = new ArrayList<>(); |
| 20 | |
| 21 | do { |
| 22 | ret.typeParameters.add(TypeParameter.parse(sig, pos, env)); |
| 23 | } while (sig.charAt(pos.val) != '>'); |
| 24 | |
| 25 | pos.val++; |
| 26 | } |
| 27 | |
| 28 | ret.superClassSignature = ClassTypeSignature.parse(sig, pos, env); |
| 29 | |
| 30 | if (pos.val < sig.length()) { |
| 31 | ret.superInterfaceSignatures = new ArrayList<>(); |
| 32 | |
| 33 | do { |
| 34 | ret.superInterfaceSignatures.add(ClassTypeSignature.parse(sig, pos, env)); |
| 35 | } while (pos.val < sig.length()); |
| 36 | } |
| 37 | |
| 38 | assert ret.toString().equals(sig); |
| 39 | |
| 40 | return ret; |
| 41 | } |
| 42 | |
| 43 | public String toString(NameType nameType) { |
| 44 | StringBuilder ret = new StringBuilder(); |
no test coverage detected