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

javac does not accept classfiles with certain permitted RuntimeVisibleParameterAnnotations and RuntimeInvisibleParameterAnnotations attributes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • tools
    • b15

      JVMS 4.7.18 and 4.7.19 say this about the entries in the RuntimeVisibleParameterAnnotations and RuntimeInvisibleParameterAnnotations attributes:

      The i'th entry in the parameter_annotations table may, but is not required to, correspond to the i'th parameter descriptor in the method descriptor (§4.3.3).

      I.e. there is no requirement for this attribute to contain entries for all parameters, and it is not required for this attribute to not contain additional entries. (It also does not specify the ordering of the annotations.) javac only accepts these attributes if the number of entries matches the number of parameters in the Signature attribute, or the number of parameters in the method descriptor if the Signature attribute is not present.

      javac should be adjusted to tolerate other attributes as well, possibly by ignoring them, if it cannot heuristically assign the annotations to the parameters.

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: