comparison src/share/vm/prims/jvm.cpp @ 11099:ba9dacff9c9d

8014399: Remove JVM_SetProtectionDomain from hotspot Summary: JVM_SetProtectionDomain has been deprecated since 1.5 and is being removed Reviewed-by: coleenp, hseigel Contributed-by: eric.mccorkle@oracle.com
author hseigel
date Mon, 08 Jul 2013 19:36:22 -0400
parents 9f3e3245b50f
children 6b0fd0964b87 b2e698d2276c 4f9a42c33738 bdd155477289
comparison
equal deleted inserted replaced
11094:cc5b7915104e 11099:ba9dacff9c9d
1119 oop pd = java_lang_Class::protection_domain(JNIHandles::resolve(cls)); 1119 oop pd = java_lang_Class::protection_domain(JNIHandles::resolve(cls));
1120 return (jobject) JNIHandles::make_local(env, pd); 1120 return (jobject) JNIHandles::make_local(env, pd);
1121 JVM_END 1121 JVM_END
1122 1122
1123 1123
1124 // Obsolete since 1.2 (Class.setProtectionDomain removed), although
1125 // still defined in core libraries as of 1.5.
1126 JVM_ENTRY(void, JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protection_domain))
1127 JVMWrapper("JVM_SetProtectionDomain");
1128 if (JNIHandles::resolve(cls) == NULL) {
1129 THROW(vmSymbols::java_lang_NullPointerException());
1130 }
1131 if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) {
1132 // Call is ignored for primitive types
1133 Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
1134
1135 // cls won't be an array, as this called only from ClassLoader.defineClass
1136 if (k->oop_is_instance()) {
1137 oop pd = JNIHandles::resolve(protection_domain);
1138 assert(pd == NULL || pd->is_oop(), "just checking");
1139 java_lang_Class::set_protection_domain(k->java_mirror(), pd);
1140 }
1141 }
1142 JVM_END
1143
1144 static bool is_authorized(Handle context, instanceKlassHandle klass, TRAPS) { 1124 static bool is_authorized(Handle context, instanceKlassHandle klass, TRAPS) {
1145 // If there is a security manager and protection domain, check the access 1125 // If there is a security manager and protection domain, check the access
1146 // in the protection domain, otherwise it is authorized. 1126 // in the protection domain, otherwise it is authorized.
1147 if (java_lang_System::has_security_manager()) { 1127 if (java_lang_System::has_security_manager()) {
1148 1128