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 111414

Summary: IllegalStateException editing component id in jsp
Product: obsolete Reporter: _ krystyna <krystyna>
Component: visualwebAssignee: _ sandipchitale <sandipchitale>
Status: STARTED ---    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description _ krystyna 2007-07-31 00:10:17 UTC
NB build 7270000
XP
JDK1.5.0_12

Reproduced
1. clean userdir, create ee5 project
2. drop 2 textfields. Switch to .jsp file and edit id for textField2 -> textXXX
3. switch back to designer
4. swtich back to jsp to reinstate id of textField2
>each time backspace is pressed to erase "XXX", get IllegalArgumentException and you have to press Close on
the dialog; and then each character addition will throw IAE with slightly different stack.

In 5.5.1, after step 3, switching back to .jsp, textField2 would be resinstated by insync.


java.lang.IllegalStateException: Illegal source modification with dirty model C:\Documents and Settings\Krystyna 
Polomski\My Documents\NetBeansProjects\WebApplication153\web\Page1.jsp
        at org.netbeans.modules.visualweb.insync.SourceUnit.setSourceDirty(SourceUnit.java:258)
        at org.netbeans.modules.visualweb.insync.SourceUnit.removeUpdate(SourceUnit.java:342)
        at org.netbeans.lib.editor.util.swing.PriorityDocumentListenerList.removeUpdate
(PriorityDocumentListenerList.java:63)
        at javax.swing.text.AbstractDocument.fireRemoveUpdate(AbstractDocument.java:242)
        at org.netbeans.editor.BaseDocument.fireRemoveUpdate(BaseDocument.java:1345)
        at org.netbeans.editor.BaseDocument.remove(BaseDocument.java:742)
        at org.netbeans.editor.BaseKit$DeleteCharAction.actionPerformed(BaseKit.java:1429)
        at org.netbeans.modules.web.core.syntax.JSPKit$JspDeleteCharAction.actionPerformed(JSPKit.java:548)
        at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:266)
        at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1571)
        at javax.swing.JComponent.processKeyBinding(JComponent.java:2772)
        at javax.swing.JComponent.processKeyBindings(JComponent.java:2807)
        at javax.swing.JComponent.processKeyEvent(JComponent.java:2735)
        at java.awt.Component.processEvent(Component.java:5294)
        at java.awt.Container.processEvent(Container.java:1966)
        at java.awt.Component.dispatchEventImpl(Component.java:3984)
        at java.awt.Container.dispatchEventImpl(Container.java:2024)
        at java.awt.Component.dispatchEvent(Component.java:3819)
        at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1826)
        at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:681)
        at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:938)
        at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:810)
        at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:645)
        at java.awt.Component.dispatchEventImpl(Component.java:3857)
        at java.awt.Container.dispatchEventImpl(Container.java:2024)
        at java.awt.Window.dispatchEventImpl(Window.java:1791)
        at java.awt.Component.dispatchEvent(Component.java:3819)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
[catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 _ sandipchitale 2007-08-03 06:41:25 UTC
Insync expects that the id of the component tag matched the property name.

In fact in the method:

void org.netbeans.modules.visualweb.insync.faces.FacesBean.setBindingProperties()

this is enforced. So when the id is changed in JSP but is not in Java, the id is forced to be the name of the property 
in backing bean. This cause a DOM modification event on JSP. This makes the model dirty. Then when the user switches 
to JSP source again and tries to correct the id the reported IAE happens.

The workaround is to rename the id in the PropertySheet after selecting the component in the Designer. Reducing to P3 
as there is a workaround.
Comment 2 _ sandipchitale 2007-10-28 02:56:07 UTC
As such the changing of id in JSP is not supported. See: 117711 also.

So I am going to reduce the priority on this one. We can talk about it if you like.