[
https://jira.codehaus.org/browse/MCLIRR-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dennis Lundberg closed MCLIRR-36.
---------------------------------
Resolution: Fixed
Fix Version/s: 2.4
Assignee: Dennis Lundberg
Patch applied in [r16062|http://fisheye.codehaus.org/changelog/mojo/?cs=16062].
Thanks for the patch and test case!
> AbstractClirrMojo.reportDiffs crashes with ArrayIndexOutOfBoundsException
> while handling CheckerException
> ---------------------------------------------------------------------------------------------------------
>
> Key: MCLIRR-36
> URL: https://jira.codehaus.org/browse/MCLIRR-36
> Project: Maven 2.x Clirr Plugin
> Issue Type: Bug
> Affects Versions: 2.3
> Reporter: SebbASF
> Assignee: Dennis Lundberg
> Fix For: 2.4
>
> Attachments: clirr-skip-bad-classes.patch, commons-sanselan-0.98.zip,
> MCLIRR-36.patch
>
>
> Sample crash analysing Commons Math trunk:
> {code}
> [INFO] [clirr:clirr {execution: default-cli}]
> [INFO] Comparing to version: 2.1
> [ERROR] Unable to find information in class
> org.apache.commons.math.analysis.solvers.LaguerreSolver referring back to
> nested class org.apache.commons.
> math.analysis.solvers.LaguerreSolver$1
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] 558
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.ArrayIndexOutOfBoundsException: 558
> at
> org.codehaus.mojo.clirr.AbstractClirrMojo.reportDiffs(AbstractClirrMojo.java:666)
> at
> org.codehaus.mojo.clirr.AbstractClirrMojo.executeClirr(AbstractClirrMojo.java:263)
> at org.codehaus.mojo.clirr.ClirrReport.doReport(ClirrReport.java:243)
> at org.codehaus.mojo.clirr.ClirrReport.generate(ClirrReport.java:219)
> at org.codehaus.mojo.clirr.ClirrReport.generate(ClirrReport.java:355)
> at org.codehaus.mojo.clirr.ClirrReport.doExecute(ClirrReport.java:182)
> at
> org.codehaus.mojo.clirr.AbstractClirrMojo.execute(AbstractClirrMojo.java:200)
> {code}
> The source code at this point is:
> {code}
> // remove class with errors
> JavaType[] origClasses2 = new JavaType[origClasses.length - 1];
> int j = 0;
> for ( int i = 0; i < origClasses.length; i++ )
> {
> if ( !e.getMessage().endsWith( origClasses[i].getName() ) )
> {
> origClasses2[j++] = origClasses[i]; // <== Line 666
> }
> }
> {code}
> It's not clear why the output array is sized one less than the input array,
> but if every class passes the test and is stored, the output array will run
> off the end.
> The code immediately following has the same issue - the allocation of the
> output array is one less that the theoretical maximum required.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.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