Skip to content

Commit 09ed795

Browse files
authored
Merge pull request #811 from gitlab4j/issue-810
Fix #810 : Change all model Ids to Long
2 parents 594bc6c + f237167 commit 09ed795

File tree

145 files changed

+1825
-1808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+1825
-1808
lines changed

src/main/java/org/gitlab4j/api/AbstractApi.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public Object getProjectIdOrPath(Object obj) throws GitLabApiException {
4646
return (urlEncode(((String) obj).trim()));
4747
} else if (obj instanceof Project) {
4848

49-
Integer id = ((Project) obj).getId();
50-
if (id != null && id.intValue() > 0) {
49+
Long id = ((Project) obj).getId();
50+
if (id != null && id.longValue() > 0) {
5151
return (id);
5252
}
5353

@@ -81,8 +81,8 @@ public Object getGroupIdOrPath(Object obj) throws GitLabApiException {
8181
return (urlEncode(((String) obj).trim()));
8282
} else if (obj instanceof Group) {
8383

84-
Integer id = ((Group) obj).getId();
85-
if (id != null && id.intValue() > 0) {
84+
Long id = ((Group) obj).getId();
85+
if (id != null && id.longValue() > 0) {
8686
return (id);
8787
}
8888

@@ -116,8 +116,8 @@ public Object getUserIdOrUsername(Object obj) throws GitLabApiException {
116116
return (urlEncode(((String) obj).trim()));
117117
} else if (obj instanceof User) {
118118

119-
Integer id = ((User) obj).getId();
120-
if (id != null && id.intValue() > 0) {
119+
Long id = ((User) obj).getId();
120+
if (id != null && id.longValue() > 0) {
121121
return (id);
122122
}
123123

@@ -151,8 +151,8 @@ public Object getLabelIdOrName(Object obj) throws GitLabApiException {
151151
return (urlEncode(((String) obj).trim()));
152152
} else if (obj instanceof Label) {
153153

154-
Integer id = ((Label) obj).getId();
155-
if (id != null && id.intValue() > 0) {
154+
Long id = ((Label) obj).getId();
155+
if (id != null && id.longValue() > 0) {
156156
return (id);
157157
}
158158

src/main/java/org/gitlab4j/api/ApplicationSettingsApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public ApplicationSettings getApplicationSettings() throws GitLabApiException {
3737
}
3838

3939
/**
40-
* Update the application settings of the GitLab instance with the settings in the
40+
* Update the application settings of the GitLab instance with the settings in the
4141
* provided ApplicationSettings instance.
4242
*
4343
* <pre><code>GitLab Endpoint: PUT /api/v4/application/settings</code></pre>
@@ -117,7 +117,7 @@ public static final ApplicationSettings parseApplicationSettings(JsonNode root)
117117
String fieldName = fieldNames.next();
118118
switch (fieldName) {
119119
case "id":
120-
appSettings.setId(root.path(fieldName).asInt());
120+
appSettings.setId(root.path(fieldName).asLong());
121121
break;
122122

123123
case "created_at":

src/main/java/org/gitlab4j/api/ApplicationsApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public Application createApplication(String name, String redirectUri, List<Appli
126126
* @param applicationId the ID of the OUAUTH Application to delete
127127
* @throws GitLabApiException if any exception occurs
128128
*/
129-
public void deleteApplication(Integer applicationId) throws GitLabApiException {
129+
public void deleteApplication(Long applicationId) throws GitLabApiException {
130130
delete(Response.Status.NO_CONTENT, null, "applications", applicationId);
131131
}
132132
}

src/main/java/org/gitlab4j/api/AuditEventApi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public AuditEventApi(GitLabApi gitLabApi) {
3232
* @return a List of group Audit events
3333
* @throws GitLabApiException if any exception occurs
3434
*/
35-
public List<AuditEvent> getAuditEvents(Date created_after, Date created_before, String entityType, Integer entityId) throws GitLabApiException {
35+
public List<AuditEvent> getAuditEvents(Date created_after, Date created_before, String entityType, Long entityId) throws GitLabApiException {
3636
return (getAuditEvents(created_after, created_before, entityType, entityId, getDefaultPerPage()).all());
3737
}
3838

@@ -49,7 +49,7 @@ public List<AuditEvent> getAuditEvents(Date created_after, Date created_before,
4949
* @return a Pager of group Audit events
5050
* @throws GitLabApiException if any exception occurs
5151
*/
52-
public Pager<AuditEvent> getAuditEvents(Date created_after, Date created_before, String entityType, Integer entityId, int itemsPerPage) throws GitLabApiException {
52+
public Pager<AuditEvent> getAuditEvents(Date created_after, Date created_before, String entityType, Long entityId, int itemsPerPage) throws GitLabApiException {
5353
Form form = new GitLabApiForm()
5454
.withParam("created_before", ISO8601.toString(created_before, false))
5555
.withParam("created_after", ISO8601.toString(created_after, false))
@@ -70,7 +70,7 @@ public Pager<AuditEvent> getAuditEvents(Date created_after, Date created_before,
7070
* @return a Stream of group Audit events
7171
* @throws GitLabApiException if any exception occurs
7272
*/
73-
public Stream<AuditEvent> getAuditEventsStream(Date created_after, Date created_before, String entityType, Integer entityId) throws GitLabApiException {
73+
public Stream<AuditEvent> getAuditEventsStream(Date created_after, Date created_before, String entityType, Long entityId) throws GitLabApiException {
7474
return (getAuditEvents(created_after, created_before, entityType, entityId, getDefaultPerPage()).stream());
7575
}
7676

@@ -83,7 +83,7 @@ public Stream<AuditEvent> getAuditEventsStream(Date created_after, Date created_
8383
* @return the group Audit event
8484
* @throws GitLabApiException if any exception occurs
8585
*/
86-
public AuditEvent getAuditEvent(Integer auditEventId) throws GitLabApiException {
86+
public AuditEvent getAuditEvent(Long auditEventId) throws GitLabApiException {
8787
Response response = get(Response.Status.OK, null, "audit_events", auditEventId);
8888
return (response.readEntity(AuditEvent.class));
8989
}

0 commit comments

Comments
 (0)