8145787: [TEST_BUG][PIT] javax/swing/undo/UndoManager/AbstractDocumentUndoConcurrentTest.java fails with CannotUndoException
Reviewed-by: alexsch, serb
--- a/jdk/test/javax/swing/undo/UndoManager/AbstractDocumentUndoConcurrentTest.java Fri Apr 15 09:54:27 2016 +0300
+++ b/jdk/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");
}