This code was originally for lisp lists, i modifed it for ArrayLists. But it doesn't work properly. It supposed to take a string ( a list of numbers), convert them to integers and return an ArrayList
public static ArrayList<Integer> parseIntArrayList(String str) { String line = str.trim(); String contents = line.substring(1,line.length()-1).trim(); if(contents.length()==0) return null; String[] nums = contents.split(","); ArrayList<Integer> list = null; for(int i=nums.length-1; i>=0; i--) { String num = nums[i].trim(); list.add(i,Integer.parseInt(num)); } return list; }