Skip to content

Commit

Permalink
resolve qodana static analysis warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Apr 25, 2023
1 parent f56173a commit 1b841dc
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ void expireVariableEntries(long now) {
}
}

/** Returns the duration until the next item expires, or {@link Long.MAX_VALUE} if none. */
/** Returns the duration until the next item expires, or {@link Long#MAX_VALUE} if none. */
@GuardedBy("evictionLock")
long getExpirationDelay(long now) {
long delay = Long.MAX_VALUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ <K1 extends K, V1 extends V> Weigher<K1, V1> getWeigher(boolean isAsync) {
* {@link Cache#estimatedSize()}, but will never be visible to read or write operations; such
* entries are cleaned up as part of the routine maintenance described in the class javadoc.
* <p>
* This feature cannot be used in conjunction when {@link #weakKeys()} is combined with
* This feature cannot be used in conjunction when {@link #evictionListener()} is combined with
* {@link #buildAsync}.
*
* @return this {@code Caffeine} instance (for chaining)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ BiFunction<Set<? extends K>, Executor, CompletableFuture<Map<K, V>>> newBulkMapp
return (keysToLoad, executor) -> {
try {
@SuppressWarnings("unchecked")
var loaded = (CompletableFuture<Map<K, V>>) (Object) cacheLoader
.asyncLoadAll(keysToLoad, executor);
var loaded = (CompletableFuture<Map<K, V>>) cacheLoader.asyncLoadAll(keysToLoad, executor);
return loaded;
} catch (RuntimeException e) {
throw e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ static void soProducerLimit(BaseMpscLinkedArrayQueue<?> self, long v) {
* An ordered store(store + StoreStore barrier) of an element to a given offset
*
* @param buffer this.buffer
* @param offset computed via {@link org.jctools.util.UnsafeRefArrayAccess#calcElementOffset}
* @param offset computed
* @param e an orderly kitty
*/
static <E> void soElement(E[] buffer, long offset, E e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

/**
* A base class providing the mechanics for supporting dynamic striping of bounded buffers. This
* implementation is an adaption of the numeric 64-bit {@link java.util.concurrent.atomic.Striped64}
* implementation is an adaption of the numeric 64-bit <i>java.util.concurrent.atomic.Striped64</i>
* class, which is used by atomic counters. The approach was modified to lazily grow an array of
* buffers in order to minimize memory usage for caches that are not heavily contended on.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void unlink(Node<K, V> node) {
}
}

/** Returns the duration until the next bucket expires, or {@link Long.MAX_VALUE} if none. */
/** Returns the duration until the next bucket expires, or {@link Long#MAX_VALUE} if none. */
@SuppressWarnings("IntLongMath")
public long getExpirationDelay() {
for (int i = 0; i < SHIFT.length; i++) {
Expand Down Expand Up @@ -265,7 +265,7 @@ public long getExpirationDelay() {
}

/**
* Returns the duration when the wheel's next bucket expires, or {@link Long.MAX_VALUE} if empty.
* Returns the duration when the wheel's next bucket expires, or {@link Long#MAX_VALUE} if empty.
*
* @param index the timing wheel being operated on
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@

/**
* This package contains in-memory caching functionality. All cache variants are configured and
* created by using the {@link Caffeine} builder.
* created by using the {@link com.github.benmanes.caffeine.cache.Caffeine} builder.
* <p>
* A {@link Cache} provides similar characteristics as
* {@link java.util.concurrent.ConcurrentHashMap} with additional support for policies to bound the
* map by. When built with a {@link CacheLoader}, the {@link LoadingCache} variant allows the cache
* to populate itself on miss and offers refresh capabilities.
* map by. When built with a {@link com.github.benmanes.caffeine.cache.CacheLoader}, the
* {@link com.github.benmanes.caffeine.cache.LoadingCache} variant allows the cache to populate
* itself on miss and offers refresh capabilities.
* <p>
* A {@link AsyncCache} is similar to a {@link Cache} except that a cache entry holds a
* A {@link com.github.benmanes.caffeine.cache.AsyncCache} is similar to a
* {@link com.github.benmanes.caffeine.cache.Cache} except that a cache entry holds a
* {@link java.util.concurrent.CompletableFuture} of the value. This entry will be automatically
* removed if the future fails, resolves to {@code null}, or based on an eviction policy. When built
* with a {@link AsyncCacheLoader}, the {@link AsyncLoadingCache} variant allows the cache to
* populate itself on miss and offers refresh capabilities.
* with a {@link com.github.benmanes.caffeine.cache.AsyncCacheLoader}, the
* {@link com.github.benmanes.caffeine.cache.AsyncLoadingCache} variant allows the cache to populate
* itself on miss and offers refresh capabilities.
* <p>
* Additional functionality such as bounding by the entry's size, removal notifications, statistics,
* and eviction policies are described in the {@link Caffeine} builder.
* and eviction policies are described in the {@link com.github.benmanes.caffeine.cache.Caffeine}
* builder.
*
* @author ben.manes@gmail.com (Ben Manes)
*/
Expand Down
4 changes: 3 additions & 1 deletion qodana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ exclude:
- name: CastCanBeRemovedNarrowingVariableType
- name: CommentedOutCode
- name: ConstantValue
- name: DanglingJavadoc
- name: DataFlowIssue
- name: EmptyStatementBody
- name: EqualsWhichDoesntCheckParameterClass
- name: GrUnnecessarySemicolon
- name: GroovyEmptyStatementBody
- name: GroovyUnnecessaryReturn
- name: GrUnnecessarySemicolon
- name: IgnoreResultOfCall
- name: Java9CollectionFactory
- name: JavaAnnotator
- name: JavadocLinkAsPlainText
- name: JavaRequiresAutoModule
- name: NonSynchronizedMethodOverridesSynchronizedMethod
- name: NotNullFieldNotInitialized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,9 @@ private void validateStatus() {
/** Prints out the internal state of the policy. */
private void printClock() {
System.out.println("** CLOCK-Pro list HEAD (small recency) **");
System.out.println(listHead.toString());
System.out.println(listHead);
for (Node n = listHead.next; n != listHead; n = n.next) {
System.out.println(n.toString());
System.out.println(n);
}
System.out.println("** CLOCK-Pro list TAIL (large recency) **");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ private void validateStatus() {
/** Prints out the internal state of the policy. */
private void printClock() {
System.out.println("** CLOCK-Pro list HEAD (small recency) **");
System.out.println(listHead.toString());
System.out.println(listHead);
for (Node n = listHead.next; n != listHead; n = n.next) {
System.out.println(n.toString());
System.out.println(n);
}
System.out.println("** CLOCK-Pro list TAIL (large recency) **");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,21 +333,21 @@ private void printClock() {
if (sizeCold > 0) {
System.out.println("** CLOCK-Pro list COLD HEAD (small recency) **");
for (Node n = headCold.next; n != headCold; n = n.next) {
System.out.println(n.toString());
System.out.println(n);
}
System.out.println("** CLOCK-Pro list COLD TAIL (large recency) **");
}
if (sizeHot > 0) {
System.out.println("** CLOCK-Pro list HOT HEAD (small recency) **");
for (Node n = headHot.next; n != headHot; n = n.next) {
System.out.println(n.toString());
System.out.println(n);
}
System.out.println("** CLOCK-Pro list HOT TAIL (large recency) **");
}
if (sizeNR > 0) {
System.out.println("** CLOCK-Pro list NR HEAD (small recency) **");
for (Node n = headNonResident.next; n != headNonResident; n = n.next) {
System.out.println(n.toString());
System.out.println(n);
}
System.out.println("** CLOCK-Pro list NR TAIL (large recency) **");
}
Expand Down

0 comments on commit 1b841dc

Please sign in to comment.