bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.67k stars 6.12k forks source link

Fix broken DownsamplerEmulatorTest due to class-not-found regression #5365

Closed falhassen closed 9 months ago

falhassen commented 9 months ago

The changes to DownsamplerSamplerEmulatorTest in https://github.com/bumptech/glide/pull/5357 broke the test, with errors loading the SDK level 34 class, android.graphics.Gainmap:

"Caused by: java.lang.ClassNotFoundException: Didn't find class "android.graphics.Gainmap" on path"

Apparently, the test runner does a class resolution of all method signatures, even if they have a @RequiresApi annoation. This will fail on emulators that have SDK levels that don't include the class. Also, even import statements seem to fail.

I basically inlined the method, which is version-guarded, and removed the explicit import.