question: private static String fixupXPath ( String xpath ) { final int end = xpath . length ( ) ; int offset = 0 ; boolean whitespace = true ; char c ; for ( ; offset < end ; ++ offset ) { c = xpath . charAt ( offset ) ; if ( whitespace ) { if ( ! XMLChar . isSpace ( c ) ) { if ( c == '.' || c == '/' ) { whitespace = false ; } else if ( c != '|' ) { return fixupXPath2 ( xpath , offset , end ) ; } } } else if ( c == '|' ) { whitespace = true ; } } return xpath ; }
target:  Fixup XPath expression. Avoid creating a new String if possible.