Method
replaceValues
(String value, String newValue)
Source from the content-addressed store, hash-verified
| 265 | |
| 266 | // replace all values that match, return the count of those replaced |
| 267 | @SuppressWarnings("unused") |
| 268 | public int replaceValues(String value, String newValue) { |
| 269 | int changed = 0; |
| 270 | if (value == null) { |
| 271 | for (int i = 0; i < count; i++) { |
| 272 | if (data[i] == null) { |
| 273 | data[i] = newValue; |
| 274 | changed++; |
| 275 | } |
| 276 | } |
| 277 | } else { |
| 278 | for (int i = 0; i < count; i++) { |
| 279 | if (value.equals(data[i])) { |
| 280 | data[i] = newValue; |
| 281 | changed++; |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | return changed; |
| 286 | } |
| 287 | |
| 288 | |
| 289 | /** |
Callers
nothing calls this directly
Tested by
no test coverage detected