Use multi-catch when possible

This commit is contained in:
Alexander Udalov
2017-04-01 00:33:19 +03:00
parent 34f0576135
commit 6aa0f7bb65
14 changed files with 16 additions and 68 deletions
@@ -87,20 +87,13 @@ public class KotlinLightClassCoherenceTest extends KotlinAsJavaTestBase {
}
public void assertPropertyCoherent(KtLightClass lightClass, String methodName) {
Class<?> reflect = PsiClass.class;
try {
Method method = reflect.getMethod(methodName);
Method method = PsiClass.class.getMethod(methodName);
Object lightResult = method.invoke(lightClass);
Object delegateResult = method.invoke(lightClass.getClsDelegate());
assertEquals("Result of method " + methodName + "() differs in light class and its delegate", delegateResult, lightResult);
}
catch (NoSuchMethodException e) {
throw new AssertionError(e);
}
catch (InvocationTargetException e) {
throw new AssertionError(e);
}
catch (IllegalAccessException e) {
catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
throw new AssertionError(e);
}
}