Skip to content

Commit

Permalink
Move file creation upfront
Browse files Browse the repository at this point in the history
  • Loading branch information
prsadhuk committed Mar 8, 2024
1 parent c676c94 commit f3e6d0a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/jdk/javax/swing/text/BoxView/bug6494356.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public class bug6494356 {

public static void main(final String[] args) throws Exception {
final Path file = Path.of("bug6494356.html");

try (Writer writer = Files.newBufferedWriter(file)) {
writer.write("<p>Paragraph</p>");
}
try {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Expand All @@ -74,12 +76,6 @@ public void propertyChange(PropertyChangeEvent pce) {
f.setContentPane(ep);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
try (Writer writer = Files.newBufferedWriter(file)) {
writer.write("<p>Paragraph</p>");
} catch (Exception e) {
testPassed = false;
throw new RuntimeException(e);
}
try {
ep.setPage("file:" + file);
} catch (Exception ex) {
Expand Down

0 comments on commit f3e6d0a

Please sign in to comment.