Skip to content

Commit

Permalink
extend id from int to long
Browse files Browse the repository at this point in the history
  • Loading branch information
Arne Burmeister committed Oct 23, 2017
1 parent b443e86 commit 7735ede
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
public class GHDeploymentStatusBuilder {
private final Requester builder;
private GHRepository repo;
private int deploymentId;
private long deploymentId;

public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeploymentState state) {
public GHDeploymentStatusBuilder(GHRepository repo, long deploymentId, GHDeploymentState state) {
this.repo = repo;
this.deploymentId = deploymentId;
this.builder = new Requester(repo.root);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/kohsuke/github/GHObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract class GHObject {
protected Map<String, List<String>> responseHeaderFields;

protected String url;
protected int id;
protected long id;
protected String created_at;
protected String updated_at;

Expand Down Expand Up @@ -84,13 +84,13 @@ public Date getUpdatedAt() throws IOException {
/**
* Unique ID number of this resource.
*/
@WithBridgeMethods(value=String.class, adapterMethod="intToString")
public int getId() {
@WithBridgeMethods(value=String.class, adapterMethod="longToString")
public long getId() {
return id;
}

@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", justification = "Bridge method of getId")
private Object intToString(int id, Class type) {
private Object longToString(long id, Class type) {
return String.valueOf(id);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public GHDeploymentBuilder createDeployment(String ref) {
return new GHDeploymentBuilder(this,ref);
}

public PagedIterable<GHDeploymentStatus> getDeploymentStatuses(final int id) {
public PagedIterable<GHDeploymentStatus> getDeploymentStatuses(final long id) {
return new PagedIterable<GHDeploymentStatus>() {
public PagedIterator<GHDeploymentStatus> _iterator(int pageSize) {
return new PagedIterator<GHDeploymentStatus>(root.retrieve().asIterator(getApiTailUrl("deployments")+"/"+id+"/statuses", GHDeploymentStatus[].class, pageSize)) {
Expand Down Expand Up @@ -140,7 +140,7 @@ private String getParam(String name, String value) {
return StringUtils.trimToNull(value)== null? null: name+"="+value;
}

public GHDeploymentStatusBuilder createDeployStatus(int deploymentId, GHDeploymentState ghDeploymentState) {
public GHDeploymentStatusBuilder createDeployStatus(long deploymentId, GHDeploymentState ghDeploymentState) {
return new GHDeploymentStatusBuilder(this,deploymentId,ghDeploymentState);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/github/GitHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ public PagedIterable<GHRepository> listAllPublicRepositories() {
* This provides a dump of every public repository, in the order that they were created.
*
* @param since
* The integer ID of the last Repository that you’ve seen. See {@link GHRepository#getId()}
* The numeric ID of the last Repository that you’ve seen. See {@link GHRepository#getId()}
* @see <a href="https://developer.github.com/v3/repos/#list-all-public-repositories">documentation</a>
*/
public PagedIterable<GHRepository> listAllPublicRepositories(final String since) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/kohsuke/github/AppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public void testListAllRepositories() throws Exception {
GHRepository r = itr.next();
System.out.println(r.getFullName());
assertNotNull(r.getUrl());
assertNotEquals(0,r.getId());
assertNotEquals(0L,r.getId());
}
}

Expand Down

0 comments on commit 7735ede

Please sign in to comment.