Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2016-05-23 20:56:14 +0000
committerMatthias Sohn2016-05-31 06:42:35 +0000
commite5f719a2df244c80412c66da3f3d27b84001fccb (patch)
tree8ce74be98d98c3637e733243793d8bb672c87149
parent67c83db9698a091be9b9e643f424af75eb3b2a2c (diff)
downloadegit-e5f719a2df244c80412c66da3f3d27b84001fccb.tar.gz
egit-e5f719a2df244c80412c66da3f3d27b84001fccb.tar.xz
egit-e5f719a2df244c80412c66da3f3d27b84001fccb.zip
Fix NPE in BranchOperationUI.show()
Also change visibility of this internal method to private since it shouldn't be used from outside. Bug: 494351 Change-Id: I983929383b679a1f425ef65ceb623ef8ffbe28b2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
index 81f7040712..f8e58baddc 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
@@ -35,6 +35,7 @@ import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.internal.CoreText;
import org.eclipse.egit.core.internal.job.RuleUtil;
import org.eclipse.egit.core.internal.util.ProjectUtil;
+import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.api.CheckoutCommand;
import org.eclipse.jgit.api.CheckoutResult;
import org.eclipse.jgit.api.CheckoutResult.Status;
@@ -64,7 +65,7 @@ public class BranchOperation extends BaseOperation {
private final String target;
- private CheckoutResult result;
+ private @NonNull CheckoutResult result = CheckoutResult.NOT_TRIED_RESULT;
private boolean delete;
@@ -179,6 +180,7 @@ public class BranchOperation extends BaseOperation {
/**
* @return the result of the operation
*/
+ @NonNull
public CheckoutResult getResult() {
return result;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
index b4563f9657..8b6491d872 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
@@ -62,6 +62,7 @@ import org.eclipse.jface.operation.ModalContext;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.api.CheckoutResult;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Ref;
@@ -473,7 +474,7 @@ public class BranchOperationUI {
* @param result
* the result to show
*/
- public void show(final CheckoutResult result) {
+ private void show(final @NonNull CheckoutResult result) {
if (result.getStatus() == CheckoutResult.Status.CONFLICTS) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override

Back to the top