RFR: 8351733: Crash when creating too many nested event loops [v5]

Andy Goryachev angorya at openjdk.org
Thu Mar 27 19:47:22 UTC 2025


On Thu, 27 Mar 2025 19:39:23 GMT, Martin Fox <mfox at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/javafx/application/Platform.java line 305:
>> 
>>> 303:      * other than the JavaFX Application Thread.
>>> 304:      *
>>> 305:      * @throws RuntimeException if this call would exceed the maximum
>> 
>> I wonder if there is a more specific subclass of `RuntimeException` that we could throw? Maybe `IllegalStateException`, which seems the closest in meaning and has the advantage that we already throw it in other cases.
>
> I'll have to wait for others to chime in on that question, I don't have much background in this area.

The `IllegalStateException` is the right one, as it states that it _"Signals that a method has been invoked at an illegal or inappropriate time."_

Another positive thing it will probably eliminate the need for a CSR as this method already throws one.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1741#discussion_r2017506290


More information about the openjfx-dev mailing list