RFR: 1145: NPE in GitHubPullRequest::reviews

Erik Joelsson erikj at openjdk.java.net
Mon Aug 30 20:32:24 UTC 2021


The core of this change is to fix an NPE in GitHubPullRequest::reviews, which happens when a commit that a review refers to no longer exists (presumably because of a rebase or forced update of the review branch). The introduction of a possible null value in Review::hash has some ripple effects however, so this gets a bit more complicated.

I've opted to wrap the return value of Review::hash and ReviewComment::hash with Optional to properly force every caller to handle the situation. I haven't seen this happen for ReviewComment, but I would be surprised if the same thing didn't apply there from the GitHub side.

-------------

Commit messages:
 - SKARA-1145

Changes: https://git.openjdk.java.net/skara/pull/1211/files
 Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1211&range=00
  Issue: https://bugs.openjdk.java.net/browse/SKARA-1145
  Stats: 56 lines in 10 files changed: 30 ins; 0 del; 26 mod
  Patch: https://git.openjdk.java.net/skara/pull/1211.diff
  Fetch: git fetch https://git.openjdk.java.net/skara pull/1211/head:pull/1211

PR: https://git.openjdk.java.net/skara/pull/1211


More information about the skara-dev mailing list