Skip to content

Commit 6aa7ad2

Browse files
sjuddglide-copybara-robot
authored andcommitted
Fix class cast exception in Registry#setResosurceDecoderBucketPriorityList
This works around a bug in the jdk. Fixes #4309 PiperOrigin-RevId: 326123807
1 parent 93a2d0e commit 6aa7ad2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

library/src/main/java/com/bumptech/glide/Registry.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,11 @@ public <Data, TResource> Registry prepend(
261261
public final Registry setResourceDecoderBucketPriorityList(@NonNull List<String> buckets) {
262262
// See #3296 and https://bugs.openjdk.java.net/browse/JDK-6260652.
263263
List<String> modifiedBuckets = new ArrayList<>(buckets.size());
264-
modifiedBuckets.addAll(buckets);
265-
modifiedBuckets.add(0, BUCKET_PREPEND_ALL);
264+
modifiedBuckets.add(BUCKET_PREPEND_ALL);
265+
// See https://github.com/bumptech/glide/issues/4309.
266+
for (String bucket : buckets) {
267+
modifiedBuckets.add(bucket);
268+
}
266269
modifiedBuckets.add(BUCKET_APPEND_ALL);
267270
decoderRegistry.setBucketPriorityList(modifiedBuckets);
268271
return this;

0 commit comments

Comments
 (0)