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.
I defined instance following way: <file name="natures.instance"> <attr name="instanceCreate" methodvalue="o.n.api.p.wizards.WS.createNaturesIterator"/> <attr name="instanceOf" stringvalue="org.netbeans.WizardDescriptor$Iterator"/> </file> but it does not work. The instanceClass attribute is missing and therefore the "natures ClassNotFound" exception is thrown.
I have the feeling that for purpose of Lookup instanceClass is mandatory.
I think the issue is more an enhancement than a defect. In previous releases the instanceClass was always mandatory either as an file attribute or a filename part. For the Lookup it could be sufficient to define an instance using following attributes: 1. instanceCreate + instanceOf 2. instanceClass + instanceOf If you omit instanceOf it can also work but it will have a performance impact. A class would have to be loaded or instance would have to be created to allow to detect the instance type.
I guess it could be considered an enhancement, but I think it is clearly counterintuitive that you need to supply an instanceClass attribute when Lookup does not really care about the implementation class as such. I.e. InstanceCookie.instanceClass(), if it is ever called (and it is not likely for most instance files) can be easily derived from other information.
Agreed. Fixed in org/openide/loaders/InstanceDataObject.java, 1.130
Works fine now. Thanx!
Resolved for 3.4.x or earlier, no new info since then -> closing.