diff options
author | Michael Koch <konqueror@gmx.de> | 2004-07-30 14:50:50 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2004-07-30 14:50:50 +0000 |
commit | 2afed683ea103c28f0b17a3a996ba5e69bf8d749 (patch) | |
tree | a442b6f713d775dc41e2cad274ba6f5cea81feae /libjava/gnu | |
parent | 0a925a32e2dfcc71b77b2bd506e0239c206c2f61 (diff) | |
download | gcc-2afed683ea103c28f0b17a3a996ba5e69bf8d749.zip gcc-2afed683ea103c28f0b17a3a996ba5e69bf8d749.tar.gz gcc-2afed683ea103c28f0b17a3a996ba5e69bf8d749.tar.bz2 |
2004-07-30 Michael Koch <konqueror@gmx.de>
* gnu/java/awt/EmbeddedWindow.java
(addNotify): Use AccessController to allow execution of privileged
code.
From-SVN: r85337
Diffstat (limited to 'libjava/gnu')
-rw-r--r-- | libjava/gnu/java/awt/EmbeddedWindow.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libjava/gnu/java/awt/EmbeddedWindow.java b/libjava/gnu/java/awt/EmbeddedWindow.java index 5f1d71a..08bc027 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) |