summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorPer-Åke Minborg <minborg@speedment.com>2016-10-27 23:27:16 -0700
committerHenri Sara <hesara@vaadin.com>2016-11-02 14:41:54 +0000
commit557721f86e3de24b80efb6d80382a74699fa38d0 (patch)
treeb23a75265d758e1c263ac0d2555d7afc2a9fc20d /server
parent6b8f9779fbc8c81d1dff2ac139bd41535018aa78 (diff)
downloadvaadin-framework-557721f86e3de24b80efb6d80382a74699fa38d0.tar.gz
vaadin-framework-557721f86e3de24b80efb6d80382a74699fa38d0.zip
Replace with multi-catch
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf7216
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/navigator/Navigator.java7
-rw-r--r--server/src/main/java/com/vaadin/server/GAEVaadinServlet.java8
-rw-r--r--server/src/main/java/com/vaadin/server/ServletPortletHelper.java6
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java9
5 files changed, 8 insertions, 26 deletions
diff --git a/server/src/main/java/com/vaadin/navigator/Navigator.java b/server/src/main/java/com/vaadin/navigator/Navigator.java
index 4fb3906e9e..07d7c5c085 100644
--- a/server/src/main/java/com/vaadin/navigator/Navigator.java
+++ b/server/src/main/java/com/vaadin/navigator/Navigator.java
@@ -340,13 +340,12 @@ public class Navigator implements Serializable {
try {
View view = viewClass.newInstance();
return view;
- } catch (InstantiationException e) {
- // TODO error handling
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
// TODO error handling
throw new RuntimeException(e);
}
+ // TODO error handling
+
}
return null;
}
diff --git a/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java b/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java
index 93a43829b3..bfa2925dcb 100644
--- a/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java
+++ b/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java
@@ -341,13 +341,7 @@ public class GAEVaadinServlet extends VaadinServlet {
VaadinSession vaadinSession = (VaadinSession) ois.readObject();
getService().storeSession(vaadinSession,
new WrappedHttpSession(session));
- } catch (IOException e) {
- getLogger().log(Level.WARNING,
- "Could not de-serialize ApplicationContext for "
- + session.getId()
- + " A new one will be created. ",
- e);
- } catch (ClassNotFoundException e) {
+ } catch (IOException | ClassNotFoundException e) {
getLogger().log(Level.WARNING,
"Could not de-serialize ApplicationContext for "
+ session.getId()
diff --git a/server/src/main/java/com/vaadin/server/ServletPortletHelper.java b/server/src/main/java/com/vaadin/server/ServletPortletHelper.java
index 5bd4c01427..bf7b1c8452 100644
--- a/server/src/main/java/com/vaadin/server/ServletPortletHelper.java
+++ b/server/src/main/java/com/vaadin/server/ServletPortletHelper.java
@@ -183,11 +183,7 @@ public class ServletPortletHelper implements Serializable {
} catch (ClassCastException e) {
throw new ServiceException("UIProvider class " + uiProviderProperty
+ " does not extend UIProvider", e);
- } catch (InstantiationException e) {
- throw new ServiceException(
- "Could not instantiate UIProvider " + uiProviderProperty,
- e);
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
throw new ServiceException(
"Could not instantiate UIProvider " + uiProviderProperty,
e);
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java
index 6d2b2518b0..bf50d6a53d 100644
--- a/server/src/main/java/com/vaadin/ui/Grid.java
+++ b/server/src/main/java/com/vaadin/ui/Grid.java
@@ -601,9 +601,7 @@ public class Grid<T> extends AbstractSingleSelect<T> implements HasComponents {
try {
type = (getState(false).getClass()
.getDeclaredField(diffStateKey).getGenericType());
- } catch (NoSuchFieldException e) {
- e.printStackTrace();
- } catch (SecurityException e) {
+ } catch (NoSuchFieldException | SecurityException e) {
e.printStackTrace();
}
EncodeResult encodeResult = JsonCodec.encode(
diff --git a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java
index 3d7dcc20d9..29c4c5491d 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java
@@ -86,9 +86,7 @@ public class FieldBinder implements Serializable {
if (value == null) {
unboundFields.add(f.getName());
}
- } catch (IllegalArgumentException e) {
- throw new FieldBindingException("Could not get field value", e);
- } catch (IllegalAccessException e) {
+ } catch (IllegalArgumentException | IllegalAccessException e) {
throw new FieldBindingException("Could not get field value", e);
}
}
@@ -197,10 +195,7 @@ public class FieldBinder implements Serializable {
field.set(bindTarget, instance);
}
return true;
- } catch (IllegalAccessException e) {
- throw new FieldBindingException(
- "Field binding failed for " + identifier, e);
- } catch (IllegalArgumentException e) {
+ } catch (IllegalAccessException | IllegalArgumentException e) {
throw new FieldBindingException(
"Field binding failed for " + identifier, e);
}