mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 23:39:39 +07:00
[java-inspections] IDEA-287483 Suggest explicit type for uninitialized 'var', based on the first assignment
GitOrigin-RevId: 80fa9ecf09130d04c41d27ad40897ef24183e4e1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c7ed6477fb
commit
453a00c310
@@ -0,0 +1,7 @@
|
||||
// "Set variable type to 'String'" "true"
|
||||
public class Demo {
|
||||
void test() {
|
||||
String s = null;
|
||||
s = "hello";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Set variable type to 'Integer'" "true"
|
||||
public class Demo {
|
||||
void test() {
|
||||
Integer s = null;
|
||||
s = 123;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Set variable type to 'int'" "true"
|
||||
public class Demo {
|
||||
void test() {
|
||||
int s;
|
||||
s = 123;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Set variable type to 'String'" "true"
|
||||
public class Demo {
|
||||
void test() {
|
||||
String s;
|
||||
s = "hello";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Set variable type to 'String'" "true"
|
||||
public class Demo {
|
||||
void test() {
|
||||
v<caret>ar s = null;
|
||||
s = "hello";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Set variable type to 'Integer'" "true"
|
||||
public class Demo {
|
||||
void test() {
|
||||
v<caret>ar s = null;
|
||||
s = 123;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Set variable type to 'int'" "true"
|
||||
public class Demo {
|
||||
void test() {
|
||||
v<caret>ar s;
|
||||
s = 123;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Set variable type to 'String'" "true"
|
||||
public class Demo {
|
||||
void test() {
|
||||
v<caret>ar s;
|
||||
s = "hello";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user