Skip to content

Commit eb34482

Browse files
tunanPavlikPolivka
authored andcommitted
remove lombok, use RuntimeException wrap VcsException
1 parent 4f2148f commit eb34482

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
plugins {
22
id "org.jetbrains.intellij" version "0.2.13"
3-
id 'io.franzbecker.gradle-lombok' version '1.14'
43
}
54

65
intellij {

src/main/java/com/ppolivka/gitlabprojects/merge/GitLabDiffViewWorker.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import git4idea.update.GitFetchResult;
1919
import git4idea.update.GitFetcher;
2020
import git4idea.util.GitCommitCompareInfo;
21-
import lombok.SneakyThrows;
2221
import org.jetbrains.annotations.NotNull;
2322
import org.jetbrains.annotations.Nullable;
2423
import org.jetbrains.ide.PooledThreadExecutor;
@@ -85,9 +84,9 @@ public DiffInfo getDiffInfo(@NotNull final BranchInfo from, @NotNull final Branc
8584
} catch (InterruptedException e) {
8685
throw new IOException(e);
8786
} catch (ExecutionException e) {
88-
Throwable ex = e.getCause();
89-
if (ex instanceof VcsException) {
90-
throw new IOException(ex);
87+
Throwable wrapEx = e.getCause();
88+
if (wrapEx.getCause() instanceof VcsException) {
89+
throw new IOException(wrapEx.getCause());
9190
}
9291
return null;
9392
}
@@ -99,7 +98,13 @@ public CompletableFuture<DiffInfo> launchLoadDiffInfo(@NotNull final BranchInfo
9998
}
10099

101100
CompletableFuture<Boolean> fetchFuture = launchFetchRemote(branch);
102-
return fetchFuture.thenApply(t -> doLoadDiffInfo(from, branch));
101+
return fetchFuture.thenApply(t -> {
102+
try {
103+
return doLoadDiffInfo(from, branch);
104+
} catch (VcsException e) {
105+
throw new RuntimeException(e);
106+
}
107+
});
103108
}
104109

105110
private CompletableFuture<Boolean> launchFetchRemote(@NotNull final BranchInfo branch) {
@@ -125,8 +130,7 @@ private boolean doFetchRemote(@NotNull BranchInfo branch) {
125130
}
126131

127132
@NotNull
128-
@SneakyThrows(VcsException.class)
129-
private DiffInfo doLoadDiffInfo(@NotNull final BranchInfo from, @NotNull final BranchInfo to) {
133+
private DiffInfo doLoadDiffInfo(@NotNull final BranchInfo from, @NotNull final BranchInfo to) throws VcsException {
130134
String currentBranch = from.getFullName();
131135
String targetBranch = to.getFullRemoteName();
132136

0 commit comments

Comments
 (0)