Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2017-06-20 16:26:46 +0000
committerTomasz Zarna2017-06-20 20:44:15 +0000
commit34e030c0a1974fb966f207fabce8e1157268c188 (patch)
tree3317419475e0d3beda8809d3ca85742eace5631c
parentb036e15f646427cccd80058898e68cd3acbb96aa (diff)
downloadorg.eclipse.mylyn.reviews-34e030c0a1974fb966f207fabce8e1157268c188.tar.gz
org.eclipse.mylyn.reviews-34e030c0a1974fb966f207fabce8e1157268c188.tar.xz
org.eclipse.mylyn.reviews-34e030c0a1974fb966f207fabce8e1157268c188.zip
506866: use enum for different user types, not Strings
Change-Id: Id001f68a53222c09afce158e7db1c5ba7798365d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=506866
-rw-r--r--org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient29.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient29.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient29.java
index 315f2391e..293e89981 100644
--- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient29.java
+++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient29.java
@@ -71,6 +71,10 @@ public class GerritClient29 extends GerritClient {
final String MAY = "MAY"; //$NON-NLS-1$
+ private static enum UserType {
+ Author, Committer
+ }
+
protected GerritClient29(TaskRepository repository, Version version) {
super(repository, version);
}
@@ -482,12 +486,12 @@ public class GerritClient29 extends GerritClient {
private PatchSetInfo setAccountPatchSetInfo(PatchSetInfo patchSetInfo, IProgressMonitor monitor) {
if (patchSetInfo.getAuthor().getAccount() == null) {
- patchSetInfo.setAuthor(
- setUserIdentity(patchSetInfo.getAuthor().getName(), patchSetInfo.getAuthor(), "Author", monitor)); //$NON-NLS-1$
+ patchSetInfo.setAuthor(setUserIdentity(patchSetInfo.getAuthor().getName(), patchSetInfo.getAuthor(),
+ UserType.Author, monitor));
}
if (patchSetInfo.getCommitter().getAccount() == null) {
patchSetInfo.setCommitter(setUserIdentity(patchSetInfo.getCommitter().getName(),
- patchSetInfo.getCommitter(), "Committer", monitor)); //$NON-NLS-1$
+ patchSetInfo.getCommitter(), UserType.Committer, monitor));
}
return patchSetInfo;
}
@@ -505,7 +509,7 @@ public class GerritClient29 extends GerritClient {
return accountInfo;
}
- private UserIdentity setUserIdentity(String name, UserIdentity userIdentity, String user,
+ private UserIdentity setUserIdentity(String name, UserIdentity userIdentity, UserType user,
IProgressMonitor monitor) {
org.eclipse.mylyn.internal.gerrit.core.client.rest.AccountInfo accountInfo = null;
try {

Back to the top