Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mylyn » [WikiText] Error while parsing more then one MediaWiki strings
[WikiText] Error while parsing more then one MediaWiki strings [message #1016515] Wed, 06 March 2013 18:05 Go to next message
Marek Małkiewicz is currently offline Marek MałkiewiczFriend
Messages: 3
Registered: March 2013
Junior Member
I have the following code:

                StringWriter writer = new StringWriter();
		HtmlDocumentBuilder builder = new HtmlDocumentBuilder(writer);
		builder.setEmitAsDocument(false);
		MediaWikiLanguage lang = new MediaWikiLanguage();
		lang.configure(conf);
		lang.setInternalLinkPattern("{0}");
		MarkupParser parser = new MarkupParser(lang, builder);
		parser.parse("''text1''");
		System.out.println(writer.toString());
		writer.flush();
		parser.parse("'''text2'''");
		System.out.println(writer.toString());


When parsing second text I get NullPointerException:
Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.mylyn.wikitext.core.util.DefaultXmlStreamWriter.writeStartElement(DefaultXmlStreamWriter.java:322)
	at org.eclipse.mylyn.wikitext.core.parser.builder.HtmlDocumentBuilder.beginBlock(HtmlDocumentBuilder.java:798)
	at org.eclipse.mylyn.internal.wikitext.mediawiki.core.block.ParagraphBlock.processLineContent(ParagraphBlock.java:66)
	at org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage.processContent(MarkupLanguage.java:184)
	at org.eclipse.mylyn.internal.wikitext.mediawiki.core.AbstractMediaWikiLanguage.processContent(AbstractMediaWikiLanguage.java:97)
	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 html.HtmlLinks.setText(HtmlLinks.java:63)
	at javax.swing.JEditorPane.<init>(Unknown Source)
	at html.HtmlLinks.<init>(HtmlLinks.java:35)
	at html.HtmlLinks.main(HtmlLinks.java:106)


There is no problem when I create new objects each time I want to parse some text. But it's a waste of resources...
Re: [WikiText] Error while parsing more then one MediaWiki strings [message #1062368 is a reply to message #1016515] Fri, 07 June 2013 12:29 Go to previous message
Tomasz Zarna is currently offline Tomasz ZarnaFriend
Messages: 172
Registered: July 2009
Senior Member
Hi Marek,

Why don't you file a bug against Mylyn Docs and describe your case there? You should be even able to provide a failing test case.

Cheers,
Previous Topic:Juno SR2 deleted my task list
Next Topic:WikiText Maven artifact availability?
Goto Forum:
  


Current Time: Sat Nov 09 02:01:53 GMT 2024

Powered by FUDForum. Page generated in 0.03667 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top