Skip to content

Commit

Permalink
Concretize variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Sep 4, 2024
1 parent b2d5b26 commit 1806b17
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ public Repository fetchRepository(String nameWithOwner) throws IOException {
pullRequest.setComments(new HashSet<>());
}
try {
User author = getUserFromGHUser(pr.getUser());
author.addPullRequest(pullRequest);
pullRequest.setAuthor(author);
User prAuthor = getUserFromGHUser(pr.getUser());
prAuthor.addPullRequest(pullRequest);
pullRequest.setAuthor(prAuthor);
} catch (IOException e) {
logger.error("Error while fetching PR author!");
pullRequest.setAuthor(null);
Expand All @@ -138,9 +138,9 @@ public Repository fetchRepository(String nameWithOwner) throws IOException {
Set<PullRequestReview> reviews = pr.listReviews().toList().stream().map(review -> {
PullRequestReview prReview = reviewConverter.convert(review);
try {
User owner = getUserFromGHUser(review.getUser());
owner.addReview(prReview);
prReview.setOwner(owner);
User reviewAuthor = getUserFromGHUser(review.getUser());
reviewAuthor.addReview(prReview);
prReview.setAuthor(reviewAuthor);
} catch (IOException e) {
logger.error("Error while fetching review owner!");
}
Expand Down Expand Up @@ -177,15 +177,15 @@ private Set<IssueComment> getCommentsFromGHPullRequest(GHPullRequest pr, PullReq
.map(comment -> {
IssueComment c = commentConverter.convert(comment);
c.setPullRequest(pullRequest);
User author;
User commentAuthor;
try {
author = getUserFromGHUser(comment.getUser());
author.addComment(c);
commentAuthor = getUserFromGHUser(comment.getUser());
commentAuthor.addComment(c);
} catch (IOException e) {
logger.error("Error while fetching author!");
author = null;
commentAuthor = null;
}
c.setAuthor(author);
c.setAuthor(commentAuthor);
return c;
}).collect(Collectors.toSet());
return comments;
Expand Down

0 comments on commit 1806b17

Please sign in to comment.