From a7b254c42888db691b7339b2165abcd462473fcf Mon Sep 17 00:00:00 2001 From: Sam Judd Date: Fri, 16 Apr 2021 14:42:35 -0700 Subject: [PATCH] ...Androidx Annotation Migration... PiperOrigin-RevId: 368922286 --- .../bumptech/glide/annotation/compiler/ProcessorUtil.java | 5 ----- .../GeneratedAppGlideModuleImpl.java | 2 +- .../GeneratedAppGlideModuleImpl.java | 2 +- .../GeneratedAppGlideModuleImpl.java | 2 +- .../GeneratedAppGlideModuleImpl.java | 2 +- .../GeneratedAppGlideModuleImpl.java | 2 +- .../test/resources/EmptyAppGlideModuleTest/GlideApp.java | 6 +++--- .../main/java/com/bumptech/glide/gifdecoder/GifFrame.java | 2 +- .../java/com/bumptech/glide/gifdecoder/GifHeaderParser.java | 2 +- .../com/bumptech/glide/gifdecoder/StandardGifDecoder.java | 4 ++-- .../com/bumptech/glide/gifencoder/AnimatedGifEncoder.java | 2 +- 11 files changed, 13 insertions(+), 18 deletions(-) diff --git a/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java b/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java index 65a01ab567..473833af6c 100644 --- a/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java +++ b/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java @@ -55,8 +55,6 @@ /** Utilities for writing classes and logging. */ final class ProcessorUtil { - // TODO: Remove this once we convert Glide's internal classes to AndroidX. - private static final boolean REQUIRE_SUPPORT_ANNOTATIONS = false; private static final String GLIDE_MODULE_PACKAGE_NAME = "com.bumptech.glide.module"; private static final String APP_GLIDE_MODULE_SIMPLE_NAME = "AppGlideModule"; private static final String LIBRARY_GLIDE_MODULE_SIMPLE_NAME = "LibraryGlideModule"; @@ -503,9 +501,6 @@ static List nonNulls() { } private ClassName findAnnotationClassName(ClassName androidxName, ClassName supportName) { - if (REQUIRE_SUPPORT_ANNOTATIONS) { - return supportName; - } Elements elements = processingEnv.getElementUtils(); TypeElement visibleForTestingTypeElement = elements.getTypeElement(androidxName.reflectionName()); diff --git a/annotation/compiler/test/src/test/resources/AppGlideModuleWithExcludesTest/GeneratedAppGlideModuleImpl.java b/annotation/compiler/test/src/test/resources/AppGlideModuleWithExcludesTest/GeneratedAppGlideModuleImpl.java index 65601ab29a..37c370dd32 100644 --- a/annotation/compiler/test/src/test/resources/AppGlideModuleWithExcludesTest/GeneratedAppGlideModuleImpl.java +++ b/annotation/compiler/test/src/test/resources/AppGlideModuleWithExcludesTest/GeneratedAppGlideModuleImpl.java @@ -1,8 +1,8 @@ package com.bumptech.glide; import android.content.Context; -import androidx.annotation.NonNull; import android.util.Log; +import androidx.annotation.NonNull; import com.bumptech.glide.test.AppModuleWithExcludes; import java.util.HashSet; import java.util.Set; diff --git a/annotation/compiler/test/src/test/resources/AppGlideModuleWithLibraryInPackageTest/GeneratedAppGlideModuleImpl.java b/annotation/compiler/test/src/test/resources/AppGlideModuleWithLibraryInPackageTest/GeneratedAppGlideModuleImpl.java index 02d9b660f9..f2ad77e022 100644 --- a/annotation/compiler/test/src/test/resources/AppGlideModuleWithLibraryInPackageTest/GeneratedAppGlideModuleImpl.java +++ b/annotation/compiler/test/src/test/resources/AppGlideModuleWithLibraryInPackageTest/GeneratedAppGlideModuleImpl.java @@ -1,8 +1,8 @@ package com.bumptech.glide; import android.content.Context; -import androidx.annotation.NonNull; import android.util.Log; +import androidx.annotation.NonNull; import com.bumptech.glide.test.AppModuleWithLibraryInPackage; import java.util.HashSet; import java.util.Set; diff --git a/annotation/compiler/test/src/test/resources/AppGlideModuleWithMultipleExcludesTest/GeneratedAppGlideModuleImpl.java b/annotation/compiler/test/src/test/resources/AppGlideModuleWithMultipleExcludesTest/GeneratedAppGlideModuleImpl.java index 6b285af414..c0f30f3838 100644 --- a/annotation/compiler/test/src/test/resources/AppGlideModuleWithMultipleExcludesTest/GeneratedAppGlideModuleImpl.java +++ b/annotation/compiler/test/src/test/resources/AppGlideModuleWithMultipleExcludesTest/GeneratedAppGlideModuleImpl.java @@ -1,8 +1,8 @@ package com.bumptech.glide; import android.content.Context; -import androidx.annotation.NonNull; import android.util.Log; +import androidx.annotation.NonNull; import com.bumptech.glide.test.AppModuleWithMultipleExcludes; import java.util.HashSet; import java.util.Set; diff --git a/annotation/compiler/test/src/test/resources/EmptyAppAndLibraryGlideModulesTest/GeneratedAppGlideModuleImpl.java b/annotation/compiler/test/src/test/resources/EmptyAppAndLibraryGlideModulesTest/GeneratedAppGlideModuleImpl.java index 7180b6f625..d8e26dbdf7 100644 --- a/annotation/compiler/test/src/test/resources/EmptyAppAndLibraryGlideModulesTest/GeneratedAppGlideModuleImpl.java +++ b/annotation/compiler/test/src/test/resources/EmptyAppAndLibraryGlideModulesTest/GeneratedAppGlideModuleImpl.java @@ -1,8 +1,8 @@ package com.bumptech.glide; import android.content.Context; -import androidx.annotation.NonNull; import android.util.Log; +import androidx.annotation.NonNull; import com.bumptech.glide.test.EmptyAppModule; import com.bumptech.glide.test.EmptyLibraryModule; import java.util.Collections; diff --git a/annotation/compiler/test/src/test/resources/EmptyAppGlideModuleTest/GeneratedAppGlideModuleImpl.java b/annotation/compiler/test/src/test/resources/EmptyAppGlideModuleTest/GeneratedAppGlideModuleImpl.java index 8ed710b2bc..c5e014dded 100644 --- a/annotation/compiler/test/src/test/resources/EmptyAppGlideModuleTest/GeneratedAppGlideModuleImpl.java +++ b/annotation/compiler/test/src/test/resources/EmptyAppGlideModuleTest/GeneratedAppGlideModuleImpl.java @@ -1,8 +1,8 @@ package com.bumptech.glide; import android.content.Context; -import androidx.annotation.NonNull; import android.util.Log; +import androidx.annotation.NonNull; import com.bumptech.glide.test.EmptyAppModule; import java.util.Collections; import java.util.Set; diff --git a/annotation/compiler/test/src/test/resources/EmptyAppGlideModuleTest/GlideApp.java b/annotation/compiler/test/src/test/resources/EmptyAppGlideModuleTest/GlideApp.java index 2b18540210..a95da451e6 100644 --- a/annotation/compiler/test/src/test/resources/EmptyAppGlideModuleTest/GlideApp.java +++ b/annotation/compiler/test/src/test/resources/EmptyAppGlideModuleTest/GlideApp.java @@ -3,12 +3,12 @@ import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.annotation.VisibleForTesting; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import android.view.View; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; import com.bumptech.glide.Glide; import com.bumptech.glide.GlideBuilder; import java.io.File; diff --git a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifFrame.java b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifFrame.java index 2d4794c85d..fcb24eb17f 100644 --- a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifFrame.java +++ b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifFrame.java @@ -1,7 +1,7 @@ package com.bumptech.glide.gifdecoder; -import androidx.annotation.IntDef; import androidx.annotation.ColorInt; +import androidx.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java index 0a38c2d21d..c6e24da678 100644 --- a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java +++ b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java @@ -4,9 +4,9 @@ import static com.bumptech.glide.gifdecoder.GifFrame.DISPOSAL_NONE; import static com.bumptech.glide.gifdecoder.GifFrame.DISPOSAL_UNSPECIFIED; +import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import android.util.Log; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/StandardGifDecoder.java b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/StandardGifDecoder.java index 24690bb6fd..7655723103 100644 --- a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/StandardGifDecoder.java +++ b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/StandardGifDecoder.java @@ -30,10 +30,10 @@ import android.graphics.Bitmap; import android.graphics.Bitmap.Config; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import android.util.Log; import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; diff --git a/third_party/gif_encoder/src/main/java/com/bumptech/glide/gifencoder/AnimatedGifEncoder.java b/third_party/gif_encoder/src/main/java/com/bumptech/glide/gifencoder/AnimatedGifEncoder.java index e4e381c9e3..ebf3b27727 100644 --- a/third_party/gif_encoder/src/main/java/com/bumptech/glide/gifencoder/AnimatedGifEncoder.java +++ b/third_party/gif_encoder/src/main/java/com/bumptech/glide/gifencoder/AnimatedGifEncoder.java @@ -4,9 +4,9 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; +import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import android.util.Log; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException;