mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-20 02:15:59 +07:00
17 lines
419 B
Java
17 lines
419 B
Java
import javax.annotation.Nonnegative;
|
|
import java.util.Random;
|
|
|
|
public class LongRangeAnnotation {
|
|
@Nonnegative int method() {
|
|
return new Random().nextInt(100);
|
|
}
|
|
|
|
void testAnnotated() {
|
|
int value = method();
|
|
if(value == 0) {
|
|
System.out.println("Zero");
|
|
} else if(<warning descr="Condition 'value > 0' is always 'true'">value > 0</warning>) {
|
|
System.out.println("Positive");
|
|
}
|
|
}
|
|
} |