MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / parseValue

Method parseValue

src/main/java/wycc/util/OptArg.java:441–455  ·  view source on GitHub ↗
(String str)

Source from the content-addressed store, hash-verified

439 }
440
441 private static Object parseValue(String str) {
442 if(str.equals("true")) {
443 return Boolean.TRUE;
444 } else if(str.equals("false")) {
445 return Boolean.FALSE;
446 } else if(Character.isDigit(str.charAt(0))) {
447 if(str.charAt(str.length()-1) == 'L') {
448 return Long.parseLong(str.substring(0,str.length()-1));
449 } else {
450 return Integer.parseInt(str);
451 }
452 } else {
453 return str;
454 }
455 }
456}

Callers 1

splitConfigMethod · 0.95

Calls 3

isDigitMethod · 0.80
lengthMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected