Skip to content

Commit

Permalink
Fix codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Haarolean committed Nov 13, 2023
1 parent 0390675 commit b704a77
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/main/java/org/kohsuke/github/GHEventPayload.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,14 @@ public static class Installation extends GHEventPayload {
private List<Repository> rawRepositories;

/**
* Gets repositories.
* For the "deleted" action please rather call {@link #getRawRepositories()}
* Gets repositories. For the "deleted" action please rather call {@link #getRawRepositories()}
*
* @return the repositories
*/
public List<GHRepository> getRepositories() {
if ("deleted".equalsIgnoreCase(getAction())) {
throw new IllegalStateException("Can't call #getRepositories() on Installation event " +
"with 'deleted' action. Please rather call #getRawRepositories()");
throw new IllegalStateException("Can't call #getRepositories() on Installation event "
+ "with 'deleted' action. Please rather call #getRawRepositories()");
}

if (reposLoaded) {
Expand Down Expand Up @@ -311,9 +310,8 @@ public List<GHRepository> getRepositories() {
;

/**
* Returns a list of raw, unpopulated repositories.
* Useful when calling from within Installation event with action "deleted".
* You can't fetch the info for repositories of an already deleted installation.
* Returns a list of raw, unpopulated repositories. Useful when calling from within Installation event with
* action "deleted". You can't fetch the info for repositories of an already deleted installation.
*
* @return List<Repository>
*/
Expand All @@ -324,8 +322,7 @@ public List<Repository> getRawRepositories() {
@JsonSetter
public void setRepositories(List<GHRepository> repositories) {
this.repositories = repositories;
this.rawRepositories = repositories
.stream()
this.rawRepositories = repositories.stream()
.map(r -> new Repository(r.getId(), r.getFullName(), r.getName(), r.getNodeId(), r.isPrivate()))
.collect(Collectors.toList());
}
Expand All @@ -343,9 +340,9 @@ void lateBind() {
}

/**
* A special minimal implementation of a {@link GHRepository} which contains
* only fields from "Properties of repositories" from
* <a href="https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#installation">here</a>
* A special minimal implementation of a {@link GHRepository} which contains only fields from "Properties of
* repositories" from <a href=
* "https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#installation">here</a>
*/
public static class Repository {
private final long id;
Expand Down

0 comments on commit b704a77

Please sign in to comment.