unchecked cast warning on Collection

Viewed 42

I am mapping a postgres array_agg value to a list, but I'm getting a warning below Unchecked cast: 'java.lang.Object' to 'java.util.Collection<java.lang.String> What is the fix for this?

public UserDTO transformTuple(Object[] objects, String[] strings) {
    List<String> roleList = new ArrayList<>((Collection<String>)objects[7]);
1 Answers
Related