File tree Expand file tree Collapse file tree
github-pullrequest-plugin/src/main/java
com/github/kostyasha/github/integration/branch
org/jenkinsci/plugins/github/pullrequest Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030import javax .annotation .Nullable ;
3131import java .io .IOException ;
3232import java .util .ArrayList ;
33- import java .util .Collections ;
3433import java .util .Date ;
3534import java .util .LinkedHashSet ;
3635import java .util .List ;
4544import static com .google .common .base .Charsets .UTF_8 ;
4645import static com .google .common .base .Predicates .not ;
4746import static java .text .DateFormat .getDateTimeInstance ;
47+ import static java .util .Collections .emptyList ;
4848import static org .jenkinsci .plugins .github .pullrequest .GitHubPRTriggerMode .LIGHT_HOOKS ;
4949import static org .jenkinsci .plugins .github .pullrequest .utils .ObjectsUtil .isNull ;
5050import static org .jenkinsci .plugins .github .pullrequest .utils .ObjectsUtil .nonNull ;
@@ -99,9 +99,9 @@ public boolean isPreStatus() {
9999 return preStatus ;
100100 }
101101
102- @ CheckForNull
102+ @ Nonnull
103103 public List <GitHubBranchEvent > getEvents () {
104- return events ;
104+ return nonNull ( events ) ? events : emptyList () ;
105105 }
106106
107107 @ CheckForNull
@@ -241,7 +241,7 @@ private List<GitHubBranchCause> readyToBuildCauses(GitHubBranchRepository localR
241241 return causes ;
242242 } catch (IOException e ) {
243243 listener .error ("Can't get build causes: '{}'" , e );
244- return Collections . emptyList ();
244+ return emptyList ();
245245 }
246246 }
247247
Original file line number Diff line number Diff line change @@ -138,8 +138,9 @@ public boolean isPreStatus() {
138138 return preStatus ;
139139 }
140140
141+ @ Nonnull
141142 public List <GitHubPREvent > getEvents () {
142- return events ;
143+ return nonNull ( events ) ? events : emptyList () ;
143144 }
144145
145146 public GitHubPRUserRestriction getUserRestriction () {
You can’t perform that action at this time.
0 commit comments