Migrate COBOL Merge Sort to Java #20
Open
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.
Migrate COBOL Merge Sort to Java
Summary
This PR implements a Java version of the COBOL merge sort program found in
merge_sort/merge_sort_test.cbl. The Java implementation replicates the exact functionality and output format of the original COBOL program, including:merge-output.txtandsorted-contract-id.txtwith identical formattingThe implementation uses a
Customerclass with proper field formatting and two main operations that mirror the COBOLmergeandsortstatements.Review & Testing Checklist for Human
merge-output.txtandsorted-contract-id.txtare identicalcom.cognition.cobol.mergesort) is appropriate for the repositoryRecommended test plan:
java com.cognition.cobol.mergesort.MergeSortExampleDiagram
%%{ init : { "theme" : "default" }}%% graph TD COBOL["merge_sort/merge_sort_test.cbl"]:::context Customer["java-merge-sort/com/cognition/<br/>cobol/mergesort/Customer.java"]:::major-edit Main["java-merge-sort/com/cognition/<br/>cobol/mergesort/MergeSortExample.java"]:::major-edit README["java-merge-sort/README.md"]:::major-edit TestFile1["test-file-1.txt"]:::minor-edit TestFile2["test-file-2.txt"]:::minor-edit MergeOutput["merge-output.txt"]:::minor-edit SortedOutput["sorted-contract-id.txt"]:::minor-edit COBOL -->|"replicates functionality"| Main Main -->|"uses"| Customer Main -->|"creates"| TestFile1 Main -->|"creates"| TestFile2 Main -->|"generates"| MergeOutput Main -->|"generates"| SortedOutput 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:#FFFFFFNotes