@Test(expected = ArgumentException.class) public void getSizeShouldThrowOnMalformedData5() throws Exception { ParserUtils.getSize("{ab125+}"); }
public static long getSize(String args) throws ArgumentException { if (args != null && args.length() > 3 && args.charAt(0) == '{' && args.charAt(args.length() - 1) == '}' && args.charAt(args.length() - 2) == '+') { try { return Long.parseLong(args.substring(1, args.length() - 2)); } catch (NumberFormatException e) { throw new ArgumentException("Size is not a long : " + e.getMessage(), e); } } throw new ArgumentException(args + " is an invalid size literal : it should be at least 4 char looking like {_+}"); }
ParserUtils { public static long getSize(String args) throws ArgumentException { if (args != null && args.length() > 3 && args.charAt(0) == '{' && args.charAt(args.length() - 1) == '}' && args.charAt(args.length() - 2) == '+') { try { return Long.parseLong(args.substring(1, args.length() - 2)); } catch (NumberFormatException e) { throw new ArgumentException("Size is not a long : " + e.getMessage(), e); } } throw new ArgumentException(args + " is an invalid size literal : it should be at least 4 char looking like {_+}"); } }
ParserUtils { public static long getSize(String args) throws ArgumentException { if (args != null && args.length() > 3 && args.charAt(0) == '{' && args.charAt(args.length() - 1) == '}' && args.charAt(args.length() - 2) == '+') { try { return Long.parseLong(args.substring(1, args.length() - 2)); } catch (NumberFormatException e) { throw new ArgumentException("Size is not a long : " + e.getMessage(), e); } } throw new ArgumentException(args + " is an invalid size literal : it should be at least 4 char looking like {_+}"); }  }
ParserUtils { public static long getSize(String args) throws ArgumentException { if (args != null && args.length() > 3 && args.charAt(0) == '{' && args.charAt(args.length() - 1) == '}' && args.charAt(args.length() - 2) == '+') { try { return Long.parseLong(args.substring(1, args.length() - 2)); } catch (NumberFormatException e) { throw new ArgumentException("Size is not a long : " + e.getMessage(), e); } } throw new ArgumentException(args + " is an invalid size literal : it should be at least 4 char looking like {_+}"); }  static long getSize(String args); static String unquote(String quoted); }
ParserUtils { public static long getSize(String args) throws ArgumentException { if (args != null && args.length() > 3 && args.charAt(0) == '{' && args.charAt(args.length() - 1) == '}' && args.charAt(args.length() - 2) == '+') { try { return Long.parseLong(args.substring(1, args.length() - 2)); } catch (NumberFormatException e) { throw new ArgumentException("Size is not a long : " + e.getMessage(), e); } } throw new ArgumentException(args + " is an invalid size literal : it should be at least 4 char looking like {_+}"); }  static long getSize(String args); static String unquote(String quoted);  }