mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8164612: NoSuchMethodException when method name contains NULL or Latin-1 supplement character
String length needs to be updated when converting from unicode to utf8. Reviewed-by: kvn, coleenp
This commit is contained in:
parent
82bdf29022
commit
ed9adcbdfa
5 changed files with 81 additions and 50 deletions
|
@ -437,17 +437,15 @@ void StringTable::dump(outputStream* st, bool verbose) {
|
|||
st->print("%d: ", length);
|
||||
} else {
|
||||
ResourceMark rm(THREAD);
|
||||
int utf8_length;
|
||||
int utf8_length = length;
|
||||
char* utf8_string;
|
||||
|
||||
if (!is_latin1) {
|
||||
jchar* chars = value->char_at_addr(0);
|
||||
utf8_length = UNICODE::utf8_length(chars, length);
|
||||
utf8_string = UNICODE::as_utf8(chars, length);
|
||||
utf8_string = UNICODE::as_utf8(chars, utf8_length);
|
||||
} else {
|
||||
jbyte* bytes = value->byte_at_addr(0);
|
||||
utf8_length = UNICODE::utf8_length(bytes, length);
|
||||
utf8_string = UNICODE::as_utf8(bytes, length);
|
||||
utf8_string = UNICODE::as_utf8(bytes, utf8_length);
|
||||
}
|
||||
|
||||
st->print("%d: ", utf8_length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue