public final synchronized BundleClassLoader createClassLoader() { if (classloader != null) return classloader; String[] classpath; try { classpath = bundle.getBundleData().getClassPath(); } catch (BundleException e) { // no classpath classpath = new String[0]; bundle.getFramework().publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e); } if (classpath == null) { // no classpath classpath = new String[0]; bundle .getFramework() .publishFrameworkEvent( FrameworkEvent.ERROR, bundle, new BundleException(Msg.BUNDLE_NO_CLASSPATH_MATCH, BundleException.MANIFEST_ERROR)); } BundleClassLoader bcl = createBCLPrevileged(bundle.getProtectionDomain(), classpath); parent = getParentPrivileged(bcl); classloader = bcl; return classloader; }