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 3964 - JavaInstanceSupport improperly provides an InstanceCookie for an uncompiled source.
Summary: JavaInstanceSupport improperly provides an InstanceCookie for an uncompiled s...
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P4 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-09-22 18:41 UTC by Jesse Glick
Modified: 2008-12-23 11:38 UTC (History)
0 users

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 Jesse Glick 1999-09-22 18:41:36 UTC
If you create a new source file from template but do not compile it, then ask for an InstanceCookie from the JavaDataObject, you will get one. Attempting to call e.g. instanceClass() throws a ClassN
otFoundException, however. This means that you cannot safely ask for an InstanceCookie and expect to get it only when appropriate.

It would be nice if the instance support tried to compile the class if it needed to before trying to load it. However, this could cause the cookie methods to block waiting for the compiler, which woul
d be bad for threading. So, probably the InstanceSupport should only be enabled on the JavaDataObject when there is a class file present.

Example test of this: create a class from template, do not compile, and immediately select Customize Bean. A ClassNotFoundException will be thrown. If the instance support were correctly disabled, thi
s menu item would not appear until it had been compiled.


[jglick] Also, the instance cookie should only be enabled if the class has a public default constructor.
Comment 1 Marek Grummich 2000-07-25 09:23:59 UTC
Priority is changed to P4 (normal).
Comment 2 Quality Engineering 2003-07-02 14:56:50 UTC
Resolved for 3.4.x or earlier, no new info since then -> verify.
Comment 3 Quality Engineering 2003-07-02 15:14:12 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.