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 39891 - [36cat] Broken source hierarchy customizers
Summary: [36cat] Broken source hierarchy customizers
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: REGRESSION
: 39233 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-10 15:21 UTC by deadpoet
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The exception that should be thrown (4.80 KB, text/plain)
2004-02-10 17:12 UTC, Miloslav Metelka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description deadpoet 2004-02-10 15:21:33 UTC
[ JDK VERSION : J2SE 1.4.2_02 ]

Customizing a class creates an ArrayIndexOutOfBound 
Exception.

To duplicate the error, follow the steps below
- In the text editor, select any part within the class
- from the popup menu, select Customize
- In the Interface Box within the Customizer Dialog select Edit 
button - the above exception appears
Comment 1 psuk 2004-02-10 17:10:54 UTC
The same happens for Methods.
If there is no item in the listbox, the onlu Add button should be enabled.
Comment 2 Miloslav Metelka 2004-02-10 17:12:43 UTC
Created attachment 13355 [details]
The exception that should be thrown
Comment 3 Jan Pokorsky 2004-02-10 18:55:15 UTC
The class customizer is not initialized properly. The edit button
should be disabled.
Comment 4 Jan Pokorsky 2004-02-10 20:29:44 UTC
Aha, I have found out the culprit. The properties infrastructure
forces all components of the custom editor to set the enable property
to true.  Issue #38065 describes a workaround how to fix it so I try
to follow it.
Comment 5 _ tboudreau 2004-02-10 23:03:35 UTC
I can try to make it less aggressive, but AFAIK this code was written by David Strupl 
sometime around 3.3, and the only thing I did was copy it.

I think I just fixed your bug - I've changed PropertyPanel to be less agressive, and not sync
the embedded component's state unless it's been disabled on initialization.

Leaving the "dontEnableMe" hack in, since this has been broken for a long time and at 
least that provides a workaround.   But now, unless you disable your whole PropertyPanel, 
you'll never encounter the problem.
Comment 6 Jan Pokorsky 2004-02-11 15:44:08 UTC
Tim, your fix resolved problem with the array editor. The modifier
editor is still broken. I am investigating what's still wrong.
Comment 7 Jan Pokorsky 2004-02-11 16:19:48 UTC
Huh, I got it. It relates to PropertyPanel.getPropertyEditor(). As you
noted in javadoc it does not cache the supplied editor now. So the
class customizer customizes the obtained editor instance which is
thrown out a while later.

If you do not consider it as a broken compatibility then it looks like
a perfect candidate for the upgrade guide IMHO.
Comment 8 _ tboudreau 2004-02-11 17:49:44 UTC
Yes, I'll document it in the upgrade guide.  

Along with that change, by default, Node now keeps a SoftReference to the property editor 
it  returns from getPropertyEditor()  (which means most uses of PropertyPanel aren't 
affected).  Easiest way to solve it is just to do the same thing as in Node.  Sorry for the 
difficulties.
Comment 9 Jan Pokorsky 2004-02-11 20:02:40 UTC
I have a working patch. I had to migrate the model from
ExPropertyModel to Node.Property (PropertySupport.Reflection).
Otherwise I cannot cache the editor.

FYI, it is not Node but Node.Property who caches the editor.
Surprisingly PropertySupport.Reflection.getPropertyEditor() breakes
that feature and with respect to propertyEditorClass value either
caches the editor or not. It is quite inconsistent.
Comment 10 Jan Pokorsky 2004-02-11 21:12:12 UTC
fixed

/cvs/java/srcmodel/src/org/openide/src/nodes/ClassCustomizer.java,v1.4
/cvs/java/srcmodel/src/org/openide/src/nodes/ElementBeanModel.java,v1.5
/cvs/java/srcmodel/src/org/openide/src/nodes/FieldCustomizer.java,v1.3
/cvs/java/srcmodel/src/org/openide/src/nodes/MethodCustomizer.java,v1.6  
Comment 11 Jan Pokorsky 2004-02-11 21:23:33 UTC
*** Issue 39233 has been marked as a duplicate of this issue. ***
Comment 12 _ tboudreau 2004-02-11 23:06:34 UTC
Well, migrating away from PropertyModel is a good thing - the propertypanel would simply 
generate an instance of PropertySupport.Reflection or a Node.Property wrapper anyway, so 
it's actually more efficient.  Hopefully for Promo-D we can inject a little sanity in our APIs 
for this -deprecate propertymodel, and come up with a reasonable interface to implement 
over Node.Property and clear up some of the general junk.  For this release, well, it ain't 
pretty (it never was) but it works...
Comment 13 ehucka 2004-02-19 15:07:42 UTC
Verified.
Comment 14 Quality Engineering 2007-09-20 09:58:51 UTC
Reorganization of java component