You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2019/08/13 23:09:45 UTC
svn commit: r1865080 -
/pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java
Author: rwhitcomb
Date: Tue Aug 13 23:09:45 2019
New Revision: 1865080
URL: http://svn.apache.org/viewvc?rev=1865080&view=rev
Log:
PIVOT-999: Consolidate "catch" clauses in a demo program.
Modified:
pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java
Modified: pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java?rev=1865080&r1=1865079&r2=1865080&view=diff
==============================================================================
--- pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java (original)
+++ pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java Tue Aug 13 23:09:45 2019
@@ -52,9 +52,7 @@ public class RESTDemoServlet extends Que
try {
JSONSerializer jsonSerializer = new JSONSerializer();
value = jsonSerializer.readObject(new FileInputStream(file));
- } catch (IOException exception) {
- throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
- } catch (SerializationException exception) {
+ } catch (IOException | SerializationException exception) {
throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
}
@@ -76,9 +74,7 @@ public class RESTDemoServlet extends Que
JSONSerializer jsonSerializer = new JSONSerializer();
jsonSerializer.writeObject(value, new FileOutputStream(file));
- } catch (IOException exception) {
- throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
- } catch (SerializationException exception) {
+ } catch (IOException | SerializationException exception) {
throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
}
@@ -110,9 +106,7 @@ public class RESTDemoServlet extends Que
try {
JSONSerializer jsonSerializer = new JSONSerializer();
jsonSerializer.writeObject(value, new FileOutputStream(file));
- } catch (IOException exception) {
- throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
- } catch (SerializationException exception) {
+ } catch (IOException | SerializationException exception) {
throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
}