Massaging the pull request.

- GHPerson really should be an abstract class
- static listPullRequests method does not fit the design of this
  library, although I'm very sympathetic as to why Luca wanted to do it.
  Nonetheless I'm removing this in favor of the lazy loading of the
  state to avoid unnecessary calls in the future.
This commit is contained in:
Kohsuke Kawaguchi
2013-11-02 18:13:40 -07:00
parent 19ec3321ae
commit ebf953cbc4
2 changed files with 2 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ import java.util.TreeMap;
*
* @author Kohsuke Kawaguchi
*/
public class GHPerson {
public abstract class GHPerson {
/*package almost final*/ GitHub root;
// core data fields that exist even for "small" user data (such as the user info in pull request)
@@ -235,5 +235,4 @@ public class GHPerson {
populate();
return followers;
}
}

View File

@@ -57,7 +57,7 @@ public class GHRepository {
private String description, homepage, name;
private String url; // this is the API url
private String html_url; // this is the UI
private GHPerson owner; // not fully populated. beware.
private GHUser owner; // not fully populated. beware.
private boolean has_issues, has_wiki, fork, _private, has_downloads;
private int watchers,forks,open_issues,size;
private String created_at, pushed_at;
@@ -378,17 +378,6 @@ public class GHRepository {
};
}
/**
* Retrieves all the pull requests of a particular state by knowing organisation and repository
*/
public static PagedIterable<GHPullRequest> listPullRequests(final GitHub root, final GHPerson owner, final String repositoryName, final GHIssueState state) {
GHRepository repo = new GHRepository();
repo.root = root;
repo.name = repositoryName;
repo.owner = owner;
return repo.listPullRequests(state);
}
/**
* Retrieves the currently configured hooks.
*/