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

getAnnotatedParameterTypes‚Äč() specification should be clarified

    XMLWordPrintable

Details

    • b172
    • b25
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved: