Add Java implementation of COBOL merge sort functionality #34
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 functionality
Summary
This PR adds a complete Java implementation that replicates the file-based merge sort functionality from
merge_sort_test.cbl. The implementation includes:The Java version uses standard libraries (Files, Collections.sort, Comparator) to replace COBOL's built-in MERGE and SORT statements while maintaining identical functionality and output format.
Review & Testing Checklist for Human
toString()method produces identical output to the COBOL version (5-digit customer ID, 50-char names, etc.)fromString()correctly parses the fixed-width format with proper substring indices (0-5, 5-55, 55-105, 105-110, 110-135)create-test-datasectionNotes
Link to Devin run: https://app.devin.ai/sessions/69819eabcf264f36975079cecf7cf40f
Requested by: @alexlaubscher
The implementation has been tested locally and produces the expected output files with correct sorting behavior. The most critical aspect to review is the fixed-width formatting compatibility since any discrepancies could cause data corruption when interfacing with COBOL systems.