aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorTroy Kelley <troy.kelley@e-gineering.com>2015-02-06 16:15:45 -0500
committerTroy Kelley <troy.kelley@e-gineering.com>2015-02-06 16:15:45 -0500
commit01042a73adbfe9076aa2546da66ea6022d3a2140 (patch)
tree7f30f1a0ae655f259ca903a4515aca695ad37f0c /src/main/java
parent2642492472675411049571ccc1140b9bb02dc46c (diff)
downloadbbprb-01042a73adbfe9076aa2546da66ea6022d3a2140.tar.gz
Return empty collections instead of null to prevent NPE.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/BitbucketApiClient.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/BitbucketApiClient.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/BitbucketApiClient.java
index 5906f4c..8bd1b03 100644
--- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/BitbucketApiClient.java
+++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/BitbucketApiClient.java
@@ -10,6 +10,7 @@ import org.codehaus.jackson.type.TypeReference;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -42,7 +43,7 @@ public class BitbucketApiClient {
} catch(Exception e) {
logger.log(Level.WARNING, "invalid pull request response.", e);
}
- return null;
+ return Collections.EMPTY_LIST;
}
public List<BitbucketPullRequestComment> getPullRequestComments(String commentOwnerName, String commentRepositoryName, String pullRequestId) {
@@ -53,7 +54,7 @@ public class BitbucketApiClient {
} catch(Exception e) {
logger.log(Level.WARNING, "invalid pull request response.", e);
}
- return null;
+ return Collections.EMPTY_LIST;
}
public void deletePullRequestComment(String pullRequestId, String commentId) {