Skip to content

Commit 2f61391

Browse files
author
Brian Burkhalter
committed
8370387: Remove handling of InterruptedIOException from java.io classes
Reviewed-by: alanb
1 parent 4e8e55d commit 2f61391

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

src/java.base/share/classes/java/io/PrintStream.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -508,9 +508,6 @@ public void write(int b) {
508508
out.flush();
509509
}
510510
}
511-
catch (InterruptedIOException x) {
512-
Thread.currentThread().interrupt();
513-
}
514511
catch (IOException x) {
515512
trouble = true;
516513
}
@@ -541,9 +538,6 @@ public void write(byte[] buf, int off, int len) {
541538
out.flush();
542539
}
543540
}
544-
catch (InterruptedIOException x) {
545-
Thread.currentThread().interrupt();
546-
}
547541
catch (IOException x) {
548542
trouble = true;
549543
}
@@ -626,8 +620,6 @@ private void write(char[] buf) {
626620
}
627621
}
628622
}
629-
} catch (InterruptedIOException x) {
630-
Thread.currentThread().interrupt();
631623
} catch (IOException x) {
632624
trouble = true;
633625
}
@@ -649,9 +641,6 @@ private void writeln(char[] buf) {
649641
out.flush();
650642
}
651643
}
652-
catch (InterruptedIOException x) {
653-
Thread.currentThread().interrupt();
654-
}
655644
catch (IOException x) {
656645
trouble = true;
657646
}
@@ -668,9 +657,6 @@ private void write(String s) {
668657
out.flush();
669658
}
670659
}
671-
catch (InterruptedIOException x) {
672-
Thread.currentThread().interrupt();
673-
}
674660
catch (IOException x) {
675661
trouble = true;
676662
}
@@ -692,9 +678,6 @@ private void writeln(String s) {
692678
out.flush();
693679
}
694680
}
695-
catch (InterruptedIOException x) {
696-
Thread.currentThread().interrupt();
697-
}
698681
catch (IOException x) {
699682
trouble = true;
700683
}
@@ -711,9 +694,6 @@ private void newLine() {
711694
out.flush();
712695
}
713696
}
714-
catch (InterruptedIOException x) {
715-
Thread.currentThread().interrupt();
716-
}
717697
catch (IOException x) {
718698
trouble = true;
719699
}
@@ -1182,8 +1162,6 @@ public PrintStream format(String format, Object ... args) {
11821162
formatter = new Formatter((Appendable) this);
11831163
formatter.format(Locale.getDefault(Locale.Category.FORMAT), format, args);
11841164
}
1185-
} catch (InterruptedIOException x) {
1186-
Thread.currentThread().interrupt();
11871165
} catch (IOException x) {
11881166
trouble = true;
11891167
}
@@ -1238,8 +1216,6 @@ public PrintStream format(Locale l, String format, Object ... args) {
12381216
formatter = new Formatter(this, l);
12391217
formatter.format(l, format, args);
12401218
}
1241-
} catch (InterruptedIOException x) {
1242-
Thread.currentThread().interrupt();
12431219
} catch (IOException x) {
12441220
trouble = true;
12451221
}

src/java.base/share/classes/java/io/PrintWriter.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -460,8 +460,6 @@ public void write(int c) {
460460
try {
461461
ensureOpen();
462462
out.write(c);
463-
} catch (InterruptedIOException x) {
464-
Thread.currentThread().interrupt();
465463
} catch (IOException x) {
466464
trouble = true;
467465
}
@@ -484,8 +482,6 @@ public void write(char[] buf, int off, int len) {
484482
try {
485483
ensureOpen();
486484
out.write(buf, off, len);
487-
} catch (InterruptedIOException x) {
488-
Thread.currentThread().interrupt();
489485
} catch (IOException x) {
490486
trouble = true;
491487
}
@@ -517,8 +513,6 @@ public void write(String s, int off, int len) {
517513
try {
518514
ensureOpen();
519515
out.write(s, off, len);
520-
} catch (InterruptedIOException x) {
521-
Thread.currentThread().interrupt();
522516
} catch (IOException x) {
523517
trouble = true;
524518
}
@@ -541,8 +535,6 @@ private void newLine() {
541535
out.write(System.lineSeparator());
542536
if (autoFlush)
543537
out.flush();
544-
} catch (InterruptedIOException x) {
545-
Thread.currentThread().interrupt();
546538
} catch (IOException x) {
547539
trouble = true;
548540
}
@@ -973,8 +965,6 @@ public PrintWriter format(String format, Object ... args) {
973965
formatter.format(Locale.getDefault(), format, args);
974966
if (autoFlush)
975967
out.flush();
976-
} catch (InterruptedIOException x) {
977-
Thread.currentThread().interrupt();
978968
} catch (IOException x) {
979969
trouble = true;
980970
}
@@ -1032,8 +1022,6 @@ public PrintWriter format(Locale l, String format, Object ... args) {
10321022
formatter.format(l, format, args);
10331023
if (autoFlush)
10341024
out.flush();
1035-
} catch (InterruptedIOException x) {
1036-
Thread.currentThread().interrupt();
10371025
} catch (IOException x) {
10381026
trouble = true;
10391027
}

0 commit comments

Comments
 (0)