Index: api/java/common/javax/swing/text/GapContentTest.java =================================================================== --- api/java/common/javax/swing/text/GapContentTest.java (revision 453197) +++ api/java/common/javax/swing/text/GapContentTest.java (working copy) @@ -279,6 +279,23 @@ assertEquals(12, pos.getOffset()); } + public void testShiftEnd_NegativeSize() throws Exception { + // Regression test for Harmony-1753 + GC localGapContent = new GC(); + localGapContent.testShifEnd(-1); + } + + class GC extends GapContent { + public GC() { + super(); + } + + public void testShifEnd(int sh) { + super.shiftEnd(sh); + } + } + + public static int getIndex(final Position pos) { try { Field f = pos.getClass().getDeclaredField("index");