FunctionalJava app throws StackOverflowError with Stream in stack trace
-
13-06-2021 - |
Domanda
FunctionalJava app throws StackOverflowError with Stream in stack trace, but the app doesn't (seemingly) use stream. What could be the cause?
Soluzione
Possibly some other datastructure is useing Stream behind the scenes, which can use massive recursion.
The suspect in my case was IterableW
, when using wrap
and bind
on native Java Iterables
. Instead that, I used fj.List.iterableList
to convert a finite Iterable
to a fj.List
, which has effective bind
operation.
Altri suggerimenti
There is a pull request to fix this on github.
If this is biting you, perhaps you could try that fix, and vote +1 on merging it if it works for you?
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow