@Test(expected = IllegalArgumentException.class) public void testExtractClassNameBad() { ClassName.extractClassName("L[Ljava/lang/Integer;"); }
public static @SlashedClassName String extractClassName(String originalName) { String name = originalName; if (name.charAt(0) != '[' && name.charAt(name.length() - 1) != ';') { return name; } while (name.charAt(0) == '[') { name = name.substring(1); } if (name.charAt(0) == 'L' && name.charAt(name.length() - 1) == ';') { name = name.substring(1, name.length() - 1); } if (name.charAt(0) == '[') { throw new IllegalArgumentException("Bad class name: " + originalName); } return name; }
ClassName { public static @SlashedClassName String extractClassName(String originalName) { String name = originalName; if (name.charAt(0) != '[' && name.charAt(name.length() - 1) != ';') { return name; } while (name.charAt(0) == '[') { name = name.substring(1); } if (name.charAt(0) == 'L' && name.charAt(name.length() - 1) == ';') { name = name.substring(1, name.length() - 1); } if (name.charAt(0) == '[') { throw new IllegalArgumentException("Bad class name: " + originalName); } return name; } }
ClassName { public static @SlashedClassName String extractClassName(String originalName) { String name = originalName; if (name.charAt(0) != '[' && name.charAt(name.length() - 1) != ';') { return name; } while (name.charAt(0) == '[') { name = name.substring(1); } if (name.charAt(0) == 'L' && name.charAt(name.length() - 1) == ';') { name = name.substring(1, name.length() - 1); } if (name.charAt(0) == '[') { throw new IllegalArgumentException("Bad class name: " + originalName); } return name; }  }
ClassName { public static @SlashedClassName String extractClassName(String originalName) { String name = originalName; if (name.charAt(0) != '[' && name.charAt(name.length() - 1) != ';') { return name; } while (name.charAt(0) == '[') { name = name.substring(1); } if (name.charAt(0) == 'L' && name.charAt(name.length() - 1) == ';') { name = name.substring(1, name.length() - 1); } if (name.charAt(0) == '[') { throw new IllegalArgumentException("Bad class name: " + originalName); } return name; }  static boolean isMathClass(@SlashedClassName String className); static void assertIsDotted(@DottedClassName String className); static void assertIsSlashed(@SlashedClassName String className); static String toSignature(@SlashedClassName String className); static @CheckForNull String getPrimitiveType(@SlashedClassName String cls); static @CheckForNull @SlashedClassName String fromFieldSignature(String signature); @SlashedClassName @SuppressFBWarnings("TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK") static String toSlashedClassName(@SlashedClassName(when = When.UNKNOWN) String className); @DottedClassName @SuppressFBWarnings("TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK") static String toDottedClassName(@SlashedClassName(when = When.UNKNOWN) String className); static @DottedClassName String extractPackageName(@DottedClassName String className); static String extractSimpleName(@DottedClassName String className); static boolean isValidClassName(String className); static boolean isLocalOrAnonymous(String className); static boolean isAnonymous(String className); static @SlashedClassName String extractClassName(String originalName); static String extractPackagePrefix(String packageName, int count); static boolean matchedPrefixes(String[] classSearchStrings, @DottedClassName String className); static @SlashedClassName String toSlashedClassName(Class<?> class1); }
ClassName { public static @SlashedClassName String extractClassName(String originalName) { String name = originalName; if (name.charAt(0) != '[' && name.charAt(name.length() - 1) != ';') { return name; } while (name.charAt(0) == '[') { name = name.substring(1); } if (name.charAt(0) == 'L' && name.charAt(name.length() - 1) == ';') { name = name.substring(1, name.length() - 1); } if (name.charAt(0) == '[') { throw new IllegalArgumentException("Bad class name: " + originalName); } return name; }  static boolean isMathClass(@SlashedClassName String className); static void assertIsDotted(@DottedClassName String className); static void assertIsSlashed(@SlashedClassName String className); static String toSignature(@SlashedClassName String className); static @CheckForNull String getPrimitiveType(@SlashedClassName String cls); static @CheckForNull @SlashedClassName String fromFieldSignature(String signature); @SlashedClassName @SuppressFBWarnings("TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK") static String toSlashedClassName(@SlashedClassName(when = When.UNKNOWN) String className); @DottedClassName @SuppressFBWarnings("TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK") static String toDottedClassName(@SlashedClassName(when = When.UNKNOWN) String className); static @DottedClassName String extractPackageName(@DottedClassName String className); static String extractSimpleName(@DottedClassName String className); static boolean isValidClassName(String className); static boolean isLocalOrAnonymous(String className); static boolean isAnonymous(String className); static @SlashedClassName String extractClassName(String originalName); static String extractPackagePrefix(String packageName, int count); static boolean matchedPrefixes(String[] classSearchStrings, @DottedClassName String className); static @SlashedClassName String toSlashedClassName(Class<?> class1);  }