Buggy code:
public class XPath { private static final boolean DEBUG_ALL = false ; private static final boolean DEBUG_XPATH_PARSE = ( XPath . DEBUG_ALL ) || false ; private static final boolean DEBUG_ANY = XPath . DEBUG_XPATH_PARSE ; protected final String fExpression ; protected final SymbolTable fSymbolTable ; protected final XPath . LocationPath [ ] fLocationPaths ; public XPath ( String xpath , SymbolTable symbolTable , NamespaceContext context ) throws XPathException { } public XPath . LocationPath [ ] getLocationPaths ( ) { } public XPath . LocationPath getLocationPath ( ) { } public String toString ( ) { StringBuffer buf = new StringBuffer ( ) ; for ( int i = 0 ; i < ( fLocationPaths . length ) ; i ++ ) { if ( i > 0 ) { <START_BUG> buf . append ( "|" ) ; <END_BUG> } buf . append ( fLocationPaths [ i ] . toString ( ) ) ; } return buf . toString ( ) ; } private static void check ( boolean b ) throws XPathException { } private XPath . LocationPath buildLocationPath ( Vector stepsVector ) throws XPathException { } private XPath . LocationPath [ ] parseExpression ( final NamespaceContext context ) throws XPathException { } private XPath . NodeTest parseNodeTest ( int typeToken , XPath . Tokens xtokens , NamespaceContext context ) throws XPathException { } public static class LocationPath implements Cloneable { public final XPath . Step [ ] steps ; public LocationPath ( XPath . Step [ ] steps ) { } protected LocationPath ( XPath . LocationPath path ) { } public String toString ( ) { StringBuffer str = new StringBuffer ( ) ; for ( int i = 0 ; i < ( steps . length ) ; i ++ ) { if ( ( i > 0 ) && ( ( ( steps [ ( i - 1 ) ] . axis . type ) != ( XPath . Axis . DESCENDANT ) ) && ( ( steps [ i ] . axis . type ) != ( XPath . Axis . DESCENDANT ) ) ) ) { str . append ( '//' ) ; } str . append ( steps [ i ] . toString ( ) ) ; } if ( false ) { str . append ( '[' ) ; String s = super . toString ( ) ; str . append ( s . substring ( s . indexOf ( '@' ) ) ) ; str . append ( ']' ) ; } return str . toString ( ) ; } public Object clone ( ) { } } public static class Step implements Cloneable { public final XPath . Axis axis ; public final XPath . NodeTest nodeTest ; public Step ( XPath . Axis axis , XPath . NodeTest nodeTest ) { } protected Step ( XPath . Step step ) { } public String toString ( ) { if ( ( axis . type ) == ( XPath . Axis . SELF ) ) { return "." ; } if ( ( axis . type ) == ( XPath . Axis . ATTRIBUTE ) ) { return "@" + ( nodeTest . toString ( ) ) ; } if ( ( axis . type ) == ( XPath . Axis . CHILD ) ) { return nodeTest . toString ( ) ; } if ( ( axis . type ) == ( XPath . Axis . DESCENDANT ) ) { return "////" ; } return ( "???<seq2seq4repair_space>(" + ( axis . type ) ) + ')' ; } public Object clone ( ) { } } public static class Axis implements Cloneable { public static final short CHILD = 1 ; public static final short ATTRIBUTE = 2 ; public static final short SELF = 3 ; public static final short DESCENDANT = 4 ; public final short type ; public Axis ( short type ) { } protected Axis ( XPath . Axis axis ) { } public String toString ( ) { switch ( type ) { case XPath . Axis . CHILD : return "child" ; case XPath . Axis . ATTRIBUTE : return "attribute" ; case XPath . Axis . SELF : return "self" ; case XPath . Axis . DESCENDANT : return "descendant" ; } return "???" ; } public Object clone ( ) { } } public static class NodeTest implements Cloneable { public static final short QNAME = 1 ; public static final short WILDCARD = 2 ; public static final short NODE = 3 ; public static final short NAMESPACE = 4 ; public final short type ; public final QName name = new QName ( ) ; public NodeTest ( short type ) { } public NodeTest ( QName name ) { } public NodeTest ( String prefix , String uri ) { } public NodeTest ( XPath . NodeTest nodeTest ) { } public String toString ( ) { switch ( type ) { case XPath . NodeTest . QNAME : { if ( ( name . prefix . length ( ) ) != 0 ) { if ( ( name . uri ) != null ) { return ( ( name . prefix ) + ':' ) + ( name . localpart ) ; } return ( ( ( ( "{" + ( name . uri ) ) + '}' ) + ( name . prefix ) ) + ':' ) + ( name . localpart ) ; } return name . localpart ; } case XPath . NodeTest . NAMESPACE : { if ( ( name . prefix . length ( ) ) != 0 ) { if ( ( name . uri ) != null ) { return ( name . prefix ) + ":*" ; } return ( ( ( "{" + ( name . uri ) ) + '}' ) + ( name . prefix ) ) + ":*" ; }

Fix:
buf . append ( '|' ) ;