8028215: ORB.init fails with SecurityException if properties select the JDK default ORB
authormsheppar
Thu, 21 Nov 2013 11:30:39 +0000
changeset 21860 3ba29895d289
parent 21859 79297dc5e081
child 21861 e0706ed62bd3
8028215: ORB.init fails with SecurityException if properties select the JDK default ORB Summary: check for default ORBImpl and ORBSingleton set via properties or System properties Reviewed-by: alanb, coffeys, mchung
corba/src/share/classes/org/omg/CORBA/ORB.java
--- a/corba/src/share/classes/org/omg/CORBA/ORB.java	Mon Nov 04 11:09:07 2013 +0100
+++ b/corba/src/share/classes/org/omg/CORBA/ORB.java	Thu Nov 21 11:30:39 2013 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -285,7 +285,8 @@
             String className = getSystemProperty(ORBSingletonClassKey);
             if (className == null)
                 className = getPropertyFromFile(ORBSingletonClassKey);
-            if (className == null) {
+            if ((className == null) ||
+                    (className.equals("com.sun.corba.se.impl.orb.ORBSingleton"))) {
                 singleton = new com.sun.corba.se.impl.orb.ORBSingleton();
             } else {
                 singleton = create_impl(className);
@@ -339,7 +340,8 @@
             className = getSystemProperty(ORBClassKey);
         if (className == null)
             className = getPropertyFromFile(ORBClassKey);
-        if (className == null) {
+        if ((className == null) ||
+                    (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) {
             orb = new com.sun.corba.se.impl.orb.ORBImpl();
         } else {
             orb = create_impl(className);
@@ -369,7 +371,8 @@
             className = getSystemProperty(ORBClassKey);
         if (className == null)
             className = getPropertyFromFile(ORBClassKey);
-        if (className == null) {
+        if ((className == null) ||
+                    (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) {
             orb = new com.sun.corba.se.impl.orb.ORBImpl();
         } else {
             orb = create_impl(className);