mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java completion: use context substitutor even for methods whose type parameters can be inferred from parameter types (IDEA-148623)
This commit is contained in:
+1
-1
@@ -390,7 +390,7 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
return type.isAssignableFrom(returned);
|
||||
}
|
||||
});
|
||||
if (matchingExpectation != null && SmartCompletionDecorator.hasUnboundTypeParams(method, matchingExpectation)) {
|
||||
if (matchingExpectation != null) {
|
||||
call.setInferenceSubstitutor(SmartCompletionDecorator.calculateMethodReturnTypeSubstitutor(method, matchingExpectation), position);
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import java.util.*;
|
||||
|
||||
public class MainClass1 {
|
||||
|
||||
List<String> foo(){
|
||||
return Collections.un<caret>
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -713,4 +713,8 @@ interface TxANotAnno {}
|
||||
checkPreferredItems 0, 'xzMap', 'xaString'
|
||||
}
|
||||
|
||||
public void testPreferCollectionsStaticOfExpectedType() {
|
||||
checkPreferredItems 0, 'unmodifiableList', 'unmodifiableCollection'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user