public Class getClassForName(final String className) {
        try {
            final OsgiRegistry osgiRegistry = ReflectionHelper.getOsgiRegistryInstance();

            if (osgiRegistry != null) {
                return osgiRegistry.classForNameWithException(className);
            } else {
                return AccessController.doPrivileged(ReflectionHelper.classForNameWithExceptionPEA(className));
            }
        } catch (final ClassNotFoundException ex) {
            throw new RuntimeException(LocalizationMessages.ERROR_SCANNING_CLASS_NOT_FOUND(className), ex);
        } catch (final PrivilegedActionException pae) {
            final Throwable cause = pae.getCause();
            if (cause instanceof ClassNotFoundException) {
                throw new RuntimeException(LocalizationMessages.ERROR_SCANNING_CLASS_NOT_FOUND(className), cause);
            } else if (cause instanceof RuntimeException) {
                throw (RuntimeException) cause;
            } else {
                throw new RuntimeException(cause);
            }
        }
    }
public Class getClassForName ( final String className ) { try { final OsgiRegistry osgiRegistry = ReflectionHelper . getOsgiRegistryInstance ( ) ; if ( osgiRegistry != null ) { return osgiRegistry . classForNameWithException ( className ) ; } else { return AccessController . doPrivileged ( ReflectionHelper . classForNameWithExceptionPEA ( className ) ) ; } } catch ( final ClassNotFoundException ex ) { throw new RuntimeException ( LocalizationMessages . ERROR_SCANNING_CLASS_NOT_FOUND ( className ) , ex ) ; } catch ( final PrivilegedActionException pae ) { final Throwable cause = pae . getCause ( ) ; if ( cause instanceof ClassNotFoundException ) { throw new RuntimeException ( LocalizationMessages . ERROR_SCANNING_CLASS_NOT_FOUND ( className ) , cause ) ; } else if ( cause instanceof RuntimeException ) { throw ( RuntimeException ) cause ; } else { throw new RuntimeException ( cause ) ; } } }
<p>getClassForName.</p>

@param className a {@link java.lang.String} object.
@return a {@link java.lang.Class} object.