blob: 1109243d24a2d78c50488589dfee1fcf20532338 [file] [log] [blame]
package com.siyeh.igtest.controlflow.if_may_be_conditional;
public class IfMayBeConditional {
void foo(int a, int b) {
int c = 0;
if (a < b) { c += a - b; } else { c -= b; }
}
void foo2(int a, int b) {
int c = 0;
if (a < b) { c += a - b; } else { c += b; }
}
void foo3(int i, StringBuilder sb) {
if (i == 0) {
sb.append("type.getConstructor()", 0, 1);
}
else {
sb.append("DescriptorUtils.getFQName(cd)",0, 1);
}
}
int foo4(int a, int b) {
if (a < b) return a;
else return b;
}
int foo5(int a, int b, int c) {
if (a < b) {
return a;
} else {
return b < c ? b : c;
}
}
void foo6(int a, int b, int c) {
int i;
if (a < b) {
i = a;
} else {
i = b < c ? b : c;
}
}
}