From 3210364a2ffbc26a6fea4c6efd3ca5e5ec224fbd Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 29 Aug 2023 09:43:34 -0700 Subject: [PATCH] Minor cleanup --- README.md | 2 +- .../rife/bld/extension/PitestOperation.java | 47 ++++++++++--------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 7176ba6..b0f2426 100755 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ public void pit() throws Exception { ``` -- [View Examples](https://github.com/rife2/bld-pittest/blob/master/examples/src/bld/java/com/example/) +- [View Examples](https://github.com/rife2/bld-pitest/blob/master/examples/src/bld/java/com/example/) Please check the [PitestOperation documentation](https://rife2.github.io/bld-pitest/rife/bld/extension/PitestOperation.html#method-summary) for all available configuration options. diff --git a/src/main/java/rife/bld/extension/PitestOperation.java b/src/main/java/rife/bld/extension/PitestOperation.java index 781d8e7..a621f90 100644 --- a/src/main/java/rife/bld/extension/PitestOperation.java +++ b/src/main/java/rife/bld/extension/PitestOperation.java @@ -28,14 +28,23 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Logger; /** - * Mutation testing and coverage with PIT. + * Mutation testing and coverage with PIT. * * @author Erik C. Thauvin * @since 1.0 */ public class PitestOperation extends AbstractProcessOperation { + /** + * False constant. + */ protected static final String FALSE = "false"; + /** + * Source directories command line option. + */ protected static final String SOURCE_DIRS = "--sourceDirs"; + /** + * True constant. + */ protected static final String TRUE = "true"; private static final Logger LOGGER = Logger.getLogger(PitestOperation.class.getName()); /** @@ -150,32 +159,28 @@ public class PitestOperation extends AbstractProcessOperation { /** * Flag to indicate if PIT should attempt to detect the inlined code generated by the java compiler in order to - * implement finally blocks. Each copy of the inlined code would normally be mutated separately, resulting in - * multiple identical looking mutations. When inlined code detection is enabled PIT will attempt to spot inlined + * implement {@code finally} blocks. Each copy of the inlined code would normally be mutated separately, resulting + * in multiple identical looking mutations. When inlined code detection is enabled PIT will attempt to spot inlined * code and create only a single mutation that mutates all affected instructions simultaneously. *

- * The algorithm cannot easily distinguish between inlined copies of code, and genuine duplicate instructions on the same line within a finally block. + * The algorithm cannot easily distinguish between inlined copies of code, and genuine duplicate instructions on + * the same line within a {@code finally} block. *

* In the case of any doubt PIT will act cautiously and assume that the code is not inlined. *

* This will be detected as two separate inlined instructions - *

+ *

      * finally {
-     * 

- *   int++; - *

- *   int++; - *

+ * int++; + * int++; * } - *

+ *

* But this will look confusing so PIT will assume no in-lining is taking place. - *

+ *

      * finally {
-     * 

*   int++; int++; - *

* } - *

+ *

* This sort of pattern might not be common with integer addition, but things like string concatenation are likely * to produce multiple similar instructions on the same line. *

@@ -347,8 +352,8 @@ public class PitestOperation extends AbstractProcessOperation { /** * List of features to enable/disable - *

- * {@see #featrues(String) + * + * @see #features(String...) */ public PitestOperation features(Collection feature) { options.put("--features", String.join(",", feature)); @@ -357,8 +362,8 @@ public class PitestOperation extends AbstractProcessOperation { /** * List of features to enable/disable - *

- * {@see #featrues(String) + * + * @see #features(Collection) */ public PitestOperation features(String... feature) { options.put("--features", String.join(",", feature)); @@ -399,8 +404,8 @@ public class PitestOperation extends AbstractProcessOperation { } /** - * list of TestNG groups/JUnit categories to include in mutation analysis. Note that only class level categories are - * supported. + * list of TestNG groups/JUnit categories to include in mutation analysis. Note that only class level categories + * are supported. * * @see #includedGroups(Collection) */