Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2016-03-19 23:36:55 +0000
committerMatthias Sohn2016-03-22 23:16:19 +0000
commita9973d46ed85a1e7956e9ceef4fad93aa49dfa90 (patch)
treebab6111046d0ef745b13c9661f74c7d540d0f8c3
parent5a532855823b2631e61e59b447fe559c4118f70a (diff)
downloadegit-a9973d46ed85a1e7956e9ceef4fad93aa49dfa90.tar.gz
egit-a9973d46ed85a1e7956e9ceef4fad93aa49dfa90.tar.xz
egit-a9973d46ed85a1e7956e9ceef4fad93aa49dfa90.zip
Fix Activator.error() calls that should have been Activator.logError()
error() just creates an IStatus. Replaced by logError() in all places where the returned IStatus was ignored. It's an easy mistake to make, especially since the UI Activator also has operations logError() and error(), but there both _do_ log. CommitMessageComponent should use the UI Activator, not the core one. Change-Id: I0a2a0d3be6454a757e2a17c10774deac52e96b89 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java6
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFile.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java9
8 files changed, 14 insertions, 13 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
index 8cb55714c8..32a85b02d4 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
@@ -137,7 +137,7 @@ public final class GitProjectSetCapability extends ProjectSetCapability {
return asReference(gitURI.getRepository().toString(),
gitURI.getTag(), gitURI.getPath().toString());
} catch (IllegalArgumentException e) {
- Activator.error(e.getMessage(), e);
+ Activator.logError(e.getMessage(), e);
// we must not fail but return null on invalid or unknown URI's.
return null;
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java
index a61bfe697c..cddf542214 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java
@@ -340,7 +340,7 @@ public class IndexDiffCacheEntry {
refreshFiles(paths);
} catch (IOException ex) {
- Activator.error(MessageFormat.format(
+ Activator.logError(MessageFormat.format(
CoreText.IndexDiffCacheEntry_errorCalculatingIndexDelta,
repository), ex);
scheduleReloadJob("Exception while calculating index delta, doing full reload instead"); //$NON-NLS-1$
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java
index f3bdd82658..378b2634b4 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java
@@ -319,9 +319,9 @@ public class CommitOperation implements IEGitOperation {
authorIdent = rw.parseCommit(cherryPickHead)
.getAuthorIdent();
} catch (IOException e) {
- Activator
- .error(CoreText.CommitOperation_ParseCherryPickCommitFailed,
- e);
+ Activator.logError(
+ CoreText.CommitOperation_ParseCherryPickCommitFailed,
+ e);
throw new IllegalStateException(e);
}
} else {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java
index 91a47400e7..0aa5877739 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java
@@ -191,7 +191,7 @@ public class ConnectProviderOperation implements IEGitOperation {
}
}, IResource.NONE);
} catch (CoreException e) {
- Activator.error(e.getMessage(), e);
+ Activator.logError(e.getMessage(), e);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFile.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFile.java
index 1c8f7d8870..1fd3dd2cb5 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFile.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFile.java
@@ -40,7 +40,7 @@ class GitRemoteFile extends GitRemoteResource {
try {
setContents(content.getContents(), monitor);
} catch (CoreException e) {
- Activator.error("", e); //$NON-NLS-1$
+ Activator.logError("", e); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java
index ed4dcf90c4..d382ffe672 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java
@@ -86,7 +86,7 @@ public class StagedChangeCache {
return result;
} catch (IOException e) {
- Activator.error(e.getMessage(), e);
+ Activator.logError(e.getMessage(), e);
return new HashMap<String, Change>(0);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java
index a8113fa925..5bdf27edca 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java
@@ -58,7 +58,7 @@ public class WorkingTreeChangeCache {
return result;
} catch (IOException e) {
- Activator.error(e.getMessage(), e);
+ Activator.logError(e.getMessage(), e);
return new HashMap<String, GitCommitsModelCache.Change>(0);
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java
index 4b053ba112..4c7bd7f51b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java
@@ -33,9 +33,9 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.RevUtils;
import org.eclipse.egit.core.internal.gerrit.GerritUtil;
+import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.ICommitMessageProvider;
import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.UIUtils;
@@ -448,7 +448,7 @@ public class CommitMessageComponent {
// Check format of commit message. The soft-wrapped text in the SWT
// control must be converted to a hard-wrapped text, since this will be
// the resulting commit message.
- if (org.eclipse.egit.ui.Activator.getDefault().getPreferenceStore()
+ if (Activator.getDefault().getPreferenceStore()
.getBoolean(UIPreferences.COMMIT_DIALOG_WARN_ABOUT_MESSAGE_SECOND_LINE)) {
String message = commitText.getCommitMessage();
String formatIssue = formatIssuesInCommitMessage(message);
@@ -583,7 +583,7 @@ public class CommitMessageComponent {
if (repository != null)
createChangeId = GerritUtil.getCreateChangeId(repository
.getConfig());
- signedOff = org.eclipse.egit.ui.Activator.getDefault()
+ signedOff = Activator.getDefault()
.getPreferenceStore()
.getBoolean(UIPreferences.COMMIT_DIALOG_SIGNED_OFF_BY);
}
@@ -687,7 +687,8 @@ public class CommitMessageComponent {
.getMessage(resourcesArray);
}
} catch (CoreException coreException) {
- Activator.error(coreException.getLocalizedMessage(), coreException);
+ Activator.logError(coreException.getLocalizedMessage(),
+ coreException);
}
if (calculatedCommitMessage != null)
return calculatedCommitMessage;

Back to the top