I've got this error on the project which contains java 1.5
code with a lot of enums, inner and anonymous classes:
java.lang.ArrayIndexOutOfBoundsException: 2
at net.sourceforge.metrics.core.sources.
CompilationUnitMetrics.
addInnerClasses(CompilationUnitMetrics.java:100)
at net.sourceforge.metrics.core.sources.
CompilationUnitMetrics.
initializeChildren(CompilationUnitMetrics.java:88)
at net.sourceforge.metrics.core.sources.
AbstractMetricSource.recurse(AbstractMetricSource.
java:297)
at net.sourceforge.metrics.core.sources.
Dispatcher.calculateAbstractMetricSource(Dispatcher.
java:109)
at net.sourceforge.metrics.builder.
MetricsBuilder$ChangedCommand.
execute(MetricsBuilder.java:509)
at net.sourceforge.metrics.builder.
MetricsBuilder$CalculatorThread.run(MetricsBuilder.java:
713)
Logged In: YES
user_id=69377
what version of eclipse ?
what version of metrics ?
with what exemple of 1.5 source code ?
is it reproducable ?
some extra details would help a lot ... more than just a
stack trace
Logged In: NO
I'm getting the exact same thing using Metrics 1.3.6, Eclipse 3.3 and Java 6 (Eclipse is running under Java 6 and my project is set to 6.0 compliance level).
The exceptions are totally reproducible and only seem to be triggered by enums (inner, static inner and anonymous inner classes seem to work fine). Here is a code example that will trigger the exception:
public class MetricTest {
public enum TestEnum {
VALUE_1, VALUE_2;
}
}