I am maintaining some code and I have just seen something silly like the below. I corrected of course because we have an unused instance of class A floating around until the garbage collector decides to reclaim it.
A a = new A();
a = (A)...;
Do any of you know of a tool that can scan source code and detect such things?