[vtkusers] How does GetJavaArray() work?

Steve M. Robbins steven.robbins at videotron.ca
Fri Aug 26 15:34:21 EDT 2005


Howdy,

I'm looking at the generated Java wrapping code from literally
minutes ago.

The generated java class for vtkFloatArray contains:

  private native float[] GetJavaArray_0();
  public float[] GetJavaArray()
    { return GetJavaArray_0(); }


Note that the native method is GetJavaArray_0.

The generated C++ JNI code contains:

extern "C" JNIEXPORT jarray JNICALL Java_vtk_vtkFloatArray_GetJavaArray_10(JNIEnv *env, jobject obj)
{ ... }

So the native function is really "GetJavaArray_10"!  

I would have expected a link error.  Yet, the test
Wrapping/Java/Regression.java works correctly.  Why?

-Steve



More information about the vtkusers mailing list