Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

changes the array which is now referenced internally by the class containing setReferencePoint. It is probably better practice to internally clone the array, for example:

Code Block
titleexample.java

public void setReferencePoint(double[] point){
   _refPoint = point.clone();
}

or to make sure the documentation to setReferencePoint explains that it will hold a reference to the array and the user should not modify it.

...