Skip to content

Commit b6063dd

Browse files
committed
Restored binary compatibility
1 parent 6415785 commit b6063dd

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ public class GHDeploymentStatusBuilder {
77
private GHRepository repo;
88
private long deploymentId;
99

10+
/**
11+
* @deprecated
12+
* ID is long now.
13+
*/
14+
public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeploymentState state) {
15+
this(repo,(long)deploymentId,state);
16+
}
17+
1018
public GHDeploymentStatusBuilder(GHRepository repo, long deploymentId, GHDeploymentState state) {
1119
this.repo = repo;
1220
this.deploymentId = deploymentId;

src/main/java/org/kohsuke/github/GHObject.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,17 @@ public Date getUpdatedAt() throws IOException {
8484
/**
8585
* Unique ID number of this resource.
8686
*/
87-
@WithBridgeMethods(value=String.class, adapterMethod="longToString")
87+
@WithBridgeMethods(value={String.class,int.class}, adapterMethod="longToStringOrInt")
8888
public long getId() {
8989
return id;
9090
}
9191

9292
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", justification = "Bridge method of getId")
93-
private Object longToString(long id, Class type) {
94-
return String.valueOf(id);
93+
private Object longToStringOrInt(long id, Class type) {
94+
if (type==String.class)
95+
return String.valueOf(id);
96+
else
97+
return (int)id;
9598
}
9699

97100
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", justification = "Bridge method of getHtmlUrl")

src/main/java/org/kohsuke/github/GHRepository.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ public GHDeploymentBuilder createDeployment(String ref) {
9595
return new GHDeploymentBuilder(this,ref);
9696
}
9797

98+
/**
99+
* @deprecated
100+
* Use {@link #getDeploymentStatuses(long)}
101+
*/
102+
public PagedIterable<GHDeploymentStatus> getDeploymentStatuses(final int id) {
103+
return getDeploymentStatuses((long)id);
104+
}
105+
98106
public PagedIterable<GHDeploymentStatus> getDeploymentStatuses(final long id) {
99107
return new PagedIterable<GHDeploymentStatus>() {
100108
public PagedIterator<GHDeploymentStatus> _iterator(int pageSize) {
@@ -140,6 +148,14 @@ private String getParam(String name, String value) {
140148
return StringUtils.trimToNull(value)== null? null: name+"="+value;
141149
}
142150

151+
/**
152+
* @deprecated
153+
* Use {@link #createDeployStatus(long, GHDeploymentState)}
154+
*/
155+
public GHDeploymentStatusBuilder createDeployStatus(int deploymentId, GHDeploymentState ghDeploymentState) {
156+
return createDeployStatus((long)deploymentId,ghDeploymentState);
157+
}
158+
143159
public GHDeploymentStatusBuilder createDeployStatus(long deploymentId, GHDeploymentState ghDeploymentState) {
144160
return new GHDeploymentStatusBuilder(this,deploymentId,ghDeploymentState);
145161
}

0 commit comments

Comments
 (0)