CoverityFix CID:1360856 Problems with implementation of equals() 34/20234/4
Nimish Kapoor [Fri, 6 Jul 2018 18:19:38 +0000 (23:19 +0530)]
Change-Id: Ia1e175445e2006435b6abd408804b36b008482fe

scilab/modules/scirenderer/src/org/scilab/forge/scirenderer/tranformations/Rotation.java

index 17eec92..c55b987 100644 (file)
@@ -291,7 +291,12 @@ public class Rotation {
         return hashCode;
     }
 
-    public boolean equals(Rotation r2) {
+    @Override
+    public boolean equals(Object object) {
+        if(this == object) return true;
+        if(!(object instanceof Rotation)) return false;
+
+        Rotation r2 = (Rotation) object;
         return  (r2 != null) && (a == r2.a)  && (b == r2.b)  && (c == r2.c)  && (d == r2.d);
     }
 }