Skip to content

Commit fb11f94

Browse files
committed
exitCode and pid should be long, fixes #1259
1 parent 655ae86 commit fb11f94

File tree

4 files changed

+96
-9
lines changed

4 files changed

+96
-9
lines changed

docker-java-api/src/main/java/com/github/dockerjava/api/command/HealthStateLog.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class HealthStateLog {
1313
private String end;
1414

1515
@JsonProperty("ExitCode")
16-
private Integer exitCode;
16+
private Long exitCode;
1717

1818
@JsonProperty("Output")
1919
private String output;
@@ -26,7 +26,16 @@ public String getEnd() {
2626
return end;
2727
}
2828

29+
/**
30+
*
31+
* @deprecated use {@link #getExitCodeLong()}
32+
*/
33+
@Deprecated
2934
public Integer getExitCode() {
35+
return exitCode != null ? exitCode.intValue() : null;
36+
}
37+
38+
public Long getExitCodeLong() {
3039
return exitCode;
3140
}
3241

docker-java-api/src/main/java/com/github/dockerjava/api/command/InspectContainerResponse.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,14 @@ public class ContainerState {
308308
*/
309309
@CheckForNull
310310
@JsonProperty("Pid")
311-
private Integer pid;
311+
private Long pid;
312312

313313
/**
314314
* @since < {@link RemoteApiVersion#VERSION_1_16}
315315
*/
316316
@CheckForNull
317317
@JsonProperty("ExitCode")
318-
private Integer exitCode;
318+
private Long exitCode;
319319

320320
/**
321321
* @since {@link RemoteApiVersion#VERSION_1_17}
@@ -395,17 +395,39 @@ public Boolean getDead() {
395395

396396
/**
397397
* See {@link #pid}
398+
*
399+
* @deprecated use {@link #getPidLong()}
398400
*/
401+
@Deprecated
399402
@CheckForNull
400403
public Integer getPid() {
404+
return pid != null ? pid.intValue() : null;
405+
}
406+
407+
/**
408+
* See {@link #pid}
409+
*/
410+
@CheckForNull
411+
public Long getPidLong() {
401412
return pid;
402413
}
403414

404415
/**
405416
* See {@link #exitCode}
417+
*
418+
* @deprecated use {@link #getExitCodeLong()}
406419
*/
420+
@Deprecated
407421
@CheckForNull
408422
public Integer getExitCode() {
423+
return exitCode != null ? exitCode.intValue() : null;
424+
}
425+
426+
/**
427+
* See {@link #exitCode}
428+
*/
429+
@CheckForNull
430+
public Long getExitCodeLong() {
409431
return exitCode;
410432
}
411433

docker-java-api/src/main/java/com/github/dockerjava/api/command/InspectExecResponse.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class InspectExecResponse {
3434
private Boolean canRemove;
3535

3636
@JsonProperty("ExitCode")
37-
private Integer exitCode;
37+
private Long exitCode;
3838

3939
@JsonProperty("ProcessConfig")
4040
private ProcessConfig processConfig;
@@ -62,7 +62,7 @@ public class InspectExecResponse {
6262
* @since {@link RemoteApiVersion#VERSION_1_25}
6363
*/
6464
@JsonProperty("Pid")
65-
private Integer pid;
65+
private Long pid;
6666

6767
public String getId() {
6868
return id;
@@ -84,7 +84,15 @@ public Boolean isRunning() {
8484
return running;
8585
}
8686

87+
/**
88+
* @deprecated use {@link #getExitCodeLong()}
89+
*/
90+
@Deprecated
8791
public Integer getExitCode() {
92+
return exitCode != null ? exitCode.intValue() : null;
93+
}
94+
95+
public Long getExitCodeLong() {
8896
return exitCode;
8997
}
9098

@@ -126,9 +134,19 @@ public String getDetachKeys() {
126134

127135
/**
128136
* @see #pid
137+
* @deprecated use {@link #getPidLong()}
129138
*/
130139
@CheckForNull
140+
@Deprecated
131141
public Integer getPid() {
142+
return pid != null ? pid.intValue() : null;
143+
}
144+
145+
/**
146+
* @see #pid
147+
*/
148+
@CheckForNull
149+
public Long getPidLong() {
132150
return pid;
133151
}
134152

docker-java-api/src/main/java/com/github/dockerjava/api/model/TaskStatusContainerStatus.java

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,37 @@ public class TaskStatusContainerStatus implements Serializable {
2020
private String containerID = null;
2121

2222
@JsonProperty("PID")
23-
private Integer pid = null;
23+
private Long pid = null;
2424

2525
@JsonProperty("ExitCode")
26-
private Integer exitCode = null;
26+
private Long exitCode = null;
2727

2828
public String getContainerID() {
2929
return containerID;
3030
}
3131

32+
/**
33+
*
34+
* @deprecated use {@link #getPidLong()}
35+
*/
36+
@Deprecated
3237
public Integer getPid() {
38+
return pid != null ? pid.intValue() : null;
39+
}
40+
41+
public Long getPidLong() {
3342
return pid;
3443
}
3544

45+
/**
46+
* @deprecated use {@link #getExitCodeLong()}
47+
*/
48+
@Deprecated
3649
public Integer getExitCode() {
50+
return exitCode != null ? exitCode.intValue() : null;
51+
}
52+
53+
public Long getExitCodeLong() {
3754
return exitCode;
3855
}
3956

@@ -42,15 +59,36 @@ public TaskStatusContainerStatus withContainerID(String containerID) {
4259
return this;
4360
}
4461

45-
public TaskStatusContainerStatus withPid(Integer pid) {
62+
public TaskStatusContainerStatus withPid(Long pid) {
4663
this.pid = pid;
4764
return this;
4865
}
4966

50-
public TaskStatusContainerStatus withExitCode(Integer exitCode) {
67+
/**
68+
*
69+
* @deprecated use {@link #withPid(Long)}
70+
*/
71+
@Deprecated
72+
public TaskStatusContainerStatus withPid(Integer pid) {
73+
this.pid = pid != null ? pid.longValue() : null;
74+
return this;
75+
}
76+
77+
public TaskStatusContainerStatus withExitCode(Long exitCode) {
5178
this.exitCode = exitCode;
5279
return this;
5380
}
81+
82+
/**
83+
*
84+
* @deprecated use {@link #withExitCode(Long)}
85+
*/
86+
@Deprecated
87+
public TaskStatusContainerStatus withExitCode(Integer exitCode) {
88+
this.exitCode = exitCode != null ? exitCode.longValue() : null;
89+
return this;
90+
}
91+
5492
@Override
5593
public String toString() {
5694
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();

0 commit comments

Comments
 (0)