diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/BMPSet.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/BMPSet.java index cbb39eac44..4b61bb526b 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/BMPSet.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/BMPSet.java @@ -316,8 +316,8 @@ public final class BMPSet { */ private static void set32x64Bits(int[] table, int start, int limit) { assert (64 == table.length); - int lead = start >> 6; - int trail = start & 0x3f; + int lead = start >> 6; // Named for UTF-8 2-byte lead byte with upper 5 bits. + int trail = start & 0x3f; // Named for UTF-8 2-byte trail byte with lower 6 bits. // Set one bit indicating an all-one block. int bits = 1 << lead; @@ -353,6 +353,10 @@ public final class BMPSet { table[trail] |= bits; } } + // limit<=0x800. If limit==0x800 then limitLead=32 and limitTrail=0. + // In that case, bits=1<