Repository: checkstyle/checkstyle

Problem statement:
Mofication of module property default values to reflect actual working data
Some check properties have default values which wont work when copy-pasted in module configurations.
For example:
`null`: https://github.com/checkstyle/checkstyle/blob/6f58247b85ff4d74eb22dbd8c51d72b69fe51839/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheck.java#L72
`charset of parent module`: https://github.com/checkstyle/checkstyle/blob/6f58247b85ff4d74eb22dbd8c51d72b69fe51839/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheck.java#L64

We need to fix all such instances.


Hints:

Patch:
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheck.java
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheck.java
@@ -55,7 +55,7 @@
  * <li>
  * Property {@code maximumDepth} - Specify the maximum depth for descendant counts.
  * Type is {@code int}.
- * Default value is {@code java.lang.Integer.MAX_VALUE}.
+ * Default value is {@code 2147483647}.
  * </li>
  * <li>
  * Property {@code minimumNumber} - Specify a minimum count for descendants.
@@ -65,7 +65,7 @@
  * <li>
  * Property {@code maximumNumber} - Specify a maximum count for descendants.
  * Type is {@code int}.
- * Default value is {@code java.lang.Integer.MAX_VALUE}.
+ * Default value is {@code 2147483647}.
  * </li>
  * <li>
  * Property {@code sumTokenCounts} - Control whether the number of tokens found
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java
@@ -44,7 +44,7 @@
  * Property {@code excludedClasses} - Specify pattern for qualified names of
  * classes which are allowed to have a {@code main} method.
  * Type is {@code java.util.regex.Pattern}.
- * Default value is {@code "^$" (empty)}.
+ * Default value is {@code "^$"}.
  * </li>
  * </ul>
  * <p>
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheck.java
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheck.java
@@ -42,7 +42,7 @@
  * associated with exception. If check meets variable name matching specified value - empty
  * block is suppressed.
  * Type is {@code java.util.regex.Pattern}.
- * Default value is {@code "^$" (empty)}.
+ * Default value is {@code "^$"}.
  * </li>
  * <li>
  * Property {@code commentFormat} - Specify the RegExp for the first comment inside empty
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java
@@ -37,7 +37,7 @@
  * Property {@code format} - Define the RegExp for illegal pattern.
  * Type is {@code java.lang.String}.
  * Validation type is {@code java.util.regex.Pattern}.
- * Default value is {@code "^$" (empty)}.
+ * Default value is {@code "^$"}.
  * </li>
  * <li>
  * Property {@code ignoreCase} - Control whether to ignore case when matching.
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java
@@ -153,7 +153,7 @@
  * <li>
  * Property {@code specialImportsRegExp} - Specify RegExp for SPECIAL_IMPORTS group imports.
  * Type is {@code java.util.regex.Pattern}.
- * Default value is {@code "^$" (empty)}.
+ * Default value is {@code "^$"}.
  * </li>
  * <li>
  * Property {@code separateLineBetweenGroups} - Force empty line separator between
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
@@ -50,7 +50,7 @@
  * <li>
  * Property {@code forbiddenSummaryFragments} - Specify the regexp for forbidden summary fragments.
  * Type is {@code java.util.regex.Pattern}.
- * Default value is {@code "^$" (empty)}.
+ * Default value is {@code "^$"}.
  * </li>
  * <li>
  * Property {@code period} - Specify the period symbol at the end of first javadoc sentence.
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java
@@ -88,7 +88,7 @@
  * <li>
  * Property {@code format} - Specify the pattern to match against.
  * Type is {@code java.util.regex.Pattern}.
- * Default value is {@code "^$"}(empty).
+ * Default value is {@code "^$"}.
  * </li>
  * <li>
  * Property {@code message} - Specify message which is used to notify about
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheck.java
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheck.java
@@ -59,7 +59,7 @@
  * <li>
  * Property {@code ignorePattern} - Specify pattern for lines to ignore.
  * Type is {@code java.util.regex.Pattern}.
- * Default value is {@code "^$" (empty)}.
+ * Default value is {@code "^$"}.
  * </li>
  * <li>
  * Property {@code max} - Specify the maximum line length allowed.


Test patch:
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java
--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java
@@ -1096,7 +1096,7 @@ else if (fieldClass == boolean.class) {
             }
             else if (fieldClass == int.class) {
                 if (value.equals(Integer.MAX_VALUE)) {
-                    result = "java.lang.Integer.MAX_VALUE";
+                    result = "2147483647";
                 }
                 else {
                     result = value.toString();
@@ -1211,10 +1211,6 @@ else if (fieldClass == Pattern.class) {
                 if (value != null) {
                     result = '"' + value.toString().replace("\n", "\\n").replace("\t", "\\t")
                             .replace("\r", "\\r").replace("\f", "\\f") + '"';
-
-                    if ("\"^$\"".equals(result)) {
-                        result += " (empty)";
-                    }
                 }
             }
             else if (fieldClass == Pattern[].class) {