Skip to content

Commit

Permalink
8290162: Reset recursion counter missed in fix of JDK-8224267
Browse files Browse the repository at this point in the history
Reviewed-by: prr
  • Loading branch information
prsadhuk committed Jul 13, 2022
1 parent 31f7fc0 commit 6e18883
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -374,6 +374,7 @@ protected Container createMessageArea() {
"OptionPane.messageAnchor", GridBagConstraints.CENTER);
cons.insets = new Insets(0,0,3,0);

recursionCount = 0;
addMessageComponents(body, cons, getMessage(),
getMaxCharactersPerLineCount(), false);
top.add(realBody, BorderLayout.CENTER);
Expand Down Expand Up @@ -478,8 +479,11 @@ public Dimension getPreferredSize() {
}
// Prevent recursion of more than
// 200 successive newlines in a message
// and indicate message is truncated via ellipsis
if (recursionCount++ > 200) {
recursionCount = 0;
addMessageComponents(container, cons, new String("..."),
maxll,false);
return;
}
addMessageComponents(container, cons, s.substring(nl + nll), maxll,
Expand Down
Expand Up @@ -22,7 +22,7 @@
*/

/* @test
@bug 8224267
@bug 8224267 8290162
@key headful
@summary Verifies if StackOverflowError is not thrown for multiple newlines
@run main TestOptionPaneStackOverflow
Expand Down

1 comment on commit 6e18883

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.