Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-05-12 10:34:31 -0400
committerMichael Keppler2019-05-14 07:48:27 -0400
commit0efded6b96f5eae953f448e36cb7a874853e4c85 (patch)
treebb5dd25442d43d1896edeab52e7a2d4e9616f147
parentd03c47ba5073afac339ef7df0fe29b7bbf4c2427 (diff)
downloadegit-0efded6b96f5eae953f448e36cb7a874853e4c85.tar.gz
egit-0efded6b96f5eae953f448e36cb7a874853e4c85.tar.xz
egit-0efded6b96f5eae953f448e36cb7a874853e4c85.zip
Join catch sections using multicatch
Change-Id: I4d0eabb0faf45a6d032f69377ad08c63363cd463 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java4
-rw-r--r--org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchConfigurationDialog.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullWizard.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitTreeCompareNavigator.java10
10 files changed, 10 insertions, 41 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java
index 513589fb0..7b3efaba4 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java
@@ -181,9 +181,7 @@ public class ProjectReferenceImporter {
}
projectReferences.add(projectReference);
- } catch (final IllegalArgumentException e) {
- throw new TeamException(reference, e);
- } catch (final URISyntaxException e) {
+ } catch (final IllegalArgumentException | URISyntaxException e) {
throw new TeamException(reference, e);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java
index f2f435b35..03af6b2c8 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java
@@ -120,9 +120,7 @@ public class AssumeUnchangedOperation implements IEGitOperation {
editor.commit();
progress.worked(1);
}
- } catch (RuntimeException e) {
- throw new CoreException(Activator.error(CoreText.UntrackOperation_failed, e));
- } catch (IOException e) {
+ } catch (RuntimeException | IOException e) {
throw new CoreException(Activator.error(CoreText.UntrackOperation_failed, e));
} finally {
for (DirCache cache : caches.values()) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java
index 34bc1d35e..97cfe4135 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java
@@ -111,9 +111,7 @@ public class UntrackOperation implements IEGitOperation {
editor.commit();
progress.worked(1);
}
- } catch (RuntimeException e) {
- throw new CoreException(Activator.error(CoreText.UntrackOperation_failed, e));
- } catch (IOException e) {
+ } catch (RuntimeException | IOException e) {
throw new CoreException(Activator.error(CoreText.UntrackOperation_failed, e));
} finally {
for (DirCacheEditor editor : edits.values()) {
diff --git a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java
index eb1dd8b85..d1b8455db 100644
--- a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java
+++ b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java
@@ -92,9 +92,7 @@ public class TaskReferenceFactory implements IAdapterFactory {
repoUrl = getRepoUrl(r);
message = revCommit.getFullMessage();
timestamp = (long) revCommit.getCommitTime() * 1000;
- } catch (IOException e) {
- continue;
- } catch (RuntimeException e) {
+ } catch (IOException | RuntimeException e) {
continue;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java
index c7fa26d74..e739c6259 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java
@@ -416,9 +416,7 @@ public abstract class AbstractGitCloneWizard extends Wizard {
try {
ProjectUtils.createProjects(records, sets,
progress.newChild(1));
- } catch (InvocationTargetException e) {
- Activator.logError(e.getLocalizedMessage(), e);
- } catch (InterruptedException e) {
+ } catch (InvocationTargetException | InterruptedException e) {
Activator.logError(e.getLocalizedMessage(), e);
}
return Status.OK_STATUS;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java
index 81e4ea05a..cffeeb916 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java
@@ -117,11 +117,7 @@ public class HeaderText {
}
});
updateSizeAndLocations();
- } catch (NoSuchFieldException e) {
- form.setText(text);
- } catch (IllegalArgumentException e) {
- form.setText(text);
- } catch (IllegalAccessException e) {
+ } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
form.setText(text);
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchConfigurationDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchConfigurationDialog.java
index 367592b7c..900bca7ab 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchConfigurationDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchConfigurationDialog.java
@@ -157,10 +157,7 @@ public class BranchConfigurationDialog extends TitleAreaDialog {
addBranchItemsForLocal();
else
addBranchItemsForRemote(remote);
- } catch (IOException e) {
- Activator.logError(
- UIText.BranchConfigurationDialog_ExceptionGettingRefs, e);
- } catch (URISyntaxException e) {
+ } catch (IOException | URISyntaxException e) {
Activator.logError(
UIText.BranchConfigurationDialog_ExceptionGettingRefs, e);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
index 69c067be7..884959df4 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
@@ -1259,10 +1259,7 @@ public class FetchGerritChangePage extends WizardPage {
}
Integer patchSetNumber = Integer.valueOf(m.group(3));
return new Change(refName, changeNumber, patchSetNumber);
- } catch (NumberFormatException e) {
- // if we can't parse this, just return null
- return null;
- } catch (IndexOutOfBoundsException e) {
+ } catch (NumberFormatException | IndexOutOfBoundsException e) {
// if we can't parse this, just return null
return null;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullWizard.java
index d2bd5f32e..be5bbb420 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullWizard.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullWizard.java
@@ -75,10 +75,7 @@ public class PullWizard extends Wizard {
}
startPull();
return true;
- } catch (IOException e) {
- Activator.logError(e.getMessage(), e);
- return false;
- } catch (URISyntaxException e) {
+ } catch (IOException | URISyntaxException e) {
Activator.logError(e.getMessage(), e);
return false;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitTreeCompareNavigator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitTreeCompareNavigator.java
index 07130ab55..bbb07fb18 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitTreeCompareNavigator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitTreeCompareNavigator.java
@@ -43,15 +43,7 @@ class GitTreeCompareNavigator extends CompareNavigator {
baseNavigables.setAccessible(true);
return (INavigatable[]) baseNavigables.invoke(mainNavigator,
Void.class);
- } catch (SecurityException e) {
- // should never happen
- } catch (NoSuchMethodException e) {
- // should never happen
- } catch (IllegalArgumentException e) {
- // should never happen
- } catch (IllegalAccessException e) {
- // should never happen
- } catch (InvocationTargetException e) {
+ } catch (SecurityException | NoSuchMethodException | IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
// should never happen
}
return new INavigatable[0];

Back to the top