Subversion Repositories SmartDukaan

Rev

Rev 2949 | Rev 2982 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2949 Rev 2961
Line 158... Line 158...
158
        setId(itemsString);
158
        setId(itemsString);
159
    }
159
    }
160
	
160
	
161
	public void setId(String itemsString) {
161
	public void setId(String itemsString) {
162
        JSONArray itemJson = null;
162
        JSONArray itemJson = null;
163
        items = new ArrayList<String>();
-
 
164
        try {
163
        try {
165
            itemJson = new JSONArray(itemsString);
164
            itemJson = new JSONArray(itemsString);
166
        } catch (JSONException e) {
165
        } catch (JSONException e) {
167
            log.error("Bad json : " + itemsString);
166
            log.error("Bad json : " + itemsString);
168
            return;
167
            return;
169
        }
168
        }
-
 
169
        
-
 
170
        items = new ArrayList<String>();
170
        for (int i=0; i<itemJson.length(); i++) {
171
        for (int i=0; i<itemJson.length(); i++) {
171
            try {
172
            try {
172
                items.add(itemJson.getString(i));
173
                items.add(itemJson.getString(i));
173
            } catch (JSONException e) {
174
            } catch (JSONException e) {
174
                log.error("Bad item at index : " + i);
175
                log.error("Bad item at index : " + i);