diff options
author | Carsten Hammer <carsten.hammer@t-online.de> | 2019-04-06 18:16:21 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-04-13 18:53:58 +0200 |
commit | c0268f899e3e600a45f6c028f4d0088b2fb2fce1 (patch) | |
tree | a017363ab828ae957cfa1f0c4ce8f72e268b0139 /org.eclipse.jgit.junit/src | |
parent | 3c1af2761f91ec7c17b648c0537e6c7f1847032e (diff) | |
download | jgit-c0268f899e3e600a45f6c028f4d0088b2fb2fce1.tar.gz jgit-c0268f899e3e600a45f6c028f4d0088b2fb2fce1.zip |
Join catch sections using multicatch
Change-Id: I1a9112e6a4f938638c599b489cb0858eca27ab91
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java | 8 | ||||
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java | 4 |
2 files changed, 2 insertions, 10 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index 8e999da6b3..5bac342b0a 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -554,13 +554,7 @@ public abstract class LocalDiskRepositoryTestCase { try { write(f, body); return f; - } catch (Error e) { - f.delete(); - throw e; - } catch (RuntimeException e) { - f.delete(); - throw e; - } catch (IOException e) { + } catch (Error | RuntimeException | IOException e) { f.delete(); throw e; } diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java index 95fe18b83c..48d016c064 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java @@ -486,9 +486,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { git.branchCreate().setName(branch).setStartPoint(commit).call(); return commit; - } catch (IOException e) { - throw new RuntimeException(e); - } catch (GitAPIException e) { + } catch (IOException | GitAPIException e) { throw new RuntimeException(e); } } |