changeset 928:75342a0a42ff

Merge
author asaha
date Tue, 04 Mar 2014 15:33:43 -0800
parents d4d1b9887107 3cce2a49d18d
children e237ef24cb93 c83b152846b2
files .hgtags
diffstat 2 files changed, 25 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Feb 27 08:29:31 2014 -0800
+++ b/.hgtags	Tue Mar 04 15:33:43 2014 -0800
@@ -412,6 +412,7 @@
 2a4842e7ca0b2228017542cea0fed3b8d4f4491a jdk7u55-b09
 5805c3291eb3a82cd75e95ac06eb13daa7f92866 jdk7u55-b09
 b9dae31c56a2bf69fc5932cc490cd80fccc1e0fd jdk7u55-b10
+cbd5b4b07e0c8a5f61eff396b7622e7b04d2a164 jdk7u55-b11
 c5b5886004e6446b8b27ccdc1fd073354c1dc614 jdk7u60-b00
 a531112cc6d0b0a1e7d4ffdaa3ba53addcd25cf4 jdk7u60-b01
 d81370c5b863acc19e8fb07315b1ec687ac1136a jdk7u60-b02
--- a/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Thu Feb 27 08:29:31 2014 -0800
+++ b/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Tue Mar 04 15:33:43 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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
@@ -170,6 +170,12 @@
     // representing LogDomain and ExceptionGroup.
     private Map wrapperMap ;
 
+    static class Holder {
+        static final PresentationManager defaultPresentationManager =
+            setupPresentationManager();
+    }
+    private static final Object pmLock = new Object();
+
     private static Map staticWrapperMap = new ConcurrentHashMap();
 
     protected MonitoringManager monitoringManager;
@@ -235,13 +241,24 @@
      */
     public static PresentationManager getPresentationManager()
     {
-        AppContext ac = AppContext.getAppContext();
-        PresentationManager pm = (PresentationManager) ac.get(PresentationManager.class);
-        if (pm == null) {
-            pm = setupPresentationManager();
-            ac.put(PresentationManager.class, pm);
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null && AppContext.getAppContexts().size() > 0) {
+            AppContext ac = AppContext.getAppContext();
+            if (ac != null) {
+                synchronized (pmLock) {
+                    PresentationManager pm =
+                        (PresentationManager) ac.get(PresentationManager.class);
+                    if (pm == null) {
+                        pm = setupPresentationManager();
+                        ac.put(PresentationManager.class, pm);
+                    }
+                    return pm;
+                }
+            }
         }
-        return pm;
+
+        // No security manager or AppContext
+        return Holder.defaultPresentationManager;
     }
 
     /** Get the appropriate StubFactoryFactory.  This