Skip to content

Commit 4c69d02

Browse files
committed
Fix #810 : Change all model Ids to Long
1 parent 231d506 commit 4c69d02

File tree

145 files changed

+1814
-1797
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

+1814
-1797
lines changed

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

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

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

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

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

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

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

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

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

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
}

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public AwardEmojiApi(GitLabApi gitLabApi) {
2929
* @return a list of AwardEmoji for the specified issue
3030
* @throws GitLabApiException if any exception occurs
3131
*/
32-
public List<AwardEmoji> getIssueAwardEmojis(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
32+
public List<AwardEmoji> getIssueAwardEmojis(Object projectIdOrPath, Long issueIid) throws GitLabApiException {
3333
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
3434
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "award_emoji");
3535
return response.readEntity(new GenericType<List<AwardEmoji>>() {});
@@ -45,7 +45,7 @@ public List<AwardEmoji> getIssueAwardEmojis(Object projectIdOrPath, Integer issu
4545
* @return a list of AwardEmoji for the specified merge request
4646
* @throws GitLabApiException if any exception occurs
4747
*/
48-
public List<AwardEmoji> getMergeRequestAwardEmojis(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException {
48+
public List<AwardEmoji> getMergeRequestAwardEmojis(Object projectIdOrPath, Long mergeRequestIid) throws GitLabApiException {
4949
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
5050
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "award_emoji");
5151
return response.readEntity(new GenericType<List<AwardEmoji>>() {});
@@ -61,7 +61,7 @@ public List<AwardEmoji> getMergeRequestAwardEmojis(Object projectIdOrPath, Integ
6161
* @return a list of AwardEmoji for the specified snippet
6262
* @throws GitLabApiException if any exception occurs
6363
*/
64-
public List<AwardEmoji> getSnippetAwardEmojis(Object projectIdOrPath, Integer snippetId) throws GitLabApiException {
64+
public List<AwardEmoji> getSnippetAwardEmojis(Object projectIdOrPath, Long snippetId) throws GitLabApiException {
6565
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
6666
"projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "award_emoji");
6767
return response.readEntity(new GenericType<List<AwardEmoji>>() {});
@@ -78,7 +78,7 @@ public List<AwardEmoji> getSnippetAwardEmojis(Object projectIdOrPath, Integer sn
7878
* @return a list of AwardEmoji for the specified note
7979
* @throws GitLabApiException if any exception occurs
8080
*/
81-
public List<AwardEmoji> getNoteAwardEmojis(Object projectIdOrPath, Integer issueIid, Integer noteId) throws GitLabApiException {
81+
public List<AwardEmoji> getNoteAwardEmojis(Object projectIdOrPath, Long issueIid, Long noteId) throws GitLabApiException {
8282
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
8383
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji");
8484
return response.readEntity(new GenericType<List<AwardEmoji>>() {});
@@ -95,7 +95,7 @@ public List<AwardEmoji> getNoteAwardEmojis(Object projectIdOrPath, Integer issue
9595
* @return an AwardEmoji instance for the specified award emoji
9696
* @throws GitLabApiException if any exception occurs
9797
*/
98-
public AwardEmoji getIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer awardId) throws GitLabApiException {
98+
public AwardEmoji getIssueAwardEmoji(Object projectIdOrPath, Long issueIid, Long awardId) throws GitLabApiException {
9999
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
100100
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "award_emoji", awardId);
101101
return (response.readEntity(AwardEmoji.class));
@@ -112,7 +112,7 @@ public AwardEmoji getIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, I
112112
* @return an AwardEmoji instance for the specified award emoji
113113
* @throws GitLabApiException if any exception occurs
114114
*/
115-
public AwardEmoji getMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer awardId) throws GitLabApiException {
115+
public AwardEmoji getMergeRequestAwardEmoji(Object projectIdOrPath, Long mergeRequestIid, Long awardId) throws GitLabApiException {
116116
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
117117
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "award_emoji", awardId);
118118
return (response.readEntity(AwardEmoji.class));
@@ -129,7 +129,7 @@ public AwardEmoji getMergeRequestAwardEmoji(Object projectIdOrPath, Integer merg
129129
* @return an AwardEmoji instance for the specified award emoji
130130
* @throws GitLabApiException if any exception occurs
131131
*/
132-
public AwardEmoji getSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, Integer awardId) throws GitLabApiException {
132+
public AwardEmoji getSnippetAwardEmoji(Object projectIdOrPath, Long snippetId, Long awardId) throws GitLabApiException {
133133
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
134134
"projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "award_emoji", awardId);
135135
return (response.readEntity(AwardEmoji.class));
@@ -147,7 +147,7 @@ public AwardEmoji getSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId
147147
* @return an AwardEmoji instance for the specified award emoji
148148
* @throws GitLabApiException if any exception occurs
149149
*/
150-
public AwardEmoji getNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
150+
public AwardEmoji getNoteAwardEmoji(Object projectIdOrPath, Long issueIid, Long noteId, Long awardId) throws GitLabApiException {
151151
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
152152
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji", awardId);
153153
return (response.readEntity(AwardEmoji.class));
@@ -164,7 +164,7 @@ public AwardEmoji getNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, In
164164
* @return an AwardEmoji instance for the added award emoji
165165
* @throws GitLabApiException if any exception occurs
166166
*/
167-
public AwardEmoji addIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, String name) throws GitLabApiException {
167+
public AwardEmoji addIssueAwardEmoji(Object projectIdOrPath, Long issueIid, String name) throws GitLabApiException {
168168
GitLabApiForm form = new GitLabApiForm().withParam("name", name, true);
169169
Response response = post(Response.Status.CREATED, form.asMap(),
170170
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "award_emoji");
@@ -182,7 +182,7 @@ public AwardEmoji addIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, S
182182
* @return an AwardEmoji instance for the added award emoji
183183
* @throws GitLabApiException if any exception occurs
184184
*/
185-
public AwardEmoji addMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, String name) throws GitLabApiException {
185+
public AwardEmoji addMergeRequestAwardEmoji(Object projectIdOrPath, Long mergeRequestIid, String name) throws GitLabApiException {
186186
GitLabApiForm form = new GitLabApiForm().withParam("name", name, true);
187187
Response response = post(Response.Status.CREATED, form.asMap(),
188188
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "award_emoji");
@@ -200,7 +200,7 @@ public AwardEmoji addMergeRequestAwardEmoji(Object projectIdOrPath, Integer merg
200200
* @return an AwardEmoji instance for the added award emoji
201201
* @throws GitLabApiException if any exception occurs
202202
*/
203-
public AwardEmoji addSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, String name) throws GitLabApiException {
203+
public AwardEmoji addSnippetAwardEmoji(Object projectIdOrPath, Long snippetId, String name) throws GitLabApiException {
204204
GitLabApiForm form = new GitLabApiForm().withParam("name", name, true);
205205
Response response = post(Response.Status.CREATED, form.asMap(),
206206
"projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "award_emoji");
@@ -219,7 +219,7 @@ public AwardEmoji addSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId
219219
* @return an AwardEmoji instance for the added award emoji
220220
* @throws GitLabApiException if any exception occurs
221221
*/
222-
public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, String name) throws GitLabApiException {
222+
public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Long issueIid, Long noteId, String name) throws GitLabApiException {
223223
GitLabApiForm form = new GitLabApiForm().withParam("name", name, true);
224224
Response response = post(Response.Status.CREATED, form.asMap(),
225225
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji");
@@ -236,7 +236,7 @@ public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, In
236236
* @param awardId the ID of the award emoji to delete
237237
* @throws GitLabApiException if any exception occurs
238238
*/
239-
public void deleteIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer awardId) throws GitLabApiException {
239+
public void deleteIssueAwardEmoji(Object projectIdOrPath, Long issueIid, Long awardId) throws GitLabApiException {
240240
delete(Response.Status.NO_CONTENT, null,
241241
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "award_emoji", awardId);
242242
}
@@ -251,7 +251,7 @@ public void deleteIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, Inte
251251
* @param awardId the ID of the award emoji to delete
252252
* @throws GitLabApiException if any exception occurs
253253
*/
254-
public void deleteMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer awardId) throws GitLabApiException {
254+
public void deleteMergeRequestAwardEmoji(Object projectIdOrPath, Long mergeRequestIid, Long awardId) throws GitLabApiException {
255255
delete(Response.Status.NO_CONTENT, null,
256256
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "award_emoji", awardId);
257257
}
@@ -266,7 +266,7 @@ public void deleteMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRe
266266
* @param awardId the ID of the award emoji to delete
267267
* @throws GitLabApiException if any exception occurs
268268
*/
269-
public void deleteSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, Integer awardId) throws GitLabApiException {
269+
public void deleteSnippetAwardEmoji(Object projectIdOrPath, Long snippetId, Long awardId) throws GitLabApiException {
270270
delete(Response.Status.NO_CONTENT, null,
271271
"projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "award_emoji", awardId);
272272
}
@@ -282,7 +282,7 @@ public void deleteSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, I
282282
* @param awardId the ID of the award emoji to delete
283283
* @throws GitLabApiException if any exception occurs
284284
*/
285-
public void deleteNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
285+
public void deleteNoteAwardEmoji(Object projectIdOrPath, Long issueIid, Long noteId, Long awardId) throws GitLabApiException {
286286
delete(Response.Status.NO_CONTENT, null,
287287
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji", awardId);
288288
}

0 commit comments

Comments
 (0)