Skip to content

Commit

Permalink
Merge pull request #4847 from sjudd:fix_javadoc_warnings
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 468013574
  • Loading branch information
sjudd committed Aug 16, 2022
2 parents 1a2cfe3 + 1b364c7 commit 00da167
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 28 deletions.
5 changes: 4 additions & 1 deletion library/src/main/java/com/bumptech/glide/GlideBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,10 @@ static final class ManualOverrideHardwareBitmapMaxFdCount implements Experiment
}
}

/** See {@link #setWaitForFramesAfterTrimMemory(boolean)}. */
/**
* This is an internal only class that may be deleted at any time without notice. For internal
* users of glide, see the {@code setWaitForFramesAfterTrimMemory(boolean)} method above.
*/
public static final class WaitForFramesAfterTrimMemory implements Experiment {
private WaitForFramesAfterTrimMemory() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public final CHILD dontTransition() {
* load finishes. Will only be run if the resource was loaded asynchronously (i.e. was not in the
* memory cache).
*
* @param viewAnimationId The resource id of the {@link android.view.animation} to use as the
* transition.
* @param viewAnimationId The resource id of the {@link android.view.animation.Animation} to use
* as the transition.
* @return This request builder.
*/
@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface ArrayPool {
<T> void put(T array);

/**
* Returns a non-null array of the given type with a length >= to the given size.
* Returns a non-null array of the given type with a length {@code >=} to the given size.
*
* <p>If an array of the given size isn't in the pool, a new one will be allocated.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface ResourceRemovedListener {
* <p>If the size multiplier causes the size of the cache to be decreased, items will be evicted
* until the cache is smaller than the new size.
*
* @param multiplier A size multiplier >= 0.
* @param multiplier A size multiplier {@code >= 0}.
*/
void setSizeMultiplier(float multiplier);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public static GlideExecutor newSourceExecutor(
/**
* Returns a new unlimited thread pool with zero core thread count to make sure no threads are
* created by default, {@link #KEEP_ALIVE_TIME_MS} keep alive time, the {@link
* #SOURCE_UNLIMITED_EXECUTOR_NAME} thread name prefix, the {@link
* #DEFAULT_SOURCE_UNLIMITED_EXECUTOR_NAME} thread name prefix, the {@link
* com.bumptech.glide.load.engine.executor.GlideExecutor.UncaughtThrowableStrategy#DEFAULT}
* uncaught throwable strategy, and the {@link SynchronousQueue} since using default unbounded
* blocking queue, for example, {@link PriorityBlockingQueue} effectively won't create more than
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ LoadData<Data> buildLoadData(
/**
* Returns true if the given model is a of a recognized type that this loader can probably load.
*
* <p>For example, you may want multiple Uri -> InputStream loaders. One might handle media store
* <p>For example, you may want multiple Uri to InputStream loaders. One might handle media store
* Uris, another might handle asset Uris, and a third might handle file Uris etc.
*
* <p>This method is generally expected to do no I/O and complete quickly, so best effort results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
*
* <p>Use cases will look something like this:
*
* <pre>
* <code>
* <pre>{@code
* public class FillSpace extends BitmapTransformation {
* private static final String ID = "com.bumptech.glide.transformations.FillSpace";
* private static final byte[] ID_BYTES = ID.getBytes(Charset.forName("UTF-8"));
Expand Down Expand Up @@ -49,8 +48,7 @@
* messageDigest.update(ID_BYTES);
* }
* }
* </code>
* </pre>
* }</pre>
*
* <p>Using the fully qualified class name as a static final {@link String} (not {@link
* Class#getName()} to avoid proguard obfuscation) is an easy way to implement {@link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* readily accessible. For non-{@link Bitmap} based {@link Drawable}s, this class must first try to
* draw the {@link Drawable} to a {@link Bitmap} using {@link android.graphics.Canvas}, which is
* less efficient. {@link Drawable}s that implement {@link android.graphics.drawable.Animatable}
* will fail with an exception. {@link Drawable}s that return <= 0 for {@link
* will fail with an exception. {@link Drawable}s that return {@code <= 0} for {@link
* Drawable#getIntrinsicHeight()} and/or {@link Drawable#getIntrinsicWidth()} will fail with an
* exception if the requested size is {@link
* com.bumptech.glide.request.target.Target#SIZE_ORIGINAL}. {@link Drawable}s without intrinsic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
* <p>The framework will decode some resources as {@link Drawable}s that do not wrap {@link
* Bitmap}s. This decoder will attempt to return a {@link Bitmap} for those {@link Drawable}s anyway
* by drawing the {@link Drawable} to a {@link Canvas}s using the {@link Drawable}'s intrinsic
* bounds or the dimensions provided to {@link #decode(Object, int, int, Options)}.
* bounds or the dimensions provided to {@link #decode(Uri, int, int, Options)}.
*
* <p>For non-{@link Bitmap} {@link Drawable}s that return <= 0 for {@link
* <p>For non-{@link Bitmap} {@link Drawable}s that return {@code <= 0} for {@link
* Drawable#getIntrinsicWidth()} and/or {@link Drawable#getIntrinsicHeight()}, this decoder will
* fail if the width and height provided to {@link #decode(Object, int, int, Options)} are {@link
* fail if the width and height provided to {@link #decode(Uri, int, int, Options)} are {@link
* Target#SIZE_ORIGINAL}.
*/
public class ResourceBitmapDecoder implements ResourceDecoder<Uri, Bitmap> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.target.Target;
import com.bumptech.glide.request.transition.Transition;

/**
* A class for monitoring the status of a request while images load.
Expand Down Expand Up @@ -74,10 +75,10 @@ boolean onLoadFailed(
* @param isFirstResource {@code true} if this is the first resource to in this load to be loaded
* into the target. For example when loading a thumbnail and a full-sized image, this will be
* {@code true} for the first image to load and {@code false} for the second.
* @return {@code true} to prevent {@link Target#onResourceReady(Drawable)} from being called on
* {@code target}, typically because the listener wants to update the {@code target} or the
* object the {@code target} wraps itself or {@code false} to allow {@link
* Target#onResourceReady(Drawable)} to be called on {@code target}.
* @return {@code true} to prevent {@link Target#onResourceReady(Object, Transition)} from being
* called on {@code target}, typically because the listener wants to update the {@code target}
* or the object the {@code target} wraps itself or {@code false} to allow {@link
* Target#onResourceReady(Object, Transition)} to be called on {@code target}.
*/
boolean onResourceReady(
R resource, Object model, Target<R> target, DataSource dataSource, boolean isFirstResource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ public CustomTarget() {
* as the requested size (unless overridden by {@link
* com.bumptech.glide.request.RequestOptions#override(int)} in the request).
*
* @param width The requested width (> 0, or == Target.SIZE_ORIGINAL).
* @param height The requested height (> 0, or == Target.SIZE_ORIGINAL).
* @throws IllegalArgumentException if width/height doesn't meet (> 0, or == Target.SIZE_ORIGINAL)
* @param width The requested width ({@code > 0, or == Target.SIZE_ORIGINAL}).
* @param height The requested height ({@code > 0, or == Target.SIZE_ORIGINAL}).
* @throws IllegalArgumentException if width/height doesn't meet the requirement: {@code > 0, or
* == Target.SIZE_ORIGINAL}
*/
public CustomTarget(int width, int height) {
if (!Util.isValidDimensions(width, height)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
* implementations of non essential methods that allows the caller to specify an exact width/height.
* Typically use cases look something like this:
*
* <pre>
* <code>
* <pre>{@code
* Target<Bitmap> target =
* Glide.with(fragment)
* .asBitmap()
Expand All @@ -29,8 +28,7 @@
* // At some later point, clear the Target to release the resources, prevent load queues from
* // blowing out proportion, and to improve load times for future requests:
* Glide.with(fragment).clear(target);
* </code>
* </pre>
* }</pre>
*
* <p><em>Warning!</em> this class is extremely prone to mis-use. Use SimpleTarget only as a last
* resort. {@link ViewTarget} or a subclass of {@link ViewTarget} is almost always a better choice.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* <li>onLoadFailed
* </ul>
*
* The typical lifecycle is onLoadStarted -> onResourceReady or onLoadFailed -> onLoadCleared.
* The typical lifecycle is onLoadStarted, then onResourceReady or onLoadFailed, then onLoadCleared.
* However, there are no guarantees. onLoadStarted may not be called if the resource is in memory or
* if the load will fail because of a null model object. onLoadCleared similarly may never be called
* if the target is never cleared. See the docs for the individual methods for details.
Expand Down
5 changes: 4 additions & 1 deletion library/src/main/java/com/bumptech/glide/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ public static int getBytesPerPixel(@Nullable Bitmap.Config config) {
return bytesPerPixel;
}

/** Returns true if width and height are both > 0 and/or equal to {@link Target#SIZE_ORIGINAL}. */
/**
* Returns {@code true} if {@code width} and {@code height} are both {@code > 0} and/or equal to
* {@link Target#SIZE_ORIGINAL}.
*/
public static boolean isValidDimensions(int width, int height) {
return isValidDimension(width) && isValidDimension(height);
}
Expand Down

0 comments on commit 00da167

Please sign in to comment.