You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2020/02/12 22:34:00 UTC

[maven-checkstyle-plugin] branch MCHECKSTYLE-289 updated (e4aec5b -> b7fba80)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch MCHECKSTYLE-289
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git.


 discard e4aec5b  [MCHECKSTYLE-289] enableRulesSummary option does not show Rules with default configuration
     add 6abad1c  [MCHECKSTYLE-353] - Don't resolve any dependencies
     add 850f7cc  [MCHECKSTYLE-375] - update all xml doctypes to latest
     add dc72922  [maven-release-plugin] prepare release maven-checkstyle-plugin-3.1.0
     add b1ad0bb  [maven-release-plugin] prepare for next development iteration
     add d5eb0d0  POM cleanup: parent pom contains everything and even updates
     add a7f6a5d  [MCHECKSTYLE-54] Ensure files EOL matches Systems lineseparator (must also apply when downloading source-release.zip, this is not a git issue)
     add 57cf969  using git now so remove this
     add d1d8bef  MCHECKSTYLE-364 Fix links
     add 77081ad  https://checkstyle.org
     add 7aaf8ed  Merge pull request #21 from elharo/elharo-patch-1
     add 4f8d5df  [MCHECKSTYLE-380] Fix link to issue management
     add 10c6298  Drop Java 9, 10, 12 - add 13, 14 to Jenkins test matrix
     add a33deb4  The wiki pn codehaus is no more
     add 2485ea7  Merge pull request #20 from elharo/patch-1
     add 3a8d555  [MCHECKSTYLE-371]: Add logViolationCountToConsole option to check goal
     add 26848dc  Merge pull request #12 from srdo/MCHECKSTYLE-371
     add eae07f9  [MCHECKSTYLE-381] make call to checker.setClassLoader() optional.
     add f0b96ab  [MCHECKSTYLE-388] Upgrade dependencies
     add e1e2f28  MCHECKSTYLE-384 Bump checkstyle to 8.28
     add c427a30  [MCHECKSTYLE-390] Upgrade to checkstyle 8.29
     add de614e3  [MCHECKSTYLE-389] Partial revert of MCHECKSTYLE-365 severity change back to 'null' default
     add bc0785d  [MCHECKSTYLE-391] Update parent to 34
     add eb47fac  added reproducible build output timestamp property
     add 104b560  [maven-release-plugin] prepare release maven-checkstyle-plugin-3.1.1
     add 0a32454  [maven-release-plugin] prepare for next development iteration
     new b7fba80  [MCHECKSTYLE-289] enableRulesSummary option does not show Rules with default configuration

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (e4aec5b)
            \
             N -- N -- N   refs/heads/MCHECKSTYLE-289 (b7fba80)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Jenkinsfile                                        |   2 +-
 pom.xml                                            |  47 +++-----
 src/it/MCHECKSTYLE-129/pom.xml                     |   2 +-
 src/it/MCHECKSTYLE-131/checkstyle.xml              |   2 +-
 src/it/MCHECKSTYLE-137/checkstyle.xml              |   2 +-
 .../build-tools/checkstyle-suppressions.xml        |   4 +-
 .../com/company/build-tools/checkstyle.xml         |   4 +-
 .../checkstyle-with-charset.xml                    |   2 +-
 .../checkstyle-without-charset.xml                 |   2 +-
 src/it/MCHECKSTYLE-193/checkstyle.xml              |   2 +-
 .../checkstyle.xml                                 |   4 +-
 .../checkstyle.xml                                 |   4 +-
 src/it/MCHECKSTYLE-338/checkstyle.xml              |   2 +-
 src/it/MCHECKSTYLE-347/checkstyle.xml              |   2 +-
 src/it/MCHECKSTYLE-357/pom.xml                     |  13 +--
 src/it/MCHECKSTYLE-365/verify.groovy               |   8 +-
 .../invoker.properties                             |   2 +-
 .../{MCHECKSTYLE-295 => MCHECKSTYLE-371}/pom.xml   |   9 +-
 .../src/test/resources}/MyClass.java               |   0
 .../verify.groovy                                  |   2 +-
 .../MyClass.java => MCHECKSTYLE-54/setup.groovy}   |  11 +-
 .../verify.groovy                                  |   9 +-
 .../verify.groovy                                  |   4 +-
 src/it/multi-modules-aggregate/maven_checks.xml    |  16 +--
 src/it/multimoduleproject/checkstyle-dekies.xml    |   2 +-
 .../checkstyle/AbstractCheckstyleReport.java       |   6 +-
 .../checkstyle/CheckstyleAggregateReport.java      |   2 +-
 .../maven/plugins/checkstyle/CheckstyleReport.java |   2 +-
 .../checkstyle/CheckstyleReportGenerator.java      |   9 +-
 .../checkstyle/CheckstyleViolationCheckMojo.java   |  30 +++--
 .../maven/plugins/checkstyle/ReportResource.java   |   2 +-
 .../checkstyle/exec/CheckstyleCheckerListener.java |   2 +-
 .../checkstyle/exec/CheckstyleExecutor.java        |   2 +-
 .../exec/CheckstyleExecutorException.java          |   2 +-
 .../checkstyle/exec/CheckstyleExecutorRequest.java |   2 +-
 .../plugins/checkstyle/exec/CheckstyleResults.java |   2 +-
 .../checkstyle/exec/DefaultCheckstyleExecutor.java | 129 +++++++++++----------
 .../plugins/checkstyle/rss/VelocityTemplate.java   |   2 +-
 .../examples/custom-developed-checkstyle.apt.vm    |   8 +-
 .../apt/examples/custom-property-expansion.apt.vm  |   4 +-
 src/site/apt/examples/suppressions-filter.apt.vm   |   4 +-
 src/site/apt/index.apt.vm                          |   8 +-
 .../plugins/checkstyle/CheckstyleReportTest.java   |   2 +-
 .../CheckstyleViolationCheckMojoTest.java          |   2 +-
 .../plugins/checkstyle/ReportResourceTest.java     |   2 +-
 .../exec/CheckstyleReportListenerTest.java         |   2 +-
 .../checkstyle/exec/CheckstyleResultsTest.java     |   2 +-
 .../stubs/MavenProjectWithExceptionsStub.java      |   2 +-
 .../stubs/MavenProjectWithNoJxrPluginStub.java     |   2 +-
 .../checkstyle/stubs/MinMavenProjectStub.java      |   2 +-
 .../checkstyle/stubs/ModuleMavenProjectStub.java   |   2 +-
 .../checkstyle/stubs/MultiMavenProjectStub.java    |   2 +-
 52 files changed, 202 insertions(+), 191 deletions(-)
 copy src/it/{MCHECKSTYLE-357 => MCHECKSTYLE-371}/invoker.properties (97%)
 copy src/it/{MCHECKSTYLE-295 => MCHECKSTYLE-371}/pom.xml (87%)
 copy src/it/{check-fail/src/main/java/org => MCHECKSTYLE-371/src/test/resources}/MyClass.java (100%)
 copy src/it/{MCHECKSTYLE-220 => MCHECKSTYLE-371}/verify.groovy (87%)
 copy src/it/{MCHECKSTYLE-172/src/main/java/org/MyClass.java => MCHECKSTYLE-54/setup.groovy} (81%)
 copy src/it/{MCHECKSTYLE-219-no-license_success => MCHECKSTYLE-54}/verify.groovy (72%)


[maven-checkstyle-plugin] 01/01: [MCHECKSTYLE-289] enableRulesSummary option does not show Rules with default configuration

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MCHECKSTYLE-289
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git

commit b7fba80700ed7e4a367d65fa4f603e52f8d060cd
Author: Guillaume Boué <gb...@apache.org>
AuthorDate: Sat Apr 7 23:56:18 2018 +0200

    [MCHECKSTYLE-289] enableRulesSummary option does not show Rules with
    default configuration
    
    Add parameter to explicitly show rules without any violations in the
    Rules summary.
---
 src/it/MCHECKSTYLE-289/checkstyle.xml              | 27 +++++++++
 src/it/MCHECKSTYLE-289/pom.xml                     | 53 ++++++++++++++++++
 .../MCHECKSTYLE-289/src/main/java/org/MyClass.java | 26 +++++++++
 src/it/MCHECKSTYLE-289/verify.groovy               | 22 ++++++++
 .../checkstyle/AbstractCheckstyleReport.java       |  9 +++
 .../checkstyle/CheckstyleReportGenerator.java      | 24 ++++++--
 .../checkstyle/exec/CheckstyleModuleFactory.java   | 64 ++++++++++++++++++++++
 .../plugins/checkstyle/exec/CheckstyleResults.java | 11 ++++
 .../checkstyle/exec/DefaultCheckstyleExecutor.java |  9 ++-
 9 files changed, 237 insertions(+), 8 deletions(-)

diff --git a/src/it/MCHECKSTYLE-289/checkstyle.xml b/src/it/MCHECKSTYLE-289/checkstyle.xml
new file mode 100644
index 0000000..564a7ab
--- /dev/null
+++ b/src/it/MCHECKSTYLE-289/checkstyle.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+  <module name="TreeWalker">
+    <module name="OuterTypeFilename"/>
+  </module>
+  <!-- add module that is not a check to verify that it does not interfere -->
+  <module name="SuppressionCommentFilter"/>
+</module>
diff --git a/src/it/MCHECKSTYLE-289/pom.xml b/src/it/MCHECKSTYLE-289/pom.xml
new file mode 100644
index 0000000..1ad0dcb
--- /dev/null
+++ b/src/it/MCHECKSTYLE-289/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins.checkstyle</groupId>
+  <artifactId>mcheckstytle-289</artifactId>
+  <version>1.0</version>
+  <url>https://issues.apache.org/jira/browse/MCHECKSTYLE-289</url>
+  <description>Tests that setting skipEmptyViolationRules to false correctly shows rules with no violations</description>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>@pom.version@</version>
+        <configuration>
+          <configLocation>checkstyle.xml</configLocation>
+          <skipEmptyViolationRules>false</skipEmptyViolationRules>
+        </configuration>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>checkstyle</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+</project>
diff --git a/src/it/MCHECKSTYLE-289/src/main/java/org/MyClass.java b/src/it/MCHECKSTYLE-289/src/main/java/org/MyClass.java
new file mode 100644
index 0000000..967d603
--- /dev/null
+++ b/src/it/MCHECKSTYLE-289/src/main/java/org/MyClass.java
@@ -0,0 +1,26 @@
+package org;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * My Class.
+ */
+public class MyClass {
+}
diff --git a/src/it/MCHECKSTYLE-289/verify.groovy b/src/it/MCHECKSTYLE-289/verify.groovy
new file mode 100644
index 0000000..c0f3700
--- /dev/null
+++ b/src/it/MCHECKSTYLE-289/verify.groovy
@@ -0,0 +1,22 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def html = new File( basedir, 'target/site/checkstyle.html' ).text;
+assert html =~ /(?s)<td>misc<\/td>.*?<td>.*?OuterTypeFilename.*?<\/td>.*?<td>0<\/td>/
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
index 85586f6..24cd30f 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
@@ -360,6 +360,14 @@ public abstract class AbstractCheckstyleReport
     private boolean enableRSS;
 
     /**
+     * Specifies if rules with no violations should be skipped from the Rules summary.
+     *
+     * @since 3.0.1
+     */
+    @Parameter( property = "checkstyle.skipEmptyViolationRules", defaultValue = "true" )
+    private boolean skipEmptyViolationRules;
+
+    /**
      * SiteTool.
      *
      * @since 2.2
@@ -740,6 +748,7 @@ public abstract class AbstractCheckstyleReport
         generator.setEnableSeveritySummary( enableSeveritySummary );
         generator.setEnableFilesSummary( enableFilesSummary );
         generator.setEnableRSS( enableRSS );
+        generator.setSkipEmptyViolationRules( skipEmptyViolationRules );
         generator.setCheckstyleConfig( results.getConfiguration() );
         if ( linkXRef )
         {
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
index aae277d..d179e81 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
@@ -65,6 +65,8 @@ public class CheckstyleReportGenerator
 
     private boolean enableFilesSummary;
 
+    private boolean skipEmptyViolationRules;
+
     private boolean enableRSS;
 
     private final SiteTool siteTool;
@@ -740,6 +742,16 @@ public class CheckstyleReportGenerator
         this.enableRSS = enableRSS;
     }
 
+    public boolean isSkipEmptyViolationRules()
+    {
+        return skipEmptyViolationRules;
+    }
+
+    public void setSkipEmptyViolationRules( boolean showEmptyViolationRules )
+    {
+        this.skipEmptyViolationRules = showEmptyViolationRules;
+    }
+
     public String getXrefLocation()
     {
         return xrefLocation;
@@ -814,24 +826,24 @@ public class CheckstyleReportGenerator
 
                 // count rule violations
                 long violations = 0;
-                AuditEvent lastMatchedEvent = null;
                 for ( List<AuditEvent> errors : results.getFiles().values() )
                 {
                     for ( AuditEvent event : errors )
                     {
                         if ( matchRule( event, ruleName, fixedmessage, configSeverity ) )
                         {
-                            lastMatchedEvent = event;
                             violations++;
                         }
                     }
                 }
 
-                if ( violations > 0 ) // forget rules without violations
+                if ( violations > 0 || !skipEmptyViolationRules ) // forget rules without violations when not requested
                 {
-                    String category = RuleUtil.getCategory( lastMatchedEvent );
-
-                    result.add( new ConfReference( category, childConfig, parent, violations, result.size() ) );
+                    String category = RuleUtil.getCategory( results.getModuleNameMap().get( ruleName ) );
+                    if ( category != null )
+                    {
+                        result.add( new ConfReference( category, childConfig, parent, violations, result.size() ) );
+                    }
                 }
             }
         }
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleModuleFactory.java b/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleModuleFactory.java
new file mode 100644
index 0000000..a5ba0fd
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleModuleFactory.java
@@ -0,0 +1,64 @@
+package org.apache.maven.plugins.checkstyle.exec;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import com.puppycrawl.tools.checkstyle.PackageObjectFactory;
+import com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter;
+import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
+
+/**
+ * Extension of the package object factory, which remembers the check class name from a given name.
+ *
+ * @author gboue
+ */
+public class CheckstyleModuleFactory
+    extends PackageObjectFactory
+{
+
+    private Map<String, String> moduleNameMap = new ConcurrentHashMap<>();
+
+    public CheckstyleModuleFactory( Set<String> packageNames, ClassLoader moduleClassLoader )
+    {
+        super( packageNames, moduleClassLoader );
+    }
+
+    @Override
+    public Object createModule( String name )
+        throws CheckstyleException
+    {
+        Object module = super.createModule( name );
+        if ( module instanceof AbstractViolationReporter )
+        {
+            moduleNameMap.put( name, module.getClass().getName() );
+        }
+        return module;
+    }
+
+    public Map<String, String> getModuleNameMap()
+    {
+        return Collections.unmodifiableMap( moduleNameMap );
+    }
+
+}
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResults.java b/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResults.java
index a82870f..6a85098 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResults.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResults.java
@@ -38,6 +38,7 @@ import java.util.Map;
 public class CheckstyleResults
 {
     private Map<String, List<AuditEvent>> files;
+    private Map<String, String> moduleNameMap;
 
     private Configuration configuration;
 
@@ -141,4 +142,14 @@ public class CheckstyleResults
     {
         this.configuration = configuration;
     }
+
+    public Map<String, String> getModuleNameMap()
+    {
+        return moduleNameMap;
+    }
+
+    public void setModuleNameMap( Map<String, String> moduleNameMap )
+    {
+        this.moduleNameMap = moduleNameMap;
+    }
 }
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java b/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
index ce7f213..44177e5 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
@@ -158,7 +158,10 @@ public class DefaultCheckstyleExecutor
 
         setUpCheckstyleClassloader( checker, classPathStrings, outputDirectories );
 
-        checker.setModuleClassLoader( Thread.currentThread().getContextClassLoader() );
+        ClassLoader moduleClassLoader = Thread.currentThread().getContextClassLoader();
+        CheckstyleModuleFactory moduleFactory =
+            new CheckstyleModuleFactory( PackageNamesLoader.getPackageNames( moduleClassLoader ), moduleClassLoader );
+        checker.setModuleFactory( moduleFactory );
 
         if ( filterSet != null )
         {
@@ -255,7 +258,9 @@ public class DefaultCheckstyleExecutor
             }
         }
 
-        return checkerListener.getResults();
+        CheckstyleResults results = checkerListener.getResults();
+        results.setModuleNameMap( moduleFactory.getModuleNameMap() );
+        return results;
     }
 
     private void setUpCheckstyleClassloader( Checker checker,