Restored binary compatibility

This commit is contained in:
Kohsuke Kawaguchi
2017-10-28 08:42:27 -07:00
parent 6415785220
commit b6063dd534
3 changed files with 30 additions and 3 deletions

View File

@@ -7,6 +7,14 @@ public class GHDeploymentStatusBuilder {
private GHRepository repo;
private long deploymentId;
/**
* @deprecated
* ID is long now.
*/
public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeploymentState state) {
this(repo,(long)deploymentId,state);
}
public GHDeploymentStatusBuilder(GHRepository repo, long deploymentId, GHDeploymentState state) {
this.repo = repo;
this.deploymentId = deploymentId;

View File

@@ -84,14 +84,17 @@ public abstract class GHObject {
/**
* Unique ID number of this resource.
*/
@WithBridgeMethods(value=String.class, adapterMethod="longToString")
@WithBridgeMethods(value={String.class,int.class}, adapterMethod="longToStringOrInt")
public long getId() {
return id;
}
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", justification = "Bridge method of getId")
private Object longToString(long id, Class type) {
return String.valueOf(id);
private Object longToStringOrInt(long id, Class type) {
if (type==String.class)
return String.valueOf(id);
else
return (int)id;
}
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", justification = "Bridge method of getHtmlUrl")

View File

@@ -95,6 +95,14 @@ public class GHRepository extends GHObject {
return new GHDeploymentBuilder(this,ref);
}
/**
* @deprecated
* Use {@link #getDeploymentStatuses(long)}
*/
public PagedIterable<GHDeploymentStatus> getDeploymentStatuses(final int id) {
return getDeploymentStatuses((long)id);
}
public PagedIterable<GHDeploymentStatus> getDeploymentStatuses(final long id) {
return new PagedIterable<GHDeploymentStatus>() {
public PagedIterator<GHDeploymentStatus> _iterator(int pageSize) {
@@ -140,6 +148,14 @@ public class GHRepository extends GHObject {
return StringUtils.trimToNull(value)== null? null: name+"="+value;
}
/**
* @deprecated
* Use {@link #createDeployStatus(long, GHDeploymentState)}
*/
public GHDeploymentStatusBuilder createDeployStatus(int deploymentId, GHDeploymentState ghDeploymentState) {
return createDeployStatus((long)deploymentId,ghDeploymentState);
}
public GHDeploymentStatusBuilder createDeployStatus(long deploymentId, GHDeploymentState ghDeploymentState) {
return new GHDeploymentStatusBuilder(this,deploymentId,ghDeploymentState);
}