Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-08-14 14:20:14 +0000
committerThomas Wolf2018-08-25 11:15:26 +0000
commit8c8e7917d5c00c485cc54e86ba8e4777c2283589 (patch)
tree038c68092c240071c0fd09992b75c19ec302c94a
parent4377af5af4c7a463e858123c306093c250258711 (diff)
downloadegit-8c8e7917d5c00c485cc54e86ba8e4777c2283589.tar.gz
egit-8c8e7917d5c00c485cc54e86ba8e4777c2283589.tar.xz
egit-8c8e7917d5c00c485cc54e86ba8e4777c2283589.zip
Refactor: Remove unneeded null checks
RevWalk.parseCommit() was marked @NonNull in January 2018, and existing egit code has not been adapted in all cases. Change-Id: Ic5f35768852cf695ac7ee8fdf53a24d53f6cc10e Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java2
2 files changed, 4 insertions, 6 deletions
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 a3622942ad..4d417a979e 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
@@ -91,11 +91,9 @@ public class TaskReferenceFactory implements IAdapterFactory {
// try to get repository url and commit message
try (RevWalk revWalk = new RevWalk(r)) {
RevCommit revCommit = revWalk.parseCommit(commit);
- if (revCommit != null) {
- repoUrl = getRepoUrl(r);
- message = revCommit.getFullMessage();
- timestamp = (long)revCommit.getCommitTime() * 1000;
- }
+ repoUrl = getRepoUrl(r);
+ message = revCommit.getFullMessage();
+ timestamp = (long) revCommit.getCommitTime() * 1000;
} catch (IOException e) {
continue;
} catch (RuntimeException e) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
index 56cdd065b5..5efc881404 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
@@ -610,7 +610,7 @@ public class CompareUtils {
destCommit = getFileRevisionTypedElement(gitPath, commit,
repository);
- if (base != null && commit != null) {
+ if (base != null) {
final ObjectId headCommitId = repository
.resolve(Constants.HEAD);
commonAncestor = getFileRevisionTypedElementForCommonAncestor(

Back to the top