On 04.09.2011 14:10, Michaël Michaud wrote: > Hi Ede, > >>> I thought I would get no problem with the change you did in >>> FeatureInstaller, because return type is not part of method signature, >> is it not? :) > At least it's how I understand this paragraph of JSL : > http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.2 > > But after I read this one, I'm not so sure... > http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.5
the drawback of a completely typed language i guess >> we should workaround that issue, let's revert the change and offer (if we do >> not already) a getMenuItem method for the same purpose. I know we use it >> already internally in the FeatureInstaller. > There is a getMenuItem in a internal class of FeatureInstaller (a > strange beast which does not seem to be used in the whole OpenJUMP > codebase). > Have you got an idea how to implement a generic getMenuItem : searching > through the menu tree, or keeping a map of all menu items somewhere ? > Would you take the PlugIn or the menu path as argument ? oh i mistook it, i did that for geometry converter, check http://jump-pilot.svn.sourceforge.net/viewvc/jump-pilot/plug-ins/de.soldin.jump/trunk/src/de/soldin/jump/geomconv/GCPlugin.java?revision=2354&view=markup getSubMenu() >> OR >> >> create a new set of e.g. create(Main|Popup)MenuItem set with the proper >> return type and declare the old addMenuItem methods deprecated. > I think it makes sense if, at the same time, we change all the calls of > the core library to use the new methods. Let's start with the first > option. Before moving to the second option, I think there may be more > refactoring to do. if we could boil down the different addTo(Main,LayerView,Popup)Menu methods to one generic maybe prefixed with an underscore signaling the private nature _createMenuItem( JMenu ...) and redirect the public methods accordingly. after that we do the deprecation tagging and add the public create* methods. et voila :) would you be willing to cook down the three addToMainMenu methods into one, i see some came from you? ..ede ------------------------------------------------------------------------------ Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsisghtdev2dev _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel