@@ -43,6 +43,9 @@ public Object getProjectIdOrPath(Object obj) throws GitLabApiException {
43
43
throw (new RuntimeException ("Cannot determine ID or path from null object" ));
44
44
} else if (obj instanceof Long ) {
45
45
return (obj );
46
+ } else if (obj instanceof Integer ) {
47
+ //Compatibility with older version of gitlab4j-api:
48
+ return Long .valueOf (((Integer ) obj ).longValue ());
46
49
} else if (obj instanceof String ) {
47
50
return (urlEncode (((String ) obj ).trim ()));
48
51
} else if (obj instanceof Project ) {
@@ -78,6 +81,9 @@ public Object getGroupIdOrPath(Object obj) throws GitLabApiException {
78
81
throw (new RuntimeException ("Cannot determine ID or path from null object" ));
79
82
} else if (obj instanceof Long ) {
80
83
return (obj );
84
+ } else if (obj instanceof Integer ) {
85
+ //Compatibility with older version of gitlab4j-api:
86
+ return Long .valueOf (((Integer ) obj ).longValue ());
81
87
} else if (obj instanceof String ) {
82
88
return (urlEncode (((String ) obj ).trim ()));
83
89
} else if (obj instanceof Group ) {
@@ -113,6 +119,9 @@ public Object getUserIdOrUsername(Object obj) throws GitLabApiException {
113
119
throw (new RuntimeException ("Cannot determine ID or username from null object" ));
114
120
} else if (obj instanceof Long ) {
115
121
return (obj );
122
+ } else if (obj instanceof Integer ) {
123
+ //Compatibility with older version of gitlab4j-api:
124
+ return Long .valueOf (((Integer ) obj ).longValue ());
116
125
} else if (obj instanceof String ) {
117
126
return (urlEncode (((String ) obj ).trim ()));
118
127
} else if (obj instanceof User ) {
@@ -148,6 +157,9 @@ public Object getLabelIdOrName(Object obj) throws GitLabApiException {
148
157
throw (new RuntimeException ("Cannot determine ID or name from null object" ));
149
158
} else if (obj instanceof Long ) {
150
159
return (obj );
160
+ } else if (obj instanceof Integer ) {
161
+ //Compatibility with older version of gitlab4j-api:
162
+ return Long .valueOf (((Integer ) obj ).longValue ());
151
163
} else if (obj instanceof String ) {
152
164
return (urlEncode (((String ) obj ).trim ()));
153
165
} else if (obj instanceof Label ) {
@@ -176,6 +188,9 @@ public Object getNamespaceIdOrPath(Object obj) throws GitLabApiException {
176
188
throw (new RuntimeException ("Cannot determine ID or path from null object" ));
177
189
} else if (obj instanceof Long ) {
178
190
return (obj );
191
+ } else if (obj instanceof Integer ) {
192
+ //Compatibility with older version of gitlab4j-api:
193
+ return Long .valueOf (((Integer ) obj ).longValue ());
179
194
} else if (obj instanceof String ) {
180
195
return (urlEncode (((String ) obj ).trim ()));
181
196
} else if (obj instanceof Namespace ) {
0 commit comments