Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 67043 - [projection] IllegalStateException in ProjectionTextStore.get()
Summary: [projection] IllegalStateException in ProjectionTextStore.get()
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 3.0 RC3   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-14 13:24 EDT by Christof Marti CLA
Modified: 2004-06-21 06:42 EDT (History)
1 user (show)

See Also:


Attachments
patch for class ProjectionViewer (1.38 KB, patch)
2004-06-17 05:25 EDT, Kai-Uwe Maetzel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christof Marti CLA 2004-06-14 13:24:06 EDT
3.0RC2

Using default settings:
- enable all folding options
- open TestCase
- select the two visible lines of runTest()
- cut to clipboard
- paste before the final } of the CU
- revert block on the QuickDiff ruler
-> results in the following exception(s):

java.lang.IllegalStateException
        at org.eclipse.jface.text.projection.ProjectionTextStore.internalError(P
rojectionTextStore.java:86)
        at org.eclipse.jface.text.projection.ProjectionTextStore.get(ProjectionT
extStore.java:153)
        at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:896
)
        at org.eclipse.jface.text.DefaultDocumentAdapter.doGetLine(DefaultDocume
ntAdapter.java:127)
        at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocument
Adapter.java:135)
        at org.eclipse.swt.custom.StyledText$ContentWidthCache.calculate(StyledT
ext.java:1219)
        at org.eclipse.swt.custom.StyledText.calculateTopIndex(StyledText.java:1
974)
        at org.eclipse.swt.custom.StyledText.setVerticalScrollOffset(StyledText.
java:7549)
        at org.eclipse.swt.custom.StyledText.setTopIndex(StyledText.java:7482)
        at org.eclipse.jface.text.TextViewer.setTopIndex(TextViewer.java:2559)
        at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:43
14)
        at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:4415)
        at org.eclipse.jface.text.source.projection.ProjectionViewer.catchupWith
ProjectionAnnotationModel(ProjectionViewer.java:868)
        at org.eclipse.jface.text.source.projection.ProjectionViewer.access$5(Pr
ojectionViewer.java:821)
        at org.eclipse.jface.text.source.projection.ProjectionViewer$1.run(Proje
ctionViewer.java:792)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.ja
va:106)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2709)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2401)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1362)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1333)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav
a:252)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96
)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformAct
ivator.java:334)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:272)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:128)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
        at org.eclipse.core.launcher.Main.run(Main.java:638)
        at org.eclipse.core.launcher.Main.main(Main.java:622)

After repeating this the following exception was thrown:

java.lang.IllegalArgumentException: overlaps with existing fragment
        at org.eclipse.jface.text.projection.ProjectionDocument.internalAddMaste
rDocumentRange(ProjectionDocument.java:253)
        at org.eclipse.jface.text.projection.ProjectionDocument.addMasterDocumen
tRange(ProjectionDocument.java:461)
        at org.eclipse.jface.text.projection.ProjectionDocument.addMasterDocumen
tRange(ProjectionDocument.java:440)
        at org.eclipse.jface.text.source.projection.ProjectionViewer.addMasterDo
cumentRange(ProjectionViewer.java:563)
        at org.eclipse.jface.text.source.projection.ProjectionViewer.executeProj
ectionCommands(ProjectionViewer.java:911)
        at org.eclipse.jface.text.source.projection.ProjectionViewer.catchupWith
ProjectionAnnotationModel(ProjectionViewer.java:865)
        at org.eclipse.jface.text.source.projection.ProjectionViewer.access$5(Pr
ojectionViewer.java:821)
        at org.eclipse.jface.text.source.projection.ProjectionViewer$1.run(Proje
ctionViewer.java:792)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.ja
va:106)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2709)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2401)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1362)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1333)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav
a:252)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96
)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformAct
ivator.java:334)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:272)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:128)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
        at org.eclipse.core.launcher.Main.run(Main.java:638)
        at org.eclipse.core.launcher.Main.main(Main.java:622)
Comment 1 Kai-Uwe Maetzel CLA 2004-06-16 09:25:12 EDT
Adding Dirk for second vote.
Comment 2 Kai-Uwe Maetzel CLA 2004-06-16 13:58:19 EDT
Approved by Dirk & Kai.
Comment 3 Kai-Uwe Maetzel CLA 2004-06-17 05:22:57 EDT
The fundamental problem is that the projection viewer has no way to 
distinguish between annotations that have been deleted during the self-cleanup 
of the annotation model (i.e. because of a document change) and those that 
have been deleted by clients of the annotation model such as the provider of 
the projection structure. This is something that we have to add post 3.0.

For now the workaround is to reinitialze the projection document from scratch 
if problems occur during the incremental update.
Comment 4 Kai-Uwe Maetzel CLA 2004-06-17 05:25:35 EDT
Created attachment 12367 [details]
patch for class ProjectionViewer
Comment 5 Kai-Uwe Maetzel CLA 2004-06-17 12:42:44 EDT
Reviewed by Tom. Released for build I200406171600.
Comment 6 Markus Keller CLA 2004-06-21 06:03:29 EDT
start verifying ...
Comment 7 Markus Keller CLA 2004-06-21 06:42:37 EDT
Verified in 200406192000.