3. Simplified HashCode sample.

Listing 3. Simplified HashCode sample.


public int hashCode2() {
  int result = super.hashCode(); // PICK ONE
  //int result = 0;              // PICK ONE
  result = Utility.hashCode(result,primitiveField);
  result = Utility.hashCode(result,flagField);
  result = Utility.hashCode(result,longField);
  result = Utility.hashCode(result,doubleField);
  result = Utility.hashCode(result,objectField);
  result = Utility.hashCode(result,maybeNullField);
  result = Utility.hashCode(result,arrayField);
  return result;
}__