feat: COBOL-to-Java/Spring Boot Migration (Phase 0-3, 5) - Core Data Layer & Utilities#77
Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
Conversation
- Phase 0: Spring Boot project structure with Maven, Java 17 - Phase 1a: Data models (Account, Customer, Item) migrated from COBOL - Phase 1b: String & numeric utilities (StringUtils, NumericUtils) - Phase 1c: Search service (binary + linear search) - Phase 2: JPA repository replacing COBOL cursor declarations - Phase 3: JSON/XML serialization (Jackson + JAXB) - Phase 5: REST controller replacing menu-driven UI - 100 unit tests, all passing - Comprehensive README with migration mapping table Co-Authored-By: Jerry Oliphant <jerry.oliphant@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:
|
Co-Authored-By: Jerry Oliphant <jerry.oliphant@cognition.ai>
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
Adds a new
migration/directory containing a Spring Boot 3.2 / Java 17 project that migrates core COBOL programs to Java. This covers Phases 0–3 and 5 of the migration plan:Account(fromsql/sql_example.cbl),Customer(fromredifines/redefines.cblREDEFINES),Item(fromsearch/search.cblwithComparablematching COBOL ascending/descending keys)StringUtils(TRIM + UNSTRING with pointer/tallying),NumericUtils(IS NUMERIC + NUMVAL)SearchService(binary search viaCollections.binarySearch, linear search via predicate)AccountRepository(JPA queries replacing three COBOL cursor declarations)JsonService(Jackson) andXmlService(JAXB) replacing COBOL JSON/XML GENERATEAccountControllerREST endpoints replacing the COBOL menu-driven UISee
migration/README.mdfor the full COBOL→Java mapping table and build instructions.Review & Testing Checklist for Human
Account.enabledboolean ↔ VARCHAR mapping: Theenabledfield is a Javabooleanmapped to theis_enabled VARCHAR(1)column storing'Y'/'N'. There is no JPAAttributeConverter— Hibernate will fail at runtime when connecting to the real PostgreSQL database. A@Convertannotation orYesNoConverteris needed before Phase 6.CustomerREDEFINES fidelity: COBOL REDEFINES shares memory — settingws-corp-nameoverwritesws-customer-first-name/ws-customer-last-name. The Java model uses separate fields, so they are independent. Verify this semantic gap is acceptable or if mutual exclusion logic should be enforced.unstringFullvs COBOLALLdelimiter: COBOLDELIMITED BY ALL "<"collapses consecutive delimiters into one. The Java implementation splits on each individual occurrence. Test with consecutive delimiters to confirm behavior matches expectations.@Column(length=...)vs real DB schema:Accountuses@Column(length=8)etc. which may conflict withddl-auto=validateif the real PostgreSQL schema uses unboundedvarchar. Verify column lengths matchsql/create_test_db.sql.mvn testlocally insidemigration/with Java 17 to confirm all 100 tests pass. Then trymvn spring-boot:runagainst a PostgreSQL instance seeded withsql/create_test_db.sqlto verify the Account entity mapping works end-to-end (expect it to fail on the boolean mapping without a converter fix).Notes
AccountControllerandAccountRepositoryhave no dedicated tests — they are wired up but only exercisable via integration testing against a database.isNumeric()trims input before checking digits, which diverges from raw COBOLIS NUMERICon PIC X fields (where trailing spaces cause failure). This was an intentional convenience choice documented in the test comments..gitignoreis included to excludetarget/, IDE files, and OS artifacts from future commits.Link to Devin session: https://app.devin.ai/sessions/9f54e86f9b2748c9bbe8e2a74db2436b
Requested by: @jerryoliphant-cog