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
@@ -313,10 +313,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
return genNotNullAssertions(state, stackValue, runtimeAssertionInfo);
}
catch (ProcessCanceledException e) {
throw e;
}
catch (CompilationException e) {
catch (ProcessCanceledException | CompilationException e) {
throw e;
}
catch (Throwable error) {
@@ -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) {
@@ -193,10 +193,7 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
try {
functionCodegen.gen((KtNamedFunction) declaration);
}
catch (ProcessCanceledException e) {
throw e;
}
catch (CompilationException e) {
catch (ProcessCanceledException | CompilationException e) {
throw e;
}
catch (Exception e) {
@@ -207,10 +204,7 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
try {
propertyCodegen.gen((KtProperty) declaration);
}
catch (ProcessCanceledException e) {
throw e;
}
catch (CompilationException e) {
catch (ProcessCanceledException | CompilationException e) {
throw e;
}
catch (Exception e) {