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

Project Coin: Allow @SafeVarargs on private methods

    Details

    • Subcomponent:
    • Introduced In Build:
      b123
    • Introduced In Version:
      7
    • Resolved In Build:
      b22
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      A SafeVarargs annotation can only be applied to variable-arity executables that are one of:

      * static methods
      * final methods
      * constructors (which from a certain point of view are a special kind of static method)

      None of these executables can be overriden, which is a constraint since annotation are only inherited along the superclass chain at a type level and *not* at the method/constructor level. Since annotations are not inherited at the method level, an overriding method could knowingly or unknowingly violate the @SafeVararags constraint of the overridden method.

      Another kind of non-overridable executable is a private method. Therefore, it would be reasonable to allow @SafeVarargs to be applied to private methods too.

        Issue Links

          Activity

          Show
          darcy Joe Darcy added a comment - Review thread: http://mail.openjdk.java.net/pipermail/compiler-dev/2014-June/008855.html
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/dev/langtools/rev/9fe158562a96
          User: darcy
          Date: 2014-06-24 17:51:10 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/langtools/rev/9fe158562a96 User: darcy Date: 2014-06-24 17:51:10 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/langtools/rev/9fe158562a96
          User: lana
          Date: 2014-07-09 17:52:48 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/langtools/rev/9fe158562a96 User: lana Date: 2014-07-09 17:52:48 +0000

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: