Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini committed Feb 6, 2024
2 parents b0603d1 + d321fe5 commit f988d28
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/org/gitlab4j/api/AbstractApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public Object getProjectIdOrPath(Object obj) throws GitLabApiException {
throw (new RuntimeException("Cannot determine ID or path from null object"));
} else if (obj instanceof Long) {
return (obj);
} else if (obj instanceof Integer) {
//Compatibility with older version of gitlab4j-api:
return Long.valueOf(((Integer) obj).longValue());
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof Project) {
Expand Down Expand Up @@ -78,6 +81,9 @@ public Object getGroupIdOrPath(Object obj) throws GitLabApiException {
throw (new RuntimeException("Cannot determine ID or path from null object"));
} else if (obj instanceof Long) {
return (obj);
} else if (obj instanceof Integer) {
//Compatibility with older version of gitlab4j-api:
return Long.valueOf(((Integer) obj).longValue());
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof Group) {
Expand Down Expand Up @@ -113,6 +119,9 @@ public Object getUserIdOrUsername(Object obj) throws GitLabApiException {
throw (new RuntimeException("Cannot determine ID or username from null object"));
} else if (obj instanceof Long) {
return (obj);
} else if (obj instanceof Integer) {
//Compatibility with older version of gitlab4j-api:
return Long.valueOf(((Integer) obj).longValue());
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof User) {
Expand Down Expand Up @@ -148,6 +157,9 @@ public Object getLabelIdOrName(Object obj) throws GitLabApiException {
throw (new RuntimeException("Cannot determine ID or name from null object"));
} else if (obj instanceof Long) {
return (obj);
} else if (obj instanceof Integer) {
//Compatibility with older version of gitlab4j-api:
return Long.valueOf(((Integer) obj).longValue());
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof Label) {
Expand Down Expand Up @@ -176,6 +188,9 @@ public Object getNamespaceIdOrPath(Object obj) throws GitLabApiException {
throw (new RuntimeException("Cannot determine ID or path from null object"));
} else if (obj instanceof Long) {
return (obj);
} else if (obj instanceof Integer) {
//Compatibility with older version of gitlab4j-api:
return Long.valueOf(((Integer) obj).longValue());
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof Namespace) {
Expand Down

0 comments on commit f988d28

Please sign in to comment.