Buggy code:
public final class MarkupParser { private static final Log log = LogFactory . getLog ( MarkupParser . class ) ; private String componentNameAttribute = ComponentTag . DEFAULT_COMPONENT_NAME_ATTRIBUTE ; private boolean stripComments ; private boolean compressWhitespace ; private boolean stripWicketTag ; private boolean stripWicketFromComponentTag = false ; private boolean automaticLinking = false ; private IXmlPullParser xmlParser = new XmlPullParser ( ) ; public MarkupParser ( final IXmlPullParser xmlParser , final String componentNameAttribute ) { } public MarkupParser ( final IXmlPullParser xmlParser ) { } public void configure ( ApplicationSettings settings ) { } public String getEncoding ( ) { } public Markup readAndParse ( final IResource resource ) throws IOException , ParseException , ResourceNotFoundException { } Markup parse ( final String string ) throws ParseException { } private List parseMarkup ( ) throws ParseException { final List list = new ArrayList ( ) ; final WicketComponentTagIdentifier detectWicketComponents = new WicketComponentTagIdentifier ( xmlParser ) ; detectWicketComponents . setComponentNameAttribute ( this . componentNameAttribute ) ; detectWicketComponents . setStripWicketFromComponentTag ( this . stripWicketFromComponentTag ) ; final WicketParamTagHandler wicketParamTagHandler = new WicketParamTagHandler ( new wicket . markup . parser . filter . HtmlHandler ( detectWicketComponents ) ) ; wicketParamTagHandler . setStripWicketTag ( this . stripWicketTag ) ; final PreviewComponentTagRemover previewComponentTagRemover = new PreviewComponentTagRemover ( wicketParamTagHandler ) ; final AutolinkHandler autolinkHandler = new AutolinkHandler ( previewComponentTagRemover ) ; autolinkHandler . setAutomaticLinking ( this . automaticLinking ) ; final IMarkupFilter parser = autolinkHandler ; for ( ComponentTag tag ; null != ( tag = ( ( ComponentTag ) ( parser . nextTag ( ) ) ) ) ; ) { boolean add = ( tag . getComponentName ( ) ) != null ; if ( ( add == false ) && ( tag . getXmlTag ( ) . isClose ( ) ) ) { add = ( ( tag . getOpenTag ( ) ) != null ) && ( ( tag . getOpenTag ( ) . getComponentName ( ) ) != null ) ; } if ( add == true ) { final CharSequence text = xmlParser . getInputFromPositionMarker ( tag . getPos ( ) ) ; if ( ( text . length ( ) ) > 0 ) { String rawMarkup = text . toString ( ) ; if ( stripComments ) { rawMarkup = rawMarkup . replaceAll ( "<!--(.|\n|\r)*?-->" , "" ) ; } if ( compressWhitespace ) { rawMarkup = rawMarkup . replaceAll ( "[<seq2seq4repair_space>\\t]+" , "<seq2seq4repair_space>" ) ; rawMarkup = rawMarkup . replaceAll ( "(<seq2seq4repair_space>?[\\r\\n]<seq2seq4repair_space>?)+" , "\n" ) ; } list . add ( new RawMarkup ( rawMarkup ) ) ; } if ( ! ( "_ignore_" . equals ( tag . getComponentName ( ) ) ) ) { tag . makeImmutable ( ) ; list . add ( tag ) ; } xmlParser . setPositionMarker ( ) ; } } <START_BUG> final CharSequence text = ( ( XmlPullParser ) ( xmlParser ) ) . getInputFromPositionMarker ( ( - 1 ) ) ; <END_BUG> if ( ( text . length ( ) ) > 0 ) { list . add ( new RawMarkup ( text ) ) ; } return Collections . unmodifiableList ( list ) ; } }

Fix:
final CharSequence text = xmlParser . getInputFromPositionMarker ( ( - 1 ) ) ;