Skip to content

Source-level fixes for Spring Boot 3 / Java 17 migration - #65

Open
amitmanchella-cog wants to merge 1 commit into
masterfrom
devin/migration-source-fixes
Open

amitmanchella-cog wants to merge 1 commit into
masterfrom
devin/migration-source-fixes

Conversation

@amitmanchella-cog

@amitmanchella-cog amitmanchella-cog commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Java-source part of the Java 8 / Boot 2.0.2 → Java 17 / Boot 3.3.x migration. Build files (pom.xml, build.gradle) are intentionally untouched — sibling PRs own those.

Dead quote service removed from Application. http://gturnquist-quoters.cfapps.io no longer resolves, so both call sites threw at startup. Removed the fetch in main(), the whole run(RestTemplate) CommandLineRunner bean (its only purpose was that call), and the RestTemplate bean that fed it, plus the now-unused imports. The @Override run(String...) JdbcTemplate logic and bean-name printing in main() are unchanged. The Quote/Value model classes are left in place (unreferenced, but not part of the failing path).

Removed Spring 6 API. JdbcTemplate.query(String, Object[], RowMapper) was deleted in Spring Framework 6; switched to the varargs overload (present in both Spring 5 and 6, so this compiles before and after the Boot bump):

-jdbcTemplate.query(sql, new Object[]{"Josh"}, (rs, rowNum) -> new Customer(...))
+jdbcTemplate.query(sql, (rs, rowNum) -> new Customer(...), "Josh")

javax.*jakarta.*: no changes needed. grep -rn "javax" src/ returns nothing — the app only uses Spring/JDK APIs, no servlet/validation/persistence imports.

Controller modernization. @RequestMapping(method = ...)@GetMapping/@PostMapping/@PutMapping/@DeleteMapping across TopicController, GreetingController, HelloController. Paths and handler bodies are unchanged; the previously method-less @RequestMapping handlers are now explicitly GET-only (they were all read endpoints).

Sanity-checked with mvn compile against the current (still Boot 2.0.2) build.

Link to Devin session: https://app.devin.ai/sessions/8c90d4fdcb7a42eba82850747a790f7e
Requested by: @amitmanchella-cog


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)
Open in Devin Review

… Spring Boot 3

Co-Authored-By: Amit Manchella <amit.manchella@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

🤖 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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Comment on lines 59 to 63
jdbcTemplate.query(
"SELECT id, first_name, last_name FROM customers WHERE first_name = ?", new Object[]{"Josh"},
(rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name"))
"SELECT id, first_name, last_name FROM customers WHERE first_name = ?",
(rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name")),
"Josh"
).forEach(customer -> log.info(customer.toString()));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Varargs query overload resolves unambiguously with a 2-arg lambda

The switch to query(String, RowMapper, Object...) was checked against the other JdbcTemplate.query overloads that end in varargs (ResultSetExtractor, RowCallbackHandler) as well as query(String, PreparedStatementSetter, RowMapper). All of those functional interfaces take a single argument, so the two-parameter lambda (rs, rowNum) -> ... can only match RowMapper; resolution is unambiguous and the returned List<Customer> is still iterated as before.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@@ -5,18 +5,14 @@
import java.util.stream.Collectors;

import hello.model.Customer;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Unreferenced Quote/Value model classes left behind

With the quote fetch removed, hello.model.Quote and hello.model.Value are now completely unreferenced (grep shows no remaining usages outside those files). The PR intentionally keeps them, but they are dead code that will silently rot; consider deleting them in a follow-up so the migration doesn't leave orphaned model classes.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed they're dead code now. Leaving them out of this PR deliberately: the scope handed to me was to remove the fetch logic and its imports, and deleting the model classes is a separate (if trivial) call that also touches a sibling session's expectations of the tree. Happy to drop Quote/Value here if the owner prefers — otherwise it's a clean follow-up.

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.

1 participant