From 0b80d13297a419c5fbe7d96a8f655d428f12c6bf Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 23 Jul 2023 08:46:01 -0400 Subject: [PATCH] Add test_LANG_1698 --- .../commons/lang3/reflect/TypeUtilsTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java index 2d843e7e4..13c1128f4 100644 --- a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java @@ -277,6 +277,25 @@ public class TypeUtilsTest extends AbstractLangTest { assertEquals("T extends java.lang.Enum", TypeUtils.toString(method.getGenericReturnType())); } + /** + *
{@code
+     * java.lang.StackOverflowError
+    at org.apache.commons.lang3.reflect.TypeUtils.typeVariableToString(TypeUtils.java:1785)
+    at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1737)
+    at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1714)
+    at org.apache.commons.lang3.reflect.TypeUtils.appendAllTo(TypeUtils.java:302)
+    at org.apache.commons.lang3.reflect.TypeUtils.wildcardTypeToString(TypeUtils.java:1902)
+    at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1734)
+    at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1714)
+    at org.apache.commons.lang3.reflect.TypeUtils.appendAllTo(TypeUtils.java:302)
+    at org.apache.commons.lang3.reflect.TypeUtils.parameterizedTypeToString(TypeUtils.java:1604)
+    at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1731)
+    at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1714)
+    at org.apache.commons.lang3.reflect.TypeUtils.appendAllTo(TypeUtils.java:302)
+    at org.apache.commons.lang3.reflect.TypeUtils.typeVariableToString(TypeUtils.java:1789)
+     * }
+     * 
+ */ @Test public void test_LANG_1698() { // SO on Java 17