Your statement is wrong, in the following sense: at runtime, the call to x.foo() would always start look at the runtime type (which in this case is Bar, or some subclass of it) - otherwise overriding methods would not work.
https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.htm...