diff --git a/libjava/ChangeLog b/libjava/ChangeLog index ba265cf3612..db17ad758e2 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2004-07-30 Michael Koch + + * gnu/java/awt/EmbeddedWindow.java + (addNotify): Use AccessController to allow execution of privileged + code. + 2004-07-29 Michael Koch * gnu/java/lang/MainThread.java: diff --git a/libjava/gnu/java/awt/EmbeddedWindow.java b/libjava/gnu/java/awt/EmbeddedWindow.java index 5f1d71a8068..08bc02755ea 100644 --- a/libjava/gnu/java/awt/EmbeddedWindow.java +++ b/libjava/gnu/java/awt/EmbeddedWindow.java @@ -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)