On Mon, 13 Apr 2026 13:29:23 GMT, Jan Lahoda <[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`. Fixed > 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. Fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30556#discussion_r3166695674 PR Review Comment: https://git.openjdk.org/jdk/pull/30556#discussion_r3166694817
