RFR: JDK-8192963/JDK-8206986 JEP 325: Switch Expressions (Preview)
jonathan.gibbons at oracle.com
Fri Jul 27 23:12:34 UTC 2018
CaseTree.java:52: spelling, "lables"
CaseTree.java:84: "return" should be "returns".
Lots of @Deprecated annotations without corresponding @deprecated
Should the @apiNote really be @deprecated. I also think that using
like this is "a bit smelly", and had a discussion with Stuart "Dr
my concerns. If nothing else, assuming the feature is a success, we are
a precedent of marking an API as deprecated-for-removal, and then in the
release, simply removing the annotation.
Attr.java:1482: ugly use of @SuppressWarnings. I understand why it is there,
but it exemplifies why @Deprecated on the declaration is a bad idea.
It'll be too easy to not remove these annotations in JDK 13.
Attr:1825: why XXX
LambdaToMethod: unnecessary new import, CaseKind
Flow: unnecessary new import, CaseKind
JavacParser: order of imports
messages: generally, I think the text of the messages could be improved
(related but not new) we should somehow identify language keywords from
English text (i.e. words like `break, `case`, `continue`, `return`)
204: saying the name is both a valid label and a valid expression hints
at the cause but not the error (i.e. the name is ambiguous)
JCTree: inconsistent layout of annotations; inconsistent use of
@Deprecated and @Deprecated(forRemoval=true)
Not reviewed in detail yet.
New test descriptions should use "/*" for jtreg comment block; not
"/**". These are not javadoc documentation comments.
New test descriptions should have @summary
Presumably, we will have to change the -old.out files if the preview
feature becomes standard in JDK 13.
The logic is nice, but the use of @Deprecated(forRemoval=true) and
resulting @SuppressWarnings really suck.
I don't think the current practice is serving us well.
On 07/17/2018 11:00 AM, Jan Lahoda wrote:
> As JEP 325 is in the proposed to target state, I thought it might be a
> good idea to start a review process for the code.
> The code here strives to implement the current specification for the
> Switch Expressions:
> The current webrev is here:
> (includes a list of new errors.)
> Any feedback is welcome!
More information about the compiler-dev