anathema/anathema — Issue #45: Change an item statistics' name without errors
Author: UrsKR
Created: 2012-02-07 12:01:53+00:00
State: open
Labels: Bug

@the-smith reports:
"there's problems in the older equipment areas (Close Combat,
Ranged, Armor, Shield). The first problem is that Anathema puts in
the type of item as it's name and resists the users changing that by
popping up a message that says "Please enter a name for this set of
statistics" while you attempt to give it a name (causing your typing
cursor to move to a different spot in the letters you're typing).
This message appears and disappears as you add letters to the name."

I get

```
java.lang.IllegalStateException: Attempt to mutate in notification
at javax.swing.text.AbstractDocument.writeLock(Unknown Source)
at javax.swing.text.AbstractDocument.replace(Unknown Source)
at javax.swing.text.JTextComponent.setText(Unknown Source)
at net.sf.anathema.lib.workflow.textualdescription.view.TextView.setText(TextView.java:32)
at net.sf.anathema.lib.workflow.textualdescription.TextualPresentation$2.valueChanged(TextualPresentation.java:16)
at net.sf.anathema.lib.workflow.textualdescription.TextualPresentation$2.valueChanged(TextualPresentation.java:14)
at net.sf.anathema.lib.control.objectvalue.ObjectValueControl.fireValueChangedEvent(ObjectValueControl.java:21)
at net.sf.anathema.lib.workflow.textualdescription.model.SimpleTextualDescription.fireChangedEvent(SimpleTextualDescription.java:36)
at net.sf.anathema.lib.workflow.textualdescription.model.AbstractTextualDescription.setDirty(AbstractTextualDescription.java:15)
at net.sf.anathema.lib.workflow.textualdescription.model.SimpleTextualDescription.setText(SimpleTextualDescription.java:31)
at net.sf.anathema.lib.workflow.textualdescription.TextualPresentation$1.valueChanged(TextualPresentation.java:10)
at net.sf.anathema.lib.workflow.textualdescription.TextualPresentation$1.valueChanged(TextualPresentation.java:8)
at net.sf.anathema.lib.workflow.textualdescription.view.TextView$1.updateText(TextView.java:40)
at net.sf.anathema.lib.gui.event.AbstractDocumentListener.removeUpdate(AbstractDocumentListener.java:13)
at javax.swing.text.AbstractDocument.fireRemoveUpdate(Unknown Source)
at javax.swing.text.AbstractDocument.handleRemove(Unknown Source)
at javax.swing.text.AbstractDocument.remove(Unknown Source)
at javax.swing.text.AbstractDocument.replace(Unknown Source)
at javax.swing.text.JTextComponent.setText(Unknown Source)
at net.sf.anathema.lib.workflow.textualdescription.view.TextView.setText(TextView.java:32)
at net.sf.anathema.lib.workflow.textualdescription.TextualPresentation$2.valueChanged(TextualPresentation.java:16)
at net.sf.anathema.lib.workflow.textualdescription.TextualPresentation$2.valueChanged(TextualPresentation.java:14)
at net.sf.anathema.lib.control.objectvalue.ObjectValueControl.fireValueChangedEvent(ObjectValueControl.java:21)
at net.sf.anathema.lib.workflow.textualdescription.model.SimpleTextualDescription.fireChangedEvent(SimpleTextualDescription.java:36)
at net.sf.anathema.lib.workflow.textualdescription.model.AbstractTextualDescription.setDirty(AbstractTextualDescription.java:15)
at net.sf.anathema.lib.workflow.textualdescription.model.SimpleTextualDescription.setText(SimpleTextualDescription.java:31)
at net.sf.anathema.lib.workflow.textualdescription.TextualPresentation$1.valueChanged(TextualPresentation.java:10)
at net.sf.anathema.lib.workflow.textualdescription.TextualPresentation$1.valueChanged(TextualPresentation.java:8)
at net.sf.anathema.lib.workflow.textualdescription.view.TextView$1.updateText(TextView.java:40)
at net.sf.anathema.lib.gui.event.AbstractDocumentListener.insertUpdate(AbstractDocumentListener.java:9)
at javax.swing.text.AbstractDocument.fireInsertUpdate(Unknown Source)
at javax.swing.text.AbstractDocument.handleInsertString(Unknown Source)
at javax.swing.text.AbstractDocument.insertString(Unknown Source)
at javax.swing.text.PlainDocument.insertString(Unknown Source)
at javax.swing.text.AbstractDocument.replace(Unknown Source)
at javax.swing.text.JTextComponent.replaceSelection(Unknown Source)
at javax.swing.text.DefaultEditorKit$DefaultKeyTypedAction.actionPerformed(Unknown Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.WaitDispatchSupport$2.run(Unknown Source)
at java.awt.WaitDispatchSupport$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(Unknown Source)
at java.awt.Dialog.show(Unknown Source)
at net.disy.commons.swing.dialog.core.SwingDialog.show(SwingDialog.java:101)
at net.disy.commons.swing.dialog.wizard.WizardDialog.show(WizardDialog.java:250)
at net.sf.anathema.character.equipment.impl.item.model.EquipmentStatsCreationFactory.runDialog(EquipmentStatsCreationFactory.java:88)
at net.sf.anathema.character.equipment.impl.item.model.EquipmentStatsCreationFactory.createNewStats(EquipmentStatsCreationFactory.java:65)
at net.sf.anathema.character.equipment.item.AddNewStatsAction.execute(AddNewStatsAction.java:55)
at net.disy.commons.swing.action.SmartAction.actionPerformed(SmartAction.java:66)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)```