Skip to content

Commit 9c11790

Browse files
committed
Fix SpotBugs [ERROR] High: Potentially dangerous use of
non-short-circuit logic in org.apache.commons.codec.language.DaitchMokotoffSoundex.cleanup(String) [org.apache.commons.codec.language.DaitchMokotoffSoundex] At DaitchMokotoffSoundex.java:[line 350] NS_DANGEROUS_NON_SHORT_CIRCUIT
1 parent 9661073 commit 9c11790

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ The <action> type attribute can be add,update,fix,remove.
6666
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs [ERROR] Medium: org.apache.commons.codec.binary.BaseNCodec$AbstractBuilder.setEncodeTable(byte[]) may expose internal representation by storing an externally mutable object into BaseNCodec$AbstractBuilder.encodeTable [org.apache.commons.codec.binary.BaseNCodec$AbstractBuilder] At BaseNCodec.java:[line 131] EI_EXPOSE_REP2.</action>
6767
<action type="fix" dev="ggregory" due-to="Gary Gregory">The method org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder.setLineSeparator(byte...) now makes a defensive copy.</action>
6868
<action type="fix" dev="ggregory" due-to="Gary Gregory">Avoid unnecessary String conversion in org.apache.commons.codec.language.bm.PhoneticEngine.applyFinalRules(PhonemeBuilder, Map).</action>
69+
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs [ERROR] High: Potentially dangerous use of non-short-circuit logic in org.apache.commons.codec.language.DaitchMokotoffSoundex.cleanup(String) [org.apache.commons.codec.language.DaitchMokotoffSoundex] At DaitchMokotoffSoundex.java:[line 350] NS_DANGEROUS_NON_SHORT_CIRCUIT.</action>
6970
<!-- ADD -->
7071
<action type="add" dev="ggregory" due-to="Gary Gregory">Add HmacUtils.hmac(Path).</action>
7172
<action type="add" dev="ggregory" due-to="Gary Gregory">Add HmacUtils.hmacHex(Path).</action>

src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public DaitchMokotoffSoundex(final boolean folding) {
347347
private String cleanup(final String input) {
348348
final StringBuilder sb = new StringBuilder();
349349
for (char ch : input.toCharArray()) {
350-
if (Character.isWhitespace(ch) | !Character.isLetter(ch)) {
350+
if (Character.isWhitespace(ch) || !Character.isLetter(ch)) {
351351
continue;
352352
}
353353
ch = Character.toLowerCase(ch);

0 commit comments

Comments
 (0)