Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6423973

getReturnType() returns VoidType for a constructor

XMLWordPrintable

    • b91
    • generic
    • generic
    • Verified

      The specification for the method getReturnType() in javax.lang.model.element.ExecutableElement says:

      ---
      TypeMirror getReturnType()
          Returns the return type if this executable represents *a method*. Returns *NoType otherwise*. Returns VoidType if this executable is a method that does not return a value.

             ...
      ---

        For a constructor in the following example VoidType is returned:

      public class S_EE0004 extends TestSource {
          public S_EE0004(Integer param) {}
      }

            sseligmasunw Scott Seligman (Inactive)
            ashusher Alexander Shusherov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: