Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
37 | 2 | 6 | 0.980 | class_member_declarations[3] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 37 | 65 | src/NHibernate/Type/DateType.cs |
2 | 37 | 72 | src/NHibernate/Type/TimeType.cs |
| ||||
public override bool IsEqual(object x, object y) { if (x == y) { return true; } if (x == null || y == null) { return false; } DateTime date1 = (DateTime)x; DateTime date2 = (DateTime)y; if (date1.Equals(date2)) return true; return date1.Day == date2.Day && date1.Month == date2.Month && date1.Year == date2.Year; } public override int GetHashCode(object x, EntityMode entityMode) { DateTime date = (DateTime)x; int hashCode = 1; unchecked { hashCode = 31 * hashCode + date.Day; hashCode = 31 * hashCode + date.Month; hashCode = 31 * hashCode + date.Year; } return hashCode; } public override string ToString(object val) { return ((DateTime) val).ToShortDateString(); } |
| ||||
public override bool IsEqual(object x, object y) { if (x == y) { return true; } if (x == null || y == null) { return false; } DateTime date1 = (DateTime)x; DateTime date2 = (DateTime)y; if (date1.Equals(date2)) return true; return date1.Hour == date2.Hour && date1.Minute == date2.Minute && date1.Second == date2.Second; } public override int GetHashCode(object x, EntityMode entityMode) { DateTime date = (DateTime)x; int hashCode = 1; unchecked { hashCode = 31 * hashCode + date.Second; hashCode = 31 * hashCode + date.Minute; hashCode = 31 * hashCode + date.Hour; } return hashCode; } public override string ToString(object val) { return ((DateTime) val).ToShortTimeString(); } |
| |||
public override bool IsEqual(object x, object y) { if (x == y) { return true; } if (x == null || y == null) { return false; } DateTime date1 = (DateTime)x; DateTime date2 = (DateTime)y; if (date1.Equals(date2)) return true; return date1. [[#variable652f4760]]== date2. [[#variable652f4760]]&& date1. [[#variable652f46a0]]== date2. [[#variable652f46a0]]&& date1. [[#variable550c1cc0]]== date2. [[#variable550c1cc0]]; } public override int GetHashCode(object x, EntityMode entityMode) { DateTime date = (DateTime)x; int hashCode = 1; unchecked { hashCode = 31 * hashCode + date. [[#variable652f46e0]]; hashCode = 31 * hashCode + date. [[#variable652f46a0]]; hashCode = 31 * hashCode + date. [[#variable550c1c80]]; } return hashCode; } public override string ToString(object val) { return ((DateTime)val). [[#variable652f4620]](); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#652f4760]] | Hour |
1 | 2 | [[#652f4760]] | Day |
2 | 1 | [[#652f46a0]] | Minute |
2 | 2 | [[#652f46a0]] | Month |
3 | 1 | [[#550c1cc0]] | Second |
3 | 2 | [[#550c1cc0]] | Year |
4 | 1 | [[#652f46e0]] | Second |
4 | 2 | [[#652f46e0]] | Day |
5 | 1 | [[#550c1c80]] | Hour |
5 | 2 | [[#550c1c80]] | Year |
6 | 1 | [[#652f4620]] | ToShortTimeString |
6 | 2 | [[#652f4620]] | ToShortDateString |