-
Notifications
You must be signed in to change notification settings - Fork 55
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
Skip to next bundle on predicate failure. #78
Conversation
if (symbolicName!=null && !symbolicName.equals(b.getSymbolicName())) continue; | ||
if (version!=null && !Version.parseVersion(version).equals(b.getVersion())) continue; | ||
for (Predicate<? super Bundle> predicate: predicates) { | ||
if (!predicate.apply(b)) continue; | ||
if (!predicate.apply(b)) continue allBundles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could Predicates.and
be used instead of the nested loop? Alternatively can you extract it in a separate method to avoid dealing with labels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 i don't like labels here, and in any case i think the inner loop as svet suggests can be replaced by one line
if (!Predicates.and(predicates).apply(b)) continue;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like a fix to me! will add that soon.
Without this change, if the predicate fails, the code flow just picks the next predicate to check, when really we want to skip to checking the next bundle.
Have rebased and pushed the change suggested. |
Kicked a new build due to the unrelated failure.
|
Did this not complete? The build seems to have finished successfully. |
Trying a recycle |
Reopening |
Without this change, if the predicate fails, the code flow just picks the next predicate to check,
when really we want to skip to checking the next bundle.