Commit 0015376
committed
Replace ICU4J UCharacter methods with standard Java Character class
ICU4J 75.1 removed the char-taking overloads of UCharacter methods:
- isHighSurrogate(char) — removed (only isHighSurrogate(int) remains)
- isLowSurrogate(char) — removed (only isLowSurrogate(int) remains)
- getCodePoint(char, char) — removed (only getCodePoint(int, int) remains)
When code compiled against an older ICU4J (which had those methods) runs
with ICU4J 75.1, it throws NoSuchMethodError — because the bytecode
contains direct references to the removed method signatures.
Note: Code compiled against ICU4J 75.1 happens to work because Java’s
implicit widening conversion (char → int) binds to the int versions
at compile time. But that doesn’t help users of pre-compiled artifacts.
This change replaces all uses of those ICU4J methods with equivalent
methods from Java’s standard Character class (available since Java 5):
- UCharacter.isHighSurrogate(c) → Character.isHighSurrogate(c)
- UCharacter.isLowSurrogate(c) → Character.isLowSurrogate(c)
- UCharacter.getCodePoint(c1, c2) → Character.toCodePoint(c1, c2)1 parent e6afc7d commit 0015376
1 file changed
Lines changed: 5 additions & 6 deletions
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
106 | | - | |
| 105 | + | |
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
| |||
153 | 152 | | |
154 | 153 | | |
155 | 154 | | |
156 | | - | |
| 155 | + | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | | - | |
| 160 | + | |
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
165 | 164 | | |
166 | | - | |
167 | | - | |
| 165 | + | |
| 166 | + | |
168 | 167 | | |
169 | 168 | | |
170 | 169 | | |
| |||
0 commit comments