diff --git a/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunUtils.java b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunUtils.java index 2cc662bd7c6..21d4b1d47eb 100644 --- a/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunUtils.java +++ b/compiler/android-tests/src/org/jetbrains/kotlin/android/tests/run/RunUtils.java @@ -111,10 +111,7 @@ public class RunUtils { } close(handler.getProcessInput()); } - catch (ExecutionException e) { - return new RunResult(false, getStackTrace(e)); - } - catch (IOException e) { + catch (ExecutionException | IOException e) { return new RunResult(false, getStackTrace(e)); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index e11f39491df..a304b30b7d3 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -313,10 +313,7 @@ public class ExpressionCodegen extends KtVisitor impleme return genNotNullAssertions(state, stackValue, runtimeAssertionInfo); } - catch (ProcessCanceledException e) { - throw e; - } - catch (CompilationException e) { + catch (ProcessCanceledException | CompilationException e) { throw e; } catch (Throwable error) { diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java index 67598ddd45f..71d6eb6d5a4 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java @@ -381,10 +381,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { generateSecondaryConstructor(secondaryConstructor); } } - catch (CompilationException e) { - throw e; - } - catch (ProcessCanceledException e) { + catch (CompilationException | ProcessCanceledException e) { throw e; } catch (RuntimeException e) { diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java index 4f051b8ffd6..432592d5d9d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java @@ -193,10 +193,7 @@ public abstract class MemberCodegen>>"); diff --git a/compiler/tests-common/org/jetbrains/kotlin/codegen/flags/AbstractWriteFlagsTest.java b/compiler/tests-common/org/jetbrains/kotlin/codegen/flags/AbstractWriteFlagsTest.java index 363598cd8ac..730dec812c2 100644 --- a/compiler/tests-common/org/jetbrains/kotlin/codegen/flags/AbstractWriteFlagsTest.java +++ b/compiler/tests-common/org/jetbrains/kotlin/codegen/flags/AbstractWriteFlagsTest.java @@ -184,10 +184,7 @@ public abstract class AbstractWriteFlagsTest extends CodegenTestCase { Field field = klass.getDeclaredField(flag); expectedAccess |= field.getInt(klass); } - catch (NoSuchFieldException e) { - throw new IllegalArgumentException("Cannot find " + flag + " field in Opcodes class", e); - } - catch (IllegalAccessException e) { + catch (NoSuchFieldException | IllegalAccessException e) { throw new IllegalArgumentException("Cannot find " + flag + " field in Opcodes class", e); } } diff --git a/compiler/tests/org/jetbrains/kotlin/asJava/KotlinLightClassCoherenceTest.java b/compiler/tests/org/jetbrains/kotlin/asJava/KotlinLightClassCoherenceTest.java index a7e3e31e61c..9a0d42c6cd2 100644 --- a/compiler/tests/org/jetbrains/kotlin/asJava/KotlinLightClassCoherenceTest.java +++ b/compiler/tests/org/jetbrains/kotlin/asJava/KotlinLightClassCoherenceTest.java @@ -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); } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/StdlibTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/StdlibTest.java index ab01bf03ba4..cd53406ccdd 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/StdlibTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/StdlibTest.java @@ -142,12 +142,9 @@ public class StdlibTest extends KotlinTestWithEnvironment { return TestCase.class.isAssignableFrom(aClass) ? new TestSuite(aClass) : TestRunnerUtil.isJUnit4TestClass(aClass) ? new JUnit4TestAdapter(aClass) : null; } - catch (NoSuchMethodException e) { + catch (NoSuchMethodException | ClassNotFoundException e) { // Ignore test classes we can't instantiate return null; } - catch (ClassNotFoundException e) { - return null; - } } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java index 817a1636d39..68341ce7d35 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java @@ -165,13 +165,7 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase { ourOutputRootField.set(null, LOCAL_CACHE_APP_DIR); } - catch (NoSuchFieldException e) { - throw ExceptionUtilsKt.rethrow(e); - } - catch (IllegalAccessException e) { - throw ExceptionUtilsKt.rethrow(e); - } - catch (IOException e) { + catch (NoSuchFieldException | IOException | IllegalAccessException e) { throw ExceptionUtilsKt.rethrow(e); } } diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/PackageDeclarationTranslator.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/PackageDeclarationTranslator.java index 92c2a70b24c..3d040846cb6 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/PackageDeclarationTranslator.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/PackageDeclarationTranslator.java @@ -54,10 +54,7 @@ public final class PackageDeclarationTranslator extends AbstractTranslator { catch (TranslationRuntimeException e) { throw e; } - catch (RuntimeException e) { - throw new TranslationRuntimeException(file, e); - } - catch (AssertionError e) { + catch (RuntimeException | AssertionError e) { throw new TranslationRuntimeException(file, e); } } diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/general/Translation.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/general/Translation.java index bfa37c7291e..401e7ce2f18 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/general/Translation.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/general/Translation.java @@ -168,10 +168,7 @@ public final class Translation { catch (TranslationRuntimeException e) { throw e; } - catch (RuntimeException e) { - throw new TranslationRuntimeException(expression, e); - } - catch (AssertionError e) { + catch (RuntimeException | AssertionError e) { throw new TranslationRuntimeException(expression, e); } }