diff --git a/.idea/intellij-javadocs-4.0.1.xml b/.idea/intellij-javadocs-4.0.1.xml
new file mode 100644
index 0000000..90d3347
--- /dev/null
+++ b/.idea/intellij-javadocs-4.0.1.xml
@@ -0,0 +1,204 @@
+
+
+
+
+ UPDATE
+ false
+ true
+
+ FIELD
+ METHOD
+ TYPE
+
+
+ PUBLIC
+ PROTECTED
+ DEFAULT
+
+
+
+
+
+ ^.*(public|protected|private)*.+interface\s+\w+.*
+ /**\n
+ * The interface ${name}.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+ */
+
+
+ ^.*(public|protected|private)*.+enum\s+\w+.*
+ /**\n
+ * The enum ${name}.\n
+ */
+
+
+ ^.*(public|protected|private)*.+class\s+\w+.*
+ /**\n
+ * The type ${name}.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+ */
+
+
+ .+
+ /**\n
+ * The type ${name}.\n
+ */
+
+
+
+
+ .+
+ /**\n
+ * Instantiates a new ${name}.\n
+<#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+<#list element.parameterList.parameters as parameter>
+ * @param ${parameter.name} the ${paramNames[parameter.name]}\n
+</#list>
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+
+
+ ^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+
+ /**\n
+ * Gets ${partName}.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+<#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+<#list element.parameterList.parameters as parameter>
+ * @param ${parameter.name} the ${paramNames[parameter.name]}\n
+</#list>
+<#if isNotVoid>
+ *\n
+ * @return the ${partName}\n
+</#if>
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+ ^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+
+ /**\n
+ * Sets ${partName}.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+<#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+<#list element.parameterList.parameters as parameter>
+ * @param ${parameter.name} the ${paramNames[parameter.name]}\n
+</#list>
+<#if isNotVoid>
+ *\n
+ * @return the ${partName}\n
+</#if>
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+ ^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+
+ /**\n
+ * The entry point of application.\n
+
+ <#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+ * @param ${element.parameterList.parameters[0].name} the input arguments\n
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+ .+
+ /**\n
+ * ${name}<#if isNotVoid> ${return}</#if>.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+<#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+<#list element.parameterList.parameters as parameter>
+ * @param ${parameter.name} the ${paramNames[parameter.name]}\n
+</#list>
+<#if isNotVoid>
+ *\n
+ * @return the ${return}\n
+</#if>
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+
+
+ ^.*(public|protected|private)*.+static.*(\w\s\w)+.+
+ /**\n
+ * The constant ${element.getName()}.\n
+ */
+
+
+ ^.*(public|protected|private)*.*(\w\s\w)+.+
+ /**\n
+ <#if element.parent.isInterface()>
+ * The constant ${element.getName()}.\n
+<#else>
+ * The ${name}.\n
+</#if> */
+
+
+ .+
+ /**\n
+ <#if element.parent.isEnum()>
+ *${name} ${typeName}.\n
+<#else>
+ * The ${name}.\n
+</#if>*/
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index f03c702..6ab9726 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,3 +1,4 @@
+
@@ -8,6 +9,12 @@
diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties
index 80e04df..33db783 100644
--- a/lib/bld/bld-wrapper.properties
+++ b/lib/bld/bld-wrapper.properties
@@ -1,6 +1,6 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
-bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.3
+bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.4
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.1
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=
diff --git a/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java b/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java
index 1c4a1ac..fcff6a5 100644
--- a/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java
+++ b/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java
@@ -62,7 +62,7 @@ public class CheckstyleOperationBuild extends Project {
.info()
.groupId("com.uwyn.rife2")
.artifactId("bld-checkstyle")
- .description("bld Checkstyle Extensions")
+ .description("bld Checkstyle Extension")
.url("https://github.com/rife2/bld-checkstyle")
.developer(
new PublishDeveloper()
diff --git a/src/main/java/rife/bld/extension/CheckstyleOperation.java b/src/main/java/rife/bld/extension/CheckstyleOperation.java
index 8237736..b1013ca 100644
--- a/src/main/java/rife/bld/extension/CheckstyleOperation.java
+++ b/src/main/java/rife/bld/extension/CheckstyleOperation.java
@@ -45,9 +45,14 @@ public class CheckstyleOperation extends AbstractProcessOperation paths) {
for (var p : paths) {
- options.put("-e", p);
+ if (isNotBlank(p)) {
+ options.put("-e", p);
+ }
}
return this;
}
/**
* Directory/file pattern to exclude from CheckStyle. Multiple excludes are allowed.
+ *
+ * @param pattern the pattern
+ * @return the checkstyle operation
*/
public CheckstyleOperation excludedPathPattern(String pattern) {
- options.put("-x", pattern);
+ if (isNotBlank(pattern)) {
+ options.put("-x", pattern);
+ }
return this;
}
@@ -152,6 +178,9 @@ public class CheckstyleOperation extends AbstractProcessOperationonly Javadoc comment content
* without including '/**' and '*/' at the beginning and at the end respectively. The option cannot
* be used other options and requires exactly one file to run on to be specified.
+ *
+ * @param isTree {@code true} or {@code false}
+ * @return the checkstyle operation
*/
public CheckstyleOperation javadocTree(boolean isTree) {
if (isTree) {
@@ -208,51 +255,73 @@ public class CheckstyleOperation extends AbstractProcessOperationATTENTION: generated result will have few queries, joined by pipe(|). Together they will match all AST nodes
* on specified line and column. You need to choose only one and recheck that it works. Usage of all of them is also
* ok, but might result in undesirable matching and suppress other issues.
+ *
+ * @param lineColumn the line column
+ * @return the checkstyle operation
*/
public CheckstyleOperation lineColumn(String lineColumn) {
- options.put("-s", lineColumn);
+ if (isNotBlank(lineColumn)) {
+ options.put("-s", lineColumn);
+ }
return this;
}
/**
* Sets the output file. Defaults to stdout.
+ *
+ * @param file the file
+ * @return the checkstyle operation
*/
public CheckstyleOperation output(String file) {
- options.put("-o", file);
+ if (isNotBlank(file)) {
+ options.put("-o", file);
+ }
return this;
}
/**
* Sets the property files to load.
+ *
+ * @param file the file
+ * @return the checkstyle operation
*/
public CheckstyleOperation propertiesFile(String file) {
- options.put("-p", file);
+ if (isNotBlank(file)) {
+ options.put("-p", file);
+ }
return this;
}
/**
* Specified the file(s) or folder(s) containing the source files to check.
*
+ * @param dir one or more directories
+ * @return the checkstyle operation
* @see #sourceDir(Collection)
*/
public CheckstyleOperation sourceDir(String... dir) {
- sourceDirs.addAll(Arrays.asList(dir));
+ sourceDirs.addAll(Arrays.stream(dir).filter(this::isNotBlank).toList());
return this;
}
/**
* Specified the file(s) or folder(s) containing the source files to check.
*
+ * @param dirs the directories
+ * @return the checkstyle operation
* @see #sourceDir(String...)
*/
public CheckstyleOperation sourceDir(Collection dirs) {
- sourceDirs.addAll(dirs);
+ sourceDirs.addAll(dirs.stream().filter(this::isNotBlank).toList());
return this;
}
/**
* Sets the length of the tab character. Used only with the {@link #lineColumn(String) lineColum} option.
* Default value is {@code 8}.
+ *
+ * @param length the length
+ * @return the checkstyle operation
*/
public CheckstyleOperation tabWith(int length) {
options.put("-w", String.valueOf(length));
@@ -262,6 +331,9 @@ public class CheckstyleOperation extends AbstractProcessOperation