On Thu, 2 Apr 2026 15:52:40 GMT, Aggelos Biboudis <[email protected]> wrote:
> This is the proposed patch for Enhanced Local Variable Declarations (Preview). > > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). src/jdk.compiler/share/classes/com/sun/source/tree/EnhancedVariableDeclTree.java line 44: > 42: */ > 43: > @PreviewFeature(feature=PreviewFeature.Feature.ENHANCED_LOCAL_VARIABLE_DECLARATIONS, > reflective=true) > 44: public interface EnhancedVariableDeclTree extends StatementTree { Just on naming, the Trees API usually does not use shorthands (like "Decl"). I would suggest either `EnhancedVariableDeclarationTree`, or maybe `EnhancedVariableTree` or `EnhancedLocalVariableTree`. src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java line 665: > 663: > 664: public void visitEnhancedVariableDecl(JCEnhancedVariableDecl > tree) { > 665: ListBuffer<PendingExit> prevPendingExits = pendingExits; The `pendingExits` (and `resoveBreaks`) handling here seems suspicious to me. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30556#discussion_r3073302772 PR Review Comment: https://git.openjdk.org/jdk/pull/30556#discussion_r3073398770
