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

[lworld] Various internal Type/Symbol APIs need rationalization/adjustment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • tools
    • generic
    • generic

      As things exist there are a bunch of problems with the following API points in Valhalla:

      (1) com.sun.tools.javac.code.Type.ClassType#isReference always returns true - For primitive class types it should not be return true

      (2) Likewise com.sun.tools.javac.code.Type.TypeVar#isReference
      and com.sun.tools.javac.code.Type.WildcardType#isReference always return true. What is it is T/? extends PrimitiveObject ??

      (3) Likewise all implementations of com.sun.tools.javac.code.Type#isNullOrReference needs to be inspected to see if they do the reasonable thing.

      (4) Type.isValueProjection() is missing

      (5) Maurizio's observations in https://github.com/openjdk/valhalla/pull/482:
      "leaving a method in Types called isPrimitiveClass which takes a type and return false when the type is derived from a primitive class seems suboptimal. See my comment on Type::isPrimitiveClass. I think what you want there is probably isPrimitiveType. or isValueType or something like that - stay away from Class."

      (My response there:
      "Since we already have com.sun.tools.javac.code.Type#isPrimitive it is useful to retain to "Class" somewhere in the new APIs name although perhaps not in the present form of Type#isPrimitiveClass()

      Perhaps the old method should be renamed to isBasicPrimitive() and the new one should be isPrimitiveClassType()")

      (6) Maurizio asks in https://github.com/openjdk/valhalla/pull/482:
      I think we should probably change the metamorphose name to a more neutral one like update ?(com.sun.tools.javac.code.Type.ClassType.Flavor#metamorphose)


      [add others]

            vromero Vicente Arturo Romero Zaldivar
            sadayapalam Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: