You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2020/03/06 16:30:00 UTC

[jira] [Commented] (LANG-1524) TypeUtils.toString StackOverflowError for an inner class in the inner class parameterized enclosing class.

    [ https://issues.apache.org/jira/browse/LANG-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053576#comment-17053576 ] 

Gary D. Gregory commented on LANG-1524:
---------------------------------------

[~kijong.youn]

May you provide a patch with this test on GitHub and a fix if you feel so inclined?

Thank you,

Gary

> TypeUtils.toString StackOverflowError for an inner class in the inner class parameterized enclosing class.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: LANG-1524
>                 URL: https://issues.apache.org/jira/browse/LANG-1524
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.reflect.*
>    Affects Versions: 3.9
>            Reporter: kijong.youn
>            Priority: Major
>
> StackOverflowError occurred on toString for an inner class in the inner class parameterized enclosing class.
>  
> source:
> {code:java}
> public class Test<T extends Inner> {
>   public static class Inner {
>   }
>   public static void main(final String[] args) {
>     System.out.println(TypeUtils.toString(Inner.class));
>   }
> } {code}
> result:
> {code:java}
> Exception in thread "main" java.lang.StackOverflowErrorException in thread "main" java.lang.StackOverflowError at java.lang.Class.getEnclosingMethodInfo(Class.java:1072) at java.lang.Class.getEnclosingClass(Class.java:1272) at org.apache.commons.lang3.reflect.TypeUtils.classToString(TypeUtils.java:1751) at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1663) at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1891) at org.apache.commons.lang3.reflect.TypeUtils.appendAllTo(TypeUtils.java:1882) at org.apache.commons.lang3.reflect.TypeUtils.typeVariableToString(TypeUtils.java:1775) at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1672) at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1891) at org.apache.commons.lang3.reflect.TypeUtils.appendAllTo(TypeUtils.java:1882) at org.apache.commons.lang3.reflect.TypeUtils.classToString(TypeUtils.java:1758) at org.apache.commons.lang3.reflect.TypeUtils.classToString(TypeUtils.java:1752)
> ...{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)