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 have a BeanInfo class. Since I renamed the original class the BeanInfo class belonged to, it no longer compiles. Unfortunately the "buggy code" (that needs the base class to be renamed) is protected. So I select that part and right click to select CUSTOMIZE which gives me the ability to edit the text inside the protected field. So far, so good.. The problem is that I get the following exception, and no matter what changes I make they do not take effect in the source-code when I click on DONE. The exception is: Wed Mar 21 23:30:36 EST 2001org.openide.src.SourceException$Protection: org.openide.src.SourceException$Protection: at org.openide.src.SourceException.<init>(SourceException.java:27) at org.openide.src.SourceException.<init>(SourceException.java:21) at org.openide.src.SourceException$Protection.<init>(SourceException.java:53 ) at org.netbeans.modules.java.codegen.ElementBinding$PartialGenerator.run(Ele mentBinding.java:453) at org.netbeans.modules.java.codegen.SourceText$1.run(SourceText.java:216) at org.netbeans.editor.BaseDocument.runAtomicAsUser(BaseDocument.java:764) at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java: 237) at org.openide.text.NbDocument.runAtomicAsUser(NbDocument.java:299) at org.netbeans.modules.java.codegen.SourceText.runAtomic(SourceText.java:22 8) at org.netbeans.modules.java.codegen.ElementBinding.regenerateHeader(Element Binding.java:316) at org.netbeans.modules.java.codegen.FieldB.changeType(FieldB.java:172) at org.netbeans.modules.java.model.FieldElementImpl.setType(FieldElementImpl .java:96) at org.openide.src.FieldElement.setType(FieldElement.java:75) at org.openide.src.nodes.FieldCustomizer$4.run(FieldCustomizer.java:226) at org.openide.src.nodes.SourceEditSupport$3.run(SourceEditSupport.java:311) at org.netbeans.editor.BaseDocument.runAtomicAsUser(BaseDocument.java:764) at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:217) at org.openide.text.NbDocument.runAtomic(NbDocument.java:278) at org.netbeans.modules.java.parser.SourceImplProxy$2.run(SourceImplProxy.ja va:230) at org.netbeans.modules.java.model.DefaultLangModel.runAtomic(DefaultLangMod el.java:430) at org.netbeans.modules.java.parser.SourceImplProxy.runAtomicAsUser(SourceIm plProxy.java:226) at org.openide.src.SourceElement.runAtomicAsUser(SourceElement.java:287) at org.openide.src.nodes.SourceEditSupport.runAsUser(SourceEditSupport.java: 308) at org.openide.src.nodes.FieldCustomizer.jComboBox1ActionPerformed(FieldCust omizer.java:224) at org.openide.src.nodes.FieldCustomizer.access$100(FieldCustomizer.java:37) at org.openide.src.nodes.FieldCustomizer$2.actionPerformed(FieldCustomizer.j ava:157) at javax.swing.JComboBox.fireActionEvent(JComboBox.java:871) at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:895) at javax.swing.JComboBox.contentsChanged(JComboBox.java:947) at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java: 85) at javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.jav a:92) at javax.swing.JComboBox.setSelectedItem(JComboBox.java:415) at org.openide.src.nodes.FieldCustomizer.<init>(FieldCustomizer.java:95) at org.openide.src.nodes.FieldElementNode.getCustomizer(FieldElementNode.jav a:106) at org.netbeans.core.NbNodeOperation.customize(NbNodeOperation.java:90) at org.openide.actions.CustomizeAction.performAction(CustomizeAction.java:34 ) at org.openide.util.actions.NodeAction.performAction(NodeAction.java:92) at org.openide.util.actions.NodeAction.actionPerformed(NodeAction.java:83) at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:76) at org.openide.util.Task.run(Task.java(Compiled Code)) [catch] at org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcessor.ja va(Compiled Code))
Svata, this look to me as possible problem in java module. Can you look at this?
This problem is known for a long time -- until something like Guarded Block proposal is implemented (see java module's website), the customizer does not know whether the element is really editable and what parts can be really changed. Of course, I could provide customizers in Java module overriding the default ones in the openide :-( However, the error should be communicated in more user-friendly way.
Svato, can we somehow fix this one even before we enahnce the guarded blocks?
I am afraid, that we need some support from the BeanInfo generator here.
Target milestone -> 3.3
Reassigning to java module -- the error is reported purposefully (attempt to modify contents of a guarded block), but it should be presented in a more user-friendly way. BTW lowering the prirority: the operation is forbidden on purpose, only the presentation is bad.
The exception is now reported correctly see issue #14465. Problem with customizer still remains see Svata's comment from 03/22/01. Changing to ENHACEMENT.
The code now cannot be customized, so this issue is not valid anymore. See also issue 49294 which should cover refactoring in guarded blocks and issue 28700 which covers guarded blocks removal and could also be related.