mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
tests fix
This commit is contained in:
+1
-2
@@ -34,7 +34,6 @@ class C {
|
||||
|
||||
public static void main(String[] args) {
|
||||
final TestProcessor testProcessor = new TestProcessor();
|
||||
testProcessor.processMap(<warning descr="Unchecked assignment: 'java.util.HashMap' to 'java.util.Map<java.lang.String,java.lang.String>'">new HashMap()</warning>);
|
||||
// ^^^ to cdr: should resolve to TestProcessor.processMap() (at UncheckedWarningLocalInspection.java:228)
|
||||
testProcessor.processMap(new HashMap());
|
||||
}
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
class TestClassT {
|
||||
static {
|
||||
new B().<ref>foo(TestClassT.class);
|
||||
}
|
||||
|
||||
public static class A {
|
||||
public A foo(Class<?> type) {
|
||||
return new A();
|
||||
}
|
||||
}
|
||||
public static class B extends A {
|
||||
@Override
|
||||
public B foo(Class type) {
|
||||
return new B();
|
||||
}
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import java.util.*;
|
||||
|
||||
class C {
|
||||
public static interface GenericAgnosticProcessor {
|
||||
void processMap(Map map);
|
||||
}
|
||||
|
||||
public static interface GenericAwareProcessor {
|
||||
void processMap(Map<String, String> map);
|
||||
}
|
||||
|
||||
public static class TestProcessor implements GenericAwareProcessor, GenericAgnosticProcessor {
|
||||
@Override
|
||||
public void processMap(Map map) { }
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
final TestProcessor testProcessor = new TestProcessor();
|
||||
testProcessor.<ref>processMap(new HashMap());
|
||||
}
|
||||
}
|
||||
@@ -465,7 +465,7 @@ public class ResolveMethod15Test extends Resolve15TestCase {
|
||||
}
|
||||
|
||||
|
||||
private static void assertGenericResolve(PsiReference ref, final String methodName, final String[] expectedTypeParameterValues, final String expectedCallType) {
|
||||
private static void assertGenericResolve(PsiReference ref, final String methodName, final String[] expectedTypeParameterValues, @NonNls final String expectedCallType) {
|
||||
PsiElement target = ref.resolve();
|
||||
assertThat(target, instanceOf(PsiMethod.class));
|
||||
|
||||
@@ -509,6 +509,18 @@ public class ResolveMethod15Test extends Resolve15TestCase {
|
||||
assertResolvesToMethodInClass(result, "A");
|
||||
}
|
||||
|
||||
public void testRawVsGenericConflictInCaseOfOverride() throws Exception{
|
||||
PsiJavaReference ref = (PsiJavaReference) configureByFile();
|
||||
final JavaResolveResult result = ref.advancedResolve(true);
|
||||
assertResolvesToMethodInClass(result, "B");
|
||||
}
|
||||
|
||||
public void testRawVsGenericConflictInCaseOfOverride2() throws Exception{
|
||||
PsiJavaReference ref = (PsiJavaReference) configureByFile();
|
||||
final JavaResolveResult result = ref.advancedResolve(true);
|
||||
assertResolvesToMethodInClass(result, "TestProcessor");
|
||||
}
|
||||
|
||||
public void testAutoboxingAndWidening() throws Exception{
|
||||
PsiJavaReference ref = (PsiJavaReference) configureByFile();
|
||||
final JavaResolveResult result = ref.advancedResolve(true);
|
||||
|
||||
Reference in New Issue
Block a user