Skip to content

Commit

Permalink
Fix class cast exception in Registry#setResosurceDecoderBucketPriorit…
Browse files Browse the repository at this point in the history
…yList

This works around a bug in the jdk. Fixes #4309

PiperOrigin-RevId: 326123807
  • Loading branch information
sjudd authored and glide-copybara-robot committed Aug 11, 2020
1 parent 93a2d0e commit 6aa7ad2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library/src/main/java/com/bumptech/glide/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,11 @@ public <Data, TResource> Registry prepend(
public final Registry setResourceDecoderBucketPriorityList(@NonNull List<String> buckets) {
// See #3296 and https://bugs.openjdk.java.net/browse/JDK-6260652.
List<String> modifiedBuckets = new ArrayList<>(buckets.size());
modifiedBuckets.addAll(buckets);
modifiedBuckets.add(0, BUCKET_PREPEND_ALL);
modifiedBuckets.add(BUCKET_PREPEND_ALL);
// See https://github.com/bumptech/glide/issues/4309.
for (String bucket : buckets) {
modifiedBuckets.add(bucket);
}
modifiedBuckets.add(BUCKET_APPEND_ALL);
decoderRegistry.setBucketPriorityList(modifiedBuckets);
return this;
Expand Down

0 comments on commit 6aa7ad2

Please sign in to comment.