The implementation uses a for loop that iterates over the threads attribute of the Parallel instance, throwing an ArrayIndexOutOfBoundsException if there are more threads than sections.
java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
at jromp.parallel.Parallel.sections(Parallel.java:237)
at jromp.parallel.Parallel.sections(Parallel.java:219)
at jromp.parallel.ParallelTests.testSectionsMoreThreadsThanSections(ParallelTests.java:92)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Describe the bug
The implementation uses a for loop that iterates over the
threads
attribute of theParallel
instance, throwing anArrayIndexOutOfBoundsException
if there are more threads than sections.https://github.com/java-romp/jromp/blob/4e5211c2487141861af51a06306080df06616332/src/main/java/jromp/parallel/Parallel.java#L220-L228
Library version(s) affected
0.0.1
Steps to reproduce
I created a test case that crashes.
Additional context, environment
No response
Logs