Consider opaqueParameters in AbstractFunctionCallExpression equals&hashcode methods to make casting operators with the same argument distinguishable

Change-Id: I7b8bf5979732eb22dff824e48a57fdd1b1da4dda
Reviewed-on: http://fulliautomatix.ics.uci.edu:8443/100
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <westmann@gmail.com>
Reviewed-by: Inci Cetindil <icetindil@gmail.com>
diff --git a/algebricks/algebricks-core/src/main/java/edu/uci/ics/hyracks/algebricks/core/algebra/expressions/AbstractFunctionCallExpression.java b/algebricks/algebricks-core/src/main/java/edu/uci/ics/hyracks/algebricks/core/algebra/expressions/AbstractFunctionCallExpression.java
index b8a9c87..1792641 100644
--- a/algebricks/algebricks-core/src/main/java/edu/uci/ics/hyracks/algebricks/core/algebra/expressions/AbstractFunctionCallExpression.java
+++ b/algebricks/algebricks-core/src/main/java/edu/uci/ics/hyracks/algebricks/core/algebra/expressions/AbstractFunctionCallExpression.java
@@ -206,6 +206,16 @@
                 if (!argument.equals(fceArgument))
                     return false;
             }
+            if (opaqueParameters != null) {
+                if (opaqueParameters.length != fce.opaqueParameters.length)
+                    return false;
+                for (int i = 0; i < opaqueParameters.length; i++) {
+                    Object opaqueParameter = opaqueParameters[i];
+                    Object fceOpaqueParameter = fce.opaqueParameters[i];
+                    if (!opaqueParameter.equals(fceOpaqueParameter))
+                        return false;
+                }
+            }
             return true;
         }
     }
@@ -216,6 +226,11 @@
         for (Mutable<ILogicalExpression> e : arguments) {
             h = h * 41 + e.getValue().hashCode();
         }
+        if (opaqueParameters != null) {
+            for (int i = 0; i < opaqueParameters.length; i++) {
+                h = h * 31 + opaqueParameters[i].hashCode();
+            }
+        }
         return h;
     }