This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: minor Window fix


I'm checking this in on the trunk.
I've also put it in Classpath.

This changes java.awt.Window to properly compute the warningString.
We still don't do anything with it though.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* java/awt/Window.java (getWarningString): Just return the
	string.
	(Window): Set warningString; check with security manager.

Index: java/awt/Window.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Window.java,v
retrieving revision 1.24
diff -u -r1.24 Window.java
--- java/awt/Window.java 27 Jun 2003 22:18:30 -0000 1.24
+++ java/awt/Window.java 22 Jul 2003 20:59:34 -0000
@@ -145,9 +145,10 @@
     // FIXME: add to owner's "owned window" list
     //owner.owned.add(this); // this should be a weak reference
     
-    /*  FIXME: Security check
-    SecurityManager.checkTopLevelWindow(...)
-    */
+    // FIXME: make this text visible in the window.
+    SecurityManager s = System.getSecurityManager();
+    if (s != null && ! s.checkTopLevelWindow(this))
+      warningString = System.getProperty("awt.appletWarning");
 
     if (gc != null
         && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)
@@ -301,20 +302,7 @@
    */
   public final String getWarningString()
   {
-    boolean secure = true;
-    /* boolean secure = SecurityManager.checkTopLevelWindow(...) */
-
-    if (!secure)
-      {
-        if (warningString != null)
-          return warningString;
-        else
-          {
-            String warning = System.getProperty("awt.appletWarning");
-            return warning;
-          }
-      }
-    return null;
+    return warningString;
   }
 
   /**


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]