@Test public void testParseIntArray_empty() { Assert.assertEquals(ArrayUtil.parseIntArray(""), new Integer[]{null}); }
public static Integer[] parseIntArray(String s) { if (s == null) { return new Integer[0]; } String[] arr = s.split("[,]"); Integer[] result = new Integer[arr.length]; for (int i = 0; i < arr.length; ++i) { try { result[i] = Integer.parseInt(arr[i].trim()); } catch (NumberFormatException e) { result[i] = null; } } return result; }
ArrayUtil { public static Integer[] parseIntArray(String s) { if (s == null) { return new Integer[0]; } String[] arr = s.split("[,]"); Integer[] result = new Integer[arr.length]; for (int i = 0; i < arr.length; ++i) { try { result[i] = Integer.parseInt(arr[i].trim()); } catch (NumberFormatException e) { result[i] = null; } } return result; } }
ArrayUtil { public static Integer[] parseIntArray(String s) { if (s == null) { return new Integer[0]; } String[] arr = s.split("[,]"); Integer[] result = new Integer[arr.length]; for (int i = 0; i < arr.length; ++i) { try { result[i] = Integer.parseInt(arr[i].trim()); } catch (NumberFormatException e) { result[i] = null; } } return result; } private  ArrayUtil(); }
ArrayUtil { public static Integer[] parseIntArray(String s) { if (s == null) { return new Integer[0]; } String[] arr = s.split("[,]"); Integer[] result = new Integer[arr.length]; for (int i = 0; i < arr.length; ++i) { try { result[i] = Integer.parseInt(arr[i].trim()); } catch (NumberFormatException e) { result[i] = null; } } return result; } private  ArrayUtil(); static String join(Object[] objects, String flag); static String join(String[] objects, String flag); static Object[] toArray(T[] array); static Integer[] parseIntArray(String s); }
ArrayUtil { public static Integer[] parseIntArray(String s) { if (s == null) { return new Integer[0]; } String[] arr = s.split("[,]"); Integer[] result = new Integer[arr.length]; for (int i = 0; i < arr.length; ++i) { try { result[i] = Integer.parseInt(arr[i].trim()); } catch (NumberFormatException e) { result[i] = null; } } return result; } private  ArrayUtil(); static String join(Object[] objects, String flag); static String join(String[] objects, String flag); static Object[] toArray(T[] array); static Integer[] parseIntArray(String s);  }