Looks for incorrect casts to views that according to the XML are of a different type
Keeps track of the view types associated with ids and if it finds a usage of the id in the Java code it ensures that it is treated as the same type.