Top "Unchecked-cast" questions

Unchecked cast means that you are casting from a generic type to a non-qualified type, or the other way around.

How to check types of key and value if Object instanceof HashMap?

I have a method that accepts an Object. In one use case, the method accepts a HashMap<String, String&…

java object unchecked-cast
Type safety: Unchecked cast from Object to ArrayList<MyVariable>

Here is a part of a program that sends an ArrayList from a server to a client. I want to …

java arraylist casting warnings unchecked-cast
Unsafe or unchecked operations warning

In an app I am using SharedPrefernces to save/load (serialize/deserialize) some objects. This is the deserialization code: private …

java android serialization sharedpreferences unchecked-cast
Unchecked cast: 'java.io.Serializable' to 'java.util.ArrayList<android.app.Fragment>'

I am getting an unchecked cast warning and I am not sure if it is safe to suppress it. I …

java android unchecked-cast