diff -r 7fd2a68f1318 -r b8c2433a9c34 jdk/test/javax/swing/undo/UndoManager/AbstractDocumentUndoConcurrentTest.java --- 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"); }