JDK 9 RFR of JDK-8048014: Update java.lang.SafeVararags for private methods
Hello, Please review the libraries update portion of allowing @SafeVarargs on private instance methods: JDK-8048014: Update java.lang.SafeVararags for private methods The patch is diff -r 6c26f18d9bc0 src/share/classes/java/lang/SafeVarargs.java --- a/src/share/classes/java/lang/SafeVarargs.java Mon Jun 23 12:12:30 2014 -0700 +++ b/src/share/classes/java/lang/SafeVarargs.java Tue Jun 24 10:03:21 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ * <li> the declaration is a fixed arity method or constructor * * <li> the declaration is a variable arity method that is neither - * {@code static} nor {@code final}. + * {@code static} nor {@code final} nor {@code private}. * * </ul> * The bulk of the change to allow @SafeVarargs on private methods, including the tests, are over in the langtools repo with javac updates. The javac changes have been reviewed and approved on compiler-dev: http://mail.openjdk.java.net/pipermail/compiler-dev/2014-June/008855.html Thanks, -Joe
+1 On Jun 24, 2014, at 1:13 PM, Joe Darcy <joe.darcy@oracle.com> wrote:
Hello,
Please review the libraries update portion of allowing @SafeVarargs on private instance methods:
JDK-8048014: Update java.lang.SafeVararags for private methods
The patch is
diff -r 6c26f18d9bc0 src/share/classes/java/lang/SafeVarargs.java --- a/src/share/classes/java/lang/SafeVarargs.java Mon Jun 23 12:12:30 2014 -0700 +++ b/src/share/classes/java/lang/SafeVarargs.java Tue Jun 24 10:03:21 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ * <li> the declaration is a fixed arity method or constructor * * <li> the declaration is a variable arity method that is neither - * {@code static} nor {@code final}. + * {@code static} nor {@code final} nor {@code private}. * * </ul> *
The bulk of the change to allow @SafeVarargs on private methods, including the tests, are over in the langtools repo with javac updates. The javac changes have been reviewed and approved on compiler-dev:
http://mail.openjdk.java.net/pipermail/compiler-dev/2014-June/008855.html
Thanks,
-Joe
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen@oracle.com
Will there be another ticket to update the section (9.6.4.7.) in JLS 9? Cheers, Paul On Tue, Jun 24, 2014 at 12:27 PM, Lance Andersen <Lance.Andersen@oracle.com> wrote:
+1 On Jun 24, 2014, at 1:13 PM, Joe Darcy <joe.darcy@oracle.com> wrote:
Hello,
Please review the libraries update portion of allowing @SafeVarargs on private instance methods:
JDK-8048014: Update java.lang.SafeVararags for private methods
The patch is
diff -r 6c26f18d9bc0 src/share/classes/java/lang/SafeVarargs.java --- a/src/share/classes/java/lang/SafeVarargs.java Mon Jun 23 12:12:30 2014 -0700 +++ b/src/share/classes/java/lang/SafeVarargs.java Tue Jun 24 10:03:21 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ * <li> the declaration is a fixed arity method or constructor * * <li> the declaration is a variable arity method that is neither - * {@code static} nor {@code final}. + * {@code static} nor {@code final} nor {@code private}. * * </ul> *
The bulk of the change to allow @SafeVarargs on private methods, including the tests, are over in the langtools repo with javac updates. The javac changes have been reviewed and approved on compiler-dev:
http://mail.openjdk.java.net/pipermail/compiler-dev/2014-June/008855.html
Thanks,
-Joe
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen@oracle.com
On 06/24/2014 10:43 AM, Paul Benedict wrote:
Will there be another ticket to update the section (9.6.4.7.) in JLS 9?
JDK-8047159: 9.6.4.7: Allow @SafeVarargs on private methods https://bugs.openjdk.java.net/browse/JDK-8047159 Cheers, -Joe
Cheers, Paul
On Tue, Jun 24, 2014 at 12:27 PM, Lance Andersen <Lance.Andersen@oracle.com <mailto:Lance.Andersen@oracle.com>> wrote:
+1 On Jun 24, 2014, at 1:13 PM, Joe Darcy <joe.darcy@oracle.com <mailto:joe.darcy@oracle.com>> wrote:
> Hello, > > Please review the libraries update portion of allowing @SafeVarargs on private instance methods: > > JDK-8048014: Update java.lang.SafeVararags for private methods > > The patch is > > diff -r 6c26f18d9bc0 src/share/classes/java/lang/SafeVarargs.java > --- a/src/share/classes/java/lang/SafeVarargs.java Mon Jun 23 12:12:30 2014 -0700 > +++ b/src/share/classes/java/lang/SafeVarargs.java Tue Jun 24 10:03:21 2014 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -45,7 +45,7 @@ > * <li> the declaration is a fixed arity method or constructor > * > * <li> the declaration is a variable arity method that is neither > - * {@code static} nor {@code final}. > + * {@code static} nor {@code final} nor {@code private}. > * > * </ul> > * > > The bulk of the change to allow @SafeVarargs on private methods, including the tests, are over in the langtools repo with javac updates. The javac changes have been reviewed and approved on compiler-dev: > > http://mail.openjdk.java.net/pipermail/compiler-dev/2014-June/008855.html > > Thanks, > > -Joe
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen@oracle.com <mailto:Lance.Andersen@oracle.com>
Hi Joe, Just for completeness, there is another case where @SafeVarargs is safe, any methods of an internal class (inner class static or not) declared private that is not overridden. because the internal class is private, the compiler can easily check all possible subclasses in the compilation unit of that class. cheers, Rémi On 06/24/2014 07:13 PM, Joe Darcy wrote:
Hello,
Please review the libraries update portion of allowing @SafeVarargs on private instance methods:
JDK-8048014: Update java.lang.SafeVararags for private methods
The patch is
diff -r 6c26f18d9bc0 src/share/classes/java/lang/SafeVarargs.java --- a/src/share/classes/java/lang/SafeVarargs.java Mon Jun 23 12:12:30 2014 -0700 +++ b/src/share/classes/java/lang/SafeVarargs.java Tue Jun 24 10:03:21 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ * <li> the declaration is a fixed arity method or constructor * * <li> the declaration is a variable arity method that is neither - * {@code static} nor {@code final}. + * {@code static} nor {@code final} nor {@code private}. * * </ul> *
The bulk of the change to allow @SafeVarargs on private methods, including the tests, are over in the langtools repo with javac updates. The javac changes have been reviewed and approved on compiler-dev:
http://mail.openjdk.java.net/pipermail/compiler-dev/2014-June/008855.html
Thanks,
-Joe
Hi Remi, Thanks for the note. However, I don't plan to extend @SafeVarargs to cover this case. Cheers, -Joe On 6/25/2014 1:35 AM, Remi Forax wrote:
Hi Joe,
Just for completeness, there is another case where @SafeVarargs is safe, any methods of an internal class (inner class static or not) declared private that is not overridden.
because the internal class is private, the compiler can easily check all possible subclasses in the compilation unit of that class.
cheers, Rémi
On 06/24/2014 07:13 PM, Joe Darcy wrote:
Hello,
Please review the libraries update portion of allowing @SafeVarargs on private instance methods:
JDK-8048014: Update java.lang.SafeVararags for private methods
The patch is
diff -r 6c26f18d9bc0 src/share/classes/java/lang/SafeVarargs.java --- a/src/share/classes/java/lang/SafeVarargs.java Mon Jun 23 12:12:30 2014 -0700 +++ b/src/share/classes/java/lang/SafeVarargs.java Tue Jun 24 10:03:21 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ * <li> the declaration is a fixed arity method or constructor * * <li> the declaration is a variable arity method that is neither - * {@code static} nor {@code final}. + * {@code static} nor {@code final} nor {@code private}. * * </ul> *
The bulk of the change to allow @SafeVarargs on private methods, including the tests, are over in the langtools repo with javac updates. The javac changes have been reviewed and approved on compiler-dev:
http://mail.openjdk.java.net/pipermail/compiler-dev/2014-June/008855.html
Thanks,
-Joe
participants (4)
-
Joe Darcy
-
Lance Andersen
-
Paul Benedict
-
Remi Forax