IntelliJ by default installation doesn't build project after changes. You either need to do manually (upper menu -> Build : project, module or recompile only particular source file) or change settings presumably.
For me isn't clear. Maybe you could add some screenshots, i.e. showing your current code has a method call:
2. but in debug mode it calls method B() instead of A(), because that was previous version of your code.
Are we talking about the same thing as described above?