Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341824

Summary: [Textile] Editor can't open files with styled links
Product: z_Archived Reporter: Fabian Steeg <steeg>
Component: MylynAssignee: David Green <greensopinion>
Status: RESOLVED FIXED QA Contact: David Green <greensopinion>
Severity: normal    
Priority: P3 CC: sam.davis
Version: unspecified   
Target Milestone: 1.5.0   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 341947    
Attachments:
Description Flags
Stack trace
none
mylyn/context/zip none

Description Fabian Steeg CLA 2011-04-04 13:14:58 EDT
Created attachment 192481 [details]
Stack trace

Version: Mylyn WikiText 1.5.0.I20110404-1055

Create a *.textile file, open it with the text editor and paste a link with styled text, like:

"_Eclipse_":http://eclipse.org or: "*Eclipse*":http://eclipse.org

The editor fails to open such a file: "Could not open the editor: Editor could not be initialized" (see attached stack trace for details).

The Textile processor at http://textile.thresholdstate.com handles these cases.
Comment 1 David Green CLA 2011-04-04 14:16:08 EDT
Thanks for the bug.  Interestingly, this works fine in the task editor.
Comment 2 David Green CLA 2011-04-04 19:51:41 EDT
Fabian,  I'm not able to reproduce here.  Any chance you could attach the problematic Textile file (or preferably a small file that can be used to reliably reproduce)?
Comment 3 Fabian Steeg CLA 2011-04-04 20:34:55 EDT
I just reproduced this on a different machine in a clean Helios SR 2 Java package (20110218-0911, Mac Cocoa 64 bit) with a file called 'test.textile', containing this single line (same issue in the task editor):

"_Eclipse_":http://eclipse.org

While it doesn't sound like one, could this be a platform-specific issue?
Comment 4 David Green CLA 2011-04-05 11:33:30 EDT
Thanks, I can reproduce now.  This is not platform-specific:

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.ParagraphBlock.processLineContent(ParagraphBlock.java:92)
	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.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.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner.resetPartitions(FastMarkupPartitioner.java:71)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner.setMarkupLanguage(FastMarkupPartitioner.java:61)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.setMarkupLanguage(MarkupEditor.java:1009)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.initializeMarkupLanguage(MarkupEditor.java:996)
	at org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor.doSetInput(MarkupEditor.java:478)
	at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3043)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
Comment 5 David Green CLA 2011-04-05 12:32:58 EDT
This problem might be avoidable if the link with emphasis is preceded by some text on the same line.

Fixed.
Comment 6 David Green CLA 2011-04-05 12:33:01 EDT
Created attachment 192577 [details]
mylyn/context/zip
Comment 7 Fabian Steeg CLA 2011-04-05 13:31:15 EDT
Same issue here with text before and after the link, e.g.:

Link: "_Eclipse_":http://eclipse.org Foundation
Comment 8 David Green CLA 2011-09-16 17:15:48 EDT
*** Bug 357894 has been marked as a duplicate of this bug. ***