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

getAnnotatedParameterTypes​() specification should be clarified

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Build:
      b172
    • Resolved In Build:
      b25
    • Verification:
      Not verified

      Backports

        Description

        The getAnnotatedParameterTypes​() specification incorrectly defines its behavior in case of no-args constructor for inner classes.
        The specification states: "Returns an array of length 0 if the method/constructor declares no parameters."
        Actual behavior is :
        --------------------------------------------------
        class ConsParamData {
            public class Inner {
                public Inner(@Anno(0) ConsParamData ConsParamData.this) {}
                public class InnerInner {
                    public InnerInner() {}
                }
            }
        }

         params={ConsParamData} ConsParamData.Inner.class.getConstructor(params).getAnnotatedParameterTypes()
         [ ctor == public Inner(@Anno(0) ConsParamData ConsParamData.this) {} ]
         returns { ConsParamData }.length() == 1
         
         params={ ConsParamData.Inner} ConsParamData.Inner.InnerInner.class.getConstructor(params).getAnnotatedParameterTypes()
         [ ctor == public InnerInner() {} ]
         returns { ConsParamData$Inner }.length() == 1
        --------------------------------

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                darcy Joe Darcy
                Reporter:
                lkuskov Leonid Kuskov
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: