From 2bf49cad091d96a6e23c35023f940eaa4d5b173a Mon Sep 17 00:00:00 2001 From: Jeff Bahr Date: Fri, 22 Mar 2024 09:57:22 -0700 Subject: [PATCH] Migrate google java format from 1.7 -> 1.21.0 Reviewed By: IanChilds Differential Revision: D52786052 --- .../base/AnimatedImageResultBuilder.java | 4 +++- .../backend/AnimationInformation.java | 8 +++++-- .../animation/drawable/AnimatedDrawable2.java | 4 +++- .../AnimatedDrawable2DebugDrawListener.java | 4 +++- .../animation/frame/FrameScheduler.java | 4 +++- .../controller/AbstractDraweeController.java | 3 ++- .../debug/DebugControllerOverlayDrawable.java | 4 +++- .../generic/GenericDraweeHierarchy.java | 4 +++- .../drawee/interfaces/DraweeHierarchy.java | 4 +++- .../com/facebook/common/internal/Files.java | 1 + .../PooledByteArrayBufferedInputStream.java | 1 + .../com/facebook/common/util/TriState.java | 4 +++- .../com/facebook/datasource/DataSource.java | 24 ++++++++++++++----- .../backends/volley/VolleyNetworkFetcher.java | 4 +++- .../cache/disk/DefaultDiskStorage.java | 7 ++++-- .../com/facebook/cache/disk/DiskStorage.java | 2 ++ .../com/facebook/cache/disk/FileCache.java | 8 +++++-- .../AbstractAdaptiveCountingMemoryCache.java | 2 ++ .../image/BaseCloseableStaticBitmap.java | 20 ++++++++++++---- .../imagepipeline/image/CloseableImage.java | 16 +++++++++---- .../image/DefaultCloseableImage.java | 1 + .../imagepipeline/image/ImageInfo.java | 16 +++++++++---- .../imagepipeline/cache/CacheKeyFactory.java | 8 +++++-- .../cache/DefaultCacheKeyFactory.java | 4 +++- .../core/ImagePipelineFactory.java | 4 +++- .../decoder/ProgressiveJpegParser.java | 8 +++++-- .../imagepipeline/memory/BitmapCounter.java | 8 +++++-- .../imagepipeline/memory/BucketMap.java | 4 +++- .../imagepipeline/producers/Consumer.java | 5 ++++ .../producers/LocalFetchProducer.java | 4 +++- .../producers/PriorityNetworkFetcher.java | 1 + .../producers/ProducerListener2.java | 4 +++- .../imagepipeline/request/ImageRequest.java | 4 +++- .../request/ImageRequestBuilder.java | 4 +++- .../instrumentation/PerfListener.java | 12 +++++++--- .../fragments/recycler/DraweeViewHolder.java | 4 +++- .../instrumentation/PerfListener.java | 12 +++++++--- .../ScalingBlurPostprocessor.java | 1 + .../vito/core/impl/FrescoDrawable2Impl.java | 8 +++++-- 39 files changed, 183 insertions(+), 57 deletions(-) diff --git a/animated-base/src/main/java/com/facebook/imagepipeline/animated/base/AnimatedImageResultBuilder.java b/animated-base/src/main/java/com/facebook/imagepipeline/animated/base/AnimatedImageResultBuilder.java index 17ab9bc5b7..f004cb5ba4 100644 --- a/animated-base/src/main/java/com/facebook/imagepipeline/animated/base/AnimatedImageResultBuilder.java +++ b/animated-base/src/main/java/com/facebook/imagepipeline/animated/base/AnimatedImageResultBuilder.java @@ -92,7 +92,9 @@ public AnimatedImageResultBuilder setFrameForPreview(int frameForPreview) { return CloseableReference.cloneOrNull(mDecodedFrames); } - /** @return animated image uri path */ + /** + * @return animated image uri path + */ @Nullable public String getSource() { return mSource; diff --git a/animated-drawable/src/main/java/com/facebook/fresco/animation/backend/AnimationInformation.java b/animated-drawable/src/main/java/com/facebook/fresco/animation/backend/AnimationInformation.java index 2df5659cf2..f61690aac6 100644 --- a/animated-drawable/src/main/java/com/facebook/fresco/animation/backend/AnimationInformation.java +++ b/animated-drawable/src/main/java/com/facebook/fresco/animation/backend/AnimationInformation.java @@ -38,10 +38,14 @@ public interface AnimationInformation { */ int getLoopDurationMs(); - /** @return Animation asset width */ + /** + * @return Animation asset width + */ int width(); - /** @return Animation asset height */ + /** + * @return Animation asset height + */ int height(); /** diff --git a/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2.java b/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2.java index db625ee91d..13bbfb5c8f 100644 --- a/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2.java +++ b/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2.java @@ -470,7 +470,9 @@ private void onFrameDropped() { } } - /** @return the current uptime in ms */ + /** + * @return the current uptime in ms + */ private long now() { // This call has to return [SystemClock#uptimeMillis()] in order to preserve correct // frame scheduling. diff --git a/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2DebugDrawListener.java b/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2DebugDrawListener.java index 50319e2ecc..6ce65e2e98 100644 --- a/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2DebugDrawListener.java +++ b/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2DebugDrawListener.java @@ -62,7 +62,9 @@ public void onDraw( mLastFrameNumber = frameNumberToDraw; FLog.d( TAG, - "draw: frame: %2d, drawn: %b, delay: %3d ms, rendering: %3d ms, prev: %3d ms ago, duplicates: %3d, skipped: %3d, draw calls: %4d, anim time: %6d ms, next start: %6d ms, next scheduled: %6d ms", + "draw: frame: %2d, drawn: %b, delay: %3d ms, rendering: %3d ms, prev: %3d ms ago," + + " duplicates: %3d, skipped: %3d, draw calls: %4d, anim time: %6d ms, next start: %6d" + + " ms, next scheduled: %6d ms", frameNumberToDraw, frameDrawn, animationTimeMs % frameScheduler.getLoopDurationMs() diff --git a/animated-drawable/src/main/java/com/facebook/fresco/animation/frame/FrameScheduler.java b/animated-drawable/src/main/java/com/facebook/fresco/animation/frame/FrameScheduler.java index 389ddf1bdd..55c12f5936 100644 --- a/animated-drawable/src/main/java/com/facebook/fresco/animation/frame/FrameScheduler.java +++ b/animated-drawable/src/main/java/com/facebook/fresco/animation/frame/FrameScheduler.java @@ -49,6 +49,8 @@ public interface FrameScheduler { */ long getTargetRenderTimeForNextFrameMs(long animationTimeMs); - /** @return true if the animation is infinite */ + /** + * @return true if the animation is infinite + */ boolean isInfiniteAnimation(); } diff --git a/drawee/src/main/java/com/facebook/drawee/controller/AbstractDraweeController.java b/drawee/src/main/java/com/facebook/drawee/controller/AbstractDraweeController.java index 03c67df6c6..d8d92bfbe2 100644 --- a/drawee/src/main/java/com/facebook/drawee/controller/AbstractDraweeController.java +++ b/drawee/src/main/java/com/facebook/drawee/controller/AbstractDraweeController.java @@ -873,7 +873,8 @@ private Extras obtainExtras( protected @Nullable Uri getMainUri() { return null; - }; + } + ; private Extras obtainExtras( @Nullable DataSource datasource, @Nullable INFO info, @Nullable Uri mainUri) { diff --git a/drawee/src/main/java/com/facebook/drawee/debug/DebugControllerOverlayDrawable.java b/drawee/src/main/java/com/facebook/drawee/debug/DebugControllerOverlayDrawable.java index 221aacc4fa..ea1af2b08a 100644 --- a/drawee/src/main/java/com/facebook/drawee/debug/DebugControllerOverlayDrawable.java +++ b/drawee/src/main/java/com/facebook/drawee/debug/DebugControllerOverlayDrawable.java @@ -149,7 +149,9 @@ public void setOrigin(String text, int color) { invalidateSelf(); } - /** @param imageSizeBytes the image size in bytes */ + /** + * @param imageSizeBytes the image size in bytes + */ public void setImageSize(int imageSizeBytes) { mImageSizeBytes = imageSizeBytes; } diff --git a/drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java b/drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java index 28732fb20a..c4b6df801c 100644 --- a/drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java +++ b/drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java @@ -440,7 +440,9 @@ public void setPlaceholderImage(Drawable drawable, ScalingUtils.ScaleType scaleT getScaleTypeDrawableAtIndex(PLACEHOLDER_IMAGE_INDEX).setScaleType(scaleType); } - /** @return true if there is a placeholder image set. */ + /** + * @return true if there is a placeholder image set. + */ public boolean hasPlaceholderImage() { return mFadeDrawable.getDrawable(PLACEHOLDER_IMAGE_INDEX) != null; } diff --git a/drawee/src/main/java/com/facebook/drawee/interfaces/DraweeHierarchy.java b/drawee/src/main/java/com/facebook/drawee/interfaces/DraweeHierarchy.java index d84d8b5c65..056552aafa 100644 --- a/drawee/src/main/java/com/facebook/drawee/interfaces/DraweeHierarchy.java +++ b/drawee/src/main/java/com/facebook/drawee/interfaces/DraweeHierarchy.java @@ -45,6 +45,8 @@ public interface DraweeHierarchy { */ Drawable getTopLevelDrawable(); - /** @return bounds of the top drawable */ + /** + * @return bounds of the top drawable + */ Rect getBounds(); } diff --git a/fbcore/src/main/java/com/facebook/common/internal/Files.java b/fbcore/src/main/java/com/facebook/common/internal/Files.java index 3013f4c9fe..f186aaae5e 100644 --- a/fbcore/src/main/java/com/facebook/common/internal/Files.java +++ b/fbcore/src/main/java/com/facebook/common/internal/Files.java @@ -52,6 +52,7 @@ static byte[] readFile(InputStream in, long expectedSize) throws IOException { ? ByteStreams.toByteArray(in) : ByteStreams.toByteArray(in, (int) expectedSize); } + /** * Reads all bytes from a file into a byte array. * diff --git a/fbcore/src/main/java/com/facebook/common/memory/PooledByteArrayBufferedInputStream.java b/fbcore/src/main/java/com/facebook/common/memory/PooledByteArrayBufferedInputStream.java index b5ddce3305..bba66605c0 100644 --- a/fbcore/src/main/java/com/facebook/common/memory/PooledByteArrayBufferedInputStream.java +++ b/fbcore/src/main/java/com/facebook/common/memory/PooledByteArrayBufferedInputStream.java @@ -33,6 +33,7 @@ public class PooledByteArrayBufferedInputStream extends InputStream { /** how many bytes in mByteArray were set by last call to mInputStream.read */ private int mBufferedSize; + /** * position of next buffered byte in mByteArray to be read * diff --git a/fbcore/src/main/java/com/facebook/common/util/TriState.java b/fbcore/src/main/java/com/facebook/common/util/TriState.java index 530fd00732..7a09a5ed1d 100644 --- a/fbcore/src/main/java/com/facebook/common/util/TriState.java +++ b/fbcore/src/main/java/com/facebook/common/util/TriState.java @@ -19,7 +19,9 @@ public enum TriState { UNSET, ; - /** @return whether this value is set; that is, whether it is YES or NO. */ + /** + * @return whether this value is set; that is, whether it is YES or NO. + */ @Functional public boolean isSet() { return this != UNSET; diff --git a/fbcore/src/main/java/com/facebook/datasource/DataSource.java b/fbcore/src/main/java/com/facebook/datasource/DataSource.java index 7b7e39fae2..4f7aa0f67b 100644 --- a/fbcore/src/main/java/com/facebook/datasource/DataSource.java +++ b/fbcore/src/main/java/com/facebook/datasource/DataSource.java @@ -24,7 +24,9 @@ */ public interface DataSource { - /** @return true if the data source is closed, false otherwise */ + /** + * @return true if the data source is closed, false otherwise + */ boolean isClosed(); /** @@ -51,7 +53,9 @@ public interface DataSource { */ boolean hasResult(); - /** @return an object with extra data for this datasource */ + /** + * @return an object with extra data for this datasource + */ @Nullable Map getExtras(); @@ -61,17 +65,25 @@ public interface DataSource { */ boolean hasMultipleResults(); - /** @return true if request is finished, false otherwise */ + /** + * @return true if request is finished, false otherwise + */ boolean isFinished(); - /** @return true if request finished due to error */ + /** + * @return true if request finished due to error + */ boolean hasFailed(); - /** @return failure cause if the source has failed, else null */ + /** + * @return failure cause if the source has failed, else null + */ @Nullable Throwable getFailureCause(); - /** @return progress in range [0, 1] */ + /** + * @return progress in range [0, 1] + */ float getProgress(); /** diff --git a/imagepipeline-backends/imagepipeline-volley/src/main/java/com/facebook/imagepipeline/backends/volley/VolleyNetworkFetcher.java b/imagepipeline-backends/imagepipeline-volley/src/main/java/com/facebook/imagepipeline/backends/volley/VolleyNetworkFetcher.java index 6cf02c90e4..817c87d159 100644 --- a/imagepipeline-backends/imagepipeline-volley/src/main/java/com/facebook/imagepipeline/backends/volley/VolleyNetworkFetcher.java +++ b/imagepipeline-backends/imagepipeline-volley/src/main/java/com/facebook/imagepipeline/backends/volley/VolleyNetworkFetcher.java @@ -53,7 +53,9 @@ public VolleyNetworkFetchState( private final RequestQueue mRequestQueue; - /** @param requestQueue The Volley {@link RequestQueue} to use */ + /** + * @param requestQueue The Volley {@link RequestQueue} to use + */ public VolleyNetworkFetcher(RequestQueue requestQueue) { mRequestQueue = requestQueue; } diff --git a/imagepipeline-base/src/main/java/com/facebook/cache/disk/DefaultDiskStorage.java b/imagepipeline-base/src/main/java/com/facebook/cache/disk/DefaultDiskStorage.java index 120fec3f16..d078ddb575 100644 --- a/imagepipeline-base/src/main/java/com/facebook/cache/disk/DefaultDiskStorage.java +++ b/imagepipeline-base/src/main/java/com/facebook/cache/disk/DefaultDiskStorage.java @@ -311,11 +311,14 @@ private boolean isExpectedFile(File file) { return true; } - /** @return true if and only if the file is not old enough to be considered an old temp file */ + /** + * @return true if and only if the file is not old enough to be considered an old temp file + */ private boolean isRecentFile(File file) { return file.lastModified() > (mClock.now() - TEMP_FILE_LIFETIME_MS); } - }; + } + ; @Override public void purgeUnexpectedResources() { diff --git a/imagepipeline-base/src/main/java/com/facebook/cache/disk/DiskStorage.java b/imagepipeline-base/src/main/java/com/facebook/cache/disk/DiskStorage.java index 3677403b46..fdd170d9a0 100644 --- a/imagepipeline-base/src/main/java/com/facebook/cache/disk/DiskStorage.java +++ b/imagepipeline-base/src/main/java/com/facebook/cache/disk/DiskStorage.java @@ -156,8 +156,10 @@ public DiskDumpInfo() { interface Entry { /** the id representing the resource */ String getId(); + /** calculated on first time and never changes so it can be used as immutable * */ long getTimestamp(); + /** calculated on first time and never changes so it can be used as immutable * */ long getSize(); diff --git a/imagepipeline-base/src/main/java/com/facebook/cache/disk/FileCache.java b/imagepipeline-base/src/main/java/com/facebook/cache/disk/FileCache.java index 0378c12b6e..8c1a335aa0 100644 --- a/imagepipeline-base/src/main/java/com/facebook/cache/disk/FileCache.java +++ b/imagepipeline-base/src/main/java/com/facebook/cache/disk/FileCache.java @@ -64,10 +64,14 @@ public interface FileCache extends DiskTrimmable { */ void remove(CacheKey key); - /** @return the in-use size of the cache */ + /** + * @return the in-use size of the cache + */ long getSize(); - /** @return the count of pictures in the cache */ + /** + * @return the count of pictures in the cache + */ long getCount(); /** diff --git a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/AbstractAdaptiveCountingMemoryCache.java b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/AbstractAdaptiveCountingMemoryCache.java index 596800a130..da5ac36551 100644 --- a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/AbstractAdaptiveCountingMemoryCache.java +++ b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/AbstractAdaptiveCountingMemoryCache.java @@ -79,6 +79,7 @@ public abstract class AbstractAdaptiveCountingMemoryCache @GuardedBy("this") @VisibleForTesting int mLFUFractionPromil; + // default LFU Fraction static final int DEFAULT_LFU_FRACTION_PROMIL = 500; @@ -100,6 +101,7 @@ public abstract class AbstractAdaptiveCountingMemoryCache @GuardedBy("this") @VisibleForTesting final int mAdaptiveRatePromil; + // defualt adaptive rate static final int DEFAULT_ADAPTIVE_RATE_PROMIL = 10; diff --git a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/BaseCloseableStaticBitmap.java b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/BaseCloseableStaticBitmap.java index 51ae65bbff..7454682b59 100644 --- a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/BaseCloseableStaticBitmap.java +++ b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/BaseCloseableStaticBitmap.java @@ -131,13 +131,17 @@ public Bitmap getUnderlyingBitmap() { return mBitmap; } - /** @return size in bytes of the underlying bitmap */ + /** + * @return size in bytes of the underlying bitmap + */ @Override public int getSizeInBytes() { return BitmapUtil.getSizeInBytes(mBitmap); } - /** @return width of the image */ + /** + * @return width of the image + */ @Override public int getWidth() { if (mRotationAngle % 180 != 0 @@ -148,7 +152,9 @@ public int getWidth() { return getBitmapWidth(mBitmap); } - /** @return height of the image */ + /** + * @return height of the image + */ @Override public int getHeight() { if (mRotationAngle % 180 != 0 @@ -167,12 +173,16 @@ private static int getBitmapHeight(@Nullable Bitmap bitmap) { return (bitmap == null) ? 0 : bitmap.getHeight(); } - /** @return the rotation angle of the image */ + /** + * @return the rotation angle of the image + */ public int getRotationAngle() { return mRotationAngle; } - /** @return the EXIF orientation of the image */ + /** + * @return the EXIF orientation of the image + */ @Override public int getExifOrientation() { return mExifOrientation; diff --git a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/CloseableImage.java b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/CloseableImage.java index 58b7db0915..6f27b136d3 100644 --- a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/CloseableImage.java +++ b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/CloseableImage.java @@ -14,7 +14,9 @@ @Nullsafe(Nullsafe.Mode.LOCAL) public interface CloseableImage extends Closeable, ImageInfo, HasBitmap, HasExtraData { - /** @return size in bytes of the bitmap(s) */ + /** + * @return size in bytes of the bitmap(s) + */ int getSizeInBytes(); /** Closes this instance and releases the resources. */ @@ -26,13 +28,19 @@ public interface CloseableImage extends Closeable, ImageInfo, HasBitmap, HasExtr boolean isStateful(); - /** @return width of the image */ + /** + * @return width of the image + */ int getWidth(); - /** @return height of the image */ + /** + * @return height of the image + */ int getHeight(); - /** @return quality information for the image */ + /** + * @return quality information for the image + */ QualityInfo getQualityInfo(); ImageInfo getImageInfo(); diff --git a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/DefaultCloseableImage.java b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/DefaultCloseableImage.java index ac7a0ae9d5..cccaab148a 100644 --- a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/DefaultCloseableImage.java +++ b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/DefaultCloseableImage.java @@ -11,6 +11,7 @@ public abstract class DefaultCloseableImage extends BaseCloseableImage { private static final String TAG = "CloseableImage"; + /** Ensures that the underlying resources are always properly released. */ @Override protected void finalize() throws Throwable { diff --git a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/ImageInfo.java b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/ImageInfo.java index 56069eb9b3..d6541d4c93 100644 --- a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/ImageInfo.java +++ b/imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/ImageInfo.java @@ -9,17 +9,25 @@ /** Interface containing information about an image. */ public interface ImageInfo extends HasImageMetadata { - /** @return width of the image */ + /** + * @return width of the image + */ int getWidth(); - /** @return height of the image */ + /** + * @return height of the image + */ int getHeight(); - /** @return size in bytes of the image */ + /** + * @return size in bytes of the image + */ default int getSizeInBytes() { return 0; } - /** @return quality information for the image */ + /** + * @return quality information for the image + */ QualityInfo getQualityInfo(); } diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/cache/CacheKeyFactory.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/cache/CacheKeyFactory.java index 5883961b0d..b7cff85203 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/cache/CacheKeyFactory.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/cache/CacheKeyFactory.java @@ -15,10 +15,14 @@ /** Factory methods for creating cache keys for the pipeline. */ public interface CacheKeyFactory { - /** @return {@link CacheKey} for doing bitmap cache lookups in the pipeline. */ + /** + * @return {@link CacheKey} for doing bitmap cache lookups in the pipeline. + */ CacheKey getBitmapCacheKey(ImageRequest request, @Nullable Object callerContext); - /** @return {@link CacheKey} for doing post-processed bitmap cache lookups in the pipeline. */ + /** + * @return {@link CacheKey} for doing post-processed bitmap cache lookups in the pipeline. + */ CacheKey getPostprocessedBitmapCacheKey(ImageRequest request, @Nullable Object callerContext); /** diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/cache/DefaultCacheKeyFactory.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/cache/DefaultCacheKeyFactory.java index 721b8e6663..bb6af5c28c 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/cache/DefaultCacheKeyFactory.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/cache/DefaultCacheKeyFactory.java @@ -80,7 +80,9 @@ public CacheKey getEncodedCacheKey( return new SimpleCacheKey(getCacheKeySourceUri(sourceUri).toString()); } - /** @return a {@link Uri} that unambiguously indicates the source of the image. */ + /** + * @return a {@link Uri} that unambiguously indicates the source of the image. + */ protected Uri getCacheKeySourceUri(Uri sourceUri) { return sourceUri; } diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipelineFactory.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipelineFactory.java index 4c31b391a5..d53d96defd 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipelineFactory.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipelineFactory.java @@ -97,7 +97,9 @@ public static synchronized void initialize(ImagePipelineConfigInterface imagePip if (sInstance != null) { FLog.w( TAG, - "ImagePipelineFactory has already been initialized! `ImagePipelineFactory.initialize(...)` should only be called once to avoid unexpected behavior."); + "ImagePipelineFactory has already been initialized!" + + " `ImagePipelineFactory.initialize(...)` should only be called once to avoid" + + " unexpected behavior."); if (sForceSingleInstance) { return; } diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/ProgressiveJpegParser.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/ProgressiveJpegParser.java index b79de3722a..3a1881a3c6 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/ProgressiveJpegParser.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/ProgressiveJpegParser.java @@ -251,12 +251,16 @@ public boolean isJpeg() { return mBytesParsed > 1 && mParserState != NOT_A_JPEG; } - /** @return offset at which parsed data should be cut to decode best available partial result */ + /** + * @return offset at which parsed data should be cut to decode best available partial result + */ public int getBestScanEndOffset() { return mBestScanEndOffset; } - /** @return number of the best scan found so far */ + /** + * @return number of the best scan found so far + */ public int getBestScanNumber() { return mBestScanNumber; } diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BitmapCounter.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BitmapCounter.java index 15e95aa7fe..dfe7d49a1c 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BitmapCounter.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BitmapCounter.java @@ -80,12 +80,16 @@ public synchronized void decrease(Bitmap bitmap) { mCount--; } - /** @return number of counted bitmaps */ + /** + * @return number of counted bitmaps + */ public synchronized int getCount() { return mCount; } - /** @return total size in bytes of counted bitmaps */ + /** + * @return total size in bytes of counted bitmaps + */ public synchronized long getSize() { return mSize; } diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BucketMap.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BucketMap.java index 997394cbe1..6ef9686bc9 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BucketMap.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BucketMap.java @@ -84,7 +84,9 @@ public synchronized void release(int key, T value) { moveToFront(bucket); } - /** @return number of objects contained in the {@link BucketMap} */ + /** + * @return number of objects contained in the {@link BucketMap} + */ @VisibleForTesting synchronized int valueCount() { int count = 0; diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/Consumer.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/Consumer.java index 485b4cacae..b4b8a74b94 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/Consumer.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/Consumer.java @@ -60,26 +60,31 @@ public interface Consumer { * for flags. */ int NO_FLAGS = 0; + /** * Status flag to show whether the result being received is the last one coming or to expect more. */ int IS_LAST = 1; + /** * Status flag to show the result should not be cached in disk or encoded caches, even if it's the * last result. */ int DO_NOT_CACHE_ENCODED = 1 << 1; + /** * Status flag to show whether the result is a placeholder for the final result. Should only be * set if IS_LAST is not set. */ int IS_PLACEHOLDER = 1 << 2; + /** * Status flag to show the result does not represent the whole image, just part of it. This may be * due to a cancellation or failure while the file was being downloaded or because only part of * the image was requested. */ int IS_PARTIAL_RESULT = 1 << 3; + /** Status flag that indicates whether the given image has been resized. */ int IS_RESIZING_DONE = 1 << 4; diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/LocalFetchProducer.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/LocalFetchProducer.java index fd045ab172..13eac8d551 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/LocalFetchProducer.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/LocalFetchProducer.java @@ -105,6 +105,8 @@ protected EncodedImage getEncodedImage(InputStream inputStream, int length) thro protected abstract @Nullable EncodedImage getEncodedImage(ImageRequest imageRequest) throws IOException; - /** @return name of the Producer */ + /** + * @return name of the Producer + */ protected abstract String getProducerName(); } diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/PriorityNetworkFetcher.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/PriorityNetworkFetcher.java index ffb684be21..8ac614a1f0 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/PriorityNetworkFetcher.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/PriorityNetworkFetcher.java @@ -83,6 +83,7 @@ public class PriorityNetworkFetcher /** the amount of time a request should wait before it gets re-queued again */ private final long requeueDelayTimeInMillis; + /** the number of immediate re-queue, with no delay */ private final int immediateRequeueCount; diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/ProducerListener2.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/ProducerListener2.java index eceda283af..e620f337e6 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/ProducerListener2.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/ProducerListener2.java @@ -70,6 +70,8 @@ void onProducerFinishWithCancellation( void onUltimateProducerReached( ProducerContext producerContext, String producerName, boolean successful); - /** @return true if listener makes use of extra map */ + /** + * @return true if listener makes use of extra map + */ boolean requiresExtraMap(ProducerContext producerContext, String producerName); } diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/request/ImageRequest.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/request/ImageRequest.java index f9e086fe2c..b0397bdbdc 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/request/ImageRequest.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/request/ImageRequest.java @@ -205,7 +205,9 @@ public RotationOptions getRotationOptions() { return mRotationOptions; } - /** @deprecated Use {@link #getRotationOptions()} */ + /** + * @deprecated Use {@link #getRotationOptions()} + */ @Deprecated public boolean getAutoRotateEnabled() { return mRotationOptions.useImageMetadata(); diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/request/ImageRequestBuilder.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/request/ImageRequestBuilder.java index b0ef39b0fa..00a3547449 100644 --- a/imagepipeline/src/main/java/com/facebook/imagepipeline/request/ImageRequestBuilder.java +++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/request/ImageRequestBuilder.java @@ -395,7 +395,9 @@ public ImageRequestBuilder setRequestListener(@Nullable RequestListener requestL return this; } - /** @return the additional request listener to use for this image request */ + /** + * @return the additional request listener to use for this image request + */ public @Nullable RequestListener getRequestListener() { return mRequestListener; } diff --git a/samples/comparison/src/main/java/com/facebook/samples/comparison/instrumentation/PerfListener.java b/samples/comparison/src/main/java/com/facebook/samples/comparison/instrumentation/PerfListener.java index 62d0989248..132149f7f5 100644 --- a/samples/comparison/src/main/java/com/facebook/samples/comparison/instrumentation/PerfListener.java +++ b/samples/comparison/src/main/java/com/facebook/samples/comparison/instrumentation/PerfListener.java @@ -58,17 +58,23 @@ public long getAverageWaitTime() { return completedRequests > 0 ? mSumOfWaitTime / completedRequests : 0; } - /** @return difference between number of started requests and number of completed requests */ + /** + * @return difference between number of started requests and number of completed requests + */ public long getOutstandingRequests() { return mStartedRequests - getCompletedRequests(); } - /** @return number of cancelled requests */ + /** + * @return number of cancelled requests + */ public long getCancelledRequests() { return mCancelledRequests; } - /** @return number of completed requests, either by seting final image, failure or cancellation */ + /** + * @return number of completed requests, either by seting final image, failure or cancellation + */ public long getCompletedRequests() { return mSuccessfulRequests + mCancelledRequests + mFailedRequests; } diff --git a/samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/fragments/recycler/DraweeViewHolder.java b/samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/fragments/recycler/DraweeViewHolder.java index 6bbeddf44d..74f1e8587b 100644 --- a/samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/fragments/recycler/DraweeViewHolder.java +++ b/samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/fragments/recycler/DraweeViewHolder.java @@ -46,7 +46,9 @@ public DraweeViewHolder( mPerfListener = perfListener; } - /** @param uri The Uri to show into the DraweeView for this Holder */ + /** + * @param uri The Uri to show into the DraweeView for this Holder + */ public void bind(Uri uri) { mDraweeView.initInstrumentation(uri.toString(), mPerfListener); ImageRequestBuilder imageRequestBuilder = diff --git a/samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/instrumentation/PerfListener.java b/samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/instrumentation/PerfListener.java index b36315e85f..2f42e6870f 100644 --- a/samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/instrumentation/PerfListener.java +++ b/samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/instrumentation/PerfListener.java @@ -61,17 +61,23 @@ public long getAverageWaitTime() { return completedRequests > 0 ? mSumOfWaitTime / completedRequests : 0; } - /** @return difference between number of started requests and number of completed requests */ + /** + * @return difference between number of started requests and number of completed requests + */ public long getOutstandingRequests() { return mStartedRequests - getCompletedRequests(); } - /** @return number of cancelled requests */ + /** + * @return number of cancelled requests + */ public long getCancelledRequests() { return mCancelledRequests; } - /** @return number of completed requests, either by seting final image, failure or cancellation */ + /** + * @return number of completed requests, either by seting final image, failure or cancellation + */ public long getCompletedRequests() { return mSuccessfulRequests + mCancelledRequests + mFailedRequests; } diff --git a/samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/postprocessor/ScalingBlurPostprocessor.java b/samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/postprocessor/ScalingBlurPostprocessor.java index 71ed22c93c..6feaa731bc 100644 --- a/samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/postprocessor/ScalingBlurPostprocessor.java +++ b/samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/postprocessor/ScalingBlurPostprocessor.java @@ -26,6 +26,7 @@ public class ScalingBlurPostprocessor extends BasePostprocessor { private final Paint mPaint = new Paint(); private final int mIterations; private final int mBlurRadius; + /** * A scale ration of 4 means that we reduce the total number of pixels to process by factor 16. */ diff --git a/vito/core-java-impl/src/main/java/com/facebook/fresco/vito/core/impl/FrescoDrawable2Impl.java b/vito/core-java-impl/src/main/java/com/facebook/fresco/vito/core/impl/FrescoDrawable2Impl.java index b9bdac58fc..12a30a6c87 100644 --- a/vito/core-java-impl/src/main/java/com/facebook/fresco/vito/core/impl/FrescoDrawable2Impl.java +++ b/vito/core-java-impl/src/main/java/com/facebook/fresco/vito/core/impl/FrescoDrawable2Impl.java @@ -386,7 +386,9 @@ public VitoImagePerfListener getImagePerfListener() { return mImagePerfListener; } - /** @return the width of the underlying actual image or -1 if unset */ + /** + * @return the width of the underlying actual image or -1 if unset + */ @Override public int getActualImageWidthPx() { if (CloseableReference.isValid(mImageReference)) { @@ -395,7 +397,9 @@ public int getActualImageWidthPx() { return -1; } - /** @return the width of the underlying actual image or -1 if unset */ + /** + * @return the width of the underlying actual image or -1 if unset + */ @Override public int getActualImageHeightPx() { if (CloseableReference.isValid(mImageReference)) {