Java is Pass-by-Value, Dammit
So to summarize, you have a Java function:  public void f(Foo bar) { ... }

Which is the equivalent C++ function?  void f(Foo bar) { ... }
  void f(Foo& bar) { ... }
  void f(Foo* bar) { ... }

It's the last one. Java passes everything by value, but non-primitive objects in Java are actually pointers (which Java inaccurately calls references), and the pointer is passed by value.