Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3070,7 +3070,6 @@ public boolean equals(@Nullable Object o) {
}

@Override
@SuppressWarnings("NullAway")
public int hashCode() {
@Var int hash = 0;
long now = expirationTicker().read();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ static Duration parseIsoDuration(String key, String value) {

/** Returns a parsed duration using the simple time unit format. */
static Duration parseSimpleDuration(String key, String value) {
@SuppressWarnings("NullAway")
long duration = parseLong(key, value.substring(0, value.length() - 1));
TimeUnit unit = parseTimeUnit(key, value);
return Duration.ofNanos(unit.toNanos(duration));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public boolean isAsync() {
}

@Override
@SuppressWarnings("NullAway")
public @Nullable Expiry<K, V> expiry() {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ public void getAllFunction_iterable_empty(AsyncCache<Int, Int> cache, CacheConte
assertThat(result).isExhaustivelyEmpty();
}

@SuppressWarnings("NullAway")
@Test(dataProvider = "caches")
@CacheSpec(removalListener = { Listener.DISABLED, Listener.REJECTING })
public void getAllFunction_nullLookup(AsyncCache<Int, Int> cache, CacheContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public MapSubject(FailureMetadata metadata, @Nullable Map<?, ?> subject) {
this.actual = subject;
}

@SuppressWarnings("NullAway")
public static Factory<MapSubject, Map<?, ?>> map() {
return MapSubject::new;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CaffeinatedGuavaCache<K, V> implements Cache<K, V>, Serializable {
}

@Override
@SuppressWarnings({"NullAway", "PMD.ExceptionAsFlowControl", "PMD.PreserveStackTrace"})
@SuppressWarnings({"PMD.ExceptionAsFlowControl", "PMD.PreserveStackTrace"})
public V get(K key, Callable<? extends V> valueLoader) throws ExecutionException {
requireNonNull(valueLoader);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class CaffeinatedGuavaLoadingCache<K, V>
}

@Override
@SuppressWarnings({"NullAway", "PMD.PreserveStackTrace"})
@SuppressWarnings("PMD.PreserveStackTrace")
public V get(K key) throws ExecutionException {
requireNonNull(key);
try {
Expand All @@ -74,7 +74,7 @@ public V get(K key) throws ExecutionException {
}

@Override
@SuppressWarnings({"CatchingUnchecked", "NullAway",
@SuppressWarnings({"CatchingUnchecked",
"PMD.AvoidCatchingNPE", "PMD.PreserveStackTrace"})
public V getUnchecked(K key) {
try {
Expand Down Expand Up @@ -117,7 +117,7 @@ public ImmutableMap<K, V> getAll(Iterable<? extends K> keys) throws ExecutionExc
}

@Override
@SuppressWarnings({"deprecation", "NullAway"})
@SuppressWarnings("deprecation")
public V apply(K key) {
return cache.get(key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public static Test suite() {
return cache.asMap();
})));
suite.addTest(MapTestFactory.suite("GuavaLoadingView", generator(() -> {
@SuppressWarnings("NullAway")
Cache<String, String> cache = CaffeinatedGuava.build(
Caffeine.newBuilder().maximumSize(Long.MAX_VALUE),
key -> { throw new AssertionError(); });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ public Map<K, V> getAll(Set<? extends K> keys) {
*/
protected Map<K, Expirable<V>> getAndFilterExpiredEntries(
Set<? extends K> keys, boolean updateAccessTime) {
// NullAway does not yet understand the @NonNull annotation in the return type of getAllPresent.
@SuppressWarnings("NullAway")
var result = new HashMap<K, Expirable<V>>(cache.getAllPresent(keys));

int[] expired = { 0 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public void loadAll(Set<? extends K> keys, boolean replaceExistingValues,
var future = CompletableFuture.runAsync(() -> {
try {
if (replaceExistingValues) {
@SuppressWarnings("NullAway")
Map<K, V> loaded = cacheLoader.orElseThrow().loadAll(keys);
for (var entry : loaded.entrySet()) {
putNoCopyOrAwait(entry.getKey(), entry.getValue(), /* publishToWriter= */ false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* @author [email protected] (Ben Manes)
*/
@NullMarked
@SuppressWarnings({"ImmutableMemberCollection", "JavaUtilDate", "JdkObsolete"})
@SuppressWarnings({"ImmutableMemberCollection", "JavaUtilDate"})
public abstract class AbstractCopier<A> implements Copier {
private static final Map<Class<?>, Function<Object, Object>> JAVA_DEEP_COPY = Map.of(Date.class,
o -> ((Date) o).clone(), GregorianCalendar.class, o -> ((GregorianCalendar) o).clone());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ public void canDeeplyCopy() {
}

@Test(dataProvider = "copier")
@SuppressWarnings({"JavaUtilDate", "JdkObsolete", "UndefinedEquals"})
@SuppressWarnings({"JavaUtilDate", "UndefinedEquals"})
public void deepCopy_date(Copier copier) {
var date = new Date();
assertThat(copy(copier, date)).isEqualTo(date);
}

@Test(dataProvider = "copier")
@SuppressWarnings({"JavaUtilDate", "JdkObsolete"})
@SuppressWarnings("JavaUtilDate")
public void deepCopy_calendar(Copier copier) {
var calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"), US);
calendar.setTime(new Date());
Expand Down
Loading