mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-09 23:50:22 +00:00
8378992: Case folding cache should not look up code point U+0000
Reviewed-by: sherman, rriggs
This commit is contained in:
parent
3531c78dea
commit
4d2c537189
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -188,6 +188,12 @@ public final class CaseFolding {
|
||||
}
|
||||
|
||||
private static long getDefined(int cp) {
|
||||
// Exclude code point U+0000, which is guaranteed to have no
|
||||
// case-folding mapping.
|
||||
if (cp == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var hashes = CASE_FOLDING_HASHES;
|
||||
var length = CASE_FOLDING_CPS.length; // hashed based on total defined.
|
||||
var hash = cp % length;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user