Skip to content

docs(agents): align AGENTS.md to Java 11 reality#2947

Merged
bjagg merged 1 commit into
uPortal-Project:masterfrom
bjagg:docs/agents-java-11-align
Apr 24, 2026
Merged

docs(agents): align AGENTS.md to Java 11 reality#2947
bjagg merged 1 commit into
uPortal-Project:masterfrom
bjagg:docs/agents-java-11-align

Conversation

@bjagg

@bjagg bjagg commented Apr 24, 2026

Copy link
Copy Markdown
Member

Summary

AGENTS.md had two pieces of outdated guidance that contradicted the project's actual Java 11 stance:

  1. Banned-patterns table still flagged Java 9–11 features as banned (var, List.of()/Map.of(), Optional.isEmpty(), String.isBlank()), even though the file's own tech-stack section says "sourceCompatibility 11". Since uPortal compiles under Java 11, those features are allowed.

  2. SDKMAN section told agents to install and use java 8.0.472-amzn, annotated as "required for uPortal-start". uPortal-start also moved to Java 11, so that guidance sends agents down a broken path.

Changes

All documentation — no code changes.

Banned-patterns table — the ban line shifts from "Java 9+" to "Java 12+"

Dropped rows for features allowed on Java 11:

  • var
  • List.of(), Map.of()
  • Optional.isEmpty()
  • String.isBlank()

Replaced the single "Records, text blocks, sealed classes" row with explicit per-feature rows, each annotated with the Java version that introduced it:

  • Switch expressions with -> (Java 14+)
  • Text blocks """...""" (Java 15+)
  • Records (Java 16+)
  • Pattern matching for instanceof (Java 16+)
  • Sealed classes / non-sealed / permits (Java 17+)
  • Pattern matching for switch (Java 21+)

Kept unchanged: JUnit 5 annotations, inline Gradle versions, commons-logging.

Added a short lead-in above the table clarifying that Java 9–11 features are fair game and the ban line is Java 12.

Checklist + Boundaries

"No Java 9+ language features or APIs used" → "No Java 12+ ..." (both occurrences).

SDKMAN section

8.0.472-amzn11.0.30-amzn in the install / switch / default example commands, and in the troubleshooting table's "Java version mismatch" fix line. Updated the prose to say both uPortal and uPortal-start require Java 11, and added a note about the .sdkmanrc + sdk env in each repo.

Test plan

  • grep "Java 8\|8\.0\." AGENTS.md — no stale refs remain
  • Build commands in the file still apply as-is (no tooling changes)

🤖 Generated with Claude Code

Problem: AGENTS.md claimed Java 11 source compatibility but
still banned Java 9-11 language features (`var`, `List.of()`,
`Optional.isEmpty()`, `String.isBlank()`, etc.) in its
banned-patterns table. The SDKMAN section also told agents to
install and use Java 8 ("required for uPortal-start"), which
no longer matches reality — uPortal-start also moved to Java 11.
This left readers with two contradictory answers about what
Java version applies.

Goal: have the banned-patterns table, checklist, boundaries,
and SDKMAN guidance all reflect the real ceiling: Java 11 is
allowed in full, Java 12+ is off-limits; JUnit 4 remains the
test stack; uPortal-start runs on Java 11.

Changes:
- Banned-patterns table: drop `var`, `List.of()`/`Map.of()`,
  `Optional.isEmpty()`, `String.isBlank()` (all Java 9–11,
  now allowed). Expand the Java 12+ row into explicit rows
  per feature: switch expressions with `->`, text blocks,
  records, pattern matching for `instanceof`/`switch`, sealed
  classes. Keep the JUnit 5 / inline-versions / commons-logging
  bans unchanged.
- Add a lead-in sentence above the table stating that the ban
  line is Java 12 and later.
- Checklist: "No Java 9+ language features or APIs used"
  → "No Java 12+ ..."
- Boundaries: same rewording.
- SDKMAN section: install/switch/default commands updated
  from `8.0.472-amzn` to `11.0.30-amzn`. Prose updated to say
  both uPortal and uPortal-start require Java 11. Added a
  note pointing at the `.sdkmanrc` in each repo and
  `sdk env`.
- Troubleshooting table: Java-version-mismatch fix command
  updated to `sdk use java 11.0.30-amzn`.

Notes: no code changes; this is purely documentation
alignment. Spot-checked grep for remaining "Java 8" / "8.0."
references — all gone.
@bjagg bjagg merged commit 6ddf2c9 into uPortal-Project:master Apr 24, 2026
5 checks passed
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.

2 participants