From cb77db0d8d3938c48fe8dfa35b70624107c66fae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Feb 2026 23:41:50 +0000 Subject: [PATCH 1/3] Initial plan From beef8c1f236a0a5d163d679a9b7870a4e655618b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Feb 2026 23:44:30 +0000 Subject: [PATCH 2/3] docs: update README with Enterprise category, badges, correct counts, and improved contributing guide Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com> --- README.md | 20 +++++++++++------ content/template.json | 50 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 content/template.json diff --git a/README.md b/README.md index 9b7724a..0c5e7e5 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,13 @@ A collection of side-by-side code comparisons showing old Java patterns next to 🔗 **[javaevolved.github.io](https://javaevolved.github.io)** +[![GitHub Pages](https://img.shields.io/badge/GitHub%20Pages-live-brightgreen)](https://javaevolved.github.io) +[![Snippets](https://img.shields.io/badge/snippets-107-blue)](#categories) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) +[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange)](#contributing) + +> **Note:** Update the snippet count badge above when adding new patterns. + --- ## What is this? @@ -31,12 +38,13 @@ Each comparison includes an explanation of *why* the modern approach is better, | **Date/Time** | `java.time` basics, `Duration`/`Period`, `DateTimeFormatter`, instant precision | | **Security** | TLS defaults, `SecureRandom`, PEM encoding, key derivation functions | | **Tooling** | JShell, single-file execution, JFR profiling, compact source files, AOT | +| **Enterprise** | EJB → CDI, JDBC → JPA/Jakarta Data, JNDI → injection, MDB → reactive messaging, REST | ## Architecture This site uses a **JSON-first** build pipeline: -- **Source of truth**: Individual `content/category/slug.json` files (85 across 10 category folders) +- **Source of truth**: Individual `content/category/slug.json` files (107 across 11 category folders) - **Templates**: `templates/` — shared HTML templates with `{{placeholder}}` tokens - **Generator**: `html-generators/generate.jar` — pre-built fat JAR that produces all HTML detail pages and `data/snippets.json` - **Deploy**: GitHub Actions runs the generator and deploys to GitHub Pages @@ -53,7 +61,7 @@ Generated files (`site/category/*.html` and `site/data/snippets.json`) are in `. ```bash # Generate all HTML pages and data/snippets.json into site/ -jbang html-generators/generate.java +java -jar html-generators/generate.jar # Serve locally jwebserver -b 0.0.0.0 -d site -p 8090 @@ -69,10 +77,10 @@ For development on the generator itself, you can use JBang or Python — see [ht Contributions are welcome! Content is managed as JSON files — never edit generated HTML. 1. Fork the repo -2. Create or edit a JSON file in the appropriate content folder (e.g. `content/language/my-feature.json`) -3. Follow the [snippet JSON schema](.github/copilot-instructions.md) for all required fields -4. Run `java -jar html-generators/generate.jar` to verify your changes build correctly -5. Update `site/index.html` with a new preview card if adding a new snippet +2. Create a new JSON file in the appropriate `content//` folder (e.g. `content/language/my-feature.json`) +3. Copy [`content/template.json`](content/template.json) to the new file as a starting point for all required fields (see the [snippet JSON schema](.github/copilot-instructions.md) for details) +4. Update the `prev`/`next` fields in adjacent pattern JSON files to maintain navigation +5. Run `java -jar html-generators/generate.jar` to verify your changes build correctly 6. Open a pull request Please ensure JDK version labels only reference the version where a feature became **final** (non-preview). diff --git a/content/template.json b/content/template.json new file mode 100644 index 0000000..8a7da6d --- /dev/null +++ b/content/template.json @@ -0,0 +1,50 @@ +{ + "id": 0, + "slug": "your-slug-here", + "title": "Your Pattern Title", + "category": "language", + "difficulty": "beginner", + "jdkVersion": "17", + "oldLabel": "Java 8", + "modernLabel": "Java 17+", + "oldApproach": "Old Approach Name", + "modernApproach": "Modern Approach Name", + "oldCode": "// Old way...", + "modernCode": "// Modern way...", + "summary": "One-line description of the pattern.", + "explanation": "A paragraph explaining how the modern approach works and when to use it.", + "whyModernWins": [ + { + "icon": "⚡", + "title": "Short benefit title", + "desc": "One sentence describing this benefit." + }, + { + "icon": "👁", + "title": "Short benefit title", + "desc": "One sentence describing this benefit." + }, + { + "icon": "🔒", + "title": "Short benefit title", + "desc": "One sentence describing this benefit." + } + ], + "support": { + "state": "available", + "description": "Widely available since JDK 17 (September 2021)" + }, + "prev": "category/previous-slug", + "next": "category/next-slug", + "related": [ + "category/related-slug-1", + "category/related-slug-2", + "category/related-slug-3" + ], + "docs": [ + { + "title": "Javadoc or Guide Title", + "href": "https://docs.oracle.com/..." + } + ] +} From e6082cb8c070b2f04ef3200ddddf122b56de17cd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 00:01:21 +0000 Subject: [PATCH 3/3] docs: revert build command to jbang (jar not in repo) Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c5e7e5..d801c12 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Generated files (`site/category/*.html` and `site/data/snippets.json`) are in `. ```bash # Generate all HTML pages and data/snippets.json into site/ -java -jar html-generators/generate.jar +jbang html-generators/generate.java # Serve locally jwebserver -b 0.0.0.0 -d site -p 8090 @@ -80,7 +80,7 @@ Contributions are welcome! Content is managed as JSON files — never edit gener 2. Create a new JSON file in the appropriate `content//` folder (e.g. `content/language/my-feature.json`) 3. Copy [`content/template.json`](content/template.json) to the new file as a starting point for all required fields (see the [snippet JSON schema](.github/copilot-instructions.md) for details) 4. Update the `prev`/`next` fields in adjacent pattern JSON files to maintain navigation -5. Run `java -jar html-generators/generate.jar` to verify your changes build correctly +5. Run `jbang html-generators/generate.java` to verify your changes build correctly 6. Open a pull request Please ensure JDK version labels only reference the version where a feature became **final** (non-preview).