(MappedElementKind targetKind, int namespace, String name)
| 195 | } |
| 196 | |
| 197 | @Override |
| 198 | public void visitDstName(MappedElementKind targetKind, int namespace, String name) { |
| 199 | if (namespace != dstNs) return; |
| 200 | |
| 201 | switch (targetKind) { |
| 202 | case CLASS: |
| 203 | switch (fieldTarget) { |
| 204 | case MAPPED: |
| 205 | if (!cls.hasMappedName() || replace) { |
| 206 | if (ClassInstance.hasOuterName(name)) { |
| 207 | name = ClassInstance.getInnerName(name); |
| 208 | } |
| 209 | |
| 210 | cls.setMappedName(name); |
| 211 | } |
| 212 | |
| 213 | break; |
| 214 | case AUX: |
| 215 | case AUX2: |
| 216 | if (!cls.hasAuxName(fieldTarget.type.getAuxIndex()) || replace) { |
| 217 | if (ClassInstance.hasOuterName(name)) { |
| 218 | name = ClassInstance.getInnerName(name); |
| 219 | } |
| 220 | |
| 221 | cls.setAuxName(fieldTarget.type.getAuxIndex(), name); |
| 222 | } |
| 223 | |
| 224 | break; |
| 225 | case UID: |
| 226 | String prefix = env.getGlobal().classUidPrefix; |
| 227 | |
| 228 | if (!name.startsWith(prefix)) { |
| 229 | Matcher.LOGGER.warn("Invalid uid class name {}", name); |
| 230 | return; |
| 231 | } else { |
| 232 | int innerNameStart = name.lastIndexOf('$') + 1; |
| 233 | String uidStr; |
| 234 | |
| 235 | if (innerNameStart > 0) { |
| 236 | int subPrefixStart = prefix.lastIndexOf('/') + 1; |
| 237 | |
| 238 | if (!name.startsWith(prefix.substring(subPrefixStart), innerNameStart)) { |
| 239 | Matcher.LOGGER.warn("Invalid uid class name {}", name); |
| 240 | return; |
| 241 | } else { |
| 242 | uidStr = name.substring(innerNameStart + prefix.length() - subPrefixStart); |
| 243 | } |
| 244 | } else { |
| 245 | uidStr = name.substring(prefix.length()); |
| 246 | } |
| 247 | |
| 248 | int uid = Integer.parseInt(uidStr); |
| 249 | |
| 250 | if (uid < 0) { |
| 251 | Matcher.LOGGER.warn("Invalid class uid {}", uid); |
| 252 | return; |
| 253 | } else if (cls.getUid() < 0 || cls.getUid() > uid || replace) { |
| 254 | cls.setUid(uid); |
nothing calls this directly
no test coverage detected