MethodReturnTypeFix: do not suggest when type refers to type parameter not available at method declaration

This commit is contained in:
Tagir Valeev
2017-10-09 09:27:16 +07:00
parent 55330b22fb
commit 9a91789f27
5 changed files with 77 additions and 11 deletions
@@ -0,0 +1,14 @@
// "Make 'method' return 'java.util.List<T>'" "true"
import java.util.*;
public class Test {
class Inner<T> {
List<T> method() {
return null;
}
void test() {
List<T> t = method();
}
}
}
@@ -0,0 +1,12 @@
// "Make 'method' return 'java.util.List<T>'" "true"
import java.util.*;
public class Test {
class Inner<T> {
void method() {}
void test() {
List<T> t = met<caret>hod();
}
}
}
@@ -0,0 +1,13 @@
// "Make 'method' return 'java.util.List<T>'" "false"
import java.util.*;
public class Test {
void method() {}
class Inner<T> {
void test() {
List<T> t = met<caret>hod();
}
}
}
@@ -0,0 +1,12 @@
// "Make 'method' return 'java.util.List<T>'" "false"
import java.util.*;
public class Test {
static class Inner<T> {
static void method() {}
void test() {
List<T> t = met<caret>hod();
}
}
}