@Override protected synchronized Class<?> loadClass(final String name, final boolean resolve) throws ClassNotFoundException { return super.loadClass(name, resolve); }
@Override protected synchronized Class<?> loadClass(final String name, final boolean resolve) throws ClassNotFoundException { return super.loadClass(name, resolve); }
private Class<?> loadClass(String className) throws ClassNotFoundException { return mClassLoader.loadClass(className); } }
private Class<?> loadClass(String className) throws ClassNotFoundException { return mClassLoader.loadClass(className); } }
/** * Loads (but doesn't link or initialize) the class. * * @throws LinkageError when there were errors in loading classes that this class depends on. * For example, {@link NoClassDefFoundError}. */ public Class<?> load() { try { return loader.loadClass(className); } catch (ClassNotFoundException e) { // Shouldn't happen, since the class name is read from the class path. throw new IllegalStateException(e); } }
private static Class<?> type(String className) throws ClassNotFoundException { return WebLogicRequestUpgradeStrategy.class.getClassLoader().loadClass(className); }
@Override public Class<?> resolve(String className) throws ClassNotFoundException { try { return classLoader.loadClass(className); } catch (ClassNotFoundException ignored) { return Class.forName(className, false, classLoader); } }
/** * Check whether the given class is loadable in the given ClassLoader. * @param clazz the class to check (typically an interface) * @param classLoader the ClassLoader to check against * @since 5.0.6 */ private static boolean isLoadable(Class<?> clazz, ClassLoader classLoader) { try { return (clazz == classLoader.loadClass(clazz.getName())); // Else: different class with same name found } catch (ClassNotFoundException ex) { // No corresponding class found at all return false; } }
@SuppressWarnings("unchecked") @Nullable private static Class<? extends Annotation> getAnnotationType(String annotationType, @Nullable ClassLoader classLoader) { if (classLoader != null) { try { return (Class<? extends Annotation>) classLoader.loadClass(annotationType); } catch (ClassNotFoundException ex) { // Annotation Class not resolvable } } return null; }
@Override public Class<?> loadClass(String name) throws ClassNotFoundException { return childLoader1.loadClass(name); } };
/** * Locates the {@link ResourceBundleHolder} for this CLI method. */ private ResourceBundleHolder loadMessageBundle(Method m) throws ClassNotFoundException { Class c = m.getDeclaringClass(); Class<?> msg = c.getClassLoader().loadClass(c.getName().substring(0, c.getName().lastIndexOf(".")) + ".Messages"); return ResourceBundleHolder.get(msg); }
@Override public Class<?> loadClass(String name) throws ClassNotFoundException { if (shouldShadow(name)) { Class<?> cls = this.classCache.get(name); if (cls != null) { return cls; } return doLoadClass(name); } else { return this.enclosingClassLoader.loadClass(name); } }
@Override public Class<?> loadClass(String name) throws ClassNotFoundException { if (this.overrideDelegate != null && isEligibleForOverriding(name)) { return this.overrideDelegate.loadClass(name); } return super.loadClass(name); }
@Restricted(NoExternalUse.class) public boolean isMailerPluginPresent() { try { // mail support has moved to a separate plugin return null != Jenkins.getInstance().pluginManager.uberClassLoader.loadClass("hudson.tasks.Mailer$UserProperty"); } catch (ClassNotFoundException e) { LOGGER.finer("Mailer plugin not present"); } return false; }
/** * @deprecated Use {@link #getAction(Class)} on {@code AggregatedTestResultAction}. */ @Deprecated public Action getAggregatedTestResultAction() { try { return getAction(Jenkins.getInstance().getPluginManager().uberClassLoader.loadClass("hudson.tasks.test.AggregatedTestResultAction").asSubclass(Action.class)); } catch (ClassNotFoundException x) { return null; } }
private void runTestMethod(ClassLoader classLoader) throws Exception { Class<?> test = classLoader.loadClass(FuturesTest.class.getName()); Object testInstance = test.newInstance(); test.getMethod("setUp").invoke(testInstance); test.getMethod(getName()).invoke(testInstance); test.getMethod("tearDown").invoke(testInstance); }
private void checkHelperVersion(ClassLoader classLoader, String expectedHelperClassName) throws Exception { // Make sure we are actually running with the expected helper implementation Class<?> abstractFutureClass = classLoader.loadClass(AbstractFuture.class.getName()); Field helperField = abstractFutureClass.getDeclaredField("ATOMIC_HELPER"); helperField.setAccessible(true); assertEquals(expectedHelperClassName, helperField.get(null).getClass().getSimpleName()); }
private void checkHelperVersion(ClassLoader classLoader, String expectedHelperClassName) throws Exception { // Make sure we are actually running with the expected helper implementation Class<?> abstractFutureClass = classLoader.loadClass(AggregateFutureState.class.getName()); Field helperField = abstractFutureClass.getDeclaredField("ATOMIC_HELPER"); helperField.setAccessible(true); assertEquals(expectedHelperClassName, helperField.get(null).getClass().getSimpleName()); }
private void runTestMethod(ClassLoader classLoader) throws Exception { Class<?> test = classLoader.loadClass(AbstractFutureTest.class.getName()); test.getMethod(getName()).invoke(test.newInstance()); }
private void makeInstance() throws Exception { String fullName = clsNode.getFullName(); instance = getClassLoader().loadClass(fullName).newInstance(); if (instance == null) { throw new NullPointerException("Instantiation failed"); } }