From 732b151b22fea26633598c74eb433ea97c74ab48 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Mon, 19 Jul 2021 20:43:35 -0700 Subject: [PATCH] Comment out a few bogus lgtm warnings --- src/main/java/com/ctc/wstx/dtd/DTDAttribute.java | 2 +- .../java/com/ctc/wstx/dtd/SmallPrefixedNameSet.java | 2 +- .../java/com/ctc/wstx/evt/CompactStartElement.java | 10 +++++----- src/main/java/com/ctc/wstx/sr/ElemAttrs.java | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/ctc/wstx/dtd/DTDAttribute.java b/src/main/java/com/ctc/wstx/dtd/DTDAttribute.java index ca404041..4ce482b3 100644 --- a/src/main/java/com/ctc/wstx/dtd/DTDAttribute.java +++ b/src/main/java/com/ctc/wstx/dtd/DTDAttribute.java @@ -380,7 +380,7 @@ protected String validateDefaultNames(InputProblemReporter rep, boolean normaliz } if (count == 0) { - reportValidationProblem(rep, "Invalid default value '"+defValue + return reportValidationProblem(rep, "Invalid default value '"+defValue +"'; empty String is not a valid name value"); } diff --git a/src/main/java/com/ctc/wstx/dtd/SmallPrefixedNameSet.java b/src/main/java/com/ctc/wstx/dtd/SmallPrefixedNameSet.java index 0ddadb7f..0b5701ac 100644 --- a/src/main/java/com/ctc/wstx/dtd/SmallPrefixedNameSet.java +++ b/src/main/java/com/ctc/wstx/dtd/SmallPrefixedNameSet.java @@ -98,7 +98,7 @@ public void appendNames(StringBuilder sb, String sep) sb.append(':'); } } - sb.append(mStrings[i++]); + sb.append(mStrings[i++]); // lgtm [java/index-out-of-bounds] } } } diff --git a/src/main/java/com/ctc/wstx/evt/CompactStartElement.java b/src/main/java/com/ctc/wstx/evt/CompactStartElement.java index ea87317e..9117a0e0 100644 --- a/src/main/java/com/ctc/wstx/evt/CompactStartElement.java +++ b/src/main/java/com/ctc/wstx/evt/CompactStartElement.java @@ -119,14 +119,14 @@ protected void outputNsAndAttr(Writer w) throws IOException if (raw != null) { for (int i = 0, len = raw.length; i < len; i += 4) { w.write(' '); - String prefix = raw[i + OFFSET_NS_PREFIX]; + String prefix = raw[i + OFFSET_NS_PREFIX]; // lgtm [java/index-out-of-bounds] if (prefix != null && prefix.length() > 0) { w.write(prefix); w.write(':'); } w.write(raw[i]); // local name w.write("=\""); - TextEscaper.writeEscapedAttrValue(w, raw[i + OFFSET_VALUE]); + TextEscaper.writeEscapedAttrValue(w, raw[i + OFFSET_VALUE]); // lgtm [java/index-out-of-bounds] w.write('"'); } } @@ -142,9 +142,9 @@ protected void outputNsAndAttr(XMLStreamWriter w) throws XMLStreamException if (raw != null) { for (int i = 0, len = raw.length; i < len; i += 4) { String ln = raw[i]; - String prefix = raw[i + OFFSET_NS_PREFIX]; - String nsURI = raw[i + OFFSET_NS_URI]; - w.writeAttribute(prefix, nsURI, ln, raw[i + OFFSET_VALUE]); + String prefix = raw[i + OFFSET_NS_PREFIX]; // lgtm [java/index-out-of-bounds] + String nsURI = raw[i + OFFSET_NS_URI]; // lgtm [java/index-out-of-bounds] + w.writeAttribute(prefix, nsURI, ln, raw[i + OFFSET_VALUE]); // lgtm [java/index-out-of-bounds] } } } diff --git a/src/main/java/com/ctc/wstx/sr/ElemAttrs.java b/src/main/java/com/ctc/wstx/sr/ElemAttrs.java index 820c2abc..fc3e4894 100644 --- a/src/main/java/com/ctc/wstx/sr/ElemAttrs.java +++ b/src/main/java/com/ctc/wstx/sr/ElemAttrs.java @@ -122,7 +122,7 @@ public int findIndex(QName name) if (!ln.equals(raw[i])) { continue; } - String thisUri = raw[i+OFFSET_NS_URI]; + String thisUri = raw[i+OFFSET_NS_URI]; // lgtm [java/index-out-of-bounds] if (defaultNs) { if (thisUri == null || thisUri.length() == 0) { return i;