From 4d3947316671fc7f09eb94536b8d58707ab0806b Mon Sep 17 00:00:00 2001 From: Sergey Isterin Date: Mon, 5 Feb 2018 11:15:26 +0300 Subject: [PATCH 1/2] Fixed update file API response code. --- src/main/java/org/gitlab4j/api/RepositoryFileApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/gitlab4j/api/RepositoryFileApi.java b/src/main/java/org/gitlab4j/api/RepositoryFileApi.java index c3c6b9e75..472fe7035 100644 --- a/src/main/java/org/gitlab4j/api/RepositoryFileApi.java +++ b/src/main/java/org/gitlab4j/api/RepositoryFileApi.java @@ -121,7 +121,7 @@ public RepositoryFile updateFile(RepositoryFile file, Integer projectId, String if (isApiVersion(ApiVersion.V3)) { response = put(Response.Status.OK, formData.asMap(), "projects", projectId, "repository", "files"); } else { - response = put(Response.Status.CREATED, formData.asMap(), "projects", projectId, "repository", "files", urlEncode(file.getFilePath())); + response = put(Response.Status.OK, formData.asMap(), "projects", projectId, "repository", "files", urlEncode(file.getFilePath())); } return (response.readEntity(RepositoryFile.class)); From 5b0b1c19c86ed0cae373f253f0d563cc10142ce7 Mon Sep 17 00:00:00 2001 From: Sergey Isterin Date: Tue, 6 Feb 2018 00:06:07 +0300 Subject: [PATCH 2/2] Changed comparison of Integer references using the == to equals() --- src/main/java/org/gitlab4j/api/GitLabApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/gitlab4j/api/GitLabApi.java b/src/main/java/org/gitlab4j/api/GitLabApi.java index d9cea03d7..280a99914 100644 --- a/src/main/java/org/gitlab4j/api/GitLabApi.java +++ b/src/main/java/org/gitlab4j/api/GitLabApi.java @@ -521,7 +521,7 @@ public void setSudoAsId(Integer sudoAsId) throws GitLabApiException { // Get the User specified by the sudoAsId, if you are not an admin or the username is not found, this will fail User user = getUserApi().getUser(sudoAsId); - if (user == null || user.getId() != sudoAsId) { + if (user == null || !user.getId().equals(sudoAsId)) { throw new GitLabApiException("the specified user ID was not found"); }