Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#523 After Undo Comment: "IllegalArgumentException: At end"

closed-fixed
9
2006-08-31
2006-08-25
Mathias Ricken
No

When I start DrJava, and enter in the empty document

/**

and hit return, the text changes to

/**
*

Then I hit "Undo", and I get the following exception.
From that point on, DrJava is in an unstable state, and
it can't even be quit without throwing more exceptions
that prevent closing it.

edu.rice.cs.util.UnexpectedException:
java.lang.IllegalArgumentException: At end
at
edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelControl.move(ReducedModelControl.java:82)
at
edu.rice.cs.drjava.model.AbstractDJDocument.move(AbstractDJDocument.java:440)
at
edu.rice.cs.drjava.model.AbstractDJDocument.setCurrentLocation(AbstractDJDocument.java:422)
at
edu.rice.cs.drjava.model.definitions.DefinitionsDocument._getRelativeLine(DefinitionsDocument.java:478)
at
edu.rice.cs.drjava.model.definitions.DefinitionsDocument.getCurrentLine(DefinitionsDocument.java:443)
at
edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc.getCurrentLine(AbstractGlobalModel.java:3712)
at
edu.rice.cs.drjava.ui.MainFrame$PositionListener.caretUpdate(MainFrame.java:5631)
at
javax.swing.text.JTextComponent.fireCaretUpdate(JTextComponent.java:367)
at
javax.swing.text.JTextComponent$MutableCaretEvent.fire(JTextComponent.java:3232)
at
javax.swing.text.JTextComponent$MutableCaretEvent.stateChanged(JTextComponent.java:3254)
at
javax.swing.text.DefaultCaret.fireStateChanged(DefaultCaret.java:779)
at
javax.swing.text.DefaultCaret.changeCaretPosition(DefaultCaret.java:1209)
at
javax.swing.text.DefaultCaret.handleSetDot(DefaultCaret.java:1117)
at
javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:1098)
at
javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:1026)
at
javax.swing.text.DefaultCaret$Handler.removeUpdate(DefaultCaret.java:1705)
at
javax.swing.text.AbstractDocument.fireRemoveUpdate(AbstractDocument.java:242)
at
javax.swing.text.AbstractDocument$DefaultDocumentEvent.undo(AbstractDocument.java:2810)
at
edu.rice.cs.drjava.ui.DefinitionsPane$UndoWithPosition.undo(DefinitionsPane.java:1268)
at
javax.swing.undo.CompoundEdit.undo(CompoundEdit.java:46)
at
javax.swing.undo.UndoManager.undoTo(UndoManager.java:210)
at javax.swing.undo.UndoManager.undo(UndoManager.java:275)
at
edu.rice.cs.drjava.model.definitions.CompoundUndoManager.undo(CompoundUndoManager.java:178)
at
edu.rice.cs.drjava.ui.DefinitionsPane$UndoAction.actionPerformed(DefinitionsPane.java:1168)
at
edu.rice.cs.util.swing.DelegatingAction.actionPerformed(DelegatingAction.java:135)
at
edu.rice.cs.drjava.ui.MainFrame$56.actionPerformed(MainFrame.java:884)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
at
java.awt.Component.processMouseEvent(Component.java:5554)
at
javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5319)
at java.awt.Container.processEvent(Container.java:2010)
at
java.awt.Component.dispatchEventImpl(Component.java:4021)
at
java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3869)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
at
java.awt.Container.dispatchEventImpl(Container.java:2054)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3869)
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.IllegalArgumentException: At end
at
edu.rice.cs.drjava.model.definitions.reducedmodel.TokenList$Iterator._moveRight(TokenList.java:242)
at
edu.rice.cs.drjava.model.definitions.reducedmodel.TokenList$Iterator._move(TokenList.java:206)
at
edu.rice.cs.drjava.model.definitions.reducedmodel.TokenList$Iterator.move(TokenList.java:189)
at
edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelBrace.move(ReducedModelBrace.java:125)
at
edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelControl.move(ReducedModelControl.java:77)
... 50 more

Caused by:
java.lang.IllegalArgumentException: At end
at
edu.rice.cs.drjava.model.definitions.reducedmodel.TokenList$Iterator._moveRight(TokenList.java:242)
at
edu.rice.cs.drjava.model.definitions.reducedmodel.TokenList$Iterator._move(TokenList.java:206)
at
edu.rice.cs.drjava.model.definitions.reducedmodel.TokenList$Iterator.move(TokenList.java:189)
at
edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelBrace.move(ReducedModelBrace.java:125)
at
edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelControl.move(ReducedModelControl.java:77)
at
edu.rice.cs.drjava.model.AbstractDJDocument.move(AbstractDJDocument.java:440)
at
edu.rice.cs.drjava.model.AbstractDJDocument.setCurrentLocation(AbstractDJDocument.java:422)
at
edu.rice.cs.drjava.model.definitions.DefinitionsDocument._getRelativeLine(DefinitionsDocument.java:478)
at
edu.rice.cs.drjava.model.definitions.DefinitionsDocument.getCurrentLine(DefinitionsDocument.java:443)
at
edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc.getCurrentLine(AbstractGlobalModel.java:3712)
at
edu.rice.cs.drjava.ui.MainFrame$PositionListener.caretUpdate(MainFrame.java:5631)
at
javax.swing.text.JTextComponent.fireCaretUpdate(JTextComponent.java:367)
at
javax.swing.text.JTextComponent$MutableCaretEvent.fire(JTextComponent.java:3232)
at
javax.swing.text.JTextComponent$MutableCaretEvent.stateChanged(JTextComponent.java:3254)
at
javax.swing.text.DefaultCaret.fireStateChanged(DefaultCaret.java:779)
at
javax.swing.text.DefaultCaret.changeCaretPosition(DefaultCaret.java:1209)
at
javax.swing.text.DefaultCaret.handleSetDot(DefaultCaret.java:1117)
at
javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:1098)
at
javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:1026)
at
javax.swing.text.DefaultCaret$Handler.removeUpdate(DefaultCaret.java:1705)
at
javax.swing.text.AbstractDocument.fireRemoveUpdate(AbstractDocument.java:242)
at
javax.swing.text.AbstractDocument$DefaultDocumentEvent.undo(AbstractDocument.java:2810)
at
edu.rice.cs.drjava.ui.DefinitionsPane$UndoWithPosition.undo(DefinitionsPane.java:1268)
at
javax.swing.undo.CompoundEdit.undo(CompoundEdit.java:46)
at
javax.swing.undo.UndoManager.undoTo(UndoManager.java:210)
at javax.swing.undo.UndoManager.undo(UndoManager.java:275)
at
edu.rice.cs.drjava.model.definitions.CompoundUndoManager.undo(CompoundUndoManager.java:178)
at
edu.rice.cs.drjava.ui.DefinitionsPane$UndoAction.actionPerformed(DefinitionsPane.java:1168)
at
edu.rice.cs.util.swing.DelegatingAction.actionPerformed(DelegatingAction.java:135)
at
edu.rice.cs.drjava.ui.MainFrame$56.actionPerformed(MainFrame.java:884)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
at
java.awt.Component.processMouseEvent(Component.java:5554)
at
javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5319)
at java.awt.Container.processEvent(Container.java:2010)
at
java.awt.Component.dispatchEventImpl(Component.java:4021)
at
java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3869)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
at
java.awt.Container.dispatchEventImpl(Container.java:2054)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3869)
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)

System Properties:
DrJava Version 20060825-0418
drjava.debug.port = 59523
java.runtime.name = Java(TM) 2 Runtime Environment,
Standard Edition
sun.boot.library.path =
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries
java.vm.version = 1.5.0_06-64
awt.nativeDoubleBuffering = true
gopherProxySet = false
java.vm.vendor = "Apple Computer, Inc."
java.vendor.url = http://apple.com/
path.separator = :
java.vm.name = Java HotSpot(TM) Client VM
file.encoding.pkg = sun.io
user.country = US
sun.os.patch.level = unknown
java.vm.specification.name = Java Virtual Machine
Specification
user.dir = /Users/mgricken
java.runtime.version = 1.5.0_06-112
java.awt.graphicsenv = apple.awt.CGraphicsEnvironment
java.endorsed.dirs =
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/endorsed
os.arch = i386
java.io.tmpdir = /tmp
line.separator = "\u000a"
java.vm.specification.vendor = Sun Microsystems Inc.
os.name = Mac OS X
apple.laf.useScreenMenuBar = true
sun.jnu.encoding = MacRoman
java.library.path =
.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
java.specification.name = Java Platform API Specification
java.class.version = 49.0
sun.management.compiler = HotSpot Client Compiler
os.version = 10.4.7
user.home = /Users/mgricken
user.timezone = America/Chicago
java.awt.printerjob = apple.awt.CPrinterJob
file.encoding = MacRoman
java.specification.version = 1.5
java.class.path =
/Users/mgricken/Documents/drjava/drjava/drjava-15.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/.compatibility/14compatibility.jar:/Users/mgricken/Documents/drjava/drjava:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/.compatibility/14compatibility.jar
user.name = mgricken
apple.awt.graphics.UseQuartz = true
java.vm.specification.version = 1.0
java.home =
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
sun.arch.data.model = 32
user.language = en
java.specification.vendor = Sun Microsystems Inc.
awt.toolkit = apple.awt.CToolkit
java.vm.info = mixed mode, sharing
java.version = 1.5.0_06
java.ext.dirs =
/Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext
sun.boot.class.path =
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/sunrsasign.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/charsets.jar
java.vendor = Apple Computer, Inc.
file.separator = /
java.vendor.url.bug = http://developer.apple.com/java/
com.apple.macos.useScreenMenuBar = true
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
java.rmi.server.hostname = 127.0.0.1
mrj.version = 1040.1.5.0_06-112
sun.awt.exception.handler =
edu.rice.cs.drjava.ui.DrJavaErrorHandler
sun.cpu.isalist =

Discussion

  • Logged In: YES
    user_id=430590

    It appears that the undo action is not using proper
    sychronization. I'll look at undo code to see if I can
    identify a synchronization bug.

     
  • Mathias Ricken
    Mathias Ricken
    2006-08-31

    • assigned_to: nobody --> rcartwright
    • status: open --> closed-fixed
     
  • Mathias Ricken
    Mathias Ricken
    2006-08-31

    Logged In: YES
    user_id=1075744

    I think Corky's changes in revision 3984 fixed this problem.