Skip to content

Commit 0ee75dc

Browse files
committed
Simplify DataInputStream UTF exceptions
1 parent 9661e4d commit 0ee75dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

vm/JavaAPI/src/java/io/DataInputStream.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,25 +200,25 @@ private static String decode(byte[] in, char[] out, int offset, int utfSize) thr
200200
s++;
201201
} else if (((a = out[s]) & 0xe0) == 0xc0) {
202202
if (count >= utfSize) {
203-
throw new UTFDataFormatException("bad second byte");
203+
throw new UTFDataFormatException();
204204
}
205205
int b = in[offset + count++];
206206
if ((b & 0xC0) != 0x80) {
207-
throw new UTFDataFormatException("bad second byte");
207+
throw new UTFDataFormatException();
208208
}
209209
out[s++] = (char) (((a & 0x1F) << 6) | (b & 0x3F));
210210
} else if ((a & 0xf0) == 0xe0) {
211211
if (count + 1 >= utfSize) {
212-
throw new UTFDataFormatException("bad third byte");
212+
throw new UTFDataFormatException();
213213
}
214214
int b = in[offset + count++];
215215
int c = in[offset + count++];
216216
if (((b & 0xC0) != 0x80) || ((c & 0xC0) != 0x80)) {
217-
throw new UTFDataFormatException("bad second or third byte");
217+
throw new UTFDataFormatException();
218218
}
219219
out[s++] = (char) (((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F));
220220
} else {
221-
throw new UTFDataFormatException("bad byte");
221+
throw new UTFDataFormatException();
222222
}
223223
}
224224
return new String(out, 0, s);

0 commit comments

Comments
 (0)