IDEA-119052 Java smart type code completion proposes incorrect variant if non-matching local variable hides a matching instance variable

This commit is contained in:
peter
2014-01-13 19:58:47 +01:00
parent df8967b840
commit b06366a1ba
5 changed files with 46 additions and 2 deletions
@@ -0,0 +1,18 @@
import java.util.Collection;
class A {
String join(Collection<String> strings) {
return StringUtil.join(strings, ",");
}
void method(Collection<String> param) {
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String[] param = {""}; // hides the parameter
Collection<String> params = Arrays.asList(param);
join(params)<caret>
}
};
}
}
@@ -0,0 +1,18 @@
import java.util.Collection;
class A {
String join(Collection<String> strings) {
return StringUtil.join(strings, ",");
}
void method(Collection<String> param) {
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String[] param = {""}; // hides the parameter
Collection<String> params = Arrays.asList(param);
join(<caret>)
}
};
}
}