From 5998a297ce1866c1f16f508ab443ae8e3293c21e Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 26 Aug 2016 14:43:40 +0200 Subject: [PATCH] Simplify exception handling in JsonPathExpectationsHelper --- .../test/util/JsonPathExpectationsHelper.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java b/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java index cbb74dc6e4..e1d9d1615c 100644 --- a/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java +++ b/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -227,13 +227,7 @@ public class JsonPathExpectationsHelper { try { return this.jsonPath.read(content); } - catch (InvalidPathException ex) { - throw new AssertionError(message + ex.getMessage()); - } - catch (ArrayIndexOutOfBoundsException ex) { - throw new AssertionError(message + ex.getMessage()); - } - catch (IndexOutOfBoundsException ex) { + catch (InvalidPathException | IndexOutOfBoundsException ex) { throw new AssertionError(message + ex.getMessage()); } }