Skip to content

glide 4.7.1 Error #3157

@huahua495

Description

@huahua495

@nonnull
public final Registry setResourceDecoderBucketPriorityList(@nonnull List buckets) {
List modifiedBuckets = new ArrayList<>(buckets);
modifiedBuckets.add(0, BUCKET_PREPEND_ALL);
modifiedBuckets.add(BUCKET_APPEND_ALL);
decoderRegistry.setBucketPriorityList(modifiedBuckets);
return this;
}
It may appear here
java.lang.ClassCastException: int[] cannot be cast to java.lang.Object[]
at java.util.Arrays$ArrayList.toArray(Arrays.java:120)
at java.util.ArrayList.(ArrayList.java:97)
at com.bumptech.glide.Registry.setResourceDecoderBucketPriorityList(Registry.java:268)
Can you tell me what caused this?

Discovered by tracking, The last sentence here

public Registry() {
this.modelLoaderRegistry = new ModelLoaderRegistry(throwableListPool);
this.encoderRegistry = new EncoderRegistry();
this.decoderRegistry = new ResourceDecoderRegistry();
this.resourceEncoderRegistry = new ResourceEncoderRegistry();
this.dataRewinderRegistry = new DataRewinderRegistry();
this.transcoderRegistry = new TranscoderRegistry();
this.imageHeaderParserRegistry = new ImageHeaderParserRegistry();
setResourceDecoderBucketPriorityList(
Arrays.asList(BUCKET_GIF, BUCKET_BITMAP, BUCKET_BITMAP_DRAWABLE));
}
public static final String BUCKET_GIF = "Gif";
public static final String BUCKET_BITMAP = "Bitmap";
public static final String BUCKET_BITMAP_DRAWABLE = "BitmapDrawable";

Here is that this error should not occur

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions