Skip to content

Commit

Permalink
Some more #121 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 6, 2021
1 parent 0f57cd2 commit 90b048a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/ctc/wstx/sr/BasicStreamReader.java
Expand Up @@ -3130,6 +3130,7 @@ private final boolean handleNsAttrs(char c)
// returns null if it's a dupe:
if (null == tb) {
throwParseError("Duplicate declaration for namespace prefix '"+localName+"'.");
return false; // never gets here but static analyzers have a fit...
}
startLen = tb.getCharSize();
} else if (localName == sPrefixXmlns && prefix == null) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/ctc/wstx/sr/InputElementStack.java
Expand Up @@ -431,7 +431,7 @@ public int resolveAndValidateElement()
mReporter.throwParseError(ErrorConsts.ERR_NS_REDECL_XMLNS);
} else if (prefix == "xml") {
// whereas xml is ok, as long as it's same URI:
if (!nsUri.equals(XMLConstants.XML_NS_URI)) {
if (!XMLConstants.XML_NS_URI.equals(nsUri)) {
mReporter.throwParseError(ErrorConsts.ERR_NS_REDECL_XML,
nsUri, null);
}
Expand Down Expand Up @@ -988,7 +988,7 @@ public final boolean matches(String prefix, String localName)
return false;
}
} else {
if (thisPrefix != prefix && !thisPrefix.equals(prefix)) {
if (thisPrefix != prefix && !prefix.equals(thisPrefix)) {
return false;
}
}
Expand Down

0 comments on commit 90b048a

Please sign in to comment.