Buggy code:
public final class ReflectionUtils { private static final String DEFAULT_SINGLETON_CONSTANT_NAME = "INSTANCE" ; private static final String DEFAULT_SINGLETON_GETTER_NAME = "getInstance" ; private static final int REQUIRED_MODIFIERS_FOR_ACCESS = ( ( Modifier . PUBLIC ) | ( Modifier . FINAL ) ) | ( Modifier . STATIC ) ; private static final String [ ] DEFAULT_PACKAGE_PREFIXES = new String [ ] { "java.lang." } ; public static final void ensureClassIsLoaded ( final String clazz ) throws ClassNotFoundException { } public static final void ensureClassesAreLoaded ( final String ... classes ) throws ClassNotFoundException { } @ SuppressWarnings ( "unchecked" ) public static final < T > T deepClone ( final T instance ) throws IllegalArgumentException , OutOfMemoryError { } public static final void validateSubClass ( final Class < ? > subClass , final Class < ? > baseClass ) throws ClassCastException { } private static final Class < ? > __findClassInternal ( final String clazzName , final String [ ] prefixes ) throws ClassCastException , ClassNotFoundException , LinkageError { } public static final < C > Class < ? extends C > findClass ( final String name , final Class < C > base ) throws ClassCastException , ClassNotFoundException , ExceptionInInitializerError , LinkageError { } @ SuppressWarnings ( "unchecked" ) public static final < C > Class < ? extends C > findClass ( final String name , final Class < C > base , final String [ ] prefixes ) throws ClassCastException , ClassNotFoundException , ExceptionInInitializerError , LinkageError { } private static final ReflectiveOperationException __makeFindInstanceError ( final Class < ? > base , final Class < ? > container , final String name , final String reasonString , final Throwable reasonException ) { } private static final boolean __isAssignable ( final Class < ? > base , final Class < ? > result ) { } private static final < T > T __field ( final Class < T > base , final Class < ? > container , final String name , final Field field ) throws IllegalArgumentException , ReflectiveOperationException { } private static final < T > T __method ( final Class < T > base , final Class < ? > container , final String name , final Method method ) throws IllegalArgumentException , ReflectiveOperationException { } private static final < T > T __constructor ( final Class < T > base , final Class < ? > container , final String name , final Constructor < ? > constructor ) throws IllegalArgumentException , ReflectiveOperationException { } @ SuppressWarnings ( "rawtypes" ) public static final < T > T getInstance ( final Class < T > base , final Class < ? > container , final String name ) throws ReflectiveOperationException { } public static final < T > T getInstanceByName ( final Class < T > base , final String identifier ) throws ReflectiveOperationException { } public static final < T > T getInstanceByName ( final Class < T > base , final String identifier , final String [ ] prefixes ) throws ReflectiveOperationException { } public static final InputStream getResourceAsStream ( final String resource ) { } public static final InputStream getResourceAsStream ( final String resource , final String [ ] prefixes ) { } public static final void addDefaultPackagePath ( final Collection < String > list ) { } public static final void addPackageOfClassToPrefixList ( final Class < ? > clazz , final Collection < String > list ) { final String string ; final int index ; if ( clazz != null ) { string = clazz . getCanonicalName ( ) ; if ( string != null ) { <START_BUG> index = string . indexOf ( '.' ) ; <END_BUG> if ( ( index > 0 ) && ( index < ( ( string . length ( ) ) - 1 ) ) ) { list . add ( string . substring ( 0 , ( index + 1 ) ) ) ; } } } } private ReflectionUtils ( ) { } }

Fix:
index = string . lastIndexOf ( '.' ) ;