aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2018-03-09 19:35:24 -0500
committerMatthias Sohn2018-03-16 19:55:55 -0400
commitcc2adf9a8576000b32da32c5319185116fc9f56d (patch)
tree5eafb83b78eddff31480dded1198a5ba5935cd1e
parent17e2b92ea4cdff9e53d27f404b37609f2f4093fa (diff)
downloadegit-github-cc2adf9a8576000b32da32c5319185116fc9f56d.zip
egit-github-cc2adf9a8576000b32da32c5319185116fc9f56d.tar.gz
egit-github-cc2adf9a8576000b32da32c5319185116fc9f56d.tar.xz
Remove deprecated Gist#setUser and #getUser methods
Change-Id: I4b5cc5f5dc1fe3d8a5753081f20e1ea27acdc3f8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java4
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistTest.java4
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Gist.java22
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java2
4 files changed, 7 insertions, 25 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java
index b88f31c..fe0c0d1 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java
@@ -389,9 +389,9 @@ public class GistServiceTest {
* @throws IOException
*/
@Test
- public void createGistNullUser() throws IOException {
+ public void createGistNullOwner() throws IOException {
Gist gist = new Gist();
- gist.setUser(null);
+ gist.setOwner(null);
gistService.createGist(gist);
verify(gitHubClient).post("/gists", gist, Gist.class);
}
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistTest.java
index e03248c..8b48bce 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistTest.java
@@ -46,7 +46,7 @@ public class GistTest {
assertNull(gist.getId());
assertNull(gist.getUpdatedAt());
assertNull(gist.getUrl());
- assertNull(gist.getUser());
+ assertNull(gist.getOwner());
assertNull(gist.getOwner());
assertFalse(gist.isPublic());
}
@@ -75,7 +75,7 @@ public class GistTest {
.getUpdatedAt());
assertEquals("url", gist.setUrl("url").getUrl());
User user = new User().setLogin("use");
- assertEquals(user, gist.setUser(user).getUser());
+ assertEquals(user, gist.setOwner(user).getOwner());
assertTrue(gist.setPublic(true).isPublic());
}
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Gist.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Gist.java
index bf26994..f8e3a58 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Gist.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Gist.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.egit.github.core;
-import com.google.gson.annotations.SerializedName;
-
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@@ -19,6 +17,8 @@ import java.util.Map;
import org.eclipse.egit.github.core.util.DateUtils;
+import com.google.gson.annotations.SerializedName;
+
/**
* GitHub gist model class.
*/
@@ -261,22 +261,4 @@ public class Gist implements Serializable {
this.owner = owner;
return this;
}
-
- /**
- * @return user
- */
- @Deprecated
- public User getUser() {
- return owner;
- }
-
- /**
- * @param user
- * @return this gist
- */
- @Deprecated
- public Gist setUser(User user) {
- this.owner = user;
- return this;
- }
}
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java
index de626e7..b73756d 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java
@@ -232,7 +232,7 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler {
if (credentials != null) {
client.setCredentials(credentials.getUserName(),
credentials.getPassword());
- gist.setUser(new User().setLogin(credentials.getUserName()));
+ gist.setOwner(new User().setLogin(credentials.getUserName()));
}
GistService service = new GistService(client);