aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2024-04-29 01:54:01 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2024-04-29 15:20:42 +0200
commitcfe948ac7022510f47e22ee3c9d2f4ae3681b55c (patch)
treed44674b6028b4343f418b4f72dca0913776a2371 /org.eclipse.jgit.test/tst
parent8bc7f38489438251c1cf35eff3a2db1fd0bfa553 (diff)
downloadjgit-cfe948ac7022510f47e22ee3c9d2f4ae3681b55c.tar.gz
jgit-cfe948ac7022510f47e22ee3c9d2f4ae3681b55c.zip
[errorprone] Fix pattern CatchAndPrintStackTrace
See https://errorprone.info/bugpattern/CatchAndPrintStackTrace Change-Id: I7a6698293d1485f384c275bf7e4dcddc529af4a1
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/merge/MergeGitAttributeTest.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/merge/MergeGitAttributeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/merge/MergeGitAttributeTest.java
index 6b23de3320..009ca8a152 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/merge/MergeGitAttributeTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/merge/MergeGitAttributeTest.java
@@ -19,6 +19,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.util.function.Consumer;
@@ -97,19 +98,19 @@ public class MergeGitAttributeTest extends RepositoryTestCase {
try {
writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "D\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
}, g -> {
try {
writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "F\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
}, g -> {
try {
writeTrashFile("main.cat", "A\n" + "E\n" + "C\n" + "D\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
})) {
checkoutBranch(REFS_HEADS_LEFT);
@@ -139,19 +140,19 @@ public class MergeGitAttributeTest extends RepositoryTestCase {
writeTrashFile(".gitattributes", "*.cat -merge");
writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "D\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
}, g -> {
try {
writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "F\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
}, g -> {
try {
writeTrashFile("main.cat", "A\n" + "E\n" + "C\n" + "D\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
})) {
// Check that the merge attribute is unset
@@ -184,19 +185,19 @@ public class MergeGitAttributeTest extends RepositoryTestCase {
writeTrashFile(".gitattributes", "*.txt -merge");
writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "D\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
}, g -> {
try {
writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "F\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
}, g -> {
try {
writeTrashFile("main.cat", "A\n" + "E\n" + "C\n" + "D\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
})) {
// Check that the merge attribute is unset
@@ -228,19 +229,19 @@ public class MergeGitAttributeTest extends RepositoryTestCase {
writeTrashFile(".gitattributes", "*.cat merge=binary");
writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "D\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
}, g -> {
try {
writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "F\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
}, g -> {
try {
writeTrashFile("main.cat", "A\n" + "E\n" + "C\n" + "D\n");
} catch (IOException e) {
- e.printStackTrace();
+ throw new UncheckedIOException(e);
}
})) {
// Check that the merge attribute is set to binary