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 10565 - Cannot customize protected code which is buggy
Summary: Cannot customize protected code which is buggy
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC OS/2
: P4 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-03-22 04:32 UTC by _ gtzabari
Modified: 2007-09-26 09:14 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2001-03-22 04:32:12 UTC
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))
Comment 1 Jan Lahoda 2001-03-22 08:41:51 UTC
Svata, this look to me as possible problem in java module. Can you look at this?
Comment 2 Svata Dedic 2001-03-22 10:20:12 UTC
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.
Comment 3 Miloslav Metelka 2001-03-31 01:01:59 UTC
Svato, can we somehow fix this one even before we enahnce the guarded blocks?
Comment 4 Svata Dedic 2001-03-31 07:29:07 UTC
I am afraid, that we need some support from the BeanInfo generator here. 
Comment 5 Jan Chalupa 2001-05-05 21:57:36 UTC
Target milestone -> 3.3
Comment 6 Svata Dedic 2001-05-11 14:23:39 UTC
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.
Comment 7 Tomas Hurka 2001-08-23 11:00:05 UTC
 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.
Comment 8 Martin Matula 2004-11-14 00:06:13 UTC
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.