So it turns out that Java is pass-by-value.