[ 
https://jira.codehaus.org/browse/MCHECKSTYLE-205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Herve Boutemy updated MCHECKSTYLE-205:
--------------------------------------

    Description: 
This worked in release 2.10, no longer works in 2.11. Running mvn site against 
a large project with a parent pom with many subprojects (though no code in the 
parent project) (andromda v3.5-SNAPSHOT, from sourceforge). Maven output:
{noformat}[INFO] Generating "Checkstyle" report    --- 
maven-checkstyle-plugin:2.12-SNAPSHOT
[INFO] Starting audit...
... About 6000 files ...
Audit done.

[INFO] There are 4777 checkstyle errors.
.... And no additional troubleshooting information, even in debug mode ...
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project 
andromda: Execution default-site of goal 
org.apache.maven.plugins:maven-site-plugin:3.3:site failed. 
NullPointerException -> [Help 1]

Caused by: java.lang.NullPointerException
        at java.lang.String.compareTo(String.java:1139)
        at java.lang.String.compareTo(String.java:108)
        at 
java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:290)
        at java.util.ComparableTimSort.sort(ComparableTimSort.java:171)
        at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
        at java.util.Arrays.sort(Arrays.java:472)
        at java.util.Collections.sort(Collections.java:155)
        at 
org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.doFilesSummary(CheckstyleReportGenerator.java:654)
        at 
org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.generateReport(CheckstyleReportGenerator.java:134){noformat}

I built version 2.12-SNAPSHOT locally, the NPE still exists. Running with 
version 2.10 - no NPE. The code attempts to run Collections.sort on a null key 
in the ArrayList from checkstyle results.getFiles().keySet(). This area of code 
was not modified in any of the previous revisions going into release 2.11. The 
results Collection is populated from DefaultCheckstyleExecutor.executeChecks 
calling sinkListener.addDirectory, but that method code also did not change 
over the last year.

This bug prevents us from using the latest checkstyle version. If the stack 
trace isn't enough to be able to add an extra null value check in 
executeChecks, I could run in debug mode and figure where the difference in 
values from 2.10 and 2.11 comes from, but it may be a little while before I can 
get to that.

  was:
This worked in release 2.10, no longer works in 2.11. Running mvn site against 
a large project with a parent pom with many subprojects (though no code in the 
parent project) (andromda v3.5-SNAPSHOT, from sourceforge). Maven output:
[INFO] Generating "Checkstyle" report    --- 
maven-checkstyle-plugin:2.12-SNAPSHOT
[INFO] Starting audit...
... About 6000 files ...
Audit done.

[INFO] There are 4777 checkstyle errors.
.... And no additional troubleshooting information, even in debug mode ...
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project 
andromda: Execution default-site of goal 
org.apache.maven.plugins:maven-site-plugin:3.3:site failed. 
NullPointerException -> [Help 1]

Caused by: java.lang.NullPointerException
        at java.lang.String.compareTo(String.java:1139)
        at java.lang.String.compareTo(String.java:108)
        at 
java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:290)
        at java.util.ComparableTimSort.sort(ComparableTimSort.java:171)
        at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
        at java.util.Arrays.sort(Arrays.java:472)
        at java.util.Collections.sort(Collections.java:155)
        at 
org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.doFilesSummary(CheckstyleReportGenerator.java:654)
        at 
org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.generateReport(CheckstyleReportGenerator.java:134)

I built version 2.12-SNAPSHOT locally, the NPE still exists. Running with 
version 2.10 - no NPE. The code attempts to run Collections.sort on a null key 
in the ArrayList from checkstyle results.getFiles().keySet(). This area of code 
was not modified in any of the previous revisions going into release 2.11. The 
results Collection is populated from DefaultCheckstyleExecutor.executeChecks 
calling sinkListener.addDirectory, but that method code also did not change 
over the last year.

This bug prevents us from using the latest checkstyle version. If the stack 
trace isn't enough to be able to add an extra null value check in 
executeChecks, I could run in debug mode and figure where the difference in 
values from 2.10 and 2.11 comes from, but it may be a little while before I can 
get to that.


> NPE in CheckstyleReportGenerator.doFilesSummary:654 version 2.11 regression
> ---------------------------------------------------------------------------
>
>                 Key: MCHECKSTYLE-205
>                 URL: https://jira.codehaus.org/browse/MCHECKSTYLE-205
>             Project: Maven Checkstyle Plugin
>          Issue Type: Bug
>    Affects Versions: 2.11
>         Environment: maven-checkstyle-plugin v2.11 and 2.12-SNAPSHOT (as of 
> 12/5/13). Windows 7, JDK7.45 64 bit, maven 3.1
>            Reporter: Bob Fields
>            Assignee: Dennis Lundberg
>             Fix For: 2.12
>
>         Attachments: CheckstyleResults.java.patch
>
>
> This worked in release 2.10, no longer works in 2.11. Running mvn site 
> against a large project with a parent pom with many subprojects (though no 
> code in the parent project) (andromda v3.5-SNAPSHOT, from sourceforge). Maven 
> output:
> {noformat}[INFO] Generating "Checkstyle" report    --- 
> maven-checkstyle-plugin:2.12-SNAPSHOT
> [INFO] Starting audit...
> ... About 6000 files ...
> Audit done.
> [INFO] There are 4777 checkstyle errors.
> .... And no additional troubleshooting information, even in debug mode ...
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project 
> andromda: Execution default-site of goal 
> org.apache.maven.plugins:maven-site-plugin:3.3:site failed. 
> NullPointerException -> [Help 1]
> Caused by: java.lang.NullPointerException
>       at java.lang.String.compareTo(String.java:1139)
>       at java.lang.String.compareTo(String.java:108)
>       at 
> java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:290)
>       at java.util.ComparableTimSort.sort(ComparableTimSort.java:171)
>       at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
>       at java.util.Arrays.sort(Arrays.java:472)
>       at java.util.Collections.sort(Collections.java:155)
>       at 
> org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.doFilesSummary(CheckstyleReportGenerator.java:654)
>       at 
> org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.generateReport(CheckstyleReportGenerator.java:134){noformat}
> I built version 2.12-SNAPSHOT locally, the NPE still exists. Running with 
> version 2.10 - no NPE. The code attempts to run Collections.sort on a null 
> key in the ArrayList from checkstyle results.getFiles().keySet(). This area 
> of code was not modified in any of the previous revisions going into release 
> 2.11. The results Collection is populated from 
> DefaultCheckstyleExecutor.executeChecks calling sinkListener.addDirectory, 
> but that method code also did not change over the last year.
> This bug prevents us from using the latest checkstyle version. If the stack 
> trace isn't enough to be able to add an extra null value check in 
> executeChecks, I could run in debug mode and figure where the difference in 
> values from 2.10 and 2.11 comes from, but it may be a little while before I 
> can get to that.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to