(I did a little test with scalac and found that the java compiler doesn't eliminate the field. However, it's much harder to say what the JIT is willing to do, so that's not a conclusive result.)