+ * Set to: {@code rulesets/java/quickstart.xml}
*/
public static final String RULE_SET_DEFAULT = "rulesets/java/quickstart.xml";
private static final Logger LOGGER = Logger.getLogger(PmdOperation.class.getName());
@@ -48,115 +51,83 @@ public class PmdOperation extends AbstractOperation
@@ -330,6 +345,9 @@ public class PmdOperation extends AbstractOperation
+ * Previous entries are disregarded.
+ *
+ * @param inputPath one or more paths
+ * @return this operation
+ * @see #addInputPaths(File...)
+ */
+ public PmdOperation inputPaths(File... inputPath) {
+ inputPaths_.clear();
+ inputPaths_.addAll(Arrays.stream(inputPath).map(File::toPath).toList());
+ return this;
+ }
+
+ /**
+ * Sets paths to source files, or directories containing source files to analyze.
+ *
+ * Previous entries are disregarded.
+ * @param inputPath one or more paths
+ * @return this operation
+ * @see #addInputPaths(String...)
+ */
+ public PmdOperation inputPaths(String... inputPath) {
+ inputPaths_.clear();
+ inputPaths_.addAll(Arrays.stream(inputPath).map(Paths::get).toList());
+ return this;
+ }
+
+ /**
+ * Sets paths to source files, or directories containing source files to analyze.
+ *
+ * Previous entries are disregarded.
+ * @param inputPath the input paths
+ * @return this operation
+ * @see #addInputPaths(Collection)
*/
public PmdOperation inputPaths(Collection
* The built-in rule set paths are:
*
* The built-in rule set paths are:
*
@@ -518,15 +757,19 @@ public class PmdOperation extends AbstractOperation
+ *
+ * @param ruleSet one or more rule set
+ * @return this operation
+ * @see #addRuleSet(String...)
*/
public PmdOperation ruleSets(String... ruleSet) {
ruleSets_.clear();
- ruleSets_.addAll(Arrays.asList(ruleSet));
+ ruleSets_.addAll(List.of(ruleSet));
return this;
}
/**
- * Sets the rule set path(s), disregarding any previously set paths.
+ * Sets new rule set paths, disregarding any previous entries.
*
@@ -540,15 +783,31 @@ public class PmdOperation extends AbstractOperation
+ *
+ * @param ruleSet one or more rule set
+ * @return this operation
+ * @see #addRuleSet(Collection)
*/
- public PmdOperation ruleSets(Collection