[ 
http://jira.codehaus.org/browse/MOJO-498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_95195
 ] 

Nicholas Daley commented on MOJO-498:
-------------------------------------

I am using JXR 2.1.

JXR's report is fine.  The problem is with the link that the findbugs report 
makes to the JXR report.  The problem is that when the findbugs report is 
referring to a problem in an inner class, then the link to the code in the JXR 
includes $InnerClassName in the link.

e.g. 
My findbugs report lists a problem with a class 
'com.sailscience.actions.QuitAction$1'  (i.e. an anonymous inner class in 
QuitAction - though this happens with named inner classes too).
The href value that it uses for the link is 
'xref/com/sailscience/actions/QuitAction$1.html#77'
The href value that it should use is 
'xref/com/sailscience/actions/QuitAction.html#77'   (i.e. without the $1)
This is because JXR does not create a separate file for inner classes.
Without this change, clicking on the link for any problem in an inner class 
will bring up a 'Not Found' message in the browser.

The original reporter describes the change that is needed in the description of 
this issue.

> findbugs maven plugin: Link to JXR(=xref) incorrect for inner classes
> ---------------------------------------------------------------------
>
>                 Key: MOJO-498
>                 URL: http://jira.codehaus.org/browse/MOJO-498
>             Project: Mojo
>          Issue Type: Bug
>          Components: findbugs
>         Environment: Bug found on WinXP with maven 2.0.4 + maven find bugs 
> plugin 1.0-beta-1
>            Reporter: Olivier Vierlinck
>            Priority: Minor
>
> If a java file has an inner class which contain a 
> FindBugs error, the link generated from the FindFugs 
> report to the XRef (=JXR) source doc is invalid: the 
> url built by the findbugs Reporter is based on the 
> full class name of the inner class (for example 
> MyComponent$2 or MyComponent$MyInner) where the html 
> page is named with the outer class only (MyComponent 
> in this case, no '$' part)
> I think the line 
> final String path = prefix + Reporter.URL_SEPARATOR + 
> this.mCurrentClassName.replaceAll( "[.]", "/" ); 
> from assembleJXRHyperlink() method from 
> org.codehaus.mojo.findbugs.Reporter should be 
> modified with something like
> final String path = prefix + Reporter.URL_SEPARATOR + 
> this.mCurrentClassName.replaceAll
> ( "[.]", "/" ).replaceAll("\$.*",""); 
> (not tested!)

-- 
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

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to