[LANG-1702] test for LANG-1702 (#1151)
* test for LANG-1702 * remove trailing space * Comments -> Javadoc --------- Co-authored-by: Gary Gregory <garydgregory@users.noreply.github.com>
This commit is contained in:
parent
d788e7d389
commit
959178ee9d
|
@ -315,6 +315,26 @@ public class TypeUtilsTest<B> extends AbstractLangTest {
|
|||
assertArrayEquals(expectedArray, TypeUtils.normalizeUpperBounds(typeArray));
|
||||
}
|
||||
|
||||
/** This non-static inner class is parameterized. */
|
||||
private class MyInnerClass<T> {
|
||||
}
|
||||
|
||||
/** The inner class is used as a return type from a method. */
|
||||
private <U> MyInnerClass<U> aMethod() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_LANG_1702() throws NoSuchMethodException, SecurityException {
|
||||
final Type type = TypeUtilsTest.class.getDeclaredMethod("aMethod").getGenericReturnType();
|
||||
|
||||
// any map will do
|
||||
final Map<TypeVariable<?>, Type> typeArguments = Collections.emptyMap();
|
||||
|
||||
// this fails with a stack overflow
|
||||
final Type unrolledType = TypeUtils.unrollVariables(typeArguments, type);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testContainsTypeVariables() throws Exception {
|
||||
assertFalse(TypeUtils.containsTypeVariables(Test1.class.getMethod("m0").getGenericReturnType()));
|
||||
|
|
Loading…
Reference in New Issue