From 192b513572dc058d436c5f4ca49405519e0a443d Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 11 May 2014 15:38:20 +0200 Subject: [PATCH] Extended API docs --- .../aether/util/filter/AndDependencyFilter.java | 14 ++++++++------ .../util/graph/selector/AndDependencySelector.java | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java b/aether-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java index d89c7e82..b1036fee 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java +++ b/aether-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. + * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,7 +20,8 @@ import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; /** - * A dependency filter that combines zero or more other filters using a logical {@code AND}. + * A dependency filter that combines zero or more other filters using a logical {@code AND}. The resulting filter + * accepts a given dependency node if and only if all constituent filters accept it. */ public final class AndDependencyFilter implements DependencyFilter @@ -29,9 +30,10 @@ public final class AndDependencyFilter private final Set filters = new LinkedHashSet(); /** - * Creates a new filter from the specified filters. + * Creates a new filter from the specified filters. Prefer {@link #newInstance(DependencyFilter, DependencyFilter)} + * if any of the input filters might be {@code null}. * - * @param filters The filters to combine, may be {@code null}. + * @param filters The filters to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencyFilter( DependencyFilter... filters ) { @@ -44,7 +46,7 @@ public final class AndDependencyFilter /** * Creates a new filter from the specified filters. * - * @param filters The filters to combine, may be {@code null}. + * @param filters The filters to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencyFilter( Collection filters ) { @@ -58,7 +60,7 @@ public final class AndDependencyFilter * Creates a new filter from the specified filters. * * @param filter1 The first filter to combine, may be {@code null}. - * @param filter2 The first filter to combine, may be {@code null}. + * @param filter2 The second filter to combine, may be {@code null}. * @return The combined filter or {@code null} if both filter were {@code null}. */ public static DependencyFilter newInstance( DependencyFilter filter1, DependencyFilter filter2 ) diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java b/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java index 0c641259..7f3494c4 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java +++ b/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. + * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -21,7 +21,8 @@ import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; /** - * A dependency selector that combines zero or more other selectors using a logical {@code AND}. + * A dependency selector that combines zero or more other selectors using a logical {@code AND}. The resulting selector + * selects a given dependency if and only if all constituent selectors do so. */ public final class AndDependencySelector implements DependencySelector @@ -32,9 +33,10 @@ public final class AndDependencySelector private int hashCode; /** - * Creates a new selector from the specified selectors. + * Creates a new selector from the specified selectors. Prefer + * {@link #newInstance(DependencySelector, DependencySelector)} if any of the input selectors might be {@code null}. * - * @param selectors The selectors to combine, may be {@code null}. + * @param selectors The selectors to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencySelector( DependencySelector... selectors ) { @@ -51,7 +53,7 @@ public final class AndDependencySelector /** * Creates a new selector from the specified selectors. * - * @param selectors The selectors to combine, may be {@code null}. + * @param selectors The selectors to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencySelector( Collection selectors ) { @@ -81,7 +83,7 @@ public final class AndDependencySelector * Creates a new selector from the specified selectors. * * @param selector1 The first selector to combine, may be {@code null}. - * @param selector2 The first selector to combine, may be {@code null}. + * @param selector2 The second selector to combine, may be {@code null}. * @return The combined selector or {@code null} if both selectors were {@code null}. */ public static DependencySelector newInstance( DependencySelector selector1, DependencySelector selector2 ) -- GitLab