By default, Eclipse changes entire methods, not individual lines of code. For a replaced method to become effective, is has to be called. This means that when multiple threads are accessing this method, each may be executing its own version of the method.
Is there a way to solve it?
Anyhow, figured out something interesting. I set a breakpoint on "System.out.println" and it stopped running the code when it hit it, so I ran it a few times getting the same value of X printed out. I changed the value and then continued to run it, breaking a few times at the breakpoint. This worked though, the X value was showing the changed value.
So I guess it only works if I hit the breakpoints though. Weird, but a clue.