This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Jesse's comment from issue #22384: I see that AbstractNode.setPreferredAction was introduced in 3.5 along with a nonfinal getPreferredAction. This is unfortunate (see issue #32744 for some problems it contributes to). Is it too late to delete the setter method before 3.5 is released?
OK. I tried to compile NetBeans 35 and S1S withot setPreferredAction() in the AbstractNode and the bad news is that it is already used. The FilTextType in utilities/search uses it. An then 4 classes in S1S EJB module. Partialy good news is that all of them use it for seting system action and can be rewritten to use setDefaultAction, which probably should be undeprecated again. I'm really not sure whether to do it or not. According to Jarada we anyway need the reflection fix mentioned in issue #32744 to make all Jesses tests passed. In this case it might be better to leave the setPreferredAction in the AbstractNode. Oppinions?
Hmm, I think it's indeed too late to fix this for 3.5. As Hrebejk points out, the method is already used in several modules and changes would need to be made to all of them, if the method was removed. Unless there is a user-observable impact of keeping it around, I don't think it should be fixed now.
> Unless there is a user-observable impact of keeping it around, I > don't think it should be fixed now. this is an API which we'll have to support until the end of time. If we think it's not supportable long time, then we should try our best to remove it now
setDefaultAction can be left deprecated - you need only override getPreferredAction. See issue #22384 for background. The new method *can* be supported indefinitely, I suppose - it just adds to the list of things in the API that should not have been put there to begin with, and that force the code to include extra workarounds. No user impact that I am aware of.
Created attachment 10071 [details] AbstracNode patch - against release35 - should work for trunk as well
Created attachment 10072 [details] Necessary patch for utilities module to make NetBeans compilable
Seems that the final decision is to remove the method in 3.5
Yes, I strongly opt for removing this method from 3.5 as well as trunk version. We should not add new API which we don't feel comfortable with. Petr Nejedly, Yarda (perhaps also Hrebejk) are working on it. Currently ejb and utilities modules are using this new method.
Created attachment 10085 [details] Binary patch to openide.jar
Created attachment 10086 [details] Binary patch to utilities.jar
In main trunk: Checking in openide/src/org/openide/nodes/AbstractNode.java; /cvs/openide/src/org/openide/nodes/AbstractNode.java,v <-- AbstractNode.java new revision: 1.62; previous revision: 1.61 done Processing log script arguments... More commits to come... Checking in utilities/src/org/netbeans/modules/search/types/FullTextType.java; /cvs/utilities/src/org/netbeans/modules/search/types/FullTextType.java,v <-- FullTextType.java new revision: 1.30; previous revision: 1.29 done
I don't agree with the patch in the trunk - it makes setDefaultAction un-deprecated, which we don't want since it uses SystemAction. As I wrote before: "setDefaultAction can be left deprecated - you need only override getPreferredAction. See issue #22384 for background." Suggest that it look more like this: public Action getPreferredAction() { return getDefaultAction(); } private static final Map defaultActions = new WeakHashMap(); /** @deprecated */ public void setDefaultAction(SystemAction a) { synchronized (defaultActions) { defaultActions.put(this, a); } } /** @deprecated */ public SystemAction getDefaultAction() { synchronized (defaultActions) { return (SystemAction)defaultActions.get(this); } } possibly with some extra code in getDefaultAction to delegate to getPreferredAction in case setDefaultAction has not been called and getPreferredAction has been overridden.
I approve the change for 3.5. Jesse's objection about the trunk version still needs to be addressed.
I have deprecated the setDefaultAction and implemented getPreferredAction to correctly work as requested by issue 32744. I'd like to put AbstractNode.java changes into release35. Checking in src/org/openide/nodes/AbstractNode.java; /cvs/openide/src/org/openide/nodes/AbstractNode.java,v <-- AbstractNode.java new revision: 1.63; previous revision: 1.62 done Checking in test/unit/src/org/openide/nodes/NodeTest.java; /cvs/openide/test/unit/src/org/openide/nodes/NodeTest.java,v <-- NodeTest.java new revision: 1.4; previous revision: 1.3 done
In version 3.5: /cvs/openide/src/org/openide/nodes/AbstractNode.java,v <-- AbstractNode.java new revision: 1.60.6.1; previous revision: 1.60 /cvs/utilities/src/org/netbeans/modules/search/types/FullTextType.java,v <-- FullTextType.java new revision: 1.28.4.2; previous revision: 1.28.4.1 done
*** Issue 33205 has been marked as a duplicate of this issue. ***
The commit is wrong. Resulted in a bug 33205.
/cvs/openide/src/org/openide/nodes/AbstractNode.java,v <-- AbstractNode.java new revision: 1.60.6.2; previous revision: 1.60.6.1
fixed long time ago..... ...verified.... reopen if disagree