Skip to content

Add COBOL-to-Java/Spring Boot migration project (all 8 phases)#69

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1773863341-java-migration
Open

Add COBOL-to-Java/Spring Boot migration project (all 8 phases)#69
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1773863341-java-migration

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Adds a new java-migration/ directory containing a complete Spring Boot 3.2.5 (Java 17) project that migrates all COBOL example programs into Java equivalents, organized across 8 phases:

Phase Package COBOL Source Java Approach
1 stringutils trim, unstring, is_numeric, numval Static utility methods with regex
2 datastructures redefines, search, comp_test Sealed interfaces, records, TreeMap
3 serialization json_generate, xml_generate Jackson ObjectMapper / XmlMapper
4 batch merge_sort FileMergeService + Spring Batch config
5 database sql_example JPA entities, Spring Data repositories, Flyway
6 services sub_program @service beans modeling CALL/CANCEL semantics
7 web accept, display, screen_size, mouse REST controllers replacing terminal UI
8 reports report_writer Text/CSV report generation service

81 JUnit tests pass (unit + @DataJpaTest + @WebMvcTest). Tests use H2 in-memory DB. Per-phase README.md files document every COBOL-to-Java mapping decision.

Review & Testing Checklist for Human

  • Verify COBOL behavioral fidelity for Phase 1 (StringUtils): The unstringMultipleDelimiters method and numval trailing-sign handling are the most complex translations — compare outputs against running the actual COBOL programs to ensure parity
  • Verify Phase 5 Flyway migrations against real PostgreSQL: All DB tests run against H2 only. The V1__create_accounts_table.sql and V2__insert_test_data.sql migrations, plus the searchAccounts JPQL query (which uses LIKE with an empty escape '' clause), should be tested against the actual cobol_db_example database
  • Review MergeSortJobConfig (Spring Batch): This config class defines a batch Job with merge/sort steps, but has no integration test — only the simpler FileMergeService path is tested. Verify the @Bean wiring is correct if you intend to use the batch job path
  • Review CustomerController in-memory design: The controller instantiates CustomerSearchService directly and populates sample data in its constructor. This is demo/stub code — verify this matches your expectations for the migration
  • Run mvn spring-boot:run with PostgreSQL configured and manually hit the REST endpoints (/api/accounts, /api/reports/customers) to verify end-to-end behavior

Notes

  • Database credentials in application.yml use environment variable placeholders (${DB_URL}, ${DB_USERNAME}, ${DB_PASSWORD}) with localhost defaults
  • The report page-break logic (Phase 8) uses hardcoded constants from COBOL (PAGE_LIMIT=66, LAST_DETAIL=42) but exact line-for-line output parity with COBOL Report Writer has not been validated
  • @MockBean usage in AccountControllerTest is functional but deprecated in newer Spring Boot — low priority to migrate
  • No @ControllerAdvice global exception handler is included — REST errors return Spring defaults

Link to Devin session: https://app.devin.ai/sessions/2addd7b899444abaa1fdd5537a6f7f27
Requested by: @jerryoliphant-cog

- Phase 1: String utilities (trim, unstring, isNumeric, numval)
- Phase 2: Data structures (sealed interfaces, search, COMP types)
- Phase 3: Serialization (Jackson JSON/XML)
- Phase 4: File processing (merge/sort with Spring Batch)
- Phase 5: Database layer (JPA entities, repositories, services)
- Phase 6: Subprogram architecture (Spring service layer)
- Phase 7: UI layer (REST controllers replacing terminal UI)
- Phase 8: Report generation (text and CSV reports)

Includes 81 JUnit tests, per-phase README documentation,
Flyway migrations, H2 test config, and sample test data.

Database credentials use environment variables (DB_URL, DB_USERNAME, DB_PASSWORD).

Co-Authored-By: Jerry Oliphant <jerry.oliphant@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 and CI monitoring

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