--- old/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java 2014-06-04 13:55:58.951711212 -0700 +++ new/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java 2014-06-04 13:55:58.863710684 -0700 @@ -559,11 +559,13 @@ * @param token The token string */ private void addToken(String tokenStr) { - if (!fTokenNames.containsValue(tokenStr)) { - Integer tokenInt = new Integer(fTokenNames.size()); + String str = fTokenNames.get(tokenStr); + Integer tokenInt = str == null ? null : Integer.parseInt(str); + if (tokenInt == null) { + tokenInt = new Integer(fTokenNames.size()); fTokenNames.put(tokenInt, tokenStr); - addToken(tokenInt.intValue()); } + addToken(tokenInt.intValue()); } /**