Add Java implementation of COBOL merge sort with file-based operations #26
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.
Add Java implementation of COBOL merge sort with file-based operations
Summary
This PR adds a complete Java implementation that replicates the functionality of the existing COBOL merge sort program (
merge_sort/merge_sort_test.cbl). The Java implementation maintains the same file-based approach and produces identical output to the original COBOL program.Key Changes:
java-merge-sort/directory with Java implementationCustomerRecord.java: Data model matching COBOL's 5-field customer record structureMergeSortProgram.java: Main program implementing merge and sort operations using file I/OdiffcommandsFunctionality Replicated:
Review & Testing Checklist for Human
diffto ensure exact matchRecommended Test Plan:
rm *.txtin both directoriescd merge_sort && ./merge_sort_testcd java-merge-sort && java MergeSortProgramdiff merge_sort/*.txt java-merge-sort/*.txtDiagram
%%{ init : { "theme" : "default" }}%% graph TD COBOL["merge_sort/<br/>merge_sort_test.cbl"]:::context CustomerRecord["java-merge-sort/<br/>CustomerRecord.java"]:::major-edit MergeSort["java-merge-sort/<br/>MergeSortProgram.java"]:::major-edit README["java-merge-sort/<br/>README.md"]:::major-edit TestFile1["test-file-1.txt<br/>(6 records)"]:::context TestFile2["test-file-2.txt<br/>(5 records)"]:::context MergeOutput["merge-output.txt<br/>(sorted by customer ID)"]:::context SortOutput["sorted-contract-id.txt<br/>(sorted by contract ID)"]:::context COBOL -.-> CustomerRecord CustomerRecord --> MergeSort MergeSort --> TestFile1 MergeSort --> TestFile2 TestFile1 --> MergeOutput TestFile2 --> MergeOutput MergeOutput --> SortOutput subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#F5F5F5Notes
diffLink to Devin run: https://app.devin.ai/sessions/57cd1803bcc3436da6ca115e248897ee
Requested by: @schaudhry123 (Samir Chaudhry)