A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ReactiveX/RxJava/pull/6747 below:

Is it assumed that CompositeException is eligible to modify the cause of exceptions passed in constructor of CompositeException? · Issue #6747 · ReactiveX/RxJava · GitHub

Since RxJava modifies exceptions during call of getCause method of CompositeException instance and connect these exceptions in chains we have finally millions of exceptions and quickly getting out of memory.

    @Test
    public void compositeExceptionIssue() {
        Single
            .just(new Throwable("ROOT ERROR"))
            .flatMapCompletable(rootError -> Observable
                .range(1, 10)
                .flatMapCompletable(testNumber -> Completable
                    .mergeArrayDelayError(
                        Completable.error(new RuntimeException("Test#" + testNumber + "A", rootError)),
                        Completable.error(new RuntimeException("Test#" + testNumber + "B", rootError))
                    )
                    .doOnError(Throwable::getCause)
                    .onErrorComplete()
                )
                .doOnComplete(() -> {
                    rootError.printStackTrace();
                })
            )
            .blockingAwait();
    }

This simple test demonstrates that cause of rootError throwable is changed.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4