How to fix this "incompatible types" issue
In the code below if I don't use a cast:
Code:
ArrayList<Instance> currentEvent = mapItem.getValue();
I get:
Code:
incompatible types
found : java.lang.Object
required: java.util.ArrayList<Instance>
ArrayList<Instance> currentEvent = mapItem.getValue();
If I use a cast:
Code:
ArrayList<Instance> currentEvent = (ArrayList<Instance>) mapItem.getValue();
I get
Code:
warning: [unchecked] unchecked cast
found : java.lang.Object
required: java.util.ArrayList<Instance>
ArrayList<Instance> currentEvent = (ArrayList<Instance>) mapItem.getValue();
mapItem is aMap.Entry. What am I doing wrong ?
thanks