When using the StatisticsCollectionPass and printing the benchmark results, an ArrayIndexOutOfBoundsException is thrown.
I think this happenes because the MeasurementHolder from the StatisticsCollectionPass holds two measurements unlike the other Benchmarks which only hold one measurement. When they are converted into the table for printing, the MeasurementHolder is converted into a list with length 4 which doesn't align with the other lists with length 2.
Stack trace
Exception in thread "main" java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
at de.fraunhofer.aisec.codyze.specification_languages.mark.MarkExecutor.evaluate(MarkExecutor.kt:105)
at de.fraunhofer.aisec.codyze_core.Project.doStuff(Project.kt:35)
at de.fraunhofer.aisec.codyze.Analyze.run(SubcommandAnalyze.kt:37)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:198)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:18)
at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:400)
at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:397)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:415)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:440)
at de.fraunhofer.aisec.codyze.MainKt.main(Main.kt:85)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
at de.fraunhofer.aisec.cpg.helpers.MeasurementHolderKt.printMarkdown(MeasurementHolder.kt:90)
at de.fraunhofer.aisec.cpg.helpers.BenchmarkResults.print(MeasurementHolder.kt:51)
at de.fraunhofer.aisec.codyze.specification_languages.mark.MarkExecutor.evaluate$lambda-1(MarkExecutor.kt:64)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Code of interest
analyzer.analyze()
.thenApply {
it.benchmarkResults.print()
it
}
When using the
StatisticsCollectionPass
and printing the benchmark results, anArrayIndexOutOfBoundsException
is thrown. I think this happenes because theMeasurementHolder
from theStatisticsCollectionPass
holds two measurements unlike the otherBenchmark
s which only hold one measurement. When they are converted into the table for printing, theMeasurementHolder
is converted into a list with length 4 which doesn't align with the other lists with length 2.Stack trace
Code of interest
Changes to the configuration