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

Exception values for AnnotationTypeMismatchException are not always informative

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 17
    • Component/s: core-libs

      Description

      AnnotationTypeMismatchExceptions indicate a change in a class file. However, the values that explain the found, mismatched value are not always explanatory:

      - If an enumeration was found where none should be defined, the type is expressed as a descriptor, not as a binary name. Rather, a binary name should be displayed.
      - If an annotation was found where not should be defined, the annotations implementing proxy type is displayed instead of the actual annotation type. Rather, the annotation value should be displayed.
      - If an array of an incompatible type was found, the array's component type's integer is displayed. Rather, the component type's character symbol should be displayed. (Test requires another fix via https://bugs.openjdk.java.net/browse/JDK-8266766 first which then would entail a validation of this change.)

      The message provided by AnnotationTypeMismatchExceptions is deliberately undefined such that this should not break any contract.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              winterhalter Rafael Winterhalter
              Reporter:
              winterhalter Rafael Winterhalter
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: