From e74c8722ce95b3fa69fdde270c2b401346ed0995 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Wed, 16 Dec 2020 13:57:06 +0100 Subject: [PATCH] Fix -l flag parsing in cli interface --- sdg-cli/src/main/java/es/upv/mist/slicing/cli/Slicer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdg-cli/src/main/java/es/upv/mist/slicing/cli/Slicer.java b/sdg-cli/src/main/java/es/upv/mist/slicing/cli/Slicer.java index b8893f0..edbc79c 100644 --- a/sdg-cli/src/main/java/es/upv/mist/slicing/cli/Slicer.java +++ b/sdg-cli/src/main/java/es/upv/mist/slicing/cli/Slicer.java @@ -49,7 +49,7 @@ public class Slicer { .build()); OPTIONS.addOption(Option .builder("l").longOpt("line") - .hasArg().argName("lineNumber").type(Integer.class) + .hasArg().argName("lineNumber").type(Number.class) .desc("The line that contains the statement of the slicing criterion.") .build()); OPTIONS.addOption(Option @@ -126,7 +126,7 @@ public class Slicer { } } else if (cliOpts.hasOption('f') && cliOpts.hasOption('l')) { setScFile(cliOpts.getOptionValue('f')); - setScLine((Integer) cliOpts.getParsedOptionValue("l")); + setScLine(((Number) cliOpts.getParsedOptionValue("l")).intValue()); if (cliOpts.hasOption('v')) { if (cliOpts.hasOption('n')) setScVars(cliOpts.getOptionValues('v'), cliOpts.getOptionValues('n')); -- GitLab