[
https://issues.apache.org/jira/browse/LANG-1524?focusedWorklogId=517697&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-517697
]
ASF GitHub Bot logged work on LANG-1524:
----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Nov/20 23:23
Start Date: 29/Nov/20 23:23
Worklog Time Spent: 10m
Work Description: aakashgupta96 commented on pull request #657:
URL: https://github.com/apache/commons-lang/pull/657#issuecomment-735474553
@garydgregory I agree that the problem is coming only because TypeUtils
Class is trying to display the information of type parameters too.
Java as language allows having type parameters on inner nested classes too,
but we surely can't display type information in these scenarios where we have
circular reference.
Both IntelliJ and Eclipse don't show type information for the classes and
hence they never go in that cyclic loop which java as language supports.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 517697)
Time Spent: 3h (was: 2h 50m)
> 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
> Time Spent: 3h
> Remaining Estimate: 0h
>
> 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)