Investigate "ForIteration" behavior #774
Labels
area:dmn
Related to DMN
area:engine
Related to the runtime engines
type:enhancement
Something that already exists needs to be improved
type:tech-debt
Things that were left behind an may harm us in the future.
The current implementation of ForIteration has the following details
Iterator
for its operationsIterator
is not instantiated immediately, but delegated to aSupplier
iterator
is actually instantiated only whenhasNextValue
is invokediterator.hasNext()
return false, then the iterator is set tonull
getNextValue()
does not instantiate the iterator by itself, so if thehasNextValue()
has not been called before, it returnsnull
iterators
themselvesA quick experiment, removing the supplier and using the class to simple "facade" of the underlying iterator, lead to test failuers; e.g.
"for x in [ 10, 20, 30 ], y in [ 1, 2, 3 ] return x * y"
->
That could be the sympton that there is some existing logic, outside this class itself, that is based on the
null
object returned.The text was updated successfully, but these errors were encountered: