Is there a reference that describes **Java's** behaviour in this case?