Skip to content

Commit

Permalink
Refactored double negatives
Browse files Browse the repository at this point in the history
  • Loading branch information
Ádám Balogh committed Sep 28, 2022
1 parent aeb21fd commit 8f6d692
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spotbugs/src/main/java/edu/umd/cs/findbugs/OpcodeStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -2823,14 +2823,14 @@ private void processInvokeDynamic(DismantleBytecode dbc) {
servletRequestParameterTainted = true;
}
Object sVal = i.getConstant();
if (sVal != null) {
if (sVal == null) {
appenderValue = null;
} else {
JavaClass clazz = dbc.getThisClass();
BootstrapMethod bm = getBootstrapMethod(clazz.getAttributes(), dbc.getConstantRefOperand());
ConstantPool cp = clazz.getConstantPool();
String concatArg = ((ConstantString) cp.getConstant(bm.getBootstrapArguments()[0])).getBytes(cp);
appenderValue = concatArg.replace("\u0001", sVal.toString());
} else {
appenderValue = null;
}
} else if (args.length == 2) {
Item i1 = getStackItem(0);
Expand All @@ -2840,10 +2840,10 @@ private void processInvokeDynamic(DismantleBytecode dbc) {
}
Object sVal1 = i1.getConstant();
Object sVal2 = i2.getConstant();
if (sVal1 != null && sVal2 != null) {
appenderValue = sVal2.toString() + sVal1.toString();
} else {
if (sVal1 == null || sVal2 == null) {
appenderValue = null;
} else {
appenderValue = sVal2.toString() + sVal1.toString();
}
}
}
Expand Down

0 comments on commit 8f6d692

Please sign in to comment.