refactor: decompose Methods.java into focused utility classes - #90
Open
maxulysse wants to merge 12 commits into
Open
refactor: decompose Methods.java into focused utility classes#90maxulysse wants to merge 12 commits into
maxulysse wants to merge 12 commits into
Conversation
Methods.java was 1,790 lines mixing 7+ concerns. Extract 5 new classes: - HashUtils: consolidate 3 duplicate MD5 implementations - YamlUtils: YAML reading and manipulation - ArchiveDownloader: curl/zip/tar extraction and S3 downloads - FileTraversalUtils: directory walking and file collection - NextflowOutputFilter: output line filtering and sanitization Methods.java is now a 488-line thin delegation facade. Delete duplicate filterNextflowOutput Groovy adapter. Update NfCoreUtils and CsvUtils to use HashUtils.
The sanitizeOutput method was ~100 lines with 9 getOrDefault calls and inline validation. Extract a SanitizeOptions inner class to centralize option parsing and validation.
- Fix raw types: List -> List<?> / List<String> in FileTraversalUtils and Methods public API - Fix silent exception swallowing: ArchiveDownloader.curlAndUntar, curlAndUnzip, and NfCoreUtils.installModule now throw IOException on failure instead of logging and returning silently - Consolidate DEFAULT_CSV_DOUBLE_DIGITS: single source of truth in CsvUtils.DEFAULT_DOUBLE_DIGITS, referenced by Methods and OutputSanitizer
- Implement missing additionalPatterns filtering in NextflowOutputFilter (was lost during refactoring, now properly applies regex patterns to output) - Consolidate MD5 implementations in HashUtils: - Extract shared byteToHex(byte) helper method - Use consistent hex conversion in both md5Hex() and listToMD5() - Change listToMD5 parameter from ArrayList<Object> to List<?> for type safety - Align exception handling (NoSuchAlgorithmException instead of UnsupportedEncodingException) - Update Methods.java delegation to match new HashUtils signature Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
maxulysse
force-pushed
the
refactor/decompose-methods
branch
from
September 11, 2026 13:51
5b73088 to
2634f2a
Compare
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
Methods.java was 1,790 lines mixing 7+ concerns. This PR breaks it into 5 utility classes, extracts a typed options model from OutputSanitizer, and fixes three code-quality blockers from review.
New classes
HashUtilsYamlUtilsArchiveDownloaderFileTraversalUtilsNextflowOutputFilterChanges to existing files
SanitizeOptionsinner class. Moves 9getOrDefaultcalls and validation out of the 100-linesanitizeOutputmethod.HashUtils.md5Hex().installModulenow throwsIOExceptionon failure instead of swallowing it.HashUtils.md5Hex(). OwnsDEFAULT_DOUBLE_DIGITSas single source of truth.curlAndUntarandcurlAndUnzipnow throwIOExceptionon failure instead of logging and returning silently.Also fixed
filterNextflowOutput(Object, Map)adapter (identical to theLinkedHashMapvariant)List→List<?>/List<String>) in public API signaturesDEFAULT_CSV_DOUBLE_DIGITS(was duplicated in Methods and OutputSanitizer)Deferred
HashUtilsNextflowOutputFilter.filterNextflowOutput127-line methodbuildMatchers(List<String>)helper (duplicated 3x)Verification
Generated via opencode and mistral-ai
Verified by @maxulysse