incubator-wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r1292071 - in /incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j: JSON4JArrayProvider.java JSON4JObjectProvider.java
Date Tue, 21 Feb 2012 22:49:47 GMT
Author: rfeng
Date: Tue Feb 21 22:49:47 2012
New Revision: 1292071

URL: http://svn.apache.org/viewvc?rev=1292071&view=rev
Log:
Use constants to reference the http status code

Modified:
    incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JArrayProvider.java
    incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JObjectProvider.java

Modified: incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JArrayProvider.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JArrayProvider.java?rev=1292071&r1=1292070&r2=1292071&view=diff
==============================================================================
--- incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JArrayProvider.java
(original)
+++ incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JArrayProvider.java
Tue Feb 21 22:49:47 2012
@@ -32,6 +32,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response.Status;
 import javax.ws.rs.ext.MessageBodyReader;
 import javax.ws.rs.ext.MessageBodyWriter;
 import javax.ws.rs.ext.Provider;
@@ -64,7 +65,7 @@ public class JSON4JArrayProvider impleme
             return new JSONArray(new InputStreamReader(is, ProviderUtils.getCharset(mediaType)),
                                  false);
         } catch (JSONException e) {
-            throw new WebApplicationException(e, 400);
+            throw new WebApplicationException(e, Status.BAD_REQUEST);
         }
     }
 

Modified: incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JObjectProvider.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JObjectProvider.java?rev=1292071&r1=1292070&r2=1292071&view=diff
==============================================================================
--- incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JObjectProvider.java
(original)
+++ incubator/wink/trunk/wink-providers/wink-json4j-provider/src/main/java/org/apache/wink/providers/json4j/JSON4JObjectProvider.java
Tue Feb 21 22:49:47 2012
@@ -32,6 +32,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response.Status;
 import javax.ws.rs.ext.MessageBodyReader;
 import javax.ws.rs.ext.MessageBodyWriter;
 import javax.ws.rs.ext.Provider;
@@ -63,7 +64,7 @@ public class JSON4JObjectProvider implem
         try {
             return new JSONObject(new InputStreamReader(is, ProviderUtils.getCharset(mediaType)));
         } catch (JSONException e) {
-            throw new WebApplicationException(e, 400);
+            throw new WebApplicationException(e, Status.BAD_REQUEST);
         }
     }
 



Mime
View raw message