8039108: Build Broken: 8035618 fix breaks corba build
authorcoffeys
Wed, 02 Apr 2014 20:15:59 +0100
changeset 23753 27d1fe3a2bef
parent 23752 edf6d51900f2
child 23754 597ba0e933e2
8039108: Build Broken: 8035618 fix breaks corba build Reviewed-by: alanb
corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java
--- a/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Wed Apr 02 18:21:23 2014 +0100
+++ b/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java	Wed Apr 02 20:15:59 2014 +0100
@@ -25,6 +25,8 @@
 
 package com.sun.corba.se.spi.orb;
 
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.Map ;
 import java.util.HashMap ;
 import java.util.Properties ;
@@ -245,7 +247,15 @@
         SecurityManager sm = System.getSecurityManager();
         JavaAWTAccess javaAwtAccess = sun.misc.SharedSecrets.getJavaAWTAccess();
         if (sm != null && javaAwtAccess != null) {
-            final Object appletContext = javaAwtAccess.getAppletContext();
+            Object appletContext;
+            try {
+                Class<?> clazz = JavaAWTAccess.class;
+                Method method = clazz.getMethod("getAppletContext");
+                appletContext = method.invoke(javaAwtAccess);
+            } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
+                throw new InternalError(e);
+            }
+
             if (appletContext != null) {
                 synchronized (pmContexts) {
                     PresentationManager pm = pmContexts.get(appletContext);