@Test public void testUnmatchedRightAngleBracket() { assertEquals(3, GenericUtilities.nextUnmatchedRightAngleBracket("<I>>", 0)); assertEquals(1, GenericUtilities.nextUnmatchedRightAngleBracket("I><I>", 0)); }
public static int nextUnmatchedRightAngleBracket(String s, int startingAt) { int nesting = 0; int pos = startingAt; while (true) { if (pos < 0) { return -1; } char c = s.charAt(pos); if (c == '>') { if (nesting == 0) { return pos; } nesting--; } else if (c == '<') { nesting++; } pos++; } }
GenericUtilities { public static int nextUnmatchedRightAngleBracket(String s, int startingAt) { int nesting = 0; int pos = startingAt; while (true) { if (pos < 0) { return -1; } char c = s.charAt(pos); if (c == '>') { if (nesting == 0) { return pos; } nesting--; } else if (c == '<') { nesting++; } pos++; } } }
GenericUtilities { public static int nextUnmatchedRightAngleBracket(String s, int startingAt) { int nesting = 0; int pos = startingAt; while (true) { if (pos < 0) { return -1; } char c = s.charAt(pos); if (c == '>') { if (nesting == 0) { return pos; } nesting--; } else if (c == '<') { nesting++; } pos++; } }  }
GenericUtilities { public static int nextUnmatchedRightAngleBracket(String s, int startingAt) { int nesting = 0; int pos = startingAt; while (true) { if (pos < 0) { return -1; } char c = s.charAt(pos); if (c == '>') { if (nesting == 0) { return pos; } nesting--; } else if (c == '<') { nesting++; } pos++; } }  static final TypeCategory getTypeCategory(Type type); static final boolean isPlainObject(Type type); static final String getString(Type type); static GenericObjectType getType(String className, List<? extends ReferenceType> parameters); static @CheckForNull Type getType(String signature); static ObjectType merge(@CheckForNull Type t1, ObjectType t2); static Type merge(@CheckForNull GenericObjectType t1, Type t2); static ObjectType merge(@CheckForNull GenericObjectType t1, ObjectType t2); static String removeMatchedAngleBrackets(String s); static int nextUnmatchedRightAngleBracket(String s, int startingAt); static int lastMatchedLeftAngleBracket(String s); static final @CheckForNull List<ReferenceType> getTypeParameters(String signature); static final List<String> split(String signature, boolean skipInitialAngleBracket); }
GenericUtilities { public static int nextUnmatchedRightAngleBracket(String s, int startingAt) { int nesting = 0; int pos = startingAt; while (true) { if (pos < 0) { return -1; } char c = s.charAt(pos); if (c == '>') { if (nesting == 0) { return pos; } nesting--; } else if (c == '<') { nesting++; } pos++; } }  static final TypeCategory getTypeCategory(Type type); static final boolean isPlainObject(Type type); static final String getString(Type type); static GenericObjectType getType(String className, List<? extends ReferenceType> parameters); static @CheckForNull Type getType(String signature); static ObjectType merge(@CheckForNull Type t1, ObjectType t2); static Type merge(@CheckForNull GenericObjectType t1, Type t2); static ObjectType merge(@CheckForNull GenericObjectType t1, ObjectType t2); static String removeMatchedAngleBrackets(String s); static int nextUnmatchedRightAngleBracket(String s, int startingAt); static int lastMatchedLeftAngleBracket(String s); static final @CheckForNull List<ReferenceType> getTypeParameters(String signature); static final List<String> split(String signature, boolean skipInitialAngleBracket);  }