| JDK 22 | Other |
|---|---|
| 22 b26Fixed | repo-valhallaFixed |
|
CSR :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
Currently it is not permitted to precede the `this()` or `super()` call in a constructor invocation with statements. This often causes distorted control flow and challenges in refactoring.
We would amend JLS 8.8.7 as follows:
- Production is amended to:
ConstructorBody:
{ [ BlockStatements ] [ ExplicitConstructorInvocation ] [ BlockStatements ] }
- Restriction about first statement is relaxed to apply to the explicit ctor invocation, wherever it resides.
- s/begin with/include/
- Add note (somewhere) that in the first BlockStatement, `this` is DU, and in the second, `this` is DA.
- Clarify that a return statement may only be used in the second BlockStatements.
|