reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dongjoon Hyun (JIRA)" <j...@apache.org>
Subject [jira] [Created] (REEF-1047) ConstructorDefImpl.hashCode function should consider `className`
Date Mon, 07 Dec 2015 15:59:10 GMT
Dongjoon Hyun created REEF-1047:
-----------------------------------

             Summary: ConstructorDefImpl.hashCode function should consider `className`
                 Key: REEF-1047
                 URL: https://issues.apache.org/jira/browse/REEF-1047
             Project: REEF
          Issue Type: Bug
          Components: Tang
            Reporter: Dongjoon Hyun
            Assignee: Dongjoon Hyun


`hashCode` function should consider all fields to distinguish objects. This issue fixes the
`hashCode` function of `ConstructorDefImpl` class to consider `className` and `args` together.

{code:title=ConstructorDefImpl.java|borderStyle=solid}
   public int hashCode() {
     final ConstructorArg[] argsSort = getArgs().clone();
     Arrays.sort(argsSort);
-    return Arrays.hashCode(argsSort);
+    int result = Arrays.hashCode(argsSort);
+    result = 31 * result + (this.className == null ? 0 : this.className.hashCode());
+    return result;
   }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message