0

Android Lint is giving a warning as "Uses unchecked or unsafe operations" and I can't understand why and how to get rid of it without suppressing warnings.

In this next piece of code

...
AppSettings appSettings = AppSettings.getInstance();
int cornerRadius = AWScreen.dp2px(appSettings.paintingCornerRadius, this);
//
int animDrawable = AWUtils.getDrawable(animName);
if (animDrawable!=-1){
    Glide
        .with(this)
        .load(animDrawable)
        .override(imgWidth, imgHeight)
        .transform(new CenterCrop(), new RoundedCorners(cornerRadius))
        .into(animOverlay);
}

animOverlay.setVisibility(View.VISIBLE);
...

Lint is giving the warning in

.transform(new CenterCrop(), new RoundedCorners(cornerRadius))

I know unsafe operations warnings mostly happen when you have a generic ArrayList where you don't specify type, but I don't see anything wrong in the line and there is also no ArrayList in the Glide config.

¿Any ideas?

Diego Perez
  • 2,188
  • 2
  • 30
  • 58
  • It's not just `ArrayList`, it's _any_ generic. It appears that `transform` takes a varargs array of generic `Transformation`s, which means that it should be annotated with `@SafeVarargs` but isn't. This appears to be a bug in Glide and should be reported. – chrylis -cautiouslyoptimistic- May 01 '20 at 22:04
  • Thank you very much for your detailed and helpful comment @chrylis -on strike- Should I close this answer? – Diego Perez May 01 '20 at 22:16

0 Answers0