From be1b310a393ae3da894a8813813b02ff494c1ec0 Mon Sep 17 00:00:00 2001 From: rec3141 <1102883+rec3141@users.noreply.github.com> Date: Thu, 11 Jun 2026 16:33:21 -0500 Subject: [PATCH] Fix NumberFormatException in SketchTool.loadSketchesFromString for single-k sketches The single-k (no comma) branch of the K: header parser passed the full field string `s` (e.g. "K:31") to Integer.parseInt instead of the value substring `sub` (e.g. "31"), throwing NumberFormatException. This made TaxServer return HTTP 400 for every sendsketch query whose sketch uses a single kmer length (e.g. a local k=31 sketch server). The two file-reading parsers and the comma branch already use `sub` correctly; only this branch was affected, so default dual-k (k=32,24) sketches were unaffected. --- current/sketch/SketchTool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/current/sketch/SketchTool.java b/current/sketch/SketchTool.java index a9fa172d..848ac3c0 100644 --- a/current/sketch/SketchTool.java +++ b/current/sketch/SketchTool.java @@ -1144,7 +1144,7 @@ public ArrayList loadSketchesFromString(String sketchString){ k_sketch=Tools.max(x, y); k2_sketch=Tools.min(x, y); }else{ - k_sketch=Integer.parseInt(s); + k_sketch=Integer.parseInt(sub); k2_sketch=0; } }else if(s.startsWith("H:")){//Hash version