Skip to content

Commit

Permalink
fix javadoc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Jul 15, 2024
1 parent 64a4560 commit 56a7055
Show file tree
Hide file tree
Showing 37 changed files with 88 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* padding may or may not have a visible effect.
* <p>
* This benchmark requires a JavaAgent to evaluate the object sizes and can be executed using
* <tt>gradle -q memoryOverhead</tt>.
* <code>gradle -q memoryOverhead</code>.
*
* @author ben.manes@gmail.com (Ben Manes)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public E next() {
return previous;
}

/** Retrieves the next element to traverse to or <tt>null</tt> if there are no more elements. */
/** Retrieves the next element to traverse to or {@code null} if there are no more elements. */
abstract @Nullable E computeNext();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ public void setNext(E e, @Nullable E next) {
interface AccessOrder<T extends AccessOrder<T>> {

/**
* Retrieves the previous element or <tt>null</tt> if either the element is unlinked or the
* Retrieves the previous element or {@code null} if either the element is unlinked or the
* first element on the deque.
*/
@Nullable T getPreviousInAccessOrder();

/** Sets the previous element or <tt>null</tt> if there is no link. */
/** Sets the previous element or {@code null} if there is no link. */
void setPreviousInAccessOrder(@Nullable T prev);

/**
* Retrieves the next element or <tt>null</tt> if either the element is unlinked or the last
* Retrieves the next element or {@code null} if either the element is unlinked or the last
* element on the deque.
*/
@Nullable T getNextInAccessOrder();

/** Sets the next element or <tt>null</tt> if there is no link. */
/** Sets the next element or {@code null} if there is no link. */
void setNextInAccessOrder(@Nullable T next);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1838,8 +1838,8 @@ void drainWriteBuffer() {
}

/**
* Atomically transitions the node to the <tt>dead</tt> state and decrements the
* <tt>weightedSize</tt>.
* Atomically transitions the node to the <code>dead</code> state and decrements the
* <code>weightedSize</code>.
*
* @param node the entry in the page replacement policy
*/
Expand Down Expand Up @@ -2827,7 +2827,7 @@ public void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
* remappingFunction to be statistics aware.
*
* @param key key with which the specified value is to be associated
* @param keyRef the key to associate with or a lookup only key if not <tt>computeIfAbsent</tt>
* @param keyRef the key to associate with or a lookup only key if not {@code computeIfAbsent}
* @param remappingFunction the function to compute a value
* @param expiry the calculator for the expiration time
* @param now the current time, according to the ticker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ final class FrequencySketch<E> {
public FrequencySketch() {}

/**
* Initializes and increases the capacity of this <tt>FrequencySketch</tt> instance, if necessary,
* Initializes and increases the capacity of this {@code FrequencySketch} instance, if necessary,
* to ensure that it can accurately estimate the popularity of elements given the maximum size of
* the cache. This operation forgets all previous counts when resizing.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* to support usage. They are not thread-safe; in the absence of external synchronization, they do
* not support concurrent access by multiple threads. Null elements are prohibited.
* <p>
* Most <tt>LinkedDeque</tt> operations run in constant time by assuming that the element parameter
* Most {@code LinkedDeque} operations run in constant time by assuming that the element parameter
* is associated with the deque instance. Any usage that violates this assumption will result in
* non-deterministic behavior.
* <p>
Expand Down Expand Up @@ -79,21 +79,21 @@ interface LinkedDeque<E> extends Deque<E> {
void moveToBack(E e);

/**
* Retrieves the previous element or <tt>null</tt> if either the element is unlinked or the first
* Retrieves the previous element or {@code null} if either the element is unlinked or the first
* element on the deque.
*/
@Nullable E getPrevious(E e);

/** Sets the previous element or <tt>null</tt> if there is no link. */
/** Sets the previous element or {@code null} if there is no link. */
void setPrevious(E e, @Nullable E prev);

/**
* Retrieves the next element or <tt>null</tt> if either the element is unlinked or the last
* Retrieves the next element or {@code null} if either the element is unlinked or the last
* element on the deque.
*/
@Nullable E getNext(E e);

/** Sets the next element or <tt>null</tt> if there is no link. */
/** Sets the next element or {@code null} if there is no link. */
void setNext(E e, @Nullable E next);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* elements are not copied on resize, instead a link to the new buffer is stored in the old buffer
* for the consumer to follow.<br>
* <p>
* This is a shaded copy of <tt>MpscGrowableArrayQueue</tt> provided by
* This is a shaded copy of <code>MpscGrowableArrayQueue</code> provided by
* <a href="https://github.com/JCTools/JCTools">JCTools</a> from version 2.0.
*
* @author nitsanw@yahoo.com (Nitsan Wakart)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ public void setPolicyWeight(@NonNegative int weight) {}
@GuardedBy("this")
public abstract boolean isDead();

/** Sets the node to the <tt>retired</tt> state. */
/** Sets the node to the <code>retired</code> state. */
@GuardedBy("this")
public abstract void retire();

/** Sets the node to the <tt>dead</tt> state. */
/** Sets the node to the <code>dead</code> state. */
@GuardedBy("this")
public abstract void die();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ public void setNext(E e, @Nullable E next) {
interface WriteOrder<T extends WriteOrder<T>> {

/**
* Retrieves the previous element or <tt>null</tt> if either the element is unlinked or the
* Retrieves the previous element or {@code null} if either the element is unlinked or the
* first element on the deque.
*/
@Nullable T getPreviousInWriteOrder();

/** Sets the previous element or <tt>null</tt> if there is no link. */
/** Sets the previous element or {@code null} if there is no link. */
void setPreviousInWriteOrder(@Nullable T prev);

/**
* Retrieves the next element or <tt>null</tt> if either the element is unlinked or the last
* Retrieves the next element or {@code null} if either the element is unlinked or the last
* element on the deque.
*/
@Nullable T getNextInWriteOrder();

/** Sets the next element or <tt>null</tt> if there is no link. */
/** Sets the next element or {@code null} if there is no link. */
void setNextInWriteOrder(@Nullable T next);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/**
* A {@link StatsCounter} implementation that suppresses and logs any exception thrown by the
* delegate <tt>statsCounter</tt>.
* delegate <code>statsCounter</code>.
*
* @author ben.manes@gmail.com (Ben Manes)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* thread. This harness can be used for performance tests, investigations of
* lock contention, etc.
* <p/>
* This code was adapted from <tt>Java Concurrency in Practice</tt>, using an
* This code was adapted from <code>Java Concurrency in Practice</code>, using an
* example of a {@link CountDownLatch} for starting and stopping threads in
* timing tests.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tasks.withType<JavaCompile>().configureEach {
languageVersion = maxOf(javaVersion, JavaLanguageVersion.of(17))
}

options.compilerArgs.addAll(listOf( "-Xlint:all", "-Xlint:-auxiliaryclass", "-Xlint:-classfile",
options.compilerArgs.addAll(listOf("-Xlint:all", "-Xlint:-auxiliaryclass", "-Xlint:-classfile",
"-Xlint:-exports", "-Xlint:-processing", "-Xlint:-removal", "-Xlint:-requires-automatic"))
if (javaVersion.canCompileOrRun(21)) {
options.compilerArgs.add("-proc:full")
Expand Down Expand Up @@ -80,6 +80,12 @@ tasks.jar {
tasks.withType<Javadoc>().configureEach {
isFailOnError = false
javadocOptions {
use()
quiet()
noTimestamp()
if (javaVersion.canCompileOrRun(18)) {
addStringOption("-link-modularity-mismatch", "info")
}
links(
"https://checkerframework.org/api/",
"https://errorprone.info/api/latest/",
Expand Down
6 changes: 0 additions & 6 deletions guava/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ tasks.jar {
"Automatic-Module-Name" to "com.github.benmanes.caffeine.guava"))
}

tasks.withType<Javadoc>().configureEach {
javadocOptions {
addStringOption("Xdoclint:none", "-quiet")
}
}

tasks.named<CheckForbiddenApis>("forbiddenApisMain").configure {
bundledSignatures.addAll(listOf("jdk-deprecated", "jdk-internal",
"jdk-non-portable", "jdk-reflection", "jdk-system-out", "jdk-unsafe"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ private CaffeinatedGuava() {}
* Returns a Caffeine cache wrapped in a Guava {@link Cache} facade.
*
* @param builder the configured cache builder
* @param <K> the most general key type to create caches for
* @param <V> the most general value type to create caches for
* @param <K1> the key type of the cache
* @param <V1> the value type of the cache
* @return a cache exposed under the Guava APIs
*/
public static <K, V, K1 extends K, V1 extends V> Cache<K1, V1> build(Caffeine<K, V> builder) {
Expand All @@ -50,6 +54,10 @@ public static <K, V, K1 extends K, V1 extends V> Cache<K1, V1> build(Caffeine<K,
*
* @param builder the configured cache builder
* @param loader the cache loader used to obtain new values
* @param <K> the most general key type to create caches for
* @param <V> the most general value type to create caches for
* @param <K1> the key type of the cache
* @param <V1> the value type of the cache
* @return a cache exposed under the Guava APIs
*/
public static <K, V, K1 extends K, V1 extends V> LoadingCache<K1, V1> build(
Expand All @@ -64,6 +72,10 @@ public static <K, V, K1 extends K, V1 extends V> LoadingCache<K1, V1> build(
*
* @param builder the configured cache builder
* @param loader the cache loader used to obtain new values
* @param <K> the most general key type to create caches for
* @param <V> the most general value type to create caches for
* @param <K1> the key type of the cache
* @param <V1> the value type of the cache
* @return a cache exposed under the Guava APIs
*/
public static <K, V, K1 extends K, V1 extends V> LoadingCache<K1, V1> build(
Expand All @@ -76,6 +88,8 @@ public static <K, V, K1 extends K, V1 extends V> LoadingCache<K1, V1> build(
* Returns a Caffeine cache loader that delegates to a Guava cache loader.
*
* @param loader the cache loader used to obtain new values
* @param <K> the type of keys
* @param <V> the type of values
* @return a cache loader exposed under the Caffeine APIs
*/
public static <K, V> com.github.benmanes.caffeine.cache.CacheLoader<K, V> caffeinate(
Expand Down
2 changes: 1 addition & 1 deletion jcache/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ tasks.jar {
tasks.named<Javadoc>("javadoc").configure {
dependsOn(unzipJCacheJavaDoc)
javadocOptions {
addStringOption("Xdoclint:none", "-quiet")
addBooleanOption("Xdoclint:all,-missing", true)
linksOffline("https://static.javadoc.io/javax.cache/cache-api/${libs.versions.jcache.get()}/",
relativePath(unzipJCacheJavaDoc.map { it.destinationDir }))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
/**
* A JCache configuration with Caffeine specific settings.
* <p>
* The initial settings disable <tt>store by value</tt> so that entries are not copied when crossing
* the {@link javax.cache.Cache} API boundary. If enabled and the {@link Copier} is not explicitly
* set, then the {@link JavaSerializationCopier} will be used. This differs from
* {@link MutableConfiguration} which enables <tt>store by value</tt> at construction.
* The initial settings disable <code>store by value</code> so that entries are not copied when
* crossing the {@link javax.cache.Cache} API boundary. If enabled and the {@link Copier} is not
* explicitly set, then the {@link JavaSerializationCopier} will be used. This differs from
* {@link MutableConfiguration} which enables <code>store by value</code> at construction.
*
* @author ben.manes@gmail.com (Ben Manes)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.github.benmanes.caffeine.jcache.copy;

/**
* An object is copied when the cache is configured with <tt>storeByValue</tt> to guard against
* An object is copied when the cache is configured with <code>storeByValue</code> to guard against
* mutations of the key or value.
*
* @author ben.manes@gmail.com (Ben Manes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* listeners to be delayed until the executor is able to process the work.
* </ul>
* <p>
* Some listeners may be configured as <tt>synchronous</tt>, meaning that the publishing thread
* Some listeners may be configured as <code>synchronous</code>, meaning that the publishing thread
* should wait until the listener has processed the event. The calling thread should publish within
* an atomic block that mutates the entry, and complete the operation by calling
* {@link #awaitSynchronous()} or {@link #ignoreSynchronous()}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import com.google.common.collect.Maps;

/**
* The test cases that ensure the <tt>expiry for access</tt> time is updated for the accessed
* The test cases that ensure the <code>expiry for access</code> time is updated for the accessed
* entries. The TCK asserts that the {@link ExpiryPolicy#getExpiryForAccess()} is only called for
* the following methods, but does not check that the expiration time was updated.
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import com.google.common.util.concurrent.MoreExecutors;

/**
* The test cases that ensure the <tt>expiry for creation</tt> time is set for the created entries.
* The TCK asserts that the {@link ExpiryPolicy#getExpiryForCreation()} is only called for
* the following methods, but does not check that the expiration time was updated.
* The test cases that ensure the <code>expiry for creation</code> time is set for the created
* entries. The TCK asserts that the {@link ExpiryPolicy#getExpiryForCreation()} is only called
* for the following methods, but does not check that the expiration time was updated.
* <ul>
* <li>get (loading)
* <li>getAndPut
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import com.google.common.util.concurrent.MoreExecutors;

/**
* The test cases that ensures the <tt>variable expiry</tt> policy and <tt>maximum size</tt>
* settings are set simultaneously.
* The test cases that ensures the variable expiry policy and maximum size settings are set
* simultaneously.
*
* @author github.com/kdombeck (Ken Dombeck)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import com.github.benmanes.caffeine.jcache.configuration.CaffeineConfiguration;

/**
* The test cases that ensure the <tt>variable expiry</tt> policy is configured.
* The test cases that ensure the variable expiry policy is configured.
*
* @author ben.manes@gmail.com (Ben Manes)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import com.github.benmanes.caffeine.jcache.configuration.CaffeineConfiguration;

/**
* The test cases that ensure the <tt>expiry for update</tt> time is set for the updated entries.
* The TCK asserts that the {@link ExpiryPolicy#getExpiryForUpdate()} is only called for the
* following methods, but does not check that the expiration time was set.
* The test cases that ensure the expiry for update time is set for the updated entries. The TCK
* asserts that the {@link ExpiryPolicy#getExpiryForUpdate()} is only called for the following
* methods, but does not check that the expiration time was set.
* <ul>
* <li>getAndPut
* <li>getAndReplace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import com.google.common.util.concurrent.MoreExecutors;

/**
* The test cases that ensure the <tt>maximum size</tt> setting is honored by the cache and removal
* The test cases that ensure the maximum size< setting is honored by the cache and removal
* notifications are published.
*
* @author ben.manes@gmail.com (Ben Manes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
import com.google.common.util.concurrent.MoreExecutors;

/**
* The test cases that ensure the <tt>maximum weight</tt> setting is honored by the cache and
* removal notifications are published.
* The test cases that ensure the maximum weight setting is honored by the cache and removal
* notifications are published.
*
* @author ben.manes@gmail.com (Ben Manes)
*/
Expand Down
2 changes: 1 addition & 1 deletion simulator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ tasks.jar {

tasks.withType<Javadoc>().configureEach {
javadocOptions {
addStringOption("Xdoclint:none", "-quiet")
addBooleanOption("Xdoclint:all,-missing", true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* A command that runs multiple simulations, writes the result to a csv file, and renders a chart.
* An underscore may be used as a numeric separator and the default configuration may be overridden
* by using system properties.
* <p>
*
* <pre>{@code
* ./gradlew simulator:simulate -q \
* -Dcaffeine.simulator.files.paths.0="lirs:gli.trace.gz" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

/**
* A simulator that broadcasts the recorded cache events to each policy and generates an aggregated
* report. See <tt>reference.conf</tt> for details on the configuration.
* report. See <code>reference.conf</code> for details on the configuration.
* <p>
* The simulator reports the hit rate of each of the policy being evaluated. A miss may occur
* due to,
Expand Down
Loading

0 comments on commit 56a7055

Please sign in to comment.