Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1524

TypeUtils.toString StackOverflowError for an inner class in the inner class parameterized enclosing class.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.9
    • 3.15.0
    • lang.reflect.*
    • None

    Description

      StackOverflowError occurred on toString for an inner class in the inner class parameterized enclosing class.

       

      source:

      public class Test<T extends Inner> {
        public static class Inner {
        }
      
        public static void main(final String[] args) {
          System.out.println(TypeUtils.toString(Inner.class));
        }
      } 

      result:

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

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            kijong.youn kijong.youn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3h 10m
                3h 10m