changeset 14324:b0407f2af374

8145787: [TEST_BUG][PIT] javax/swing/undo/UndoManager/AbstractDocumentUndoConcurrentTest.java fails with CannotUndoException Reviewed-by: alexsch, serb
author ssadetsky
date Fri, 15 Apr 2016 09:59:36 +0300
parents d71511d28c7b
children 735a130dc8db
files test/javax/swing/undo/UndoManager/AbstractDocumentUndoConcurrentTest.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/swing/undo/UndoManager/AbstractDocumentUndoConcurrentTest.java	Fri Apr 15 09:54:27 2016 +0300
+++ b/test/javax/swing/undo/UndoManager/AbstractDocumentUndoConcurrentTest.java	Fri Apr 15 09:59:36 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -104,8 +104,12 @@
                     e.printStackTrace();
                 }
                 for (int i = 0; i < 1000; i++) {
-                    undoManager.undoOrRedo();
-                    undoManager.undo();
+                    if(undoManager.canUndoOrRedo()) {
+                        undoManager.undoOrRedo();
+                    }
+                    if(undoManager.canUndo()) {
+                        undoManager.undo();
+                    }
                 }
                 System.out.println("t3 done");
             }