changeset 617:d5e00185a577

Merge
author asaha
date Tue, 11 Mar 2014 14:01:16 -0700
parents 202cf27c7ad4 897088ef059f
children e2cfebaf3b9d
files .hgtags
diffstat 2 files changed, 29 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Feb 26 22:06:37 2014 -0800
+++ b/.hgtags	Tue Mar 11 14:01:16 2014 -0700
@@ -251,6 +251,9 @@
 b8c71dae05574f8eca7ca6d703b16b450850b033 jdk8-b127
 113e7569b49bca18846e5e5b74e644580b805902 jdk8-b128
 5c72d74c6805d1b4f6192f7a3550d126acf37005 jdk8-b129
+0683ee308085785d0455f4153e764e062843f178 jdk8-b130
+5e5c8f0c45dd75a08089586ca50835393f00c2cb jdk8-b131
+84fed37bbe640666bfc022c2e8b9fde468de35d2 jdk8-b132
 5de8d42f9eb7ddcdc741445f3c21a63887d694b6 jdk8u5-b01
 c750098a3ef18de28a6d739666559f0333c76c78 jdk8u5-b02
 3d9b40a53134aa33031bf13581dff9fccade9048 jdk8u5-b03
@@ -262,3 +265,5 @@
 df6e5fc3b585a6829c98bb91546b81dc28f8e2b4 jdk8u5-b08
 f5058197fa91153b7702214154d37b00f9714aaa jdk8u5-b09
 d9031b5525f777299554080d6beb8b077df0a614 jdk8u5-b10
+a2f7b36bfc1bc8df033fe5721b48fac1c3928a5b jdk8u5-b11
+475b96f6d8cecf720ca9fd6d332dd4bafb0f654c jdk8u5-b12
--- a/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Wed Feb 26 22:06:37 2014 -0800
+++ b/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Tue Mar 11 14:01:16 2014 -0700
@@ -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