(int index)
| 464 | } |
| 465 | |
| 466 | @Override |
| 467 | public L getAt(int index) { |
| 468 | if (size != Integer.MAX_VALUE) { |
| 469 | Preconditions.checkElementIndex(index, size()); |
| 470 | } // else no check necessary, all index values are valid |
| 471 | L existing = locks.get(index); |
| 472 | if (existing != null) { |
| 473 | return existing; |
| 474 | } |
| 475 | L created = supplier.get(); |
| 476 | existing = locks.putIfAbsent(index, created); |
| 477 | return MoreObjects.firstNonNull(existing, created); |
| 478 | } |
| 479 | |
| 480 | @Override |
| 481 | public int size() { |
nothing calls this directly
no test coverage detected