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

Incomplete classpath causes infinite recursion in Resolve.isAccessible

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 11
    • tools
    • None
    • behavioral
    • minimal
    • Java API
    • Implementation

      Summary

      Change the implementation of javax.lang.model.type.ErrorType.getEnclosingType() to return an object with TypeKind.NONE, instead of an object with TypeKind.ERROR.

      Problem

      Currently, the javac's implementation of ErrorType.getEnclosingType() will return the type itself. This is causing problems even to javac as such, and seems unlikely to be useful to API users (as they might need to prevent a recursive walk through the enclosing types).

      Solution

      Return a type with TypeKind.NONE from javax.lang.model.type.ErrorType.getEnclosingType(), unconditionally.

      Specification

      javax.lang.model.type.ErrorType.getEnclosingType() unconditionally return a TypeMirror with TypeKind.NONE. No javadoc change.

            jlahoda Jan Lahoda
            cushon Liam Miller-Cushon
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: