ParameterizedTypeImpl should override toString

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 5.0
    • Component/s: core-libs
    • None
    • generic
    • generic

      The ParameterizedType implementation returned by getGenericParameterTypes does not override toString, so printing out one these beasts yields no useful information. The following program illustrates the problem:

      import java.util.*;
      import java.lang.reflect.*;

      public class Junk {
          public static void main(String[] args) throws Exception {
              System.out.println(Junk.class.getMethod("foo", List.class).
                                 getGenericParameterTypes()[0]);
          }

          public void foo(List<String> dogs) {}
      }

      Running this program prints:

      sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl@1a758cb

            Assignee:
            Joe Darcy
            Reporter:
            Josh Bloch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: