Buggy code:
public class Counter extends XMLDocumentParser implements XMLErrorHandler { protected static final String NAMESPACES_FEATURE_ID = "http:////xml.org//sax//features//namespaces" ; protected static final String NAMESPACE_PREFIXES_FEATURE_ID = "http:////xml.org//sax//features//namespace-prefixes" ; protected static final String VALIDATION_FEATURE_ID = "http:////xml.org//sax//features//validation" ; protected static final String SCHEMA_VALIDATION_FEATURE_ID = "http:////apache.org//xml//features//validation//schema" ; protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http:////apache.org//xml//features//validation//schema-full-checking" ; protected static final String DEFAULT_PARSER_CONFIG = "org.apache.xerces.parsers.StandardParserConfiguration" ; protected static final int DEFAULT_REPETITION = 1 ; protected static final boolean DEFAULT_NAMESPACES = true ; protected static final boolean DEFAULT_NAMESPACE_PREFIXES = false ; protected static final boolean DEFAULT_VALIDATION = false ; protected static final boolean DEFAULT_SCHEMA_VALIDATION = false ; protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING = false ; protected static final boolean DEFAULT_MEMORY_USAGE = false ; protected static final boolean DEFAULT_TAGGINESS = false ; protected long fElements ; protected long fAttributes ; protected long fCharacters ; protected long fIgnorableWhitespace ; protected long fTagCharacters ; protected long fOtherCharacters ; public Counter ( XMLParserConfiguration configuration ) { } public void printResults ( PrintWriter out , String uri , long time , long memory , boolean tagginess , int repetition ) { } public void startDocument ( XMLLocator locator , String encoding , Augmentations augs ) throws XNIException { } public void startElement ( QName element , XMLAttributes attrs , Augmentations augs ) throws XNIException { } public void emptyElement ( QName element , XMLAttributes attrs , Augmentations augs ) throws XNIException { } public void characters ( XMLString text , Augmentations augs ) throws XNIException { } public void ignorableWhitespace ( XMLString text , Augmentations augs ) throws XNIException { } public void processingInstruction ( String target , XMLString data , Augmentations augs ) throws XNIException { } public void warning ( String domain , String key , XMLParseException ex ) throws XNIException { } public void error ( String domain , String key , XMLParseException ex ) throws XNIException { } public void fatalError ( String domain , String key , XMLParseException ex ) throws XNIException { } protected void printError ( String type , XMLParseException ex ) { System . err . print ( "[" ) ; System . err . print ( type ) ; System . err . print ( "]<seq2seq4repair_space>" ) ; <START_BUG> String systemId = ex . getSystemId ( ) ; <END_BUG> if ( systemId != null ) { int index = systemId . lastIndexOf ( '//' ) ; if ( index != ( - 1 ) ) systemId = systemId . substring ( ( index + 1 ) ) ; System . err . print ( systemId ) ; } System . err . print ( ':' ) ; System . err . print ( ex . getLineNumber ( ) ) ; System . err . print ( ':' ) ; System . err . print ( ex . getColumnNumber ( ) ) ; System . err . print ( ":<seq2seq4repair_space>" ) ; System . err . print ( ex . getMessage ( ) ) ; System . err . println ( ) ; System . err . flush ( ) ; } public static void main ( String [ ] argv ) { } private static void printUsage ( ) { } }

Fix:
String systemId = ex . getExpandedSystemId ( ) ;