NumericParser now throws LineParserException instead of NumberFormatException, follows uniform parser format
@@ -28,6 +28,7 @@ public class NumericParser extends Parser {
@Override
public Object parse(String text) throws LineParseException {
String token = getToken(text);
+ try {
if(token.endsWith("F"))
return Float.parseFloat(token);
if(token.endsWith("D") || token.contains("."))
@@ -39,6 +40,11 @@ public class NumericParser extends Parser {
if(token.endsWith("S"))
return Short.parseShort(token);
return Integer.parseInt(token);
+ } catch(NumberFormatException ex) {
+ LineParseException parseEx = new LineParseException(text, "Failed to parse number format");
+ parseEx.addSuppressed(ex);
+ throw parseEx;
+ }
}
@Override
