Files
Andrey Sokolov 59db5558ae Similar usages: Do not process non-trivial code blocks for java 'if' and loop statements
+ cleanup in JavaSimilarityFeaturesExtractor.visitReferenceExpression

IJ-CR-98301

GitOrigin-RevId: 46f865e452bd8b4688321165a5e99c85271d36ea
2022-11-30 18:03:34 +00:00

51 lines
1.0 KiB
Java

public class A {
public static void main(String[] args) {
A a = new A();
if (a.foo() == 0) { }
if (a.foo() == 0) { }
if (a.foo() == 0) { //if with two lines
System.out.println(0);
System.err.print(1);
}
if (a.foo() == 0) { //if with one line
System.out.println(0);
}
if (a.foo() == 1) { //if with one line
System.out.println(1);
}
if (a.foo() == 0) { //if with one line with else with one line
System.out.println(0);
} else {
System.out.println(1);
}
if (a.foo() == 0) { //if with one line with else with one line
System.out.println(0);
} else {
System.out.println(1);
}
if (a.foo() == 0) { //if with one line with else with two lines
System.out.println(0);
} else {
System.out.println(1);
System.out.println(1);
}
while (a.foo() == 0) { //complex while
System.out.println(1);
System.out.println(1);
System.out.println(1);
System.out.println(1);
} }
public int foo() {
return 1;
}
}