Skip to content

Commit

Permalink
Comment out a few bogus lgtm warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jul 20, 2021
1 parent 05796c2 commit 732b151
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/ctc/wstx/dtd/DTDAttribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ctc/wstx/dtd/SmallPrefixedNameSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
}
10 changes: 5 additions & 5 deletions src/main/java/com/ctc/wstx/evt/CompactStartElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -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('"');
}
}
Expand All @@ -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]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ctc/wstx/sr/ElemAttrs.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 732b151

Please sign in to comment.