From 117109994fe219577d3a162f5cf4df8b47d212fd Mon Sep 17 00:00:00 2001 From: Gregory Pett Date: Wed, 12 Jun 2024 10:25:11 -0400 Subject: [PATCH 1/4] new attempt --- pom.xml | 2 +- src/main/java/org/kohsuke/github/GHCommit.java | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index ead1665db6..fdce720674 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.kohsuke cortexapps-github-api - 1.319 + 1.320 GitHub API for Java https://github-api.kohsuke.org/ GitHub API for Java diff --git a/src/main/java/org/kohsuke/github/GHCommit.java b/src/main/java/org/kohsuke/github/GHCommit.java index 3a2400e019..1a34c6d354 100644 --- a/src/main/java/org/kohsuke/github/GHCommit.java +++ b/src/main/java/org/kohsuke/github/GHCommit.java @@ -253,19 +253,19 @@ public static class Parent { /** * The Class User. */ - static class User { + public static class User { /** The gravatar id. */ // TODO: what if someone who doesn't have an account on GitHub makes a commit? @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "We don't provide it in API now") - String url, avatar_url, gravatar_id; + public String url, avatar_url, gravatar_id; /** The id. */ @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "We don't provide it in API now") int id; /** The login. */ - String login; + public String login; } /** The sha. */ @@ -471,6 +471,17 @@ public GHUser getAuthor() throws IOException { return resolveUser(author); } + /** + * Gets author. + * + * @return the author + * @throws IOException + * the io exception + */ + public User getAuthorRaw() throws IOException { + return author; + } + /** * Gets the date the change was authored on. * From 4f4d7fc972efa9ee60b9cf31ee8c811017600af5 Mon Sep 17 00:00:00 2001 From: Gregory Pett Date: Wed, 12 Jun 2024 11:38:02 -0400 Subject: [PATCH 2/4] adding spotless annotations --- src/main/java/org/kohsuke/github/GHCommit.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/kohsuke/github/GHCommit.java b/src/main/java/org/kohsuke/github/GHCommit.java index 1a34c6d354..905ee26cc2 100644 --- a/src/main/java/org/kohsuke/github/GHCommit.java +++ b/src/main/java/org/kohsuke/github/GHCommit.java @@ -257,7 +257,7 @@ public static class User { /** The gravatar id. */ // TODO: what if someone who doesn't have an account on GitHub makes a commit? - @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "We don't provide it in API now") + @SuppressFBWarnings(value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD", justification = "We don't provide it in API now") public String url, avatar_url, gravatar_id; /** The id. */ @@ -265,6 +265,7 @@ public static class User { int id; /** The login. */ + @SuppressFBWarnings(value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD", justification = "only used in the backend code") public String login; } From e1b9d65731d68835213c1f96a6f8dbb1738f16de Mon Sep 17 00:00:00 2001 From: Gregory Pett Date: Wed, 12 Jun 2024 11:40:05 -0400 Subject: [PATCH 3/4] adding items for test --- src/main/java/org/kohsuke/github/GHCommit.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHCommit.java b/src/main/java/org/kohsuke/github/GHCommit.java index 905ee26cc2..30efc7a761 100644 --- a/src/main/java/org/kohsuke/github/GHCommit.java +++ b/src/main/java/org/kohsuke/github/GHCommit.java @@ -257,7 +257,7 @@ public static class User { /** The gravatar id. */ // TODO: what if someone who doesn't have an account on GitHub makes a commit? - @SuppressFBWarnings(value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD", justification = "We don't provide it in API now") + @SuppressFBWarnings(value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD", justification = "used in backend code") public String url, avatar_url, gravatar_id; /** The id. */ @@ -265,7 +265,7 @@ public static class User { int id; /** The login. */ - @SuppressFBWarnings(value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD", justification = "only used in the backend code") + @SuppressFBWarnings(value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD", justification = "used in backend code") public String login; } From 094057aba304835f0c3ef181477c159a6f4b08bd Mon Sep 17 00:00:00 2001 From: Gregory Pett Date: Wed, 12 Jun 2024 12:04:18 -0400 Subject: [PATCH 4/4] adding right spotless annotation --- src/main/java/org/kohsuke/github/GHCommit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/kohsuke/github/GHCommit.java b/src/main/java/org/kohsuke/github/GHCommit.java index 30efc7a761..0319f31228 100644 --- a/src/main/java/org/kohsuke/github/GHCommit.java +++ b/src/main/java/org/kohsuke/github/GHCommit.java @@ -265,7 +265,7 @@ public static class User { int id; /** The login. */ - @SuppressFBWarnings(value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD", justification = "used in backend code") + @SuppressFBWarnings(value = "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", justification = "used in backend code") public String login; }