Repository navigation
JDK 25 refresh: declare the Java version, build it, and prove it - #1
Conversation
The examples still compile unchanged — written against Java 8 in 2017, clean on JDK 25 today with no errors. What had rotted was everything around them. The README told readers to install Java 8 Update 151, which is from October 2017. For a repository aimed at students that is the one line that matters: a beginner installs exactly what the README says. It now names JDK 25 LTS. There was no build file, so the Java version was whatever JDK happened to be installed. A Maven build declares it once, in the root pom, and both modules inherit it — moving to a future release is a one-line change rather than an edit per project. Sources stay in src/ rather than being moved to src/main/java: the layout is part of what the examples teach. CI builds on Linux, Windows and macOS, on push and monthly, so the next incompatibility surfaces as a red build instead of a discovery years later. A .gitattributes normalises line endings. Thirty-nine of fifty-three files are CRLF from the original Windows authoring, with nothing declaring intent, so they show up as whole-file diffs on Linux and macOS. Existing files are left as they are; this fixes it going forward without rewriting every line of history. No source file is touched. Verified with mvn clean compile on JDK 25.0.4.1 (exit 0, 43 classes) and by running the commands the README now documents. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…tate Line endings only: no source line changes. Thirty-nine files were CRLF from the original 2017 Windows authoring, so every one of them showed as a whole-file diff to anyone on Linux or macOS. With `* text=auto` now in .gitattributes, any file a contributor touches would normalise on commit anyway — doing it piecemeal would leave the repository half converted, which is worse than either end state. So it is done once, here, and never again. Verifiable as content-free: `git diff -w` across the staged change is empty, and every file has equal insertion and deletion counts. .idea/workspace.xml is also untracked. It holds one person's window layout, open tabs and local paths. The other .idea files — misc.xml, modules.xml, uiDesigner.xml, vcs.xml — are shared project configuration and stay. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Seven lines, both Swing frames, no behaviour change. 10 warnings down to 3. `final` on FireFighterCostGUI and ButtonFrame removes [this-escape]. The warning fires because the constructors call overridable methods — setLayout, setResizable — before a subclass would finish initialising. Nothing extends either class, and neither is meant to be extended: they are the application's own windows. Saying so in the declaration is both the fix and the accurate statement. `transient` on the five fields removes [serial]. JFrame is Serializable, so every subclass inherits the contract whether or not anyone intends to serialise it, and these fields hold types that are not. They are working state, never part of a persisted form, and transient says exactly that. The remaining three are [dangling-doc-comments], in files whose Javadoc header sits above the imports rather than against the class. That is the repository's comment style, and the style is deliberate, so they stay. A student seeing three explained warnings learns more than one seeing ten unexplained ones. Verified: javac --release 25 -Xlint:all, exit 0. mvn clean compile, 43 classes. Examples still run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Took option A, plus the two cleanups. Three commits now, each one reviewable on its own.
Doing this piecemeal wasn't an option: with
10 warnings → 3. The remaining three are Verified after every commit: |
No source file is touched. The examples compile unchanged on JDK 25 — written against Java 8 in 2017, clean today with zero errors. What had rotted was everything around them.
What was actually wrong
The README told readers to install Java 8 Update 151 — October 2017. For a repo aimed at students that's the line that matters, because a beginner installs exactly what the README says. That was the whole security story here: no third-party dependencies, no network or file I/O, no deserialization, nothing for a CVE to attach to. Just an instruction to install an eight-year-old JDK.
There was no build file, so the Java version was whatever JDK happened to be installed.
39 of 53 files are CRLF from the original Windows authoring, with no
.gitattributesdeclaring intent — whole-file diffs for anyone on Linux or macOS.What this adds
pom.xml+ two module poms.github/workflows/build.yml.gitattributesSources stay in
src/rather than moving tosrc/main/java— the layout is part of what the examples teach, and moving 38 files would bury the change.The monthly cron matters more than it looks: it's what makes the next incompatibility show up as a red build rather than a discovery in 2034.
Verified, not assumed
And the commands the README now documents were run as written:
Left alone deliberately
[serial]and[this-escape]in the two Swing frames. Cosmetic, andthis-escapeis arguably a teaching point rather than a defect. Happy to address separately if wanted..gitattributesfixes intent without rewriting every line of blame. Agit add --renormalize .would clean them in one commit if you'd rather..idea/workspace.xmlis per-user state that could come out of version control separately.🤖 Generated with Claude Code