|
25 | 25 | public final class CharacterProperties { |
26 | 26 | private CharacterProperties() {} // all-static |
27 | 27 |
|
28 | | - private static final AtomicReferenceArray<UnicodeSet> sets = |
| 28 | + private static final AtomicReferenceArray<UnicodeSet> SETS = |
29 | 29 | new AtomicReferenceArray<>(UProperty.BINARY_LIMIT); |
30 | | - private static final AtomicReferenceArray<CodePointMap> maps = |
| 30 | + private static final AtomicReferenceArray<CodePointMap> MAPS = |
31 | 31 | new AtomicReferenceArray<>(UProperty.INT_LIMIT - UProperty.INT_START); |
32 | 32 |
|
33 | 33 | private static UnicodeSet makeSet(int property) { |
@@ -130,12 +130,12 @@ public static final UnicodeSet getBinaryPropertySet(int property) { |
130 | 130 | throw new IllegalArgumentException( |
131 | 131 | "" + property + " is not a constant for a UProperty binary property"); |
132 | 132 | } |
133 | | - UnicodeSet set = sets.get(property); |
| 133 | + UnicodeSet set = SETS.get(property); |
134 | 134 | if (set == null) { |
135 | 135 | set = makeSet(property); |
136 | 136 | // Race is benign: frozen UnicodeSet is immutable, duplicate computation is harmless |
137 | | - if (!sets.compareAndSet(property, null, set)) { |
138 | | - set = sets.get(property); |
| 137 | + if (!SETS.compareAndSet(property, null, set)) { |
| 138 | + set = SETS.get(property); |
139 | 139 | } |
140 | 140 | } |
141 | 141 | return set; |
@@ -163,12 +163,12 @@ public static final CodePointMap getIntPropertyMap(int property) { |
163 | 163 | "" + property + " is not a constant for a UProperty int property"); |
164 | 164 | } |
165 | 165 | int idx = property - UProperty.INT_START; |
166 | | - CodePointMap map = maps.get(idx); |
| 166 | + CodePointMap map = MAPS.get(idx); |
167 | 167 | if (map == null) { |
168 | 168 | map = makeMap(property); |
169 | 169 | // Race is benign: CodePointMap is immutable, duplicate computation is harmless |
170 | | - if (!maps.compareAndSet(idx, null, map)) { |
171 | | - map = maps.get(idx); |
| 170 | + if (!MAPS.compareAndSet(idx, null, map)) { |
| 171 | + map = MAPS.get(idx); |
172 | 172 | } |
173 | 173 | } |
174 | 174 | return map; |
|
0 commit comments