extend id from int to long

This commit is contained in:
Arne Burmeister
2017-10-23 17:05:02 +02:00
parent b443e866f9
commit 7735edeae8
5 changed files with 10 additions and 10 deletions

View File

@@ -5,9 +5,9 @@ import java.io.IOException;
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);

View File

@@ -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;
@@ -84,13 +84,13 @@ public abstract class GHObject {
/**
* 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);
}

View File

@@ -95,7 +95,7 @@ public class GHRepository extends GHObject {
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)) {
@@ -140,7 +140,7 @@ public class GHRepository extends GHObject {
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);
}

View File

@@ -793,7 +793,7 @@ public class GitHub {
* 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 youve seen. See {@link GHRepository#getId()}
* The numeric ID of the last Repository that youve 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) {

View File

@@ -784,7 +784,7 @@ public class AppTest extends AbstractGitHubApiTestBase {
GHRepository r = itr.next();
System.out.println(r.getFullName());
assertNotNull(r.getUrl());
assertNotEquals(0,r.getId());
assertNotEquals(0L,r.getId());
}
}