jCVS-4.7.5 - almost success!
Pavel Roskin
pavel_roskin at geocities.com
Thu Apr 8 03:34:49 PDT 1999
Hello!
I've managed to run jCVS-4.7.5 under latest Kaffe. Attached patch is
necessary to prevent crashes.
Without this patch following happens:
java.lang.NullPointerException
at java.awt.GridBagLayout.getCellDims(GridBagLayout.java:217)
at
java.awt.GridBagLayout.preferredLayoutSize(GridBagLayout.java:602)
at java.awt.Container.preferredSize(Container.java:464)
at java.awt.Container.getPreferredSize(Container.java:302)
at java.awt.GridBagLayout.getCellDims(GridBagLayout.java:203)
at
java.awt.GridBagLayout.preferredLayoutSize(GridBagLayout.java:602)
at java.awt.Container.preferredSize(Container.java:464)
at java.awt.Container.getPreferredSize(Container.java:302)
at java.awt.GridBagLayout.getCellDims(GridBagLayout.java:203)
at
java.awt.GridBagLayout.preferredLayoutSize(GridBagLayout.java:602)
at java.awt.Container.preferredSize(Container.java:464)
at java.awt.Frame.preferredSize(Frame.java:176)
at java.awt.Dialog.preferredSize(Dialog.java:84)
at java.awt.Container.getPreferredSize(Container.java:302)
at java.awt.Window.addNotify(Window.java:75)
at java.awt.Window.pack(Window.java:189)
at com.ice.jcvs.CVSExportDialog.<init>(CVSExportDialog.java:77)
at com.ice.jcvs.CVSApplet.performExport(CVSApplet.java:283)
at
com.ice.jcvs.CVSAppletFrame.actionPerformed(CVSAppletFrame.java:110)
at java.awt.MenuItem.processActionEvent(MenuItem.java:191)
at java.awt.ActionEvt.dispatch(ActionEvt.java:18)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:39)
Explanation:
1) com.ice.jcvs.CVSLabel calculates its dimensions when it gets
addNotify()
2) Before that it returns null on getPreferredSize()
3) This causes the crash
4) If java.awt.Window.addNotify() calls super.addNotify() before
getPreferredSize() everything is Ok.
There are still other minor visual problems and crashes at the later
stages in jCVS.
Pavel Roskin
-------------- next part --------------
Index: libraries/javalib/java/awt/Window.java
===================================================================
RCS file: /home/cvspublic/kaffe/libraries/javalib/java/awt/Window.java,v
retrieving revision 1.8
diff -u -r1.8 Window.java
--- Window.java 1999/03/24 01:14:39 1.8
+++ Window.java 1999/04/08 11:34:14
@@ -69,10 +69,6 @@
// if we have an owner that has not been created yet, do it now
if ( (owner != null) && (owner.nativeData == null) )
owner.addNotify();
-
- // defer size setting as much as possible
- if ( (width == 0) || (height == 0) )
- setSize( getPreferredSize());
if ( (nativeData = createNativeWindow()) == null )
throw new AWTError( "native create failed: " + this);
@@ -80,6 +76,10 @@
AWTEvent.registerSource( this, nativeData);
super.addNotify();
+
+ // defer size setting as much as possible
+ if ( (width == 0) || (height == 0) )
+ setSize( getPreferredSize());
}
}
}
More information about the kaffe
mailing list