Source:
<code>private WindowDefinition getWindowDefinition(Optional<Window> maybeWindow, ExpressionAnalysisContext context) { if (!maybeWindow.isPresent()) { return null; } <START> var overWindow = maybeWindow.get(); <END> final Window window; if (overWindow.windowRef() != null) { var refWindow = resolveWindowRef(overWindow.windowRef(), context.windows()); window = overWindow.merge(refWindow); } else { window = overWindow; } List<Symbol> partitionSymbols = new ArrayList<>(window.getPartitions().size()); for (Expression partition : window.getPartitions()) { Symbol symbol = convert(partition, context); SemanticSortValidator.validate(symbol, "PARTITION BY"); partitionSymbols.add(symbol); } OrderBy orderBy = OrderyByAnalyzer.analyzeSortItems(window.getOrderBy(), sortKey -> { Symbol symbol = convert(sortKey, context); SemanticSortValidator.validate(symbol); return symbol; }); WindowFrameDefinition windowFrameDefinition = WindowDefinition.RANGE_UNBOUNDED_PRECEDING_CURRENT_ROW; if (window.getWindowFrame().isPresent()) { WindowFrame windowFrame = window.getWindowFrame().get(); validateFrame(windowFrame); FrameBound start = windowFrame.getStart(); FrameBoundDefinition startBound = convertToAnalyzedFrameBound(context, start); FrameBoundDefinition endBound = windowFrame.getEnd() .map(end -> convertToAnalyzedFrameBound(context, end)) .orElse(new FrameBoundDefinition(FrameBound.Type.CURRENT_ROW)); windowFrameDefinition = new WindowFrameDefinition(windowFrame.getType(), startBound, endBound); } return new WindowDefinition(partitionSymbols, orderBy, windowFrameDefinition); }</code><technical_language>rename like: suggestion var unresolvedWindow = maybeWindow.get(); final Window resolvedWindow; clarify difference overWindow window</technical_language>

Target:
private WindowDefinition getWindowDefinition(Optional<Window> maybeWindow, ExpressionAnalysisContext context) { if (!maybeWindow.isPresent()) { return null; } var unresolvedWindow = maybeWindow.get(); final Window window; if (unresolvedWindow.windowRef() != null) { var refWindow = resolveWindowRef(unresolvedWindow.windowRef(), context.windows()); window = unresolvedWindow.merge(refWindow); } else { window = unresolvedWindow; } List<Symbol> partitionSymbols = new ArrayList<>(window.getPartitions().size()); for (Expression partition : window.getPartitions()) { Symbol symbol = convert(partition, context); SemanticSortValidator.validate(symbol, "PARTITION BY"); partitionSymbols.add(symbol); } OrderBy orderBy = OrderyByAnalyzer.analyzeSortItems(window.getOrderBy(), sortKey -> { Symbol symbol = convert(sortKey, context); SemanticSortValidator.validate(symbol); return symbol; }); WindowFrameDefinition windowFrameDefinition = WindowDefinition.RANGE_UNBOUNDED_PRECEDING_CURRENT_ROW; if (window.getWindowFrame().isPresent()) { WindowFrame windowFrame = window.getWindowFrame().get(); validateFrame(windowFrame); FrameBound start = windowFrame.getStart(); FrameBoundDefinition startBound = convertToAnalyzedFrameBound(context, start); FrameBoundDefinition endBound = windowFrame.getEnd() .map(end -> convertToAnalyzedFrameBound(context, end)) .orElse(new FrameBoundDefinition(FrameBound.Type.CURRENT_ROW)); windowFrameDefinition = new WindowFrameDefinition(windowFrame.getType(), startBound, endBound); } return new WindowDefinition(partitionSymbols, orderBy, windowFrameDefinition); }