Mykhailo Hryb created LANG-1792:
-----------------------------------

             Summary: TypeUtils.toString() skips angle brackets for Class type
                 Key: LANG-1792
                 URL: https://issues.apache.org/jira/browse/LANG-1792
             Project: Commons Lang
          Issue Type: Bug
            Reporter: Mykhailo Hryb


There is a regression for method TypeUtils.toString() between commons-lang 3.10 
and commons-lang 3.18.0.

The generics angle brackets ("<",">") are skipped for classToString method 
inside TypeUtils.toString().

For example, let's see if we have a class:
{code:java}
public class TestClass<P extends SomeClass> {
}{code}
If we execute:

{code:java}
System.out.println(TypeUtils.toString(TestClass.class));{code}
For commons-lang 3.10 we see the result:

{code:java}
org.example.TestClass<P extends org.example.SomeClass>{code}
But for commons-lang 3.18.0 we have this result:

{code:java}
org.example.TestClassP extends org.example.SomeClass{code}

To fix this, it is possibly needed to change CTJ_JOINER to GT_JOINER in this 
line:
https://github.com/apache/commons-lang/blob/rel/commons-lang-3.18.0/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java#L361



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to