I have a situation where i get an Object as a return type and it needs to be casted to a List<Object[]> type. This looks easier then it seems though.
First of all when i try the following: Object[] objectArray = (Object[])object; i get the warning that the (Object[]) cast is redundant. Why on earth would this be redundant? An Object surely must be something different to an Object Array right? Well according to Intellij its secretly the same thing and i would appreciate it if someone could explain me why this is the case.
Because of the above described phenomenon i can't do this either:
Object[] objects = (Object[])callOutputs.getOutputParameterValue(entrySet.getValue());
List<Object[]> objectList = Arrays.asList(objects);
Despite casting the returntype explicitly to Object[], Arrays.asList() still treats it as an Object. Even though the variable type is Object[].
Can someone explain how you should create a List<Object[]> object?
EDIT: Here is the method declaration:
public abstract <T> T getOutputParameterValue(org.hibernate.procedure.ParameterRegistration<T> parameterRegistration)