|
| 1 | +# Java 9 → 11 Migration Notes |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +This project has been migrated from Java 9 (`source`/`target` 1.9) to **Java 11 (LTS)** using the `release` compiler flag. The migration is minimal and behavior-safe, targeting build and dependency compatibility. |
| 6 | + |
| 7 | +## Build Changes |
| 8 | + |
| 9 | +### Maven Compiler Plugin |
| 10 | +- **Before**: `maven-compiler-plugin` 3.1 with `<source>1.9</source>` / `<target>1.9</target>` |
| 11 | +- **After**: `maven-compiler-plugin` 3.11.0 with `<release>11</release>` |
| 12 | + |
| 13 | +### New Plugins |
| 14 | +- `maven-surefire-plugin` 3.2.5 — modern test runner compatible with Java 11+ |
| 15 | +- `maven-enforcer-plugin` 3.5.0 — enforces JDK 11 as the minimum build version |
| 16 | + |
| 17 | +### Dependency Upgrades |
| 18 | +| Dependency | Old Version | New Version | Reason | |
| 19 | +|---|---|---|---| |
| 20 | +| JMH (core + annprocess) | 1.17.4 | 1.37 | Java 11 compatibility | |
| 21 | +| JUnit | 4.11 | 4.13.2 | Security fixes, Java 11 support | |
| 22 | + |
| 23 | +## Code Changes |
| 24 | + |
| 25 | +- `Util.java`: Replaced `new Double(String)` (deprecated since Java 9, marked for removal) with `Double.parseDouble(String)`. |
| 26 | + |
| 27 | +## Removed JDK Modules |
| 28 | + |
| 29 | +No removed JDK modules (JAXB, JAX-WS, CORBA, JavaFX, Nashorn) were in use — no replacement dependencies needed. |
| 30 | + |
| 31 | +## Encapsulation / JPMS |
| 32 | + |
| 33 | +The project runs on the **classpath** (no `module-info.java`). No illegal reflective access warnings are present. |
| 34 | + |
| 35 | +## Known Warnings (Intentional) |
| 36 | + |
| 37 | +- `DateTimeExamples.java` uses the deprecated `Date(int, int, int)` constructor — this is intentional for the educational example contrasting old and new Date/Time APIs. |
| 38 | +- `StreamForker.java` uses unchecked/unsafe operations — inherent to the generics example. |
| 39 | + |
| 40 | +## CI |
| 41 | + |
| 42 | +A GitHub Actions workflow (`.github/workflows/java11-build.yml`) has been added to build and compile on JDK 11 (Temurin). |
| 43 | + |
| 44 | +## GC / Logging |
| 45 | + |
| 46 | +No JVM flags or GC options were configured in this project. The default G1 collector in Java 11 applies. |
| 47 | + |
| 48 | +## TLS / Security |
| 49 | + |
| 50 | +No TLS endpoints, keystores, or cipher configurations exist in this codebase. |
| 51 | + |
| 52 | +## Follow-ups |
| 53 | + |
| 54 | +- Consider adopting `var` (Java 10) for local type inference in examples. |
| 55 | +- Consider adding `java.net.http.HttpClient` (Java 11) usage examples. |
| 56 | +- Consider adding test classes under `src/test/java/`. |
0 commit comments