8035618: Four api/org_omg/CORBA TCK tests fail under plugin only jdk8-b130

Wed, 26 Feb 2014 23:04:12 +0000

author
coffeys
date
Wed, 26 Feb 2014 23:04:12 +0000
changeset 591
0683ee308085
parent 585
eea0d7dfcbe2
child 592
fb80f6377ac7
child 596
5e5c8f0c45dd

8035618: Four api/org_omg/CORBA TCK tests fail under plugin only
Reviewed-by: mchung, chegar

src/share/classes/com/sun/corba/se/spi/orb/ORB.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Thu Feb 06 17:34:40 2014 -0800
     1.2 +++ b/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Wed Feb 26 23:04:12 2014 +0000
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -170,6 +170,12 @@
    1.11      // representing LogDomain and ExceptionGroup.
    1.12      private Map wrapperMap ;
    1.13  
    1.14 +    static class Holder {
    1.15 +        static final PresentationManager defaultPresentationManager =
    1.16 +            setupPresentationManager();
    1.17 +    }
    1.18 +    private static final Object pmLock = new Object();
    1.19 +
    1.20      private static Map staticWrapperMap = new ConcurrentHashMap();
    1.21  
    1.22      protected MonitoringManager monitoringManager;
    1.23 @@ -235,13 +241,24 @@
    1.24       */
    1.25      public static PresentationManager getPresentationManager()
    1.26      {
    1.27 -        AppContext ac = AppContext.getAppContext();
    1.28 -        PresentationManager pm = (PresentationManager) ac.get(PresentationManager.class);
    1.29 -        if (pm == null) {
    1.30 -            pm = setupPresentationManager();
    1.31 -            ac.put(PresentationManager.class, pm);
    1.32 +        SecurityManager sm = System.getSecurityManager();
    1.33 +        if (sm != null && AppContext.getAppContexts().size() > 0) {
    1.34 +            AppContext ac = AppContext.getAppContext();
    1.35 +            if (ac != null) {
    1.36 +                synchronized (pmLock) {
    1.37 +                    PresentationManager pm =
    1.38 +                        (PresentationManager) ac.get(PresentationManager.class);
    1.39 +                    if (pm == null) {
    1.40 +                        pm = setupPresentationManager();
    1.41 +                        ac.put(PresentationManager.class, pm);
    1.42 +                    }
    1.43 +                    return pm;
    1.44 +                }
    1.45 +            }
    1.46          }
    1.47 -        return pm;
    1.48 +
    1.49 +        // No security manager or AppContext
    1.50 +        return Holder.defaultPresentationManager;
    1.51      }
    1.52  
    1.53      /** Get the appropriate StubFactoryFactory.  This

mercurial