Add automatic linter (#4214)

This commit is contained in:
acbin
2023-06-09 20:05:14 +08:00
committed by GitHub
parent 00282efd8b
commit 415a04ea7f
188 changed files with 661 additions and 1133 deletions

View File

@ -43,8 +43,7 @@ public class BufferedReader {
public BufferedReader(InputStream input, int bufferSize) throws IOException {
this.input = input;
if (input.available() == -1)
throw new IOException("Empty or already closed stream provided");
if (input.available() == -1) throw new IOException("Empty or already closed stream provided");
this.bufferSize = bufferSize;
buffer = new byte[bufferSize];
@ -90,14 +89,10 @@ public class BufferedReader {
public int peek(int n) throws IOException {
int available = available();
if (n >= available)
throw new IOException(
"Out of range, available %d, but trying with %d".formatted(available, n));
if (n >= available) throw new IOException("Out of range, available %d, but trying with %d".formatted(available, n));
pushRefreshData();
if (n >= bufferSize)
throw new IllegalAccessError(
"Cannot peek %s, maximum upto %s (Buffer Limit)".formatted(n, bufferSize));
if (n >= bufferSize) throw new IllegalAccessError("Cannot peek %s, maximum upto %s (Buffer Limit)".formatted(n, bufferSize));
return buffer[n];
}