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.
After 0081ad9a40cf, ValidateLayerConsistencyTest.testLayerOverrides began failing due to Editors/Actions/build-*.instance which are provided by both editor and editor.lib. Is this really intentional? If not, remove the two @EditorActionRegistration's from editor.lib. If it is intentional (e.g. so that the actions will be defined in an app including editor.lib but not editor), please consider adding an 'int weight() default 0' to EditorActionRegistration producing a 'weight' file attribute (see bug #141925) when defined, so that the editor version can clearly override the editor.lib version without considering layer load order. Or the annotation processor could hardcode the weight attribute in this case; or even figure out that the registration in editor was an override based on the fact that NbBuildPopupMenuAction extends BuildPopupMenuAction and the superclass is also annotated with the same key.
174a04b221c1 is the current workaround in the test, by the way.
I'll add the weight attribute into the @EditorActionRegistration. Thanks.
Do not forget to revert 174a04b221c1 when fixing.
Created attachment 113170 [details] Proposed diff
Diff adds the weight attribute to @EditorActionRegistration. I have reverted 174a04b221c1 and uncommented NbBuildPopupAction in NbEditorKit and the test failed. After adding weight attribute the test passed. Jesse, are there any guidelines for the weight attribute values? I have used weight = 100 in NbEditorKit. Since EditorActionRegistration is API I request a fasttrack review. Thanks.
[JG01] Typo "ommited" [JG02] Do not link to "http://bits.netbeans.org/6.9/javadoc/". Use "@TOP@/" instead. But anyway there is no need to link to apichanges because the mechanism is covered in Javadoc proper; use {@link org.openide.filesystems.MultiFileSystem}. [JG03] Check build-popup-menu.instance which suffered from the same problem, at least when I worked around it in ValidateLayerConsistencyTest. (In reply to comment #5) > are there any guidelines for the weight attribute values? Nothing in particular, this patch looks OK to me.
Thanks, Jesse. http://hg.netbeans.org/jet-main/rev/4dbcb49c751c
One minor thing I forgot to mention before: [JG04] The natural default value for weight is 0, not MIN_VALUE: you can make files "recessive" by giving them negative weights just as they can be "dominant" with positive weights, and <attr name="weight" intvalue="0"/> is a no-op. Thus I would recommend int weight() default 0; and having the processor check if (weight != 0) ...
default weight is now 0. Thanks. http://hg.netbeans.org/jet-main/rev/942e801cbb4f
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/4dbcb49c751c User: Miloslav Metelka <mmetelka@netbeans.org> Log: #199823 - @EditorActionRegistration in editor module overrides registrations from editor.lib w/o weight attr.