Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 830
    • Issues 830
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 240
    • Merge requests 240
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTKVTK
  • VTKVTK
  • Issues
  • #17652
Closed
Open
Issue created Aug 01, 2019 by David Gobbi@dgobbiDeveloper

Java wrapping of overloaded methods doesn't prefer 'double' over 'float'

The Java wrappers always use 'jdouble' as the floating-point interface type on the Java side. However, on the C++ side, if a method is overloaded for 'float' and 'double' arguments, then the Java wrappers will simply wrap whichever overload comes first in the header file. If the 'float' overload comes first, then the Java wrappers will convert 'jdouble' to 'float' and will call the 'float' overload.

Example where the 'double' overload is wrapped and the 'float' overload is ignored:

double *vtkAbstractTransform::TransformPoint(const double p[3]) VTK_SIZEHINT(3);
float *vtkAbstractTransform::TransformPoint(const float p[3]) VTK_SIZEHINT(3);

Example where the 'float' overload is wrapped and the 'double' overload is ignored:

float *vtkMatrix4x4::MultiplyPoint(const float p[4]) VTK_SIZEHINT(4);
double *vtkMatrix4x4::MultiplyPoint(const double p[4]) VTK_SIZEHINT(4);
Assignee
Assign to
Time tracking