mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-23 15:03:36 +07:00
Fixes IDEA-343951 Warning about boolean value is always true is wrong GitOrigin-RevId: 365f32fc0ff0fc293bf2608e3b0ad1bb3b58f040
19 lines
550 B
Java
19 lines
550 B
Java
public class BoxedBooleanMethodWithCast {
|
|
// IDEA-343951
|
|
public static boolean checkObjectType(Object object) {
|
|
if (object instanceof Boolean) {
|
|
final boolean booleanValue = meansTrue((Boolean) object);
|
|
return booleanValue;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println("True = " + checkObjectType(Boolean.TRUE));
|
|
System.out.println("False = " + checkObjectType(Boolean.FALSE));
|
|
}
|
|
|
|
public static boolean meansTrue(Boolean bool) {
|
|
return Boolean.TRUE.equals(bool);
|
|
}
|
|
} |