| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 40 | 2 | 5 | 0.954 | class_member_declarations[6] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 39 | 14 | src/NHibernate/Engine/IdentifierValue.cs |
| 2 | 40 | 16 | src/NHibernate/Engine/VersionValue.cs |
| ||||
private readonly object value;
/// <summary></summary>
protected IdentifierValue()
{
value = null;
}
/// <summary>
/// Assume the transient instance is newly instantiated if its identifier is null or
/// equal to <c>Value</c>
/// </summary>
/// <param name="value"></param>
public IdentifierValue(object value)
{
this.value = value;
}
/// <summary>
/// Does the given identifier belong to a new instance
/// </summary>
public virtual bool ? IsUnsaved(object id)
{
if (log.IsDebugEnabled)
{
log.Debug("unsaved-value: " + value);
}
return id == null || id.Equals(value);
}
public virtual object GetDefaultValue(object currentValue)
{
return value;
}
/// <summary>
/// Always assume the transient instance is newly instantiated
/// </summary>
public static readonly IdentifierValue SaveAny = new SaveAnyClass();
|
| ||||
private readonly object value;
/// <summary></summary>
protected VersionValue()
{
value = null;
}
/// <summary>
/// Assume the transient instance is newly instantiated if its version is null or
/// equal to <c>Value</c>
/// </summary>
/// <param name="value"></param>
public VersionValue(object value)
{
this.value = value;
}
/// <summary>
/// Does the given identifier belong to a new instance
/// </summary>
public virtual bool ? IsUnsaved(object version)
{
if (log.IsDebugEnabled)
{
log.Debug("unsaved-value: " + value);
}
return version == null || version.Equals(value);
}
public virtual object GetDefaultValue(object currentValue)
{
return value;
}
/// <summary>
/// Assume the transient instance is newly instantiated if the version
/// is null, otherwise assume it is a detached instance.
/// </summary>
public static VersionValue VersionSaveNull = new VersionSaveNullClass();
|
| |||
private readonly object value;
/// <summary></summary>
protected [[#variable2cd13a40]]()
{
value = null;
}
/// <summary>
/// Assume the transient instance is newly instantiated if its version is null or
/// Assume the transient instance is newly instantiated if its identifier is null or
/// equal to <c>Value</c>
/// </summary>
/// <param name="value"></param>
public [[#variable2cd13a40]](object value)
{
this.value = value;
}
/// <summary>
/// Does the given identifier belong to a new instance
/// </summary>
public virtual bool ? IsUnsaved(object [[#variable67af85e0]])
{
if (log.IsDebugEnabled)
{
log.Debug("unsaved-value: " + value);
}
return [[#variable67af85e0]]== null || [[#variable67af85e0]].Equals(value);
}
public virtual object GetDefaultValue(object currentValue)
{
return value;
}
[[#variable2cd138e0]] [[#variable2cd13a40]] [[#variable2cd137c0]]= new [[#variable2cd133a0]]();
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#2cd13a40]] | VersionValue |
| 1 | 2 | [[#2cd13a40]] | IdentifierValue |
| 2 | 1 | [[#67af85e0]] | version |
| 2 | 2 | [[#67af85e0]] | id |
| 3 | 1 | [[#2cd138e0]] | /// <summary> /// Assume the transient instance is newly instantiated if the version /// is null, otherwise assume it is a detached instance. /// </summary> public static |
| 3 | 2 | [[#2cd138e0]] | /// <summary> /// Always assume the transient instance is newly instantiated /// </summary> public static readonly |
| 4 | 1 | [[#2cd137c0]] | VersionSaveNull |
| 4 | 2 | [[#2cd137c0]] | SaveAny |
| 5 | 1 | [[#2cd133a0]] | VersionSaveNullClass |
| 5 | 2 | [[#2cd133a0]] | SaveAnyClass |