Index: modules/swing/src/test/api/java/common/javax/swing/text/PlainDocumentTest.java =================================================================== --- modules/swing/src/test/api/java/common/javax/swing/text/PlainDocumentTest.java (revision 454651) +++ modules/swing/src/test/api/java/common/javax/swing/text/PlainDocumentTest.java (working copy) @@ -23,6 +23,7 @@ import javax.swing.BasicSwingTestCase; import javax.swing.event.DocumentEvent.ElementChange; +import javax.swing.event.DocumentEvent.EventType; import javax.swing.text.AbstractDocument.AbstractElement; import javax.swing.text.AbstractDocument.BranchElement; import javax.swing.text.AbstractDocument.Content; @@ -393,6 +394,14 @@ checkOffsets(root.getElement(2), 18, 19); } + // Regression for HARMONY-1797 + public void testRemoveUpdate06() throws Exception { + doc = new PlainDocument(); + insert = doc.new DefaultDocumentEvent(3, 13, EventType.INSERT); + + doc.removeUpdate(insert); // No exception should be thrown + } + /** * Tests getParagraphElement when calling on empty document. */