* If the feature {@code FLOGCALL} is disabled, this parameter is ignored and logging calls are also mutated.
*
+ * @param avoidCallsTo the list of packages
+ * @return this operation instance
* @see #avoidCallsTo(String...)
*/
public PitestOperation avoidCallsTo(Collection
* If the feature {@code FLOGCALL} is disabled, this parameter is ignored and logging calls are also mutated.
*
+ * @param avoidCallTo one or more packages
+ * @return this operation instance
* @see #avoidCallsTo(Collection)
*/
public PitestOperation avoidCallsTo(String... avoidCallTo) {
- options.put("--avoidCallsTo", String.join(",", avoidCallTo));
+ options.put("--avoidCallsTo", String.join(",", Arrays.stream(avoidCallTo).filter(this::isNotBlank).toList()));
return this;
}
@@ -121,34 +125,46 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code true}
+ *
+ * @param isDetectInlinedCode {@code true} or {@code false}
+ * @return this operation instance
*/
public PitestOperation detectInlinedCode(boolean isDetectInlinedCode) {
if (isDetectInlinedCode) {
@@ -198,20 +217,25 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code false}
+ *
+ * @param jsExport {@code true} or {@code false}
+ * @return this operation instance
*/
public PitestOperation exportLineCoverage(boolean jsExport) {
if (jsExport) {
@@ -340,6 +383,9 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code true}
+ *
+ * @param isFail {@code true} or {@code false}
+ * @return this operation instance
*/
public PitestOperation failWhenNoMutations(boolean isFail) {
if (isFail) {
@@ -353,46 +399,63 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code true}
+ *
+ * @param isLaunchClasspath {@code true} or {@code false}
+ * @return this operation instance
*/
public PitestOperation includeLaunchClasspath(boolean isLaunchClasspath) {
if (isLaunchClasspath) {
@@ -407,10 +470,13 @@ public class PitestOperation extends AbstractProcessOperation
* PIT will always attempt not to mutate test classes even if they are defined on a mutable path.
*
+ * @param path one or one paths
+ * @return this operation instance
* @see #mutableCodePaths(Collection)
*/
public PitestOperation mutableCodePaths(String... path) {
- options.put("--mutableCodePaths", String.join(",", path));
+ options.put("--mutableCodePaths", String.join(",", Arrays.stream(path).filter(this::isNotBlank).toList()));
return this;
}
@@ -483,10 +569,12 @@ public class PitestOperation extends AbstractProcessOperation
* PIT will always attempt not to mutate test classes even if they are defined on a mutable path.
*
+ * @param paths the list of paths
+ * @return this operation instance
* @see #mutableCodePaths(String...)
*/
public PitestOperation mutableCodePaths(Collection
* Please bear in mind that your build may contain equivalent mutations. Careful thought must therefore be given
* when selecting a threshold.
+ *
+ * @param threshold the threshold
+ * @return this operation instance
*/
public PitestOperation mutationThreshold(int threshold) {
if (threshold >= 0 && threshold <= 100) {
@@ -507,20 +598,24 @@ public class PitestOperation extends AbstractProcessOperation
* Default is {@code UTF-8}.
+ *
+ * @param encoding the encoding
+ * @return this operation instance
*/
public PitestOperation outputEncoding(String encoding) {
- options.put("--outputEncoding", encoding);
+ if (isNotBlank(encoding)) {
+ options.put("--outputEncoding", encoding);
+ }
return this;
}
@@ -540,10 +640,13 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code HTML}.
*
+ * @param outputFormat one or more output formats
+ * @return this operation instance
* @see #outputFormats(Collection)
*/
public PitestOperation outputFormats(String... outputFormat) {
- options.put("--outputFormats", String.join(",", outputFormat));
+ options.put("--outputFormats",
+ String.join(",", Arrays.stream(outputFormat).filter(this::isNotBlank).toList()));
return this;
}
@@ -553,18 +656,25 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code HTML}.
*
+ * @param outputFormats the list of output formats
+ * @return this operation instance
* @see #outputFormats(String...)
*/
public PitestOperation outputFormats(Collection
* Default is {@code false}
+ *
+ * @param isSkipFail {@code true} or {@code false}
+ * @return this operation instance
*/
public PitestOperation skipFailingTests(boolean isSkipFail) {
if (isSkipFail) {
@@ -585,20 +698,24 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code 4000}
+ *
+ * @param factor the factor amount
+ * @return this operation instance
*/
public PitestOperation timeoutConst(int factor) {
options.put("--timeoutConst", String.valueOf(factor));
@@ -687,6 +818,9 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code 1.25}
+ *
+ * @param factor the factor
+ * @return this operation instance
*/
public PitestOperation timeoutFactor(double factor) {
options.put("--timeoutFactor", String.valueOf(factor));
@@ -694,10 +828,13 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code false}
+ *
+ * @param isTimestamped {@code true} or {@code false}
+ * @return this operation instance
*/
public PitestOperation timestampedReports(boolean isTimestamped) {
if (isTimestamped) {
@@ -712,6 +849,9 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code false}
+ *
+ * @param isUseClasspathJar {@code true} or {@code false}
+ * @return this operation instance
*/
public PitestOperation useClasspathJar(boolean isUseClasspathJar) {
if (isUseClasspathJar) {
@@ -726,6 +866,9 @@ public class PitestOperation extends AbstractProcessOperation
* Defaults to {@code false}
+ *
+ * @param isVerbose {@code true} or {@code false}
+ * @return this operation instance
*/
public PitestOperation verbose(boolean isVerbose) {
if (isVerbose) {