| Summary: | [projection] IllegalStateException once code template has been used inside an xml file | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Olivier Thomann <Olivier_Thomann> | ||||||
| Component: | Ant | Assignee: | Dani Megert <daniel_megert> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | daniel_megert, mcbain.asm, Michael_Rennie, thatnitind | ||||||
| Version: | 3.2 | ||||||||
| Target Milestone: | 3.7 M3 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Broken since 3.2. Could also be a bug in the Ant editor. *** Bug 327985 has been marked as a duplicate of this bug. *** The cause for this is a couple of bugs in Ant, 1) being the main reason for the ISE. 1) AntContext.getEnd() returns an offset which is inside \r\n 2) AntContext.evaluate(Template) results a template string with different line delimiters than currently in the editor 3) the AntFoldingStructureProvider has a couple of bugs 4) the AntEditor creates two AntFoldingStructureProvider instead of just one Created attachment 181163 [details]
Fix
Simple test case:
1. start new workspace
2. create new project
3. add attachment 174311 [details] to the project
4. open the file
5. put caret after first '<'
6. delete rest of the line
7. type "fileset" (line 20 should now be: Tab Tab Tab<fileset
8. Ctrl+Space
applied patch to HEAD. All unit + smoke tests pass. Thanks for the patch Dani. |
Created attachment 174311 [details] Ant script that shows the problem I got this exception trying to undo into an ant script after using a code template. eclipse.buildId=I20100706-0800 java.version=1.6.0_20-ea java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_CA Command-line arguments: -os win32 -ws win32 -arch x86 -console java.lang.IllegalStateException at org.eclipse.jface.text.projection.ProjectionMapping.toImageLine(ProjectionMapping.java:480) at org.eclipse.jface.text.projection.ProjectionMapping.toClosestImageLine(ProjectionMapping.java:491) at org.eclipse.jface.text.TextViewer.getClosestWidgetLineForModelLine(TextViewer.java:5462) at org.eclipse.jface.text.TextViewer$ViewerState.updateViewport(TextViewer.java:1258) at org.eclipse.jface.text.TextViewer$ViewerState.restore(TextViewer.java:1238) at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:5082) at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:5057) at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:5142) at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:5116) at org.eclipse.jface.text.TextViewerUndoManager$DocumentUndoListener.documentUndoNotification(TextViewerUndoManager.java:174) at org.eclipse.text.undo.DocumentUndoManager.fireDocumentUndo(DocumentUndoManager.java:929) at org.eclipse.text.undo.DocumentUndoManager$UndoableCompoundTextChange.undo(DocumentUndoManager.java:472) at org.eclipse.core.commands.operations.DefaultOperationHistory.doUndo(DefaultOperationHistory.java:415) at org.eclipse.core.commands.operations.DefaultOperationHistory.undo(DefaultOperationHistory.java:1280) at org.eclipse.ui.operations.UndoActionHandler.runCommand(UndoActionHandler.java:78) at org.eclipse.ui.operations.OperationHistoryActionHandler$4.run(OperationHistoryActionHandler.java:311) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507) at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.access$6(TimeTriggeredProgressMonitorDialog.java:1) at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog$2.run(TimeTriggeredProgressMonitorDialog.java:203) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.run(TimeTriggeredProgressMonitorDialog.java:216) at org.eclipse.ui.operations.OperationHistoryActionHandler.run(OperationHistoryActionHandler.java:326) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) Steps to reproduce: 1) Open the attached file and try to use a code template inside the task: <jacoco:merge destfile="${exec.file}"> by adding: <fileset|code assist> You should get many exceptions in the .log file.