[
https://jira.codehaus.org/browse/MCLIRR-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281994#comment-281994
]
Thomas Mortagne commented on MCLIRR-36:
---------------------------------------
I hit the same ArrayIndexOutOfBoundsException bug, in my case the reason seems
to be that in the previous version I have an anonymous inner class that I have
removed in the new version:
{code}
private static final List<Event> EVENTS = new ArrayList<Event>()
{
{
add(new DocumentUpdatedEvent());
add(new DocumentCreatedEvent());
}
};
{code}
Saying that because along with the Exception I also get:
{code}
[ERROR] Unable to locate enclosing class
com.xpn.xwiki.plugin.applicationmanager.ApplicationManagerPlugin for nested
class com.xpn.xwiki.plugin.applicationmanager.ApplicationManagerPlugin$1
{code}
Even if it's private it's the only inner class I can find in the previous or
new version.
> 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
> Attachments: 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.
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