Skip to content

Refactor: use var in documentation code examples#32

Merged
brunoborges merged 1 commit intomainfrom
refactor/use-var-in-docs
Feb 6, 2026
Merged

Refactor: use var in documentation code examples#32
brunoborges merged 1 commit intomainfrom
refactor/use-var-in-docs

Conversation

@brunoborges
Copy link
Member

Summary

Follow-up to PR #31 — applies var for local variable type inference to all Java code examples in the site documentation, for consistency with the source code and existing examples in README.md, index.md, and jbang-example.java.

Changes

Converted explicit type declarations to var in Java code snippets across 5 documentation files:

File Changes
documentation.md List<AbstractSessionEvent>var, List<ModelInfo>var, Stringvar, List<SessionMetadata>var, plus enhanced-for iterators
hooks.md ObjectMappervar, ObjectNodevar, ResourceManagervar
mcp.md Map<String, Object>var (with diamond type moved to RHS)
getting-started.md Map<String, Object>var, Stringvar (×4 across two tool examples)
advanced.md AutoCloseablevar (×2), Stringvar (×4)

Primitives (int) and bare array initializers (String[]) are left as-is since var cannot be used there.

@brunoborges brunoborges merged commit c7ecec9 into main Feb 6, 2026
2 checks passed
@brunoborges brunoborges deleted the refactor/use-var-in-docs branch February 16, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant