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.

Bug 24911 - .instance without "instanceClass" does not work
Summary: .instance without "instanceClass" does not work
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-18 14:52 UTC by David Konecny
Modified: 2008-12-22 20:33 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2002-06-18 14:52:20 UTC
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.
Comment 1 _ ttran 2002-06-19 09:06:51 UTC
I have the feeling that for purpose of Lookup instanceClass is mandatory.
Comment 2 Jan Pokorsky 2002-06-19 14:17:17 UTC
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.
Comment 3 Jesse Glick 2002-06-19 17:49:31 UTC
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.
Comment 4 Jan Pokorsky 2002-06-20 22:56:51 UTC
Agreed. Fixed in

org/openide/loaders/InstanceDataObject.java, 1.130
Comment 5 David Konecny 2002-06-24 10:24:11 UTC
Works fine now. Thanx!
Comment 6 Quality Engineering 2003-07-01 16:10:45 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.