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

Elements.getTypeElement(String s) does expect binary name as a parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 6
    • Component/s: core-libs

      Description

      The spec says:
      ----
      TypeElement getTypeElement(String name)

          Returns a type element given its *fully qualified name*.

          Parameters:
              name - fully qualified type name
          Returns:
              the named type element, or null if it cannot be found
      ----

      However, the example below shows that *fully qualified name* is refused, but the binary name expected:
      ---
      package test;

      public class S_TE0015 {
          public class Inner {}
      }
      ---

      // This fails with "com.sun.tools.javac.code.Symbol$CompletionFailure: class file for test.S_TE0015.Inner not found"
      // getTypeElement("test.S_TE0015.Inner");

      // But this works...
      getTypeElement("test.S_TE0015$Inner");
      ---

      During the discussion with Peter, Joe and Scott it was found out that this is not a simple issue. Perhaps, a spec clarification is needed. Filing this bug for tracking.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: