Collapse repeating catch blocks

GitOrigin-RevId: b6768c28ea3d14d2d832a843b9d7f9d94e9aa05f
This commit is contained in:
Tagir Valeev
2022-02-06 11:23:07 +00:00
committed by intellij-monorepo-bot
parent 2b4d66a224
commit ead8c7b769
22 changed files with 25 additions and 99 deletions
@@ -279,9 +279,6 @@ public class DebugProcessEvents extends DebugProcessImpl {
}
});
}
catch (InternalException e) {
LOG.debug(e);
}
catch (InterruptedException | ProcessCanceledException | VMDisconnectedException e) {
throw e;
}
@@ -140,10 +140,7 @@ public abstract class InvokeThread<E extends PrioritizedTask> {
processEvent(myEvents.get());
}
catch (VMDisconnectedException ignored) {
break;
}
catch (EventQueueClosedException ignored) {
catch (VMDisconnectedException | EventQueueClosedException ignored) {
break;
}
catch (ProcessCanceledException ignored) {}
@@ -22,9 +22,7 @@ public final class WindowsCommandLineProcessor {
Method method = ourMainRunnerClass.getMethod("processWindowsLauncherCommandLine", String.class, String[].class);
return (Integer)method.invoke(null, currentDirectory, args);
}
catch (NoSuchMethodException ignored) { }
catch (InvocationTargetException ignored) { }
catch (IllegalAccessException ignored) { }
catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) { }
}
return 1;
}
@@ -121,13 +121,10 @@ public abstract class ExecutorAction extends DumbAwareAction implements UpdateIn
settings.checkSettings(null);
return true;
}
catch (IndexNotReadyException ex) {
return true;
}
catch (RuntimeConfigurationError ex) {
return false;
}
catch (RuntimeConfigurationException ex) {
catch (IndexNotReadyException | RuntimeConfigurationException ex) {
return true;
}
}
@@ -78,9 +78,7 @@ public final class CompoundTreeStructureProvider implements TreeStructureProvide
Object data = provider.getData(selection, dataId);
if (data != null) return data;
}
catch (IndexNotReadyException ignore) {
}
catch (ProcessCanceledException ignore) {
catch (IndexNotReadyException | ProcessCanceledException ignore) {
}
catch (Exception exception) {
LOG.warn("unexpected error in " + provider, exception);
@@ -564,9 +564,7 @@ public class EditorMouseHoverPopupManager implements Disposable {
}
}
}
catch (IndexNotReadyException ignored) {
}
catch (ProcessCanceledException ignored) {
catch (IndexNotReadyException | ProcessCanceledException ignored) {
}
catch (Exception e) {
LOG.warn(e);
@@ -136,13 +136,7 @@ final class NST {
platformWindow != null ? platformWindow.getClass() : "null");
}
}
catch (NoSuchMethodException e) {
LOG.debug(e);
}
catch (IllegalAccessException e) {
LOG.debug(e);
}
catch (InvocationTargetException e) {
catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
LOG.debug(e);
}
}
@@ -66,10 +66,7 @@ public class AsyncPopupImpl extends WizardPopup implements Runnable {
try {
myCallBackParent.handleNextStep(myFuture.get(), myParentValue);
}
catch (InterruptedException e) {
//ignore
}
catch (ExecutionException e) {
catch (InterruptedException | ExecutionException e) {
//ignore
}
return;
@@ -920,11 +920,7 @@ public class StructuralSearchDialog extends DialogWrapper implements DocumentLis
mySearchCriteriaEdit));
}
}
catch (UnsupportedPatternException e) {
removeMatchHighlights();
errors.add(new ValidationInfo(e.getMessage(), mySearchCriteriaEdit));
}
catch (NoMatchFoundException e) {
catch (UnsupportedPatternException | NoMatchFoundException e) {
removeMatchHighlights();
errors.add(new ValidationInfo(e.getMessage(), mySearchCriteriaEdit));
}
@@ -932,10 +928,7 @@ public class StructuralSearchDialog extends DialogWrapper implements DocumentLis
try {
Replacer.checkReplacementPattern(getProject(), myConfiguration.getReplaceOptions());
}
catch (UnsupportedPatternException e) {
errors.add(new ValidationInfo(e.getMessage(), myReplaceCriteriaEdit));
}
catch (MalformedPatternException e) {
catch (UnsupportedPatternException | MalformedPatternException e) {
errors.add(new ValidationInfo(e.getMessage(), myReplaceCriteriaEdit));
}
}
@@ -243,10 +243,7 @@ public abstract class MapReduceIndex<Key,Value, Input> implements InvertedIndex<
try {
data = mapInput(inputId, content);
}
catch (ProcessCanceledException e) {
throw e;
}
catch (MapReduceIndexMappingException e) {
catch (ProcessCanceledException | MapReduceIndexMappingException e) {
throw e;
}
catch (Exception e) {
@@ -222,10 +222,7 @@ public class GitExecutableManager {
GitExecutable executable = getExecutable(project);
return identifyVersion(executable);
}
catch (ProcessCanceledException e) {
return null;
}
catch (GitVersionIdentificationException e) {
catch (ProcessCanceledException | GitVersionIdentificationException e) {
return null;
}
});
@@ -238,10 +235,7 @@ public class GitExecutableManager {
try {
return identifyVersion(executable);
}
catch (ProcessCanceledException e) {
return null;
}
catch (GitVersionIdentificationException e) {
catch (ProcessCanceledException | GitVersionIdentificationException e) {
return null;
}
});
@@ -923,10 +923,7 @@ public final class CommonGradleProjectResolverExtension extends AbstractProjectR
Object result = getDependencyModule.invoke(dependency);
return (IdeaModule)result;
}
catch (IllegalAccessException e) {
LOG.info("Failed to get dependency module for [" + dependency + "]", e);
}
catch (InvocationTargetException e) {
catch (IllegalAccessException | InvocationTargetException e) {
LOG.info("Failed to get dependency module for [" + dependency + "]", e);
}
}
@@ -212,9 +212,7 @@ public final class FormsBindingManager extends FormsBuilder {
return true;
}
}
catch (IOException ignore) {
}
catch (AlienFormFileException ignore) {
catch (IOException | AlienFormFileException ignore) {
}
}
return false;
@@ -148,12 +148,7 @@ public final class FormsInstrumenter extends FormsBuilder {
// ignore non-IDEA forms
continue;
}
catch (UnexpectedFormElementException e) {
context.processMessage(new CompilerMessage(getPresentableName(), BuildMessage.Kind.ERROR, e.getMessage(), formFile.getPath()));
LOG.info(e);
continue;
}
catch (UIDesignerException e) {
catch (UnexpectedFormElementException | UIDesignerException e) {
context.processMessage(new CompilerMessage(getPresentableName(), BuildMessage.Kind.ERROR, e.getMessage(), formFile.getPath()));
LOG.info(e);
continue;
@@ -44,10 +44,7 @@ public final class Properties {
loadState(JDOMUtil.load(inputStream));
}
}
catch (JDOMException e) {
LOG.error(e);
}
catch (IOException e) {
catch (JDOMException | IOException e) {
LOG.error(e);
}
}
@@ -58,13 +58,11 @@ class Saxon9StyleFrame extends AbstractSaxon9Frame<Debugger.StyleFrame, TraceExp
Saxon9TraceListener.MUTED = true;
try {
return createValue(new ExpressionFacade(myElement));
} catch (AssertionError e) {
} catch (AssertionError | Exception e) {
debug(e);
throw new Debugger.EvaluationException(e.getMessage() != null ? e.getMessage() : e.toString());
} catch (Exception e) {
debug(e);
throw new Debugger.EvaluationException(e.getMessage() != null ? e.getMessage() : e.toString());
} finally {
}
finally {
Saxon9TraceListener.MUTED = false;
}
}
@@ -70,9 +70,7 @@ class XalanStyleFrame extends AbstractFrame<Debugger.StyleFrame> implements Debu
new XObjectValue(variable.getValue(myTransformer, myCurrentNode));
variables.add(new VariableImpl(name, value, global, kind, variable.getSystemId(), variable.getLineNumber()));
} catch (TransformerException e) {
debug(e);
} catch (Debugger.EvaluationException e) {
} catch (TransformerException | Debugger.EvaluationException e) {
debug(e);
}
}
@@ -25,11 +25,7 @@ public class RestAnnotatingVisitor implements Annotator {
try {
annotator = cls.newInstance();
}
catch (InstantiationException e) {
LOGGER.error(e);
continue;
}
catch (IllegalAccessException e) {
catch (InstantiationException | IllegalAccessException e) {
LOGGER.error(e);
continue;
}
@@ -274,9 +274,6 @@ public final class PyPackageManagerUI {
try {
manager.install(null, myExtraArgs);
}
catch (RunCanceledByUserException e) {
exceptions.add(e);
}
catch (ExecutionException e) {
exceptions.add(e);
}
@@ -38,11 +38,7 @@ public class PyAnnotatingVisitor implements Annotator {
try {
annotator = (PyAnnotator)cls.newInstance();
}
catch (InstantiationException e) {
LOGGER.error(e);
continue;
}
catch (IllegalAccessException e) {
catch (InstantiationException | IllegalAccessException e) {
LOGGER.error(e);
continue;
}
@@ -74,9 +74,6 @@ public final class DomReflectionUtil {
catch (IllegalArgumentException e) {
throw new RuntimeException("Calling method " + method + " on object " + object + " with arguments " + Arrays.asList(args), e);
}
catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
catch (InvocationTargetException e) {
final Throwable cause = e.getCause();
if (cause instanceof ProcessCanceledException) {
@@ -162,13 +162,10 @@ public class IdeaDriver {
errorHandler.error(e);
} catch (MalformedURLException e) {
Logger.getInstance(getClass().getName()).error(e);
} catch (InputFailedException e) {
} catch (InputFailedException | OutputFailedException | InvalidParamsException e) {
// handled by ErrorHandler
} catch (InvalidParamsException e) {
// handled by ErrorHandler
} catch (OutputFailedException e) {
// handled by ErrorHandler
} catch (SAXException e) {
}
catch (SAXException e) {
// cannot happen or is already handled
}
}