Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move null check into predicate function #693

Merged
merged 2 commits into from Jan 10, 2017
Merged

Conversation

imeredith
Copy link
Collaborator

Description

See JENKINS-XXXXX.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Appropriate unit or acceptance tests or explanation to why this change has no tests
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.
  • Ran Acceptance Test Harness against PR changes.

Reviewer checklist

  • Run the changes and verified the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

@reviewbybees

@@ -67,12 +67,12 @@ public Link getLink() {
for(Action action : Iterables.filter(actions, new Predicate<Action>() {
@Override
public boolean apply(Action action) {
if(action == null){
return false;
}
return !BANNED_ACTIONS.contains(action.getClass().getName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify to:
return action != null && !BANNED_ACTIONS.contains(action.getClass().getName());

@michaelneale
Copy link
Member

as long as passes automated tests this is a clear 🐝

@i386
Copy link
Contributor

i386 commented Jan 10, 2017

LGTM

@imeredith imeredith merged commit 9574ed6 into master Jan 10, 2017
@imeredith imeredith deleted the NPE_in_actionsproxyimpl branch January 10, 2017 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants