Skip to content

Commit

Permalink
improve readability of condition and wording
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
  • Loading branch information
chrisrueger committed Oct 30, 2024
1 parent b402fd3 commit 6467e74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions biz.aQute.bndlib/src/aQute/bnd/service/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface Registry {
* @param c
* @param tags
* @return all plugins matching the given class and any of the given tags.
* If a repository does not support tags or no tags are given, all
* If a plugin does not support tags or no tags are given, all
* plugins are returned without filtering.
*/
default <T> List<T> getPlugins(Class<T> c, String... tags) {
Expand All @@ -32,8 +32,8 @@ default <T> List<T> getPlugins(Class<T> c, String... tags) {
}

return getPlugins(c).stream()
.filter(repo -> !(repo instanceof Tagged) || (repo instanceof Tagged taggedRepo && taggedRepo.getTags()
.includesAny(tags)))
.filter(repo -> (repo instanceof Tagged taggedRepo) ? taggedRepo.getTags()
.includesAny(tags) : true)
.collect(Collectors.toList());
}

Expand Down

0 comments on commit 6467e74

Please sign in to comment.