53 protected Class<?> loadClass(final String name, final boolean resolve) throws ClassNotFoundException {
54 checkPackageAccess(name);
55 if (name.startsWith(NASHORN_PKG_PREFIX)) {
56 return context.getSharedLoader().loadClass(name);
57 }
58 return super.loadClass(name, resolve);
59 }
60
61 // package-private and private stuff below this point
62
63 /**
64 * Install a class for use by the Nashorn runtime
65 *
66 * @param name Binary name of class.
67 * @param data Class data bytes.
68 * @param cs CodeSource code source of the class bytes.
69 *
70 * @return Installed class.
71 */
72 synchronized Class<?> installClass(final String name, final byte[] data, final CodeSource cs) {
73 Objects.requireNonNull(cs);
74 return defineClass(name, data, 0, data.length, cs);
75 }
76 }
|
53 protected Class<?> loadClass(final String name, final boolean resolve) throws ClassNotFoundException {
54 checkPackageAccess(name);
55 if (name.startsWith(NASHORN_PKG_PREFIX)) {
56 return context.getSharedLoader().loadClass(name);
57 }
58 return super.loadClass(name, resolve);
59 }
60
61 // package-private and private stuff below this point
62
63 /**
64 * Install a class for use by the Nashorn runtime
65 *
66 * @param name Binary name of class.
67 * @param data Class data bytes.
68 * @param cs CodeSource code source of the class bytes.
69 *
70 * @return Installed class.
71 */
72 synchronized Class<?> installClass(final String name, final byte[] data, final CodeSource cs) {
73 return defineClass(name, data, 0, data.length, Objects.requireNonNull(cs));
74 }
75 }
|