Index: modules/swing/src/test/api/java/common/javax/swing/text/DefaultEditorKitTest.java =================================================================== --- modules/swing/src/test/api/java/common/javax/swing/text/DefaultEditorKitTest.java (revision 472428) +++ modules/swing/src/test/api/java/common/javax/swing/text/DefaultEditorKitTest.java (working copy) @@ -36,6 +36,7 @@ public class DefaultEditorKitTest extends EditorKitTest { + @Override protected void setUp() throws Exception { super.setUp(); @@ -129,6 +130,7 @@ inFile.close(); testExceptionalCase(new BadLocationCase() { + @Override public void exceptionalAction() throws Exception { kit.read(new ByteArrayInputStream(outFile.toByteArray()), doc, 1000); } @@ -160,6 +162,7 @@ inFile.close(); testExceptionalCase(new BadLocationCase() { + @Override public void exceptionalAction() throws Exception { kit.read(new InputStreamReader(new ByteArrayInputStream(outFile.toByteArray())), doc, 1000); } @@ -189,6 +192,7 @@ strRead); testExceptionalCase(new BadLocationCase() { + @Override public void exceptionalAction() throws Exception { kit.write(outputStream, doc, 0, 1000); } @@ -218,6 +222,7 @@ strRead); testExceptionalCase(new BadLocationCase() { + @Override public void exceptionalAction() throws Exception { kit.write(new OutputStreamWriter(outputStream), doc, 0, 1000); } @@ -232,10 +237,12 @@ final Marker flushMarker = new Marker(); final Marker closeMarker = new Marker(); StringWriter writer = new StringWriter() { + @Override public void close() throws IOException { closeMarker.setOccurred(); super.close(); } + @Override public void flush() { flushMarker.setOccurred(); super.flush(); @@ -255,10 +262,12 @@ final Marker flushMarker = new Marker(); final Marker closeMarker = new Marker(); OutputStream stream = new ByteArrayOutputStream() { + @Override public void close() throws IOException { closeMarker.setOccurred(); super.close(); } + @Override public void flush() throws IOException { flushMarker.setOccurred(); super.flush(); @@ -394,11 +403,4 @@ kit.write(outputStream, doc, pos, length); outputStream.close(); } - - - private abstract class BadLocationCase extends ExceptionalCase { - public Class expectedExceptionClass() { - return BadLocationException.class; - } - } } \ No newline at end of file