feat: Upgrade Java 17 to 21, Spring Boot 3.2 to 3.3.5, convert DTOs to records#5
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
feat: Upgrade Java 17 to 21, Spring Boot 3.2 to 3.3.5, convert DTOs to records#5devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…o records - Update pom.xml: Java 21, Spring Boot 3.3.5, springdoc-openapi 2.6.0 - Convert QuoteResult, QuoteRequest, QuoteRequestDto, QuoteResultDto to Java records - Add with* methods on QuoteResult for immutable updates in ranking service - Refactor AbstractRankingService to use immutable record pattern - Modernize getCoverMultiplier with stream API - Enable virtual threads (spring.threads.virtual.enabled=true) - Update all tests for record constructors - Mark Java upgrade task as done in NEXT_STEPS.md and BACKLOG.md Co-Authored-By: bobby.nobakht <bobby.nobakht@cognition.ai>
Contributor
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
Upgrades the project from Java 17 to Java 21 and Spring Boot 3.2.2 to 3.3.5, with dependent modernization changes:
QuoteResult,QuoteRequest,QuoteRequestDto,QuoteResultDto, andQuoteResultDto.QuoteItemDtofrom mutable POJOs to Java records. Addedwith*copy methods onQuoteResultfor immutable updates in the ranking service.setScore,setIsBestPrice,setIsRecommended) to creating new record instances, building an immutablescoredlist.getCoverMultipliermodernized to use stream API.spring.threads.virtual.enabled: trueinapplication.yml.NEXT_STEPS.mdandBACKLOG.md.Review & Testing Checklist for Human
QuoteRequestDtorecord: Records have no setters.@ModelAttributebinding inQuoteWebController.submitQuote()uses Spring'sDataBinder, which typically needs setters to populate fields from form POST data. Jackson (@RequestBody) handles records fine, but the web form atPOST /quotemay silently fail or error. Manually test the quote form flow in the browser (GET/quote→ fill form → submit → results page). If broken,QuoteRequestDtomay need to revert to a class or a customDataBinderconfiguration.QuoteResult.with*methods correctness: WhencheapestIdx == 0,withIsBestPrice(true)is applied at index 0, thenwithIsRecommended(true)overwrites index 0 again. Verify both flags are preserved (thewith*method copies all fields, so it should be fine — but confirm).openjdk-21-jdk; CI may need a similar update to its workflow/Docker image.QuoteResultandQuoteRequestdefine explicitgetXxx()methods alongside auto-generated record accessors (xxx()). These exist for backward compatibility with Thymeleaf property access and existing callers. Verify this doesn't cause issues with Jackson serialization (duplicate properties in JSON output).Recommended test plan: Start the app locally (
./mvnw spring-boot:runwith Java 21), exercise the web form at/quote, the REST API atPOST /api/quotes, verify Swagger UI at/swagger-ui.html, and check that results display correctly with ranking/best-price/recommended badges.Notes
GeocodingService.GeoLocationwas already a record — no change needed there.ProviderDetailDtoandQuoteResultItemDtodon't exist in the codebase as separate files, so they were skipped.Provider,CoverageOption) were intentionally not converted to records.Link to Devin session: https://extremenetworksdemo.devinenterprise.com/sessions/a8d56f5d524f493b9fabbba3192768c3
Requested by: @bnob-git