mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 13:43:29 +07:00
Getter inlining functionality moved to MethodCallInstruction Also: get rid of MethodCallInstruction.myPrecalculatedReturnValue. In any case, we do a lot of ad-hoc computations inside MethodCallInstruction. So we can move two cases when myPrecalculatedReturnValue was used (getter processing and empty collection processing) into MethodCallInstruction as well. This unifies code a little, and provides more possibilities, as we know current abstract interpretation state and can use it (in particular, stability of qualifier) Also: a new kind of MutationSignature 'transparent', which doesn't flush even private fields. It's not exposed to public annotations yet (appears to the user in the same way as 'pure') GitOrigin-RevId: 548ab12afc0d0314829f47e0ef51caec59985698
29 lines
1.0 KiB
Java
29 lines
1.0 KiB
Java
import org.jetbrains.annotations.Contract;
|
|
|
|
class Scratch
|
|
{
|
|
public static void main(String[] args)
|
|
{
|
|
maybeNull = true;
|
|
if (<warning descr="Condition '!isTrue(getMaybeNull())' is always 'false'">!isTrue(<warning descr="Result of 'getMaybeNull()' is always 'true'">getMaybeNull()</warning>)</warning>) { }
|
|
unknown();
|
|
if (!isTrue(getMaybeNull())) { }
|
|
if (<warning descr="Condition '!isTrue(null)' is always 'true'">!isTrue(<warning descr="Passing 'null' argument to non-annotated parameter">null</warning>)</warning>) { }
|
|
if (<warning descr="Condition '!isTrue(true)' is always 'false'">!isTrue(true)</warning>) { }
|
|
if (<warning descr="Condition '!isTrue(false)' is always 'true'">!isTrue(false)</warning>) { }
|
|
}
|
|
|
|
static native void unknown();
|
|
|
|
static Boolean maybeNull = null;
|
|
static Boolean getMaybeNull()
|
|
{
|
|
return maybeNull;
|
|
}
|
|
|
|
@Contract(value = "null -> false; !null -> param1", pure = true)
|
|
public static boolean isTrue(final Boolean value)
|
|
{
|
|
return value != null && value;
|
|
}
|
|
} |