equals(Object ) on Tuple3d not defined

Bug #337323 reported by twak
2
Affects Status Importance Assigned to Milestone
vecmath1.2 (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

The vecmath Tuple3d class doesn't define equals correctly.

the method missing (from the GPL2'd java3d vecmath) is

    public boolean equals(Object t1)
    {
      try {
           Tuple3d t2 = (Tuple3d) t1;
           return(this.x == t2.x && this.y == t2.y && this.z == t2.z);
      }
      catch (ClassCastException e1) {return false;}
      catch (NullPointerException e2) {return false;}

    }

boolean equals (Tuple3d) isn't enough!

public class NewClass
{
    public static void main (String[] args)
    {
        Vector3d v = new Vector3d(1,2,3);
        Point3d p = new Point3d(1,2,3);

        System.out.println(
                v.equals( (Object)p));
        System.out.println(
                v.equals( (Object)new Point3d(1,2,3))== v.equals( p ));
    }
}

Should consider replacing this package with the official vecmath package now it's been GPL'd?
https://vecmath.dev.java.net/

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

The official vecmath package is now available in karmic. And unofficial vecmath1.2 is likely to be removed from repositories.

Changed in vecmath1.2 (Ubuntu):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.