Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324513 - Confluence coloring code causing WikiText Editor crash
Summary: Confluence coloring code causing WikiText Editor crash
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 1.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.4.0   Edit
Assignee: David Green CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-04 10:50 EDT by David Carver CLA
Modified: 2011-01-05 11:27 EST (History)
0 users

See Also:


Attachments
candidate fix and unit tests (5.67 KB, patch)
2010-09-22 17:20 EDT, David Green CLA
no flags Details | Diff
mylyn/context/zip (9.71 KB, application/octet-stream)
2010-09-22 17:20 EDT, David Green CLA
no flags Details
mylyn/context/zip (10.09 KB, application/octet-stream)
2010-10-19 15:15 EDT, David Green CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Carver CLA 2010-09-04 10:50:42 EDT
Given the following bit of the confluence wikitext:

views to help SOA  development. These includes [SOA Services Explorer](in green) for the list of all available SOA services,
[Types Explorer](in {color:#0000ff}blue{color}) for searching and browsing all available 

In a file will generate the following stacktrace when trying to open a text file with the confluence wikitext above.  If you remove the coloring the editor opens fine.:

java.lang.IllegalArgumentException
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.Segments.add(Segments.java:30)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.Segment.add(Segment.java:96)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionBuilder.beginBlock(FastMarkupPartitioner.java:316)
	at org.eclipse.mylyn.internal.wikitext.confluence.core.block.ParagraphBlock.processLineContent(ParagraphBlock.java:40)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.processContent(MarkupLanguage.java:174)
	at org.eclipse.mylyn.wikitext.core.parser.MarkupParser.parse(MarkupParser.java:92)
	at org.eclipse.mylyn.wikitext.core.parser.MarkupParser.parse(MarkupParser.java:82)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionTokenScanner.computeOlp(FastMarkupPartitioner.java:171)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionTokenScanner.setPartialRange(FastMarkupPartitioner.java:133)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionTokenScanner.setRange(FastMarkupPartitioner.java:222)
	at org.eclipse.jface.text.rules.FastPartitioner.initialize(FastPartitioner.java:163)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner.resetPartitions(FastMarkupPartitioner.java:75)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner.setMarkupLanguage(FastMarkupPartitioner.java:65)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.setMarkupLanguage(MarkupEditor.java:999)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.initializeMarkupLanguage(MarkupEditor.java:986)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.doSetInput(MarkupEditor.java:470)
	at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3037)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2600)
	at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3055)
	at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3082)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.init(MarkupEditor.java:965)
	at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:798)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:647)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
	at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2863)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768)
	at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760)
	at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691)
	at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:331)
	at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMenu.java:179)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3552)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3171)
	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)
Comment 1 David Green CLA 2010-09-22 17:20:07 EDT
Created attachment 179417 [details]
candidate fix and unit tests

Implemented a candidate fix for this problem.   It appears as if the MarkupLanguage wasn't correctly setting the character offset for nested blocks.
Comment 2 David Green CLA 2010-09-22 17:20:09 EDT
Created attachment 179418 [details]
mylyn/context/zip
Comment 3 David Carver CLA 2010-09-23 09:51:36 EDT
Patch looks good to me.  I won't have time to manually test it (neck deep in other projects now).
Comment 4 David Green CLA 2010-10-19 15:15:01 EDT
Fixed in HEAD.
Comment 5 David Green CLA 2010-10-19 15:15:04 EDT
Created attachment 181216 [details]
mylyn/context/zip