Align build to Java 11, add test suite + CI, and code-quality fixes#8
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
… fixes Co-Authored-By: Bobby Nobakht <bobby.nobakht@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Build/config alignment, a real test suite, code-quality cleanups, README fixes, and a CI workflow.
Java version decision (Phase 1): The 2nd-edition examples use APIs added after Java 8 —
Optional.or,Optional.stream(chap10),Collectors.flatMapping/filtering(chap6),Stream.takeWhile(chap6). So targeting Java 8 fails to compile. Rather than rewrite pedagogical book code, the project now targets Java 11 (modern LTS), consistent acrosspom.xml,README.md, and CI.Phase 1 — build/config (
pom.xml)Phase 2 — testing structure
src/test/javaroot.src/main/.../chap10/ReadPositiveIntParam.javahad a@Testundersrc/main(never run by Surefire). The example helpers (readDurationImperative,readDurationWithOptional,s2i) stay insrc/main; the test moved tosrc/test/.../chap10/ReadPositiveIntParamTest.java.FilteringApplesTest(chap1) andUtilTest(chap11). 6 tests total, all passing.Phase 3 — code quality (
chap11/Util.java,chap1/FilteringApples.java)allOf-basedsequencealternative.chap1/FilteringApples.java.Phase 4 — README
java8-2100321.htmlandjdk8.java.netlinks with Adoptium/Oracle download links.pom.xml(Java 11) decision.Phase 5 — CI
.github/workflows/build.yml: sets up Temurin JDK 11, runsmvn compilethenmvn teston push/PR tomaster..gitignore: un-ignored.github(previously caught by/.*) and ignored the shade-generateddependency-reduced-pom.xml.Per the task note, intentionally duplicated per-chapter domain models (e.g.
Dish,Apple) were left untouched.Verified locally:
mvn clean verifyon JDK 11 → BUILD SUCCESS, 6/6 tests pass, shadedbenchmarks.jarproduced.Link to Devin session: https://app.devin.ai/sessions/4a09706b288c4fdabc01517620676128
Requested by: @bnob-git
Devin Review