Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-558

AnyClass.class and AnyClass.getClass() always return java.lang.Class.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-beta-9
    • None
    • None
    • Windows XP, JDK 1.4, Groovy 6/25 snapshot build

    Description

      The following script demonstrates the problem. The ".class" syntax and calls to getClass() on any class return the same result: java.lang.Class.

      Script:
      -------

      System.out.println java.lang.String.class
      System.out.println java.lang.String.getClass()
      System.out.println java.util.LinkedList.class
      System.out.println java.util.LinkedList.getClass()
      System.out.println java.sql.Timestamp.class
      System.out.println java.sql.Timestamp.getClass()

      Output:
      -------

      class java.lang.Class
      class java.lang.Class
      class java.lang.Class
      class java.lang.Class
      class java.lang.Class
      class java.lang.Class

      This may be related to GROOVY-440:

      http://jira.codehaus.org/browse/GROOVY-440

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            clintcombs Clint Combs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: