RFR: 8224267: JOptionPane message string with 5000+ newlines produces StackOverflowError [v3]

Alexey Ivanov aivanov at openjdk.org
Mon Jul 11 10:10:47 UTC 2022


On Mon, 11 Jul 2022 09:28:22 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> BasicOptionPaneUI.addMessageComponents() uses recursion to split message strings at newlines, generating a StackOverflowError when the message string contains an unusually large number of newlines.
>> Fixed by catching StackOverflow and ignoring so that application is not stuck.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Format

Marked as reviewed by aivanov (Reviewer).

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java line 480:

> 478:                 }
> 479:                 // Prevent recursion of more than
> 480:                 // 200 successive newlines in a message

Not necessarily ‘successive’, but I'm nitpicking.

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

PR: https://git.openjdk.org/jdk/pull/9388



More information about the client-libs-dev mailing list