Open cxbrooks opened 14 years ago
Hauke reports:
Another similar bug:
You will get the stack trace below.
I modified ptolemy.kernel.undo.UndoStackAttribute and added the following to the c'tor:
_debugging = true;
Note that this causes messages like:
"Warning, _debugListeners was null, which means that _debugging was set to
true, but no listeners were added?"
to appear. I removed those messages in the output below.
I also modified MoMLChangeRequest and set _DEBUG to true.
Below is a complete run that shows what is on the debug stack. My comments start with ####. It is easiest to start at the bottom and work up
bash-3.2$ $PTII/bin/vergil ** Executing MoML change:
------ in context .
=======> Pushing action onto undo stack:
...in context: .
======= Clearing redo stack.
** Executing MoML change:
------ in context .
=======> Pushing action onto undo stack:
...in context: .
======= Clearing redo stack.
** Executing MoML change:
------ in context .
=======> Pushing action onto undo stack:
...in context: .
======= Clearing redo stack.
** Executing MoML change:
------ in context .
=======> Pushing action onto undo stack:
...in context: .
======= Clearing redo stack. ** Executing MoML change:
------ in context .
=======> Pushing action onto undo stack:
...in context: .
======= Clearing redo stack.
** Executing MoML change:
------ in context .
=======> Pushing action onto undo stack:
...in context: .
======= Clearing redo stack.
<====== Executing undo action:
...in context: .
** Executing MoML change:
------ in context .
=======> Pushing action onto redo stack:
...in context: .
<====== Executing redo action:
...in context: .
** Executing MoML change:
------ in context .
ptolemy.kernel.util.InternalErrorException: ChangeRequest failed (NOTE: there is no ChangeListener):
Because:
Cannot insert a second inside link in a port that is not a multiport.
in .
What I think is happening here is that it is not sufficient to just reverse calls (link becomes unlink) in redo. I think we need to reverse the order.
Interestingly, if we use multiports instead of ports, we get a different error:
ptolemy.kernel.util.InternalErrorException: ChangeRequest failed (NOTE: there is no ChangeListener):
Because: Index: 0, Size: 0 at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:231) at ptolemy.moml.MoMLUndoEntry.execute(MoMLUndoEntry.java:107) at ptolemy.kernel.undo.UndoStackAttribute.redo(UndoStackAttribute.java:263) at ptolemy.kernel.undo.RedoChangeRequest._execute(RedoChangeRequest.java:96) at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:171) at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:732) at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1757) at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1594) at ptolemy.vergil.basic.BasicGraphFrame.redo(BasicGraphFrame.java:1187) at ptolemy.vergil.basic.BasicGraphFrame$RedoAction.actionPerformed(BasicGraphFrame.java:3318) at javax.swing.JComponent$ActionStandin.actionPerformed(JComponent.java:3230) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1573) at javax.swing.JComponent.processKeyBinding(JComponent.java:2766) at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:255) at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:204) at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2843) at javax.swing.JComponent.processKeyBindings(JComponent.java:2835) at javax.swing.JComponent.processKeyEvent(JComponent.java:2729) at java.awt.Component.processEvent(Component.java:5379) at java.awt.Container.processEvent(Container.java:2010) at java.awt.Component.dispatchEventImpl(Component.java:4068) at java.awt.Container.dispatchEventImpl(Container.java:2068) at java.awt.Component.dispatchEvent(Component.java:3903) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1828) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:681) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:940) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:810) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:645) at java.awt.Component.dispatchEventImpl(Component.java:3941) at java.awt.Container.dispatchEventImpl(Container.java:2068) at java.awt.Window.dispatchEventImpl(Window.java:1801) at java.awt.Component.dispatchEvent(Component.java:3903) at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.LinkedList.entry(LinkedList.java:368) at java.util.LinkedList.get(LinkedList.java:313) at ptolemy.moml.MoMLParser._processUnlink(MoMLParser.java:6600) at ptolemy.moml.MoMLParser.access$900(MoMLParser.java:205) at ptolemy.moml.MoMLParser$UnlinkRequest.execute(MoMLParser.java:7258) at ptolemy.moml.MoMLParser._processPendingRequests(MoMLParser.java:6306) at ptolemy.moml.MoMLParser.endElement(MoMLParser.java:892) at com.microstar.xml.XmlParser.parseETag(XmlParser.java:1026) at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1098) at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924) at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1104) at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924) at com.microstar.xml.XmlParser.parseDocument(XmlParser.java:481) at com.microstar.xml.XmlParser.doParse(XmlParser.java:159) at com.microstar.xml.XmlParser.parse(XmlParser.java:132) at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1402) at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1374) at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1530) at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:289) at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:171) ... 37 more Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.LinkedList.entry(LinkedList.java:368) at java.util.LinkedList.get(LinkedList.java:313) at ptolemy.moml.MoMLParser._processUnlink(MoMLParser.java:6600) at ptolemy.moml.MoMLParser.access$900(MoMLParser.java:205) at ptolemy.moml.MoMLParser$UnlinkRequest.execute(MoMLParser.java:7258) at ptolemy.moml.MoMLParser._processPendingRequests(MoMLParser.java:6306) at ptolemy.moml.MoMLParser.endElement(MoMLParser.java:892) at com.microstar.xml.XmlParser.parseETag(XmlParser.java:1026) at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1098) at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924) at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1104) at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924) at com.microstar.xml.XmlParser.parseDocument(XmlParser.java:481) at com.microstar.xml.XmlParser.doParse(XmlParser.java:159) at com.microstar.xml.XmlParser.parse(XmlParser.java:132) at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1402) at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1374) at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1530) at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:289) at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:171) at ptolemy.moml.MoMLUndoEntry.execute(MoMLUndoEntry.java:107) at ptolemy.kernel.undo.UndoStackAttribute.redo(UndoStackAttribute.java:263) at ptolemy.kernel.undo.RedoChangeRequest._execute(RedoChangeRequest.java:96) at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:171) at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:732) at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1757) at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1594) at ptolemy.vergil.basic.BasicGraphFrame.redo(BasicGraphFrame.java:1187) at ptolemy.vergil.basic.BasicGraphFrame$RedoAction.actionPerformed(BasicGraphFrame.java:3318) at javax.swing.JComponent$ActionStandin.actionPerformed(JComponent.java:3230) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1573) at javax.swing.JComponent.processKeyBinding(JComponent.java:2766) at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:255) at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:204) at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2843) at javax.swing.JComponent.processKeyBindings(JComponent.java:2835) at javax.swing.JComponent.processKeyEvent(JComponent.java:2729) at java.awt.Component.processEvent(Component.java:5379) at java.awt.Container.processEvent(Container.java:2010) at java.awt.Component.dispatchEventImpl(Component.java:4068) at java.awt.Container.dispatchEventImpl(Container.java:2068) at java.awt.Component.dispatchEvent(Component.java:3903) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1828) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:681) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:940) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:810) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:645) at java.awt.Component.dispatchEventImpl(Component.java:3941) at java.awt.Container.dispatchEventImpl(Container.java:2068) at java.awt.Window.dispatchEventImpl(Window.java:1801) at java.awt.Component.dispatchEvent(Component.java:3903) at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Note: the issue was created automatically with bugzilla2github tool
Original bug ID: BZ#330 From: @cxbrooks Reported version: 8.1.devel CC: pt-dev@chess.eecs.berkeley.edu