Bug 26204 - DocumentAdapter - NPE while shifting code
Summary: DocumentAdapter - NPE while shifting code
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 2.1 M3   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 26280 26518 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-11-13 16:05 EST by Andrew Irvine CLA
Modified: 2002-12-06 16:00 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Irvine CLA 2002-11-13 16:05:22 EST
Eclipse 20021113

1/ Create a new project and a new class (did not update build path).
2/ Copy the source from an existing class into this file.  You can now choose 
to save or not.  Obviously there are compile errors.
3/ Now shift all code to the right, then shift back to the left


!ENTRY org.eclipse.ui 4 4 Nov 13, 2002 16:04:43.957
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 Nov 13, 2002 16:04:43.957
!MESSAGE Argument not valid
!STACK 0
java.lang.IllegalArgumentException: Argument not valid
	at org.eclipse.swt.SWT.error(SWT.java:2166)
	at org.eclipse.swt.SWT.error(SWT.java:2110)
	at org.eclipse.jface.text.DocumentAdapter.replaceTextRange
(DocumentAdapter.java:164)
	at org.eclipse.swt.custom.StyledText.modifyContent
(StyledText.java:5621)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:6545)
	at org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2652)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5007)
	at org.eclipse.swt.custom.StyledText.handleKeyDown
(StyledText.java:5030)
	at org.eclipse.swt.custom.StyledText$8.handleEvent
(StyledText.java:4800)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java
(Compiled Code))
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1418)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:831)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
	at org.eclipse.core.launcher.Main.run(Main.java:703)
	at org.eclipse.core.launcher.Main.main(Main.java:539)
Comment 1 Lynne Kues CLA 2002-11-13 17:04:06 EST
Reassigning to text component.  Invalid argument being passed in by the 
application.
Comment 2 Lynne Kues CLA 2002-11-13 18:45:38 EST
I think this has to do with the text optimizations that are being done during 
shift-right/left.  If you shift > 20 lines at the end of a document, this is 
when the problem is occurring.  Are you generating the correct text 
changing/text changed events?  The caretOffset is out of sync with the document 
content and is leading to the error.
Comment 3 Kai-Uwe Maetzel CLA 2002-11-14 11:26:42 EST
*** Bug 26280 has been marked as a duplicate of this bug. ***
Comment 4 Kai-Uwe Maetzel CLA 2002-11-14 12:27:29 EST
Fixed for M3.
Comment 5 Grant Gayed CLA 2002-11-15 17:39:30 EST
*** Bug 26518 has been marked as a duplicate of this bug. ***
Comment 6 Andrew Irvine CLA 2002-12-06 16:00:45 EST
verified and closed