aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorS.Nishio <nishio@densan-labs.net>2015-02-08 00:05:59 +0900
committerS.Nishio <nishio@densan-labs.net>2015-02-08 00:05:59 +0900
commit96e6eded31e6bfdcb2b4845086daff77c733a0be (patch)
tree7f30f1a0ae655f259ca903a4515aca695ad37f0c /src
parent2642492472675411049571ccc1140b9bb02dc46c (diff)
parent01042a73adbfe9076aa2546da66ea6022d3a2140 (diff)
downloadbbprb-96e6eded31e6bfdcb2b4845086daff77c733a0be.tar.gz
Merge pull request #36 from egineering-llc/master
Return empty collections instead of null to prevent NPE.
Diffstat (limited to 'src')
-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) {