Add test_LANG_1698
This commit is contained in:
parent
c455ea2832
commit
6782d1daf8
|
@ -35,8 +35,10 @@ import java.lang.reflect.TypeVariable;
|
||||||
import java.lang.reflect.WildcardType;
|
import java.lang.reflect.WildcardType;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -272,6 +274,16 @@ public class TypeUtilsTest<B> extends AbstractLangTest {
|
||||||
assertEquals("T extends java.lang.Enum<T>", TypeUtils.toString(method.getGenericReturnType()));
|
assertEquals("T extends java.lang.Enum<T>", TypeUtils.toString(method.getGenericReturnType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_LANG_1698() {
|
||||||
|
ParameterizedType comparing = (ParameterizedType) Arrays.stream(Comparator.class.getDeclaredMethods())
|
||||||
|
.filter(k -> k.getName().equals("comparing")).findFirst()
|
||||||
|
.orElse(Comparator.class.getDeclaredMethods()[0]).getGenericParameterTypes()[0];
|
||||||
|
final String typeName = TypeUtils
|
||||||
|
.parameterize((Class<?>) comparing.getRawType(), comparing.getActualTypeArguments()).getTypeName();
|
||||||
|
assertEquals("java.util.function.Function<? super T, ? extends U>", typeName);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_LANG_820() {
|
public void test_LANG_820() {
|
||||||
final Type[] typeArray = {String.class, String.class};
|
final Type[] typeArray = {String.class, String.class};
|
||||||
|
|
Loading…
Reference in New Issue