Skip to content

Commit

Permalink
Added missing IOException to Reader.read(...) methods (#9933)
Browse files Browse the repository at this point in the history
This is technically a breaking change for GWT's API, but brings it
in line with the actual JRE.

Fixes #9915
  • Loading branch information
treblereel authored Jul 30, 2024
1 parent 594a326 commit 7f42724
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tools/api-checker/config/gwt211_212userapi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,8 @@ excludedPackages com.google.gwt.core.client.impl\
##############################################
#Api whitelist
# when adding to the white-list, include comments as to why the addition is
# being made.
# being made.

# java.io.Reader missing IOException throws for read methods
java.io.Reader::read([C) OVERRIDABLE_METHOD_EXCEPTION_TYPE_CHANGE new method has more exceptions: [Ljava/io/IOException;]
java.io.Reader::read([CII) OVERRIDABLE_METHOD_EXCEPTION_TYPE_CHANGE new method has more exceptions: [Ljava/io/IOException;]
4 changes: 2 additions & 2 deletions user/super/com/google/gwt/emul/java/io/Reader.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ public int read() throws IOException {
/**
* Attempts to fill {@code buf} with characters up to the size of the array.
*/
public int read(char[] buf) {
public int read(char[] buf) throws IOException {
return read(buf, 0, buf.length);
}

/**
* Attempts to fill {@code buf} with up to {@code len} characters. Characters
* will be stored in {@code buf} starting at index {@code off}.
*/
public abstract int read(char[] buf, int off, int len);
public abstract int read(char[] buf, int off, int len) throws IOException;

/**
* Returns whether the stream is ready for reading characters.
Expand Down

0 comments on commit 7f42724

Please sign in to comment.