Skip to content

feature: modernize controllers with text blocks and refresh README for Java 21 - #72

Merged
devin-ai-integration[bot] merged 1 commit into
devin/1786033413-java21-boot3-basefrom
devin/1786033698-presentation-modernization
Aug 6, 2026
Merged

devin-ai-integration[bot] merged 1 commit into
devin/1786033413-java21-boot3-basefrom
devin/1786033698-presentation-modernization

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Presentation-layer cleanup on top of the Java 21 / Spring Boot 3.5.16 upgrade (#69), plus a README that no longer lies about the project.

HelloController held eight mutable, package-private String label fields and built its three responses by +-concatenating them across a dozen lines. The labels are now private static final, and the layout is expressed with text blocks + String.formatted(...):

return """
        Greetings from Spring Boot! ----------------------\
        Datetime now is %s----------------------\
        ...
        Time in California: %s\
        """.formatted(myTimeClient, ..., myTimeClient.getZonedDateTime("Canada/Central"));

The two label-driven endpoints share one LABELLED_SECTIONS_FORMAT (%s%s × 4) so the section/value interleaving is visible at the call site instead of buried in a concatenation chain. String.valueOf(x) wrappers are gone — %s does that.

The output must not change (a parallel session is asserting on fragments of these strings), so the whole point is the escaping:

  • every text-block line ends with \ (line continuation) — otherwise text blocks would insert \n between sections;
  • the one label that ends in a significant space is written with an explicit \s terminator, because text blocks strip trailing whitespace per line before escapes are processed. That space is invisible in the source and would otherwise be silently eaten.

Verified empirically, not by eyeballing: responses for all endpoints were captured with curl before the change and diffed after. /topic, /topic/sort, /topic/{id}, /topic/minimum/length/{n}, /topic/string/operation and /topic/file/operation are byte-for-byte identical; /datetime and / differ only in the embedded timestamps and the AtomicLong counter, and are identical once those are masked. JSON shapes ({"id","subjectName","subjectDescription"} and {"id","content"}) are unchanged, and POST/PUT/DELETE were exercised against the running app.

GreetingController: templateTEMPLATE (private static final), String.format(template, name)TEMPLATE.formatted(name). AtomicLong untouched.

README.md was actively misleading: it described a Java 1.8 project, gave no build instructions (the Gradle build is gone), pointed at the upstream repo for cloning, and omitted /datetime, /topic/string/operation and /topic/file/operation from the endpoint list. Rewritten to describe the app as it is now — still a Java 8 feature showcase (that is the point of the repo), but running on Java 21 / Boot 3.5.16, built with ./mvnw clean verify and run with ./mvnw spring-boot:run, cloned from COG-GTM. Added a short "Java 21 idioms in use" section, an endpoint table, a project layout map, and a note that the WARN Could not fetch a quote from gturnquist-quoters.cfapps.io on startup is expected. Feature claims were checked against the code rather than invented.

Verification

  • ./mvnw clean verify passes on JDK 21.
  • App run via the packaged jar; every endpoint curled and diffed against the pre-change capture as described above.

Files outside this slice

None — no changes were needed in files this slice does not own (pom.xml, src/test/**, model/service/config are untouched).

Link to Devin session: https://app.devin.ai/sessions/ec504d4107fe4f738f1deefbbc539df4


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

…r Java 21

Co-Authored-By: alex.vyshetsky <alex.vyshetsky@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot merged commit 2606361 into devin/1786033413-java21-boot3-base Aug 6, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants