Community
Participate
Working Groups
------------------------ Bug.java -------------------------- class Bug<Row>{} class Derived extends Bug<String>{} class Type<Row>{ Bug<Row>bug=(Bug)new Derived(); }
IMO the compiler shouldn't flag this as an unnecessary cast in the first place. Moving to JDT/Core.
This is questionnable. Technically, Bug<String> <: Bug, thus the cast doesn't provide any extra value. It is however permitting some forbidden conversion in this scenario, and removing the offending cast would reveal the badness in the code. I would thus favor leaving the warning in, to flag the situation.
Will preserve existing behavior as explained above.