How wesleyegberto/java-new-features works
1. Repository purpose and shape
- This is a feature showcase / learning monorepo for Java platform evolution, not a single application.
- The top level is organized by JDK release (java-7 through java-27) plus two dedicated project areas (projects/loom, projects/valhalla).
- The main architectural boundary is version isolation: each folder contains examples that are meant to compile and run against that specific Java release or preview/incubator feature set.
2. Primary execution model
- Most examples are small standalone programs or tests, each demonstrating one feature in isolation.
- There is very little cross-version or cross-folder coupling; each directory acts like its own mini-lab.
- This means the repo’s architecture is best drawn as a collection of independent demo modules, rather than a layered product with shared services.
3. Build and tooling boundaries
- Java 8 is the main Maven-based subproject (java-8/pom.xml, src/main/java/...).
- Later versions rely mostly on single-file/source-file examples and version-specific scripts such as build.sh.
- The repo intentionally spans multiple Java compiler/runtime modes: stable releases, preview features, incubators, and experimental APIs. That version-specific execution requirement is a core architectural concern.
4. Java 8 as the baseline feature suite
- java-8 is a conventional package hierarchy under com.github.wesleyegberto.
- It groups examples by language/API theme: lambdas, streams, collections, base64, datetime, validation, interfaces, method references, and reductions.
- This folder provides the “legacy baseline” against which later language and platform changes are contrasted.
5. Java 9: modularity and services
- java-9/modules is the first clearly modular subsystem, showing JPMS architecture.
- It contains separate modules for:
- services/provider
- services/consumer
- simple_deps split into math_api, math_lib, and calculator
- The architecture here demonstrates module boundaries, service provision/consumption, and dependency encapsulation, with shell scripts for building and launching module graphs.
6. Java 9+ platform/API feature labs
- java-9/others-features and java-10/java-11/java-12/... are mostly topic-focused demo suites rather than systems.
- Examples cover collections improvements, process API, reactive flow, HTTP client, streams, futures, and compact collections.
- The data flow is typically local and in-memory, with occasional interaction with the host process or external endpoints.
7. Networking and external interaction examples
- java-11 contains the clearest network-facing cluster: HTTP GET/POST, async/reactive HTTP client usage, and a reusable HttpBinRequestBuilder.
- java-18/SimpleWebServer.java and its static index.html/img assets form a tiny embedded web server + static content demo.
- These examples are isolated from the rest of the repo and usually interact with external services only for demonstration purposes, not as persistent dependencies.
8. Concurrency evolution track
- From java-12 onward, concurrency examples progress from CompletableFuture to virtual threads, structured concurrency, and scoped values in later versions.
- java-19, java-20, java-21, java-24, and java-25 contain the densest concurrency material.
- The architectural theme is the shift from thread-per-request / platform-thread stress tests to virtual-thread-based workloads and structured task grouping.
- Several java-19 stress programs and the JMX file suggest performance/load experimentation around thread scaling.
9. Language-model evolution track
- A large portion of the repo demonstrates changes to the Java type system and syntax:
- records
- sealed classes/interfaces
- pattern matching for instanceof and switch
- text blocks
- flexible constructors
- unnamed/implicitly declared classes and main methods
- string templates
- sequenced collections
- These samples are generally self-contained and show how newer syntax changes application structure, especially around data carriers and branching logic.
10. Native and low-level runtime integration
- java-22/person_validator.c alongside FFM examples shows Java-to-native interop using the Foreign Function & Memory API.
- java-24/ClassFileApi* demonstrates class-file reading/writing/transformation, which is a lower-level bytecode boundary distinct from normal source-level code.
- java-14/JFREventStreamTest.java and java-25/ProfilingTest.java point to runtime observability and profiling experiments.
11. Advanced platform/runtime features
- Several folders cover JVM/runtime changes that affect deployment or execution model:
- packaging tool / runtime image work
- Unix domain sockets
- value-based class warnings
- stable/lazy constants
- final-field mutation and primitive pattern previews
- These are not application subsystems; they are runtime behavior probes showing how the platform itself changes across versions.
12. Experimental project areas
- projects/loom is a focused set of Loom prototypes around virtual threads and thread counting/execution.
- projects/valhalla contains early experiments with primitive/value classes and records.
- These folders are conceptually separate from the versioned examples: they act as forward-looking R&D tracks for upcoming platform work.
13. Typical data flow pattern
- Most programs follow a simple flow: construct example inputs → invoke a Java API or language feature → print/assert results.
- A smaller subset crosses boundaries:
- HTTP client examples call external endpoints.
- FFM examples call native C code.
- JPMS service demos resolve provider/consumer relationships at runtime.
- Stress tests exercise the scheduler/runtime under load.
- There is no central database, queue, or shared domain model.
14. How to diagram this repo accurately
- Draw it as a versioned gallery of independent demo subsystems.
- Show a few key cross-cutting categories rather than one application stack:
- language features
- collections/streams/API updates
- modularity/services
- concurrency/runtime
- native interop
- observability/tooling
- Emphasize that JDK version is the primary organizing axis and that each folder is a self-contained boundary with its own compile/run assumptions.
Main entry points: java-8 Java 8 · java-15 Java 15-17 · java-19 Java 19 · java-23 Java 23
Components 18
Baseline
Java 7/8 feature baseline and conventional Maven subproject.
Modularity
Java 9 JPMS and service/dependency demos.
- JPMS modules · Services and simple dependency graphs built around module boundaries.
java-9/modules - Java 9 labs · Collections, process API, reactive flow, and HTTP client examples.
java-9/others-features
Feature labs
Versioned language/API examples from Java 10 through 18.
- Java 10-14 · Collections, process API, text blocks, records, pattern matching, packaging, and JFR.
java-10 - Java 11 · HTTP client and request builder examples plus pipe-stream usage.
java-11 - Java 12-14 · Teeing collectors, switch expressions, compact numbers, records, and helpful NPEs.
java-12 - Java 15-17 · Sealed types, record variants, Unix domain sockets, PRNG, and pattern matching.
java-15 - Java 18 · Simple web server, JavaDoc snippets, and preview pattern matching.
java-18
Concurrency
Concurrency evolution from futures to virtual threads and structured concurrency.
- Java 19 · Platform-thread and virtual-thread stress tests plus structured concurrency motivation.
java-19 - Java 20-21 · Scoped values, structured concurrency, virtual threads, string templates, and sequenced collections.
java-20
Advanced runtime
Later release features around low-level runtime, class files, and platform APIs.
- Java 22 · Foreign Function & Memory API, multi-file source launching, and stream gatherers.
java-22 - Java 23 · Flexible constructors, implicitly declared classes, primitive patterns, and scoped values.
java-23 - Java 24 · Class-file API reading, writing, transforming, module imports, and virtual-thread synchronization.
java-24 - Java 25 · Profiling, stable values, structured concurrency, scoped values, and implicitly declared classes.
java-25 - Java 26-27 · Final-field mutation, lazy constants, primitive patterns, and PEM encoding examples.
java-26
Connections 19
- Java 7 → Java 8: baseline evolves · The repo starts with Java 7 and then establishes Java 8 as the main baseline suite.
- Java 8 → JPMS modules: modularity · Java 9 introduces explicit module boundaries and services.
- JPMS modules → Java 9 labs: platform APIs · Java 9 also broadens the feature-lab style with collections, process, reactive, and HTTP demos.
- Java 9 labs → Java 10-14: versioned demos · Later release examples continue as isolated release-specific feature programs.
- Java 10-14 → Java 11: networking · Java 11 concentrates the HTTP client and request-builder examples.
- Java 11 → Java 12-14: language changes · The demo set shifts toward newer syntax and language features.
- Java 12-14 → Java 15-17: type system · Records, sealed types, and pattern matching become the main language-evolution track.
- Java 15-17 → Java 18: runtime demo · Java 18 adds the embedded web server and preview pattern matching examples.
- Java 18 → Java 19: concurrency focus · From Java 19 onward the repo emphasizes threading, stress tests, and structured concurrency.
- Java 19 → Java 20-21: virtual threads · Virtual threads and scoped values expand the concurrency track in Java 20-21.
- Java 20-21 → Java 22: new APIs · Java 22 extends the runtime track with FFM and stream gatherers.
- Java 22 → Java 23: preview features · The later release folders continue with runtime and syntax previews.
- Java 23 → Java 24: internals · Java 24 moves into class-file tooling and module import declarations.
- Java 24 → Java 25: observability · Java 25 adds profiling and further concurrency/runtime experiments.
- Java 25 → Java 26-27: latest previews · Java 26-27 show the newest preview/runtime changes.
- Java 8 → Loom: forward look · Loom prototypes explore the virtual-thread direction beyond the baseline examples.
- Java 15-17 → Valhalla: forward look · Valhalla prototypes explore primitive/value classes beyond standard releases.
- Java 19 → Loom: prototype overlap · The Loom project mirrors the repo's virtual-thread and execution-model experiments.
- Java 23 → Valhalla: value types · Valhalla aligns with primitive and value-class experimentation in later releases.