javac, known parameter's names should be copied to automatically generated constructors for inner classes

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 8
    • Component/s: tools
    • b94
    • Verified

      When generating the method symbol for the anonymous inner class of the example:

          @Target(value = {ElementType.PARAMETER})
          @interface ParamAnnotation {}

          public class initParams {
              public initParams(@ParamAnnotation int i) {}

              public void m() {
                  new initParams(2) {};
              }
          }

      Javac will create an int parameter for it, named x0 instead of reusing the more logical "i" in this case.
      Also the parameter annotation should be copied to the generated parameter.

            Assignee:
            Vicente Arturo Romero Zaldivar
            Reporter:
            Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: