On Mon, 11 Jul 2022 09:28:22 GMT, Prasanta Sadhukhan <[email protected]> 
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

Hm… there could be problem: **the counter isn't reset** when the function is 
called again. It's reset only when the limit is reached. Or do I miss another 
case where the counter is reset?

The easiest way could be to introduce a helper function which is called from 
the main function that breaks the message and to which the recursion counter is 
passed as a parameter.

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

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

Reply via email to