Re: [Java-gnome-developer] OptionMenu events etc..
Brought to you by:
afcowie
From: Jonas B. <jb...@ni...> - 2003-10-07 22:12:42
|
On Tue, 7 Oct 2003 17:27:04 +0100, Mark Howard <mh...@ca...> wrote: > Looks good apart from one mistake: > + public boolean isOfType(OptionMenuEvent.Type type){ > + return (type.getID() =3D=3D type.getID()); > + } Oh gosh.. I originally worked on the 0.8.0 source and then switched over=20 to making the patches compatible with cvs.. in 0.8.0 the code was=20 this.type.getID() =3D=3D type.getID() and in cvs, at first glance, it loo= ked=20 like the "this" had just been removed (didn't really look into what it wa= s=20 doing, even if it was that simple).. So I removed the "this" in front and= =20 though "great, now it looks like the others", but then again, not.. Very=20 nice catch there, sorry that it slipped.. I'll try to be more careful in=20 the future. > My quick search shows that the other classes look ok. If you copied thi= s > code, could you please check this. I checked the other classes (while pondering on how that could have=20 slipped) and they seemed ok.. Some classes had slightly differing naming=20 convetions there (calling the method argument test instead of aType), but= =20 otherwise the same. > I've fixed and applied to cvs. Cool =3D) > Fell free to write more patches :) I do. =3D) And some test code also.. I put a textview test already there,= =20 looks like a tricky one (unless my test is faulty somehow).. But I can=20 make the java process grow just as well by "just" creating 100000 (or som= e=20 insane number) labels and then letting the garbage collector pick them=20 up.. Even if I call Widget.destroy() on them, the native code seems to=20 keep memory references somewhere.. I haven't tested any other components=20 yet, or even looked at how the objects are handled in the native code par= t=20 of java-gnome.. Generally I don't know how to handle data allocated by native code when=20 the object gets garbage collected.. is the only way to implement a native= =20 void finalize() method that is then called when the object is garbage=20 collected, or is there a better way? I have heard implementing finalize()= =20 methods in classes slows down execution, so hopefully there's some other=20 way to do it without the performance degradation.. Do you in general have plans to write some unit testing or similar on the= =20 components? JUnit could be one way, but with java-gnome, it's quite easy=20 to pull together even the simplest test application, in fact so easy that= =20 i find myself rather writing a gui for it than some text output =3D) > (BTW: I also applied the previous patch; forget to say that in the repl= y > email). Nice nice.. Your comment regarding putting an comment there (and maybe a=20 commented out method body for easier grepping).. I agree, that would have= =20 been better. - xkr47 |