public String getDiff() { if (diff == null && repositoryService.getRepository() != null) { Response response = null; try { response = bitbucketV2Client.getPullRequestDiff(repositoryOwner, repositoryName, id); if (response.getStatus() == HttpServletResponse.SC_OK) { diff = response.readEntity(String.class); } } finally { if (response != null) { response.close(); } } } return diff; }
public PullRequest getPullRequest() { if (pullRequest == null && repositoryService.getRepository() != null) { Response response = null; try { response = bitbucketV2Client.getPullRequestById(repositoryOwner, repositoryName, id); if (response.getStatus() == HttpServletResponse.SC_OK) { pullRequest = response.readEntity(PullRequest.class); } } finally { if (response != null) { response.close(); } } } return pullRequest; }