You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2017/11/10 16:42:01 UTC

[jira] [Closed] (LANG-1348) StackOverflowError on TypeUtils.toString(...) for a generic return type of Enum.valueOf

     [ https://issues.apache.org/jira/browse/LANG-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pascal Schumacher closed LANG-1348.
-----------------------------------

> StackOverflowError on TypeUtils.toString(...) for a generic return type of Enum.valueOf
> ---------------------------------------------------------------------------------------
>
>                 Key: LANG-1348
>                 URL: https://issues.apache.org/jira/browse/LANG-1348
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.reflect.*
>    Affects Versions: 3.6
>         Environment: Java 8 update 144
>            Reporter: Dmitry Ovchinnikov
>            Assignee: Pascal Schumacher
>             Fix For: 3.7
>
>
> The following code
> {code:java}
> final Method method = Enum.class.getMethod("valueOf", Class.class, String.class);
> final String typeText = TypeUtils.toString(method.getGenericReturnType());
> {code}
> throws the following
> {code:none}
> Exception in thread "main" java.lang.StackOverflowError
> 	at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:126)
> 	at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:40)
> 	at org.apache.commons.lang3.reflect.TypeUtils.parameterizedTypeToString(TypeUtils.java:1790)
> 	at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1666)
> 	at org.apache.commons.lang3.reflect.TypeUtils.appendAllTo(TypeUtils.java:1846)
> 	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.appendAllTo(TypeUtils.java:1846)
> 	at org.apache.commons.lang3.reflect.TypeUtils.parameterizedTypeToString(TypeUtils.java:1803)
> 	at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1666)
> 	at org.apache.commons.lang3.reflect.TypeUtils.appendAllTo(TypeUtils.java:1846)
> 	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.appendAllTo(TypeUtils.java:1846)
> 	at org.apache.commons.lang3.reflect.TypeUtils.parameterizedTypeToString(TypeUtils.java:1803)
> 	at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1666)
> 	at org.apache.commons.lang3.reflect.TypeUtils.appendAllTo(TypeUtils.java:1846)
> 	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.appendAllTo(TypeUtils.java:1846)
> 	at org.apache.commons.lang3.reflect.TypeUtils.parameterizedTypeToString(TypeUtils.java:1803)
> 	at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1666)
> 	at org.apache.commons.lang3.reflect.TypeUtils.appendAllTo(TypeUtils.java:1846)
> 	at org.apache.commons.lang3.reflect.TypeUtils.typeVariableToString(TypeUtils.java:1775)
> 	at org.apache.commons.lang3.reflect.TypeUtils.toString(TypeUtils.java:1672)
> ...
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)