[Bug 337323] [NEW] equals(Object ) on Tuple3d not defined

twak tkelly at dcs.gla.ac.uk
Tue Mar 3 17:43:20 UTC 2009


Public bug reported:

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/

** Affects: vecmath1.2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
equals(Object ) on Tuple3d not defined
https://bugs.launchpad.net/bugs/337323
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list