I can do the following without problem:
ArrayList list = (ArrayList)object;
But doing the following gives an "unchecked cast" warning:
Why is it not caring about casting to non generic types, but gives a warning when casting to a generic type? Generics aren't forbidden magic as far as I'm concerned... :)
Also, what does it want me to do to solve the warning? I don't want to put a "if(object instanceof ArrayList)" around this code in any case. it also doesn't require that when casting to a non-generic type... If I press "alt enter" on the warning, the only options are "convert to atomic", and "try to generify the class", both of which are totally pointless and would break my code.
Original message URL: http://devnet.jetbrains.net/message/5272329#5272329