mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
Merge remote-tracking branch 'origin/master'
GitOrigin-RevId: 6a16531d9dd405767883a6ce82d04513098372e1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9f61a34973
commit
7f3e176d1e
@@ -2,7 +2,7 @@
|
||||
Value is always false (x > 6 && y > 10)
|
||||
Operand #1 of &&-chain is false (x > 6)
|
||||
Left operand is 5 (x)
|
||||
'x' was assigned (5)
|
||||
'x' was assigned to '5' (=)
|
||||
*/
|
||||
|
||||
class Test {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Value is always false (foo == null)
|
||||
'foo' was assigned (=)
|
||||
One of the following happens:
|
||||
Expression cannot be null as it's newly created object (new String("foo"))
|
||||
or expression cannot be null as it's newly created object (new String("bar"))
|
||||
*/
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Test {
|
||||
|
||||
void test(boolean b) {
|
||||
String foo = b ? new String("foo") : new String("bar");
|
||||
if (<selection>foo == null</selection>) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Value is always false (foo > 3)
|
||||
One of the following happens:
|
||||
Left operand is 1 (foo)
|
||||
'foo' was assigned (=)
|
||||
or left operand is 2 (foo)
|
||||
'foo' was assigned (=)
|
||||
*/
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Test {
|
||||
|
||||
void test(boolean b) {
|
||||
int foo = b ? 1 : 2;
|
||||
if (<selection>foo > 3</selection>) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Value is always true (b)
|
||||
'b' was assigned (true)
|
||||
'b' was assigned to 'true' (=)
|
||||
*/
|
||||
|
||||
class Test {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
Value is always false (s == null)
|
||||
's' was assigned (s1)
|
||||
Condition 's1 != null' was checked before (s1 == null)
|
||||
's' was assigned (=)
|
||||
's1' is known to be 'non-null' from line #8 (s1 == null)
|
||||
*/
|
||||
class Test {
|
||||
void test(String s, String s1) {
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
Value is always false (b4)
|
||||
'b4' was assigned (b3)
|
||||
'b3' was assigned (b2)
|
||||
'b2' was assigned (b1)
|
||||
'b1' was assigned (b)
|
||||
'b4' was assigned (=)
|
||||
'b3' was assigned (=)
|
||||
'b2' was assigned (=)
|
||||
'b1' was assigned (=)
|
||||
'b == false' was established from condition (b)
|
||||
*/
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
Value is always false (x == null)
|
||||
One of the following happens:
|
||||
'x' was assigned (new Object())
|
||||
'x' was assigned (=)
|
||||
Expression cannot be null as it's newly created object (new Object())
|
||||
or 'x' was assigned ("foo")
|
||||
or 'x' was assigned to '"foo"' (=)
|
||||
Expression cannot be null as it's literal ("foo")
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
Value is always false (y == null)
|
||||
'y' was assigned (x)
|
||||
'y' was assigned (=)
|
||||
One of the following happens:
|
||||
'x' was assigned (new Object())
|
||||
'x' was assigned (=)
|
||||
Expression cannot be null as it's newly created object (new Object())
|
||||
or 'x' was assigned ("foo")
|
||||
or 'x' was assigned to '"foo"' (=)
|
||||
Expression cannot be null as it's literal ("foo")
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
Value is always true (j >= 0)
|
||||
Left operand is >= 0 (j)
|
||||
'j' was assigned (i + 1)
|
||||
'j' was assigned (=)
|
||||
Result of '+' is >= 0 (i + 1)
|
||||
Left operand is in {-1..Integer.MAX_VALUE-1} (i)
|
||||
'i' was assigned (s.indexOf(' '))
|
||||
'i' was assigned (=)
|
||||
Value is in {-1..Integer.MAX_VALUE-1} (s.indexOf(' '))
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Value is always false (s1 == null)
|
||||
's1' was assigned (s.trim())
|
||||
's1' was assigned (=)
|
||||
Method 'trim' is externally annotated as 'non-null' (trim)
|
||||
*/
|
||||
class Test {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Value is always true ((s = new Object()) != null)
|
||||
's' was assigned (new Object())
|
||||
's' was assigned (=)
|
||||
Expression cannot be null as it's newly created object (new Object())
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Value is always true (s != null)
|
||||
's' was assigned (new Object())
|
||||
's' was assigned (=)
|
||||
Expression cannot be null as it's newly created object (new Object())
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Value is always true (null == s)
|
||||
's' was assigned (null)
|
||||
's' was assigned to 'null' (=)
|
||||
*/
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
May be null (s)
|
||||
's' was assigned (loadString())
|
||||
's' was assigned (=)
|
||||
Method 'loadString' is annotated as 'nullable' (@Nullable)
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
May be null (foo)
|
||||
'foo' was assigned (getFoo())
|
||||
'foo' was assigned (=)
|
||||
Method 'getFoo' is annotated as 'nullable' (@Nullable)
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Value is always false (s == null)
|
||||
Condition 's != null' was checked before (null == s)
|
||||
's' is known to be 'non-null' from line #7 (null == s)
|
||||
*/
|
||||
class Test {
|
||||
void test(String s) {
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
Value is always false (s == s1)
|
||||
's1' was assigned (null)
|
||||
and condition 's != null' was checked before (null == s)
|
||||
's' is known to be 'non-null' from line #8 (null == s)
|
||||
and 's1' was assigned to 'null' (=)
|
||||
*/
|
||||
class Test {
|
||||
void test(String s) {
|
||||
|
||||
@@ -6,14 +6,14 @@ Value is always true (x || (a+b)+(c+d)==10)
|
||||
Result of '+' is 10 ((a+b)+(c+d))
|
||||
Result of '+' is 3 (a+b)
|
||||
Left operand is 1 (a)
|
||||
'a' was assigned (1)
|
||||
'a' was assigned to '1' (=)
|
||||
and right operand is 2 (b)
|
||||
'b' was assigned (2)
|
||||
'b' was assigned to '2' (=)
|
||||
and result of '+' is 7 (c+d)
|
||||
Left operand is 3 (c)
|
||||
'c' was assigned (3)
|
||||
'c' was assigned to '3' (=)
|
||||
and right operand is 4 (d)
|
||||
'd' was assigned (4)
|
||||
'd' was assigned to '4' (=)
|
||||
*/
|
||||
|
||||
class Test {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Value is always false (list == null)
|
||||
'list' was assigned (=)
|
||||
According to contract, method 'loadList' always returns 'new' value (loadList)
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
|
||||
class Test {
|
||||
@Contract("-> new")
|
||||
List<String> loadList() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
void test() {
|
||||
List<String> list = loadList();
|
||||
if(<selection>list == null</selection>) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user