diff options
author | Troy Kelley <troy.kelley@e-gineering.com> | 2015-02-06 16:15:45 -0500 |
---|---|---|
committer | Troy Kelley <troy.kelley@e-gineering.com> | 2015-02-06 16:15:45 -0500 |
commit | 01042a73adbfe9076aa2546da66ea6022d3a2140 (patch) | |
tree | 7f30f1a0ae655f259ca903a4515aca695ad37f0c | |
parent | 2642492472675411049571ccc1140b9bb02dc46c (diff) | |
download | bbprb-01042a73adbfe9076aa2546da66ea6022d3a2140.tar.gz |
Return empty collections instead of null to prevent NPE.
-rw-r--r-- | src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/BitbucketApiClient.java | 5 |
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) { |