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.
[dev nov 15] I opened the bean browser on the MemoryView pseudo-action (from Toolbars | Memory), browsed to instance of MemoryViewAction, down to its toolbar presenter, and immediately this exception appeared twice. (I was not attempting to set any value, just selected the node.)
Created attachment 3437 [details] Stack trace
Hello, I am marking this as invalid for now - please reopen after explaining. This is what I did: 1. clean build from trunk with apisupport module 2. Tools --> Options --> IDE Configuration --> Look and Feel --> Toolbars --> Memory --- no MemoryViewAction, just MemoryMeter 3. tried MemoryMeter --> Tools --> Bean Browse --> Bean Browse Node 4. Found toolbar presenter and displayed properties -- no problem I need to know the node/bean and the property in order to find whether the property (beaninfo) is ok or whether the problem is on PropertyPanel's side. Thanks for additional info.
That's my point, I guess--I have no idea what property is at fault. (It is quite possible something in apisupport is really to blame, but what?) The exception message does not include any useful details as to what bean is involved, what property it is working on, what the type of the property is, etc. It's not even clear if the stack trace here is at all meaningful, or if the real error occurred before and this is just a SwingUtilities.invokeLater.
The property name is there ("component"). The node is the node selected in the moment the exception poped up in the exception dialog (if it was reported by the dialog).
I see. Confusing exception message (I thought "array component" was one phrase; no?). I will try to track it down in apisupport and maybe improve the exception message to be clearer as well.
Target milestone -> 3.3.1.
Found a different case, no apisupport. Mount release33 core/src/ and compile it. Select org/netbeans/core/ui/IDESettingsPanel.java and choose Customize Bean. Dialog appears with the property sheet and this exception is thrown immediately (though properties still seem to appear OK). In this case there are r/o props Component getComponent(), Component[] getComponents(), int getComponentCount() visible.
Created attachment 3801 [details] Exception thrown when customizing IDESettingsPanel
The problem is that Introspector returns IndexedPropertyDescriptor for property called component. Try this (or similar) java.beans.BeanInfo y = java.beans.Introspector.getBeanInfo(org.netbeans.core.ui.IDESettingsPanel.class); java.beans.PropertyDescriptor[] p = y.getPropertyDescriptors(); for (int i = 0; i < p.length; i++) { if (p[i] instanceof java.beans.IndexedPropertyDescriptor) { System.out.println(p[i].getReadMethod() + " " + p[i].getWriteMethod()); } } to find out what the introspector thinks about the bean. What should I do? I expect that if something has IndexedPropertyDescriptor then its getter returns an array. If this is not true - the exception is shown. Should I make it notified as informational? I don't have anything better. Any suggestions welcomed.
Created attachment 3814 [details] Test class (internal exec)
You're right, the problem is with the 'component' property. public class Container { public Component getComponentAt(int index); } public class IDESettingsPanel extends ... Container { public Component getComponent(); } Introspector creates an indexed property here. It *correctly* sets the indexed property type and getter from Container. However it *also* adds a bogus property type Container and getter from IDESettingsPanel, accessible from the PropDesc methods. Logically these should be separate properties since they have unrelated accessors; of course only one property with a given name can exist on a bean so IMHO Introspector should discard the info from Container and make a plain PropDesc (not IndexedPropDesc) 'component' based on IDESP. Do you want to file it in Bugtraq or should I? Possible workaround: discard any IndexedPropertyDescriptor's from a model whose plain (not indexed) type is not in fact an array type; don't wait for them to be used in a getter, just throw them out. Or perhaps this workaround could be placed on BeanNode instead of in the property sheet, since BeanNode is responsible for calling the introspection to begin with and should handle its ill effects.
Please file it for the JDK team and I will fix BeanNode tomorow.
Fixed in BeanNode 1.46.32.1 (release33 branch).
Filed on JDC, will attach link when it is made public.
Resolved for 3.4.x or earlier, no new info since then -> verified
Resolved for 3.4.x or earlier, no new info since then -> closing.