[#1247] Add test which shows the problem with concrete classes that pass in the type based on a generic
This commit is contained in:
parent
e8ee6a2772
commit
73db1f886d
@ -16,8 +16,11 @@
|
||||
|
||||
package io.netty.util.internal;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class TypeParameterMatcherTest {
|
||||
@ -128,4 +131,20 @@ public class TypeParameterMatcherTest {
|
||||
TypeParameterMatcher m = TypeParameterMatcher.find(new V<String>().u, U.class, "E");
|
||||
assertTrue(m.match(new Object()));
|
||||
}
|
||||
|
||||
private abstract class W<E> {
|
||||
// Noop
|
||||
}
|
||||
|
||||
private class X<T, E> extends W<E> {
|
||||
// Noop
|
||||
}
|
||||
|
||||
@Ignore("Fail currently because of #1247")
|
||||
@Test
|
||||
public void testConcreteClassWithGeneric() throws Exception {
|
||||
TypeParameterMatcher m = TypeParameterMatcher.find(new X<String, Date>(), W.class, "E");
|
||||
assertTrue(m.match(new Date()));
|
||||
assertFalse(m.match(new Object()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user