Skip to content

Commit 6a6a302

Browse files
JakeWhartonakarnokd
authored andcommitted
Remove explicit StackOverflow check as its a VirtualMachineError. (#4391)
Looks like [the linked comment][1] was misinterpreted (but not in a way that affected the implementation) as Scala considered StackOverflowError as non-fatal but RxJava always considered it fatal. As such, its explicit check was redundant. [1]: #748 (comment)
1 parent 06eedea commit 6a6a302

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/java/io/reactivex/exceptions/Exceptions.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public static RuntimeException propagate(Throwable t) {
5252
* Throws a particular {@code Throwable} only if it belongs to a set of "fatal" error varieties. These
5353
* varieties are as follows:
5454
* <ul>
55-
* <li>{@code StackOverflowError}</li>
5655
* <li>{@code VirtualMachineError}</li>
5756
* <li>{@code ThreadDeath}</li>
5857
* <li>{@code LinkageError}</li>
@@ -68,9 +67,7 @@ public static RuntimeException propagate(Throwable t) {
6867
*/
6968
public static void throwIfFatal(Throwable t) {
7069
// values here derived from https://github.com/ReactiveX/RxJava/issues/748#issuecomment-32471495
71-
if (t instanceof StackOverflowError) {
72-
throw (StackOverflowError) t;
73-
} else if (t instanceof VirtualMachineError) {
70+
if (t instanceof VirtualMachineError) {
7471
throw (VirtualMachineError) t;
7572
} else if (t instanceof ThreadDeath) {
7673
throw (ThreadDeath) t;

0 commit comments

Comments
 (0)