[ 
http://jira.codehaus.org/browse/MPMD-91?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Herve Boutemy closed MPMD-91.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.5

fixed in r939751: if no class name vailable, filename will be used instead

> pmd does not report correct file name for unneccessary imports
> --------------------------------------------------------------
>
>                 Key: MPMD-91
>                 URL: http://jira.codehaus.org/browse/MPMD-91
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 2.4
>         Environment: Maven version: 2.0.8
> Java version: 1.5.0_12
> OS name: "linux" version: "2.6.24-21-generic" arch: "i386" Family: "unix"
>            Reporter: Sean Bridges
>            Assignee: Herve Boutemy
>             Fix For: 2.5
>
>
> If I have a class Foo in package com.corp, with unused imports, {{mvn pmd:pmd 
> pmd:check}} reports,
> {noformat}
> PMD Failure: com.corp.5 Rule:UnusedImports Priority:4 Avoid unused imports 
> such as 'com.corp.bar.Bar'.
> {noformat}
> The report does not give the class name (Foo), merely the package and line 
> number.  Looking in {{pmd.xml}} we have,
> {code:xml}
> <file name="<filename>">
> <violation beginline="5" endline="5" begincolumn="1" endcolumn="78" 
> rule="UnusedImports" ruleset="Import Statement Rules" package="com.corp" 
> externalInfoUrl="http://pmd.sourceforge.net/rules/imports.html#UnusedImports"; 
> priority="4">
> Avoid unused imports such as 'com.corp.bar.Bar'
> </violation>
> </file>
> {code}
> pmd correctly does not report a class attribute in the violation element, 
> since the package imports are not associated with a class. 
> The mvn output doesn't tell me which file has the error.  If it tells me the 
> class name, I can find the file, but with the output above all I know is that 
> some file in the package com.corp has a pmd error.  If the class can't be 
> found, it would be nice to indicate the file name somehow.  
> It may be better to always show the filename rather than class name in the 
> mvn output.  The filename is what I am interested in seeing, and will always 
> be there.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to