| Summary: | [12] EJC allows switch expression to be concluded without returning a value | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Nir Lisker <nlisker> |
| Component: | Core | Assignee: | Manoj N Palat <manoj.palat> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | jarthana, manoj.palat |
| Version: | 4.9 | ||
| Target Milestone: | 4.12 M3 | ||
| Hardware: | PC | ||
| OS: | Windows 10 | ||
| See Also: |
https://git.eclipse.org/r/141124 https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=a8d59be0a1fe090c489c1eb9fda14a27bfb7fb74 https://git.eclipse.org/r/142563 https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=3d670fe48cd3ec2fe4d3f7a2fca5830a4057291b |
||
| Whiteboard: | |||
|
Description
Nir Lisker
New Gerrit change created: https://git.eclipse.org/r/141124 (In reply to Eclipse Genie from comment #1) > New Gerrit change created: https://git.eclipse.org/r/141124 Patch above flags this code as illegal. [Side-note: With the change envisaged in https://mail.openjdk.java.net/pipermail/amber-spec-experts/2019-April/001232.html we should be able to improve the error message in Java 13 time-frame] Gerrit change https://git.eclipse.org/r/141124 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=a8d59be0a1fe090c489c1eb9fda14a27bfb7fb74 I have verified that compiler now reports the expected problem, but the new error message could be better worded/formatted: Illegal last statement in Switch expression case body - continue, return not allowed I think we should use one of "continue and return are not allowed" (or) "Illegal last statement: continue" but having both is redundant. If we are using the first, we should use ":" instead of "-" for consistency sake. And for the latter, it should be "and/or= instead of ",". Probably not worth a new bug and we can take this up now or for RC1? (In reply to Jay Arthanareeswaran from comment #4) > I have verified that compiler now reports the expected problem, but the new > error message could be better worded/formatted: > See comment 2 - will change the error message in Java 13 time frame. (In reply to Manoj Palat from comment #5) > (In reply to Jay Arthanareeswaran from comment #4) > > I have verified that compiler now reports the expected problem, but the new > > error message could be better worded/formatted: > > > See comment 2 - will change the error message in Java 13 time frame. @Jay: Please note that the relevant part in the spec is undergoing a change, expected to be stabilized in a few weeks. Hence this message will be changed anyway once there is an agreement in the spec. (In reply to Manoj Palat from comment #6) > @Jay: Please note that the relevant part in the spec is undergoing a change, > expected to be stabilized in a few weeks. Hence this message will be changed > anyway once there is an agreement in the spec. I am not sure if that will happen before 4.12? If not, this should go into 4.12. This message will be seen by users and probably translated as well. So, we should make it consistent with our standards. New Gerrit change created: https://git.eclipse.org/r/142563 (In reply to Jay Arthanareeswaran from comment #7) Updating the result of an offline discussion: Jay will go ahead with this patch for 4.12. Further changes once the spec freezes will be targeted for 4.13. Gerrit change https://git.eclipse.org/r/142563 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=3d670fe48cd3ec2fe4d3f7a2fca5830a4057291b Verified for 4.12 M3 using build I20190521-1800 |