<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nonnull/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nonnull">@nonnull</a><br>
public final Registry setResourceDecoderBucketPriorityList(<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nonnull/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nonnull">@nonnull</a> List buckets) {<br>
List modifiedBuckets = new ArrayList&lt;&gt;(buckets);<br>
modifiedBuckets.add(0, BUCKET_PREPEND_ALL);<br>
modifiedBuckets.add(BUCKET_APPEND_ALL);<br>
decoderRegistry.setBucketPriorityList(modifiedBuckets);<br>
return this;<br>
}<br>
It may appear here<br>
java.lang.ClassCastException: int[] cannot be cast to java.lang.Object[]<br>
at java.util.Arrays$ArrayList.toArray(Arrays.java:120)<br>
at java.util.ArrayList.(ArrayList.java:97)<br>
at com.bumptech.glide.Registry.setResourceDecoderBucketPriorityList(Registry.java:268)<br>
Can you tell me what caused this?</p>
<p dir="auto">Discovered by tracking， The last sentence here</p>
<p dir="auto">public Registry() {<br>
this.modelLoaderRegistry = new ModelLoaderRegistry(throwableListPool);<br>
this.encoderRegistry = new EncoderRegistry();<br>
this.decoderRegistry = new ResourceDecoderRegistry();<br>
this.resourceEncoderRegistry = new ResourceEncoderRegistry();<br>
this.dataRewinderRegistry = new DataRewinderRegistry();<br>
this.transcoderRegistry = new TranscoderRegistry();<br>
this.imageHeaderParserRegistry = new ImageHeaderParserRegistry();<br>
setResourceDecoderBucketPriorityList(<br>
Arrays.asList(BUCKET_GIF, BUCKET_BITMAP, BUCKET_BITMAP_DRAWABLE));<br>
}<br>
public static final String BUCKET_GIF = "Gif";<br>
public static final String BUCKET_BITMAP = "Bitmap";<br>
public static final String BUCKET_BITMAP_DRAWABLE = "BitmapDrawable";</p>
<p dir="auto">Here is that this error should not occur</p>
<p dir="auto">Hi</p>
<p dir="auto">I'd like an option to invalidate a cache key where the url/signature is known.</p>
<p dir="auto">I've read through <a href="https://github.com/bumptech/glide/wiki/Caching-and-Cache-Invalidation">https://github.com/bumptech/glide/wiki/Caching-and-Cache-Invalidation</a>, and that makes sense. However, if I set my own signature (for example "personalavatar"), and I know that key has changed during a background service upload. It should be easy enough to invalidate that one key.</p>
<p dir="auto">There are other cases as well. For example in some situations when uploading new images we are very aware of where those images are being used and exactly which url is loaded. It would make sense in those scenarios to invalidate those cache keys, and wait for the next load to reload the image.</p>