< prev index next >
src/java.base/share/classes/jdk/internal/jimage/ImageStringsReader.java
Print this page
*** 136,146 ****
char[] chars = new char[length];
try {
charsFromMUTF8(chars, bytes, offset, count);
} catch (UTFDataFormatException ex) {
! throw new InternalError("Attempt to convert non modified UTF-8 byte sequence");
}
return new String(chars);
}
--- 136,146 ----
char[] chars = new char[length];
try {
charsFromMUTF8(chars, bytes, offset, count);
} catch (UTFDataFormatException ex) {
! throw new InternalError("Attempt to convert non modified UTF-8 byte sequence", ex);
}
return new String(chars);
}
*** 184,203 ****
while ((uch & mask) != 0) {
ch = buffer.get();
if ((ch & 0xC0) != 0x80) {
! throw new InternalError("Bad continuation in modified UTF-8 byte sequence");
}
uch = ((uch & ~mask) << 6) | (ch & 0x3F);
mask <<= 6 - 1;
}
}
if ((uch & 0xFFFF) != uch) {
! throw new InternalError("UTF-32 char in modified UTF-8 byte sequence");
}
chars[j++] = (char)uch;
}
--- 184,205 ----
while ((uch & mask) != 0) {
ch = buffer.get();
if ((ch & 0xC0) != 0x80) {
! throw new InternalError("Bad continuation in " +
! "modified UTF-8 byte sequence: " + ch);
}
uch = ((uch & ~mask) << 6) | (ch & 0x3F);
mask <<= 6 - 1;
}
}
if ((uch & 0xFFFF) != uch) {
! throw new InternalError("UTF-32 char in modified UTF-8 " +
! "byte sequence: " + uch);
}
chars[j++] = (char)uch;
}
< prev index next >