java objects should implement toString()
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Java has a standard method to return a string that represents the object, which is useful for tracing or debugging.
The VTK Print() method provides a suitable string.
The patch below fixes the java wrapper to generate the toString() method.
Index: Wrapping/vtkParseJava.c
RCS file: /cvsroot/VTK/VTK/Wrapping/vtkParseJava.c,v retrieving revision 1.30 diff -u -b -B -r1.30 vtkParseJava.c --- Wrapping/vtkParseJava.c 14 Nov 2003 20:43:38 -0000 1.30 +++ Wrapping/vtkParseJava.c 20 Feb 2005 07:05:28 -0000 @@ -493,6 +493,7 @@ fprintf(fp," public native String Print();\n"); /* Add the PrintRevisions method to vtkObject. */ fprintf(fp," public native String PrintRevisions();\n");
- fprintf(fp," public String toString() { return Print(); }\n"); }
if (!strcmp("vtkObject",data->ClassName))