changeset 598:54acf41cfc8f jdk8_final

Merge to jdk8 release tip
author Edward Nevill edward.nevill@linaro.org
date Wed, 19 Mar 2014 10:37:00 +0000
parents 5a4f6f5a8496 (current diff) 3d96f0a5f9e2 (diff)
children 9fe8d21058ee
files .hgtags
diffstat 2 files changed, 29 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Mar 10 08:08:29 2014 -0400
+++ b/.hgtags	Wed Mar 19 10:37:00 2014 +0000
@@ -257,3 +257,8 @@
 a957e39dbc5535c6315ca8e0edb5fa2210ffa729 jdk8_b128_aarch64_rc3
 475e82b89c042b6cd6dc9f7d2266ea2b9ab76bf4 jdk8_b128_aarch64_rc4
 4cdc918e7370d107211f58ff50aea67ae716a023 jdk8_b128_aarch64_992
+113e7569b49bca18846e5e5b74e644580b805902 jdk8-b128
+5c72d74c6805d1b4f6192f7a3550d126acf37005 jdk8-b129
+0683ee308085785d0455f4153e764e062843f178 jdk8-b130
+5e5c8f0c45dd75a08089586ca50835393f00c2cb jdk8-b131
+84fed37bbe640666bfc022c2e8b9fde468de35d2 jdk8-b132
--- a/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Mon Mar 10 08:08:29 2014 -0400
+++ b/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Wed Mar 19 10:37:00 2014 +0000
@@ -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