From 406818f74098df34059a072c76e010ffccfcaa22 Mon Sep 17 00:00:00 2001 From: Jeremie Bresson Date: Tue, 24 Dec 2024 14:38:12 +0100 Subject: [PATCH] Add missing deprecated methods and format code --- .../java/org/gitlab4j/api/RepositoryApi.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/RepositoryApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/RepositoryApi.java index a4dc9f0d..20d02839 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/RepositoryApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/RepositoryApi.java @@ -913,7 +913,9 @@ public File getRepositoryArchive( * false to compare using merge base (from…to)’. * @return a CompareResults containing the results of the comparison * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #compare(Object, String, String, Long, Boolean)} instead */ + @Deprecated public CompareResults compare(Object projectIdOrPath, String from, String to, Boolean straight) throws GitLabApiException { return compare(projectIdOrPath, from, to, null, straight); @@ -928,9 +930,11 @@ public CompareResults compare(Object projectIdOrPath, String from, String to, Bo * @param to the commit SHA or branch name * @return a CompareResults containing the results of the comparison * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #compare(Object, String, String, Long, Boolean)} instead */ + @Deprecated public CompareResults compare(Object projectIdOrPath, String from, String to) throws GitLabApiException { - return (compare(projectIdOrPath, from, to, false)); + return compare(projectIdOrPath, from, to, false); } /** @@ -947,19 +951,19 @@ public CompareResults compare(Object projectIdOrPath, String from, String to) th * @throws GitLabApiException if any exception occurs */ public CompareResults compare(Object projectIdOrPath, String from, String to, Long fromProjectId, Boolean straight) - throws GitLabApiException { + throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm() - .withParam("from", from, true) - .withParam("to", to, true) - .withParam("straight", straight) - .withParam("from_project_id", fromProjectId); + .withParam("from", from, true) + .withParam("to", to, true) + .withParam("straight", straight) + .withParam("from_project_id", fromProjectId); Response response = get( - Response.Status.OK, - formData.asMap(), - "projects", - getProjectIdOrPath(projectIdOrPath), - "repository", - "compare"); + Response.Status.OK, + formData.asMap(), + "projects", + getProjectIdOrPath(projectIdOrPath), + "repository", + "compare"); return (response.readEntity(CompareResults.class)); }