I think that is exactly what compilers are supposed to be doing.
HOWEVER, quoting from Kernighan & Ritchie "...writing code that depends on order of evaluation is a bad programming practive in any language."
HOWEVER, I believe
Java specifies left-to-right order more rigorously than the C specification does:
evaluation order