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.
Please remove the hacks in GroupShadow which forcibly add a template wizard iterator to .group files when they are templates. Replace this with an addition of GroupTemplateIterator (a default instance, e.g.) to the cookie set of every GroupShadow. See issue #8858 for details of the API change. Also please grep through NB sources and look for .group templates which specify the iterator as a file attribute, and either remove this attribute yourself or file a task in IZ to have it removed by the module owner. Marking this P2 because this API change was designed with the group loader in mind as a key example, and the current code causes undesirable problems for the API Support when editing layers - template iterator attributes appear unrequested in layers and make them modified mysteriously, for example.
Could I ask you for a patches? Thanks.
Created attachment 5771 [details] Possible patch
The attached patch is totally untested (did not even check compilability) but should give you the basic idea. You also need to depend on IDE/1 > 2.13 in your manifest. I also tried to correct a logic bug in getCookie: if someone asks for CompilerCookie.Foo.class (where Foo is some weird subinterface they made themselves), you do *not* want to give them a GroupShadowCompiler, since it will not be assignable to that cookie class. Besides the patch to GroupShadow.java and the manifest, also recommend removing the attr from all .group templates in the NB source base, or filing TASKs for module owners to do so. E.g. rmi and apisupport modules use this kind of template heavily. You don't have to include the attr in the layer, but if you don't, things (.nbattrs) will be written to the userdir when the template folder is first expanded, which is ugly.
Jesse, is this change functionally backward compatible -- i.e. can I apply your patch in one step (and everything still work) and after that module owners can change their code? Thanks.
As far as I know, yes. The new behavior of TW.getIterator is to check for the cookie first, then the file attr if the cookie is missing. So with the proposed patch, the file attr templateWizardIterator on *.group files would just be ignored if present.
Applied your patch. I know nothing about groups and I do not know what should I recommend to other modules to do. For that reason I would like to ask you to file enhancements against such modules. Thanks for understanding.
OK, I will do that. I guess the code is original mryzl's. Thanks.