(@NotNull K key)
| 604 | } |
| 605 | |
| 606 | public final @Nullable V get(@NotNull K key) { |
| 607 | var currentT = Transaction.getCurrent(); |
| 608 | assert currentT != null; |
| 609 | //noinspection ConstantValue |
| 610 | if (key == null) |
| 611 | throw new IllegalArgumentException("key is null"); |
| 612 | |
| 613 | var tkey = new TableKey(getId(), key); |
| 614 | var cr = currentT.getRecordAccessed(tkey); |
| 615 | if (cr != null) { |
| 616 | @SuppressWarnings("unchecked") |
| 617 | var r = (V)cr.newestValue(); |
| 618 | return r; |
| 619 | } |
| 620 | |
| 621 | var r = load(key); |
| 622 | var v = r.strongRef; |
| 623 | currentT.addRecordAccessed(r.record.createRootInfoIfNeed(tkey), |
| 624 | new RecordAccessed(r), |
| 625 | v == null && isMemory()); |
| 626 | return v; |
| 627 | } |
| 628 | |
| 629 | public final boolean contains(@NotNull K key) { |
| 630 | return get(key) != null; |
no test coverage detected