On Sat, 2004-04-24 at 18:52, Grzegorz B. Prokopski wrote:
> Hi all,
> 
> We've just imported fresh GNU CP as of Fri Apr 23 and running SymbolTest
> program, that previously worked nicely, as documented ex. at
> http://www.sablevm.org/screenshots , now gives this:
> 
> $ ~/work/bin/java-sablevm SymbolTest 
> (:19347): Gtk-CRITICAL **: file gtkwidget.c: line 4248
>   (gtk_widget_modify_fg): assertion `GTK_IS_WIDGET (widget)' failed
> (:19347): Gtk-CRITICAL **: file gtkwidget.c: line 4248
>   (gtk_widget_modify_fg): assertion `GTK_IS_WIDGET (widget)' failed
> (:19347): Gtk-CRITICAL **: file gtkwidget.c: line 4248
>   (gtk_widget_modify_fg): assertion `GTK_IS_WIDGET (widget)' failed
>  java.lang.NullPointerException
>     at java.applet.Applet.getDimensions (Applet.java:469)
>     at java.applet.Applet.preferredSize (Applet.java:486)
>     at java.awt.Container.getPreferredSize (Container.java:576)
>     at java.awt.BorderLayout.calcCompSize (BorderLayout.java:647)
>     at java.awt.BorderLayout.calcSize (BorderLayout.java:692)
>     at java.awt.BorderLayout.preferredLayoutSize (BorderLayout.java:454)
>     at java.awt.Container.preferredSize (Container.java:589)
>     at java.awt.Container.getPreferredSize (Container.java:576)
>     at java.awt.Window.pack (Window.java:206)
>     at SymbolTest.main (SymbolTest.java:100)
>     at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)
>     at java.lang.VirtualMachine.main (VirtualMachine.java:88)
> 

I recently changed size reporting in Applet.java.  I made applets report
their preferred size as the width and height attributes given in the
applet tag.  However, the current code assumes that an applet stub is
present that can be queried for these attributes.  The NPE you're seeing
is likely caused by the stub not having been set.

The attached patch should fix the problem, though I haven't tested it. 
Can you try it out?

Thanks,
Tom

Index: java/applet/Applet.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/applet/Applet.java,v
retrieving revision 1.3.36.3
diff -u -r1.3.36.3 Applet.java
--- java/applet/Applet.java	16 Mar 2004 04:43:35 -0000	1.3.36.3
+++ java/applet/Applet.java	28 Apr 2004 16:35:36 -0000
@@ -483,7 +483,7 @@
    */
   public Dimension preferredSize()
   {
-    return getDimensions ();
+    return stub == null ? super.preferredSize () : getDimensions ();
   }
 
   /**
@@ -494,7 +494,7 @@
    */
   public Dimension minimumSize()
   {
-    return getDimensions ();
+    return stub == null ? super.minimumSize () : getDimensions ();
   }
 
   /**
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to