Skip to content

Commit b925f54

Browse files
committed
Improve interval parsing
1 parent 3c5d8f9 commit b925f54

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/util/SequenceUtil.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,19 @@ public static List<Interval> parseAndSortIntervals(String intervalString) throws
587587
List<Interval> intervals = new ArrayList<>();
588588
for (String i : intervalString.split(";"))
589589
{
590-
String[] tokens = i.split(":|-");
591-
if (tokens.length != 3)
590+
String[] tokens = i.split(":");
591+
if (tokens.length != 2)
592592
{
593593
throw new PipelineJobException("Invalid interval: " + i);
594594
}
595595

596-
intervals.add(new Interval(tokens[0], Integer.parseInt(tokens[1]), Integer.parseInt(tokens[2])));
596+
String[] interval = tokens[1].split("-");
597+
if (interval.length != 2)
598+
{
599+
throw new PipelineJobException("Invalid interval: " + i);
600+
}
601+
602+
intervals.add(new Interval(tokens[0], Integer.parseInt(interval[0]), Integer.parseInt(interval[1])));
597603
}
598604

599605

0 commit comments

Comments
 (0)