src/org/ohmage/request/observer/StreamUploadRequest.java
private JSONArray buildInvalidPoints() {
		JSONArray result = new JSONArray();
		
		for(InvalidPoint invalidPoint : invalidPoints) {
			JSONObject point = new JSONObject();

			try {
				point
					.put(
						JSON_KEY_INVALID_POINT_INDEX, 
						invalidPoint.getIndex());
				point
					.put(
						JSON_KEY_INVALID_POINT_PERSISTED,
						preserveInvalidPoints);
				point
					.put(
						JSON_KEY_INVALID_POINT_COMMENT, 
						invalidPoint.getReason());
			}
			catch(JSONException e) {
				LOGGER.error("Error building point information.", e);
				setFailed();
				return null;
			}
			
			result.put(point);
		}
		
		return result;
	}
/**
	 * Builds the JSONArray of invalid point JSONObjects to be returned to the
	 * user.
	 * 
	 * @return A JSONArray of JSONObjects where each JSONObject represents the
	 * 		   relevant information as to why a point was rejected.
	 */
Builds the JSONArray of invalid point JSONObjects to be returned to the
user.

@return A JSONArray of JSONObjects where each JSONObject represents the
relevant information as to why a point was rejected.
Builds the JSONArray of invalid point JSONObjects to be returned to the user . @return A JSONArray of JSONObjects where each JSONObject represents the relevant information as to why a point was rejected .
private JSONArray buildInvalidPoints() {
		JSONArray result = new JSONArray();
		for(InvalidPoint invalidPoint : invalidPoints) {
			JSONObject point = new JSONObject();
			try {
				point
					.put(
						JSON_KEY_INVALID_POINT_INDEX, 
						invalidPoint.getIndex());
				point
					.put(
						JSON_KEY_INVALID_POINT_PERSISTED,
						preserveInvalidPoints);
				point
					.put(
						JSON_KEY_INVALID_POINT_COMMENT, 
						invalidPoint.getReason());
			}
			catch(JSONException e) {
				LOGGER.error("Error building point information.", e);
				setFailed();
				return null;
			}
			result.put(point);
		}
		return result;
	}
private JSONArray buildInvalidPoints ( ) { JSONArray result = new JSONArray ( ) ; for ( InvalidPoint invalidPoint : invalidPoints ) { JSONObject point = new JSONObject ( ) ; try { point . put ( JSON_KEY_INVALID_POINT_INDEX , invalidPoint . getIndex ( ) ) ; point . put ( JSON_KEY_INVALID_POINT_PERSISTED , preserveInvalidPoints ) ; point . put ( JSON_KEY_INVALID_POINT_COMMENT , invalidPoint . getReason ( ) ) ; } catch ( JSONException e ) { LOGGER . error ( "Error building point information." , e ) ; setFailed ( ) ; return null ; } result . put ( point ) ; } return result ; }
Builds the JSONArray of invalid point JSONObjects to be returned to the
 user.
Builds the JSONArray of invalid point JSONObjects to be returned to the user .