fix(nanno): preserve user-requested field order in AnnotationSourceTSV#402
fix(nanno): preserve user-requested field order in AnnotationSourceTSV#402Copilot wants to merge 3 commits intonanno_multi_genefrom
Conversation
…requested field order Co-authored-by: holmeso <7066552+holmeso@users.noreply.github.com>
|
@copilot this causes a failure in a qannotate test |
…test expectations - Revert --enable-preview from build.gradle (List.getFirst/getLast are standard Java 21, not preview) - Revert --enable-preview from AnnotateTest.java Executor call - Update jsonInputsTSV expected value to match user-requested field order (aaref,HGVSc_VEP,HGVSp_VEP) with LinkedHashMap - Fix Executor.java: use getJavaPath() instead of literal "java", remove shell-style quotes from classpath (ProcessBuilder does not use a shell), switch array/jvmArgs constructors to ProcessBuilder Co-authored-by: holmeso <7066552+holmeso@users.noreply.github.com>
Fixed in commit
|
AnnotationSourceTSV.getHeaderNameAndPositionsreturned aHashMap, causingkeySet()iteration in the constructor to produce non-deterministic ordering forfieldNames/fieldPositionsarrays — potentially mismatching the user-requested CSV field order andemptyRecordResult.Changes
AnnotationSourceTSV.java: ReplaceHashMapwithLinkedHashMapingetHeaderNameAndPositionsso insertion order (driven byfieldNames.split(",")) is preserved when populating the precomputed arraysAnnotateTest.java: Updated expected value injsonInputsTSVtest to match the now-deterministic user-requested field order (aaref,HGVSc_VEP,HGVSp_VEP)Executor.java: Fixed two pre-existing bugs that causedendToEndandendToEndSnpEfftests to fail:"java"string withgetJavaPath()(derived fromjava.home) so the correct JVM binary is used regardless ofPATHProcessBuilderdoes not use a shell, so the literal"characters were being passed to the JVM, preventing class loadingExecutor(String[], String)andExecutor(String jvmArgs, String arguments, String qualifiedMainClassName)constructors to useProcessBuilderdirectly with an unquoted classpathType of change
How Has This Been Tested?
Existing and updated unit tests in
AnnotationSourceTSVTestandAnnotateTestcover the changes.AnnotationSourceTSVTest.extractFieldsFromRecordAnnotationSourceTSVTest.getHeaderNameAndPositionsAnnotateTest.jsonInputsTSVAnnotateTest.endToEndAnnotateTest.endToEndSnpEffAre WDL Updates Required?
No.
Checklist:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.