Uploaded image for project: 'CCC Migration Project'
  1. CCC Migration Project
  2. CCC-7196160

Project Coin: Allow @SafeVarargs on private methods

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API, Language construct
    • Scope:
      SE

      Description

      Summary

      Allow the SafeVarargs annotation to be used on private methods.

      Problem

      One of the rough edges of Project Coin is that @SafeVarargs cannot be applied to a private instance method even though private instance methods cannot be overridden, just like final instances methods and static methods where @SafeVarargs can be applied.

      Solution

      Add the capability for @SafeVarargs to be used on

      Specification

      In the javadoc of the java.lang.SafeVarags annotation, change

      "... it is a compile-time error if a method or constructor declaration is annotated with a @SafeVarargs annotation, and either:

      the declaration is a fixed arity method or constructor the declaration is a variable arity method that is neither static nor final."

      to

      "... it is a compile-time error if a method or constructor declaration is annotated with a @SafeVarargs annotation, and either:

      the declaration is a fixed arity method or constructor the declaration is a variable arity method that is neither static nor final nor private."

      In JLS 9.6.3.7 on SafeVarags, make the following change:

      -It is a compile-time error if a variable arity method declaration that is neither static nor final is annotated with the SafeVarargs annotation.
      +It is a compile-time error if a variable arity method declaration that is neither static nor final nor private is annotated with the SafeVarargs annotation.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              darcy Joe Darcy
              Reviewed By:
              Alex Buckley
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: