Class < ? > loadClass ( String requestedClass , boolean initialize ) throws ClassNotFoundException { String binaryName = requestedClass ; while ( true ) { try { return Class . forName ( binaryName , initialize , classLoader ) ; } catch ( ClassNotFoundException e ) { if ( ! binaryName . contains ( "." ) ) { throw e ; } else { binaryName = replaceLastPeriodWithDollar ( binaryName ) ; } } } }
Package accessible for testing .