Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357894 - editor is broken after pasting ** "<percent>{text-decoration: line-through;}11593<percent>":xxxxxx: aaaaaaa
Summary: editor is broken after pasting ** "<percent>{text-decoration: line-through;}1...
Status: RESOLVED DUPLICATE of bug 341824
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: David Green CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 20:10 EDT by Sam Davis CLA
Modified: 2011-11-07 12:01 EST (History)
0 users

See Also:


Attachments
garbled text (3.80 KB, image/png)
2011-09-15 20:19 EDT, Sam Davis CLA
no flags Details
screenshot of source viewer (2.28 KB, image/png)
2011-09-16 13:01 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 Sam Davis CLA 2011-09-15 20:10:36 EDT
If I paste the following line of text, with "<percent>" replaced with a percent sign ("%"), into an empty .textile file or an emtpy Mylyn comment editor, I get a dialog with an error.

** "<percent>{text-decoration: line-through;}11593<percent>":xxxxxx: aaaaaaa

After that, strange behaviour happens. I can't edit the text anymore, the task editor is not marked dirty, and the pasted text does not show up or is garbled. If I save a task with that text in the comment and reopen it, either the text has not been saved, or the comment part is not created. 

Error when pasting:

java.lang.IllegalArgumentException
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.Segment.<init>(Segment.java:33)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.Segment.<init>(Segment.java:43)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.Span.<init>(Span.java:29)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionBuilder.beginSpan(FastMarkupPartitioner.java:331)
	at org.eclipse.mylyn.internal.wikitext.textile.core.phrase.SimpleTextilePhraseModifier$SimplePhraseModifierProcessor.emit(SimpleTextilePhraseModifier.java:60)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.emitMarkupLine(MarkupLanguage.java:321)
	at org.eclipse.mylyn.internal.wikitext.textile.core.phrase.HyperlinkPhraseModifier$HyperlinkProcessor.emit(HyperlinkPhraseModifier.java:61)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.emitMarkupLine(MarkupLanguage.java:321)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.emitMarkupLine(MarkupLanguage.java:345)
	at org.eclipse.mylyn.internal.wikitext.textile.core.block.ListBlock.processLineContent(ListBlock.java:82)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.processContent(MarkupLanguage.java:175)
	at org.eclipse.mylyn.wikitext.textile.core.TextileLanguage.processContent(TextileLanguage.java:235)
	at org.eclipse.mylyn.wikitext.core.parser.MarkupParser.parse(MarkupParser.java:91)
	at org.eclipse.mylyn.wikitext.core.parser.MarkupParser.parse(MarkupParser.java:81)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionTokenScanner.computeOlp(FastMarkupPartitioner.java:167)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionTokenScanner.setPartialRange(FastMarkupPartitioner.java:129)
	at org.eclipse.jface.text.rules.FastPartitioner.documentChanged2(FastPartitioner.java:336)
	at org.eclipse.jface.text.AbstractDocument.updateDocumentStructures(AbstractDocument.java:696)
	at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:793)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210)
	at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7172)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7986)
	at org.eclipse.swt.custom.StyledText.paste(StyledText.java:7228)
	at org.eclipse.jface.text.TextViewer.paste(TextViewer.java:4040)
	at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:3984)
	at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:1005)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1534)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupProjectionViewer.doOperation(MarkupProjectionViewer.java:50)
	at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:129)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
	at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4160)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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)




Error creating comment part when reopening a task:

java.lang.IllegalArgumentException
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.Segment.add(Segment.java:89)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionBuilder.beginSpan(FastMarkupPartitioner.java:334)
	at org.eclipse.mylyn.internal.wikitext.textile.core.phrase.SimpleTextilePhraseModifier$SimplePhraseModifierProcessor.emit(SimpleTextilePhraseModifier.java:60)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.emitMarkupLine(MarkupLanguage.java:321)
	at org.eclipse.mylyn.internal.wikitext.textile.core.phrase.HyperlinkPhraseModifier$HyperlinkProcessor.emit(HyperlinkPhraseModifier.java:61)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.emitMarkupLine(MarkupLanguage.java:321)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.emitMarkupLine(MarkupLanguage.java:345)
	at org.eclipse.mylyn.internal.wikitext.textile.core.block.ListBlock.processLineContent(ListBlock.java:82)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.processContent(MarkupLanguage.java:175)
	at org.eclipse.mylyn.wikitext.textile.core.TextileLanguage.processContent(TextileLanguage.java:230)
	at org.eclipse.mylyn.wikitext.core.parser.MarkupParser.parse(MarkupParser.java:91)
	at org.eclipse.mylyn.wikitext.core.parser.MarkupParser.parse(MarkupParser.java:81)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionTokenScanner.computeOlp(FastMarkupPartitioner.java:167)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionTokenScanner.setPartialRange(FastMarkupPartitioner.java:129)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner$PartitionTokenScanner.setRange(FastMarkupPartitioner.java:217)
	at org.eclipse.jface.text.rules.FastPartitioner.initialize(FastPartitioner.java:163)
	at org.eclipse.jface.text.rules.FastPartitioner.checkInitialization(FastPartitioner.java:151)
	at org.eclipse.jface.text.rules.FastPartitioner.connect(FastPartitioner.java:143)
	at org.eclipse.jface.text.rules.FastPartitioner.connect(FastPartitioner.java:125)
	at org.eclipse.mylyn.wikitext.ui.editor.MarkupSourceViewer.configurePartitioning(MarkupSourceViewer.java:71)
	at org.eclipse.mylyn.wikitext.ui.editor.MarkupSourceViewer.setDocument(MarkupSourceViewer.java:63)
	at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:584)
	at org.eclipse.mylyn.internal.tasks.ui.editors.RichTextEditor.updateDocument(RichTextEditor.java:249)
	at org.eclipse.mylyn.internal.tasks.ui.editors.RichTextEditor.configure(RichTextEditor.java:194)
	at org.eclipse.mylyn.internal.tasks.ui.editors.RichTextEditor.createControl(RichTextEditor.java:295)
	at org.eclipse.mylyn.internal.tasks.ui.editors.RichTextAttributeEditor.createControl(RichTextAttributeEditor.java:84)
	at org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorRichTextPart.createControl(TaskEditorRichTextPart.java:118)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.initializePart(AbstractTaskEditorPage.java:1297)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.access$7(AbstractTaskEditorPage.java:1289)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage$14.run(AbstractTaskEditorPage.java:850)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.createParts(AbstractTaskEditorPage.java:841)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.createParts(AbstractTaskEditorPage.java:826)
	at org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaTaskEditorPage.createParts(BugzillaTaskEditorPage.java:341)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.createFormContentInternal(AbstractTaskEditorPage.java:712)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.createFormContent(AbstractTaskEditorPage.java:657)
	at org.eclipse.ui.forms.editor.FormPage$1.run(FormPage.java:152)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.forms.editor.FormPage.createPartControl(FormPage.java:150)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.createPartControl(AbstractTaskEditorPage.java:610)
	at org.eclipse.ui.forms.editor.FormEditor.pageChange(FormEditor.java:471)
	at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1067)
	at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:603)
	at org.eclipse.ui.forms.editor.SharedHeaderFormEditor.setActivePage(SharedHeaderFormEditor.java:110)
	at org.eclipse.mylyn.tasks.ui.editors.TaskEditor.addPages(TaskEditor.java:407)
	at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)
	at org.eclipse.ui.forms.editor.SharedHeaderFormEditor.createPages(SharedHeaderFormEditor.java:98)
	at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
	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.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2674)
	at org.eclipse.mylyn.tasks.ui.TasksUiUtil.openEditor(TasksUiUtil.java:176)
	at org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal.openTask(TasksUiInternal.java:917)
	at org.eclipse.mylyn.tasks.ui.TasksUiUtil.openTask(TasksUiUtil.java:279)
	at org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal.refreshAndOpenTaskListElement(TasksUiInternal.java:302)
	at org.eclipse.mylyn.internal.tasks.ui.actions.OpenTaskListElementAction.runWithEvent(OpenTaskListElementAction.java:56)
	at org.eclipse.mylyn.internal.tasks.ui.actions.OpenTaskListElementAction.run(OpenTaskListElementAction.java:47)
	at org.eclipse.mylyn.internal.tasks.ui.views.TaskListView$22.open(TaskListView.java:1308)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:843)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1131)
	at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1235)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298)
	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:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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)
Comment 1 Sam Davis CLA 2011-09-15 20:12:07 EDT
Here is that line of text again:

** "<percent>{text-decoration: line-through;}11593<percent>":xxxxxx: aaaaaaa
Comment 2 Sam Davis CLA 2011-09-15 20:19:53 EDT
Created attachment 203462 [details]
garbled text
Comment 3 Sam Davis CLA 2011-09-16 12:06:20 EDT
I was bootsrapped on e_3_7_m_3_6_x when I reported this. Now that I'm bootstrapped on master it doesn't happen, however the text
 "text-decoration: line-through" is not hidden as I would expect - it appears with a line through it.
Comment 4 David Green CLA 2011-09-16 13:01:35 EDT
Created attachment 203502 [details]
screenshot of source viewer

I can't reproduce this on latest either.  

Note that you should expect to see all of the text (ie nothing is hidden) when editing, however the preview should hide the styles.
Comment 5 David Green CLA 2011-09-16 13:10:45 EDT
When you type (without delimiting =='s):

==%{text-decoration: line-through;}11593% : aaaaaaa==

After saving you should see:

%{text-decoration: line-through;}11593%  : aaaaaaa
Comment 6 Sam Davis CLA 2011-09-16 16:58:00 EDT
Yes, that is working for me on latest.
Comment 7 David Green CLA 2011-09-16 17:15:48 EDT
From the stack trace and given that it's fixed since WikiText 1.5 was released (since e_3_7_m_3_6_x ), marking as a duplicate of 341824.

thanks for the bug Sam.

*** This bug has been marked as a duplicate of bug 341824 ***