commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1348) StackOverflowError on TypeUtils.toString(...) for a generic return type of Enum.valueOf
Date Fri, 29 Sep 2017 00:57:00 GMT

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

ASF GitHub Bot commented on LANG-1348:
--------------------------------------

GitHub user mbusso opened a pull request:

    https://github.com/apache/commons-lang/pull/292

    LANG-1348 - StackOverflowError on TypeUtils.toString

    StackOverflowError on TypeUtils.toString(...) for a generic return type of Enum.valueOf

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mbusso/commons-lang master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/292.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #292
    
----
commit 39df422dd3f36be889d6e174a94a24449373de6d
Author: mbusso <matiassbb@gmail.com>
Date:   2017-09-29T00:51:24Z

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

----


> 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
>
> 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)

Mime
View raw message