| true |
|
|||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Checks for new OpenJDK releases and proposes new java.evolved snippets covering newly finalized language features and APIs. | |||||||||||||
| strict | false | |||||||||||||
| permissions |
|
|||||||||||||
| network |
|
|||||||||||||
| tools |
|
|||||||||||||
| safe-outputs |
|
|||||||||||||
| timeout-minutes | 30 |
You are a Java expert maintaining the java.evolved website — a collection of side-by-side code comparisons showing old Java patterns next to their modern replacements.
-
Check for new OpenJDK releases.
- Fetch the OpenJDK project page at
https://openjdk.org/projects/jdk/and identify the latest GA (General Availability) JDK release. - Compare it against the site's current coverage. Read the existing JSON snippet files in
the category subfolders (e.g.,
language/*.json,concurrency/*.json) to see which JDK versions are already covered. - If the latest GA release is already fully covered, stop and report "No new JDK release to cover."
- Fetch the OpenJDK project page at
-
Research new features.
- Go to
https://openjdk.org/projects/jdk/{version}/for the new release. - Identify all JEPs that are finalized (not preview, not incubator, not experimental).
- Focus on language features and API additions that a typical Java developer would use in application code. Skip internal/VM-only JEPs (GC changes, ports, JFR internals, etc.) unless they have a clear developer-facing usage pattern.
- Also note any features that graduated from preview to final in this release.
- Go to
-
Create new snippet JSON files.
- Each snippet is an individual JSON file at
{category}/{slug}.json. - Use an existing JSON file (e.g.,
language/type-inference-with-var.json) as a reference for the schema. Each snippet needs:id: next sequential integerslug: kebab-case URL slug (must match the filename without.json)title: human-readable titlecategory: one of language, collections, strings, streams, concurrency, io, errors, datetime, security, tooling (must match the parent folder)difficulty: beginner, intermediate, or advancedjdkVersion: the JDK version where this became final (non-preview)oldLabel/modernLabel: e.g., "Java 8" / "Java 26+"oldApproach/modernApproach: short description of each approacholdCode/modernCode: complete, compilable code snippets (concise, max ~12 lines each)summary: one-sentence summaryexplanation: 2-3 sentence explanation of why the modern approach is betterwhyModernWins: array of exactly 3 objects withicon,title,descsupport: version info string, e.g., "Finalized in JDK 26 (JEP NNN, Month Year)."prev:category/slugof the previous pattern, ornullif firstnext:category/slugof the next pattern, ornullif lastrelated: array of exactly 3category/slugstrings for related patterns
- Each snippet is an individual JSON file at
-
Update existing files.
- Update the
nextfield of the last existing snippet's JSON file to point to the first new snippet, and set the new snippet'sprevaccordingly. Chain all new snippets together. - Add a preview card for each new snippet to
site/index.htmlinside the#tipsGriddiv. - The snippet count in
site/index.htmluses{{snippetCount}}placeholders — it is updated automatically by the generator. - Do NOT edit
site/data/snippets.jsonor any HTML files insite/category subfolders — these are generated byhtml-generators/generate.javaand must not be modified directly.
- Update the
-
Verify the build.
- Run
java -jar html-generators/generate.jarto regenerate all HTML pages andsite/data/snippets.json. - Confirm the new pages were generated successfully.
- Run
-
Create a pull request.
- The PR title should be:
[new-jdk] Add snippets for JDK {version} features - The PR body should list each new snippet with its title and a one-line summary.
- Mention which JEPs are covered and link to the OpenJDK release page.
- The PR title should be:
- Only include features that are final (non-preview) in the new JDK release.
- Label preview features as preview if you choose to include them, with "(Preview)" in the modernLabel.
- All content goes in
content/{category}/{slug}.jsonfiles — never edit generated HTML orsite/data/snippets.json. - Run
java -jar html-generators/generate.jarafter making changes to verify the build. - Do not modify existing snippet JSON files unless a feature graduated from preview to final.
- If a previously preview feature is now final, update its
modernLabelandsupporttext to remove the "(Preview)" label in its JSON file.