8054562: document skip results in RunCodingRules.java
authorjlahoda
Mon, 16 May 2016 15:41:20 +0200
changeset 38510 3f450a95c68f
parent 38509 01582f186579
child 38511 d934635453ad
8054562: document skip results in RunCodingRules.java Summary: Documenting when RunCodingRules gets skipped; adding a short description of AssertCheckAnalyzer and MutableFieldsAnalyzer Reviewed-by: jjg
langtools/make/tools/crules/AssertCheckAnalyzer.java
langtools/make/tools/crules/MutableFieldsAnalyzer.java
langtools/test/tools/all/RunCodingRules.java
--- a/langtools/make/tools/crules/AssertCheckAnalyzer.java	Mon May 16 13:07:57 2016 +0100
+++ b/langtools/make/tools/crules/AssertCheckAnalyzer.java	Mon May 16 15:41:20 2016 +0200
@@ -37,6 +37,9 @@
 import com.sun.tools.javac.tree.TreeScanner;
 import com.sun.tools.javac.util.Assert;
 
+/**This analyzer guards against complex messages (i.e. those that use string concatenation) passed
+ * to various Assert.check methods.
+ */
 public class AssertCheckAnalyzer extends AbstractCodingRulesAnalyzer {
 
     enum AssertOverloadKind {
--- a/langtools/make/tools/crules/MutableFieldsAnalyzer.java	Mon May 16 13:07:57 2016 +0100
+++ b/langtools/make/tools/crules/MutableFieldsAnalyzer.java	Mon May 16 15:41:20 2016 +0200
@@ -41,6 +41,7 @@
 import static com.sun.tools.javac.code.Flags.SYNTHETIC;
 import static com.sun.tools.javac.code.Kinds.Kind.*;
 
+/**This analyzer guards against non-final static fields.*/
 public class MutableFieldsAnalyzer extends AbstractCodingRulesAnalyzer {
 
     public MutableFieldsAnalyzer(JavacTask task) {
--- a/langtools/test/tools/all/RunCodingRules.java	Mon May 16 13:07:57 2016 +0100
+++ b/langtools/test/tools/all/RunCodingRules.java	Mon May 16 15:41:20 2016 +0200
@@ -50,6 +50,17 @@
 
 import com.sun.tools.javac.util.Assert;
 
+/**
+ * This is a test to verify specific coding standards for source code in the langtools repository.
+ *
+ * As such, it is not a standard unit, regression or functional test, and will
+ * automatically skip if the langtools source code is not available.
+ *
+ * If the source code is available, it will find and compile the coding
+ * style analyzers found in langtools/make/tools/crules/*.java, and run the resulting
+ * code on all source files under langtools/src/share/classes. Any coding style
+ * violations will cause the test to fail.
+ */
 public class RunCodingRules {
     public static void main(String... args) throws Exception {
         new RunCodingRules().run();