2004-07-30 Michael Koch <konqueror@gmx.de>
authorMichael Koch <konqueror@gmx.de>
Fri, 30 Jul 2004 14:50:50 +0000 (14:50 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Fri, 30 Jul 2004 14:50:50 +0000 (14:50 +0000)
* gnu/java/awt/EmbeddedWindow.java
(addNotify): Use AccessController to allow execution of privileged
code.

From-SVN: r85337

libjava/ChangeLog
libjava/gnu/java/awt/EmbeddedWindow.java

index ba265cf3612f6e90c342d4c76408a7f64840b9c6..db17ad758e2c987a548c9e763302679a5ddf526c 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-30  Michael Koch  <konqueror@gmx.de>
+
+       * gnu/java/awt/EmbeddedWindow.java
+       (addNotify): Use AccessController to allow execution of privileged
+       code.
+
 2004-07-29  Michael Koch  <konqueror@gmx.de>
 
        * gnu/java/lang/MainThread.java:
index 5f1d71a80683a69b38c021d6aee3273bce12a863..08bc02755ea5b46aff0e79f78f8f79ca84e7044d 100644 (file)
@@ -40,11 +40,13 @@ package gnu.java.awt;
 
 import gnu.classpath.Configuration;
 import gnu.java.awt.peer.EmbeddedWindowPeer;
+import gnu.java.security.action.SetAccessibleAction;
 
 import java.awt.Component;
 import java.awt.Frame;
 import java.awt.Toolkit;
 import java.lang.reflect.Field;
+import java.security.AccessController;
 
 /**
  * Represents an AWT window that can be embedded into another
@@ -88,13 +90,15 @@ public class EmbeddedWindow extends Frame
 
     if (! (tk instanceof EmbeddedWindowSupport))
       throw new UnsupportedOperationException
-        ("Embedded windows are not supported by the current peers: " + tk.getClass());
+        ("Embedded windows are not supported by the current peers: "
+        + tk.getClass());
 
     // Circumvent the package-privateness of the AWT internal
     // java.awt.Component.peer member variable.
     try
       {
        Field peerField = Component.class.getDeclaredField("peer");
+       AccessController.doPrivileged(new SetAccessibleAction(peerField));
        peerField.set(this, ((EmbeddedWindowSupport) tk).createEmbeddedWindow (this));
       }
     catch (IllegalAccessException e)