LVTI: var -> explicit type (IDEA-179177)

This commit is contained in:
Anna Kozlova
2017-09-26 16:13:12 +02:00
parent f1028073cb
commit 0ca243309f
15 changed files with 214 additions and 0 deletions
@@ -0,0 +1,8 @@
// "Replace 'var' with explicit type" "true"
class Main {
{
String b = java.util.Arrays.asList("", "").get(0);
final int i = b.compareTo("");
}
}
@@ -0,0 +1,11 @@
import java.io.Serializable;
import java.util.List;
// "Replace 'var' with explicit type" "true"
class Main {
{
List<Serializable> b = java.util.Arrays.asList("", 2);
final Object o = b.get(0);
}
}
@@ -0,0 +1,7 @@
// "Replace 'var' with explicit type" "true"
class Main {
{
int b = 0;
}
}
@@ -0,0 +1,7 @@
// "Replace 'var' with explicit type" "true"
class Main {
void m(java.util.List<? extends String> args){
String s = args.get(0);
}
}
@@ -0,0 +1,8 @@
// "Replace 'var' with explicit type" "true"
class Main {
{
<caret>var b = java.util.Arrays.asList("", "").get(0);
final int i = b.compareTo("");
}
}
@@ -0,0 +1,9 @@
// "Replace 'var' with explicit type" "false"
class Main {
{
<caret>var b = java.util.Arrays.asList("", 2);
final int i = b.get(0).compareTo("");
java.io.Serializable s = b.get(0);
}
}
@@ -0,0 +1,8 @@
// "Replace 'var' with explicit type" "false"
class Main {
{
<caret>var b = java.util.Arrays.asList("", 2);
final Object o = b.get(0);
}
}
@@ -0,0 +1,7 @@
// "Replace 'var' with explicit type" "true"
class Main {
{
<caret>var b = 0;
}
}
@@ -0,0 +1,8 @@
// "Replace 'var' with explicit type" "false"
class Main {
{
<caret>var b = java.util.Arrays.asList("", 2).get(0);
final int i = b.compareTo("");
}
}
@@ -0,0 +1,7 @@
// "Replace 'var' with explicit type" "true"
class Main {
void m(java.util.List<? extends String> args){
<caret>var s = args.get(0);
}
}