| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 47 | 2 | 3 | 0.961 | class_member_declarations[3] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 47 | 563 | src/NHibernate/AdoNet/AbstractBatcher.cs |
| 2 | 44 | 144 | src/NHibernate/Driver/NHybridDataReader.cs |
| ||||
/// <summary>
/// Finalizer that ensures the object is correctly disposed of.
/// </summary>
~AbstractBatcher()
{
// Don't log in the finalizer, it causes problems
// if the output stream is finalized before the batcher.
//log.Debug( "running BatcherImpl.Dispose(false)" );
Dispose(false);
}
/// <summary>
/// Takes care of freeing the managed and unmanaged resources that
/// this class is responsible for.
/// </summary>
public void Dispose()
{
log.Debug("running BatcherImpl.Dispose(true)");
Dispose(true);
}
/// <summary>
/// Takes care of freeing the managed and unmanaged resources that
/// this class is responsible for.
/// </summary>
/// <param name="isDisposing">Indicates if this BatcherImpl is being Disposed of or Finalized.</param>
/// <remarks>
/// If this BatcherImpl is being Finalized (<c>isDisposing==false</c>) then make sure not
/// to call any methods that could potentially bring this BatcherImpl back to life.
/// </remarks>
protected virtual void Dispose(bool isDisposing)
{
if (_isAlreadyDisposed)
{
// don't dispose of multiple times.
return;
}
// free managed resources that are being managed by the AdoTransaction if we
// know this call came through Dispose()
if (isDisposing)
{
CloseCommands();
}
// free unmanaged resources here
_isAlreadyDisposed = true;
// nothing for Finalizer to do - so tell the GC to ignore it
GC.SuppressFinalize(this );
}
|
| ||||
/// <summary>
/// Finalizer that ensures the object is correctly disposed of.
/// </summary>
~NHybridDataReader()
{
Dispose(false);
}
/// <summary>
/// Takes care of freeing the managed and unmanaged resources that
/// this class is responsible for.
/// </summary>
public void Dispose()
{
log.Debug("running NHybridDataReader.Dispose()");
Dispose(true);
}
/// <summary>
/// Takes care of freeing the managed and unmanaged resources that
/// this class is responsible for.
/// </summary>
/// <param name="isDisposing">Indicates if this NHybridDataReader is being Disposed of or Finalized.</param>
/// <remarks>
/// If this NHybridDataReader is being Finalized (<c>isDisposing==false</c>) then make sure not
/// to call any methods that could potentially bring this NHybridDataReader back to life.
/// </remarks>
protected virtual void Dispose(bool isDisposing)
{
if (_isAlreadyDisposed)
{
// don't dispose of multiple times.
return;
}
// free managed resources that are being managed by the NHybridDataReader if we
// know this call came through Dispose()
if (isDisposing)
{
_reader.Dispose();
}
// free unmanaged resources here
_isAlreadyDisposed = true;
// nothing for Finalizer to do - so tell the GC to ignore it
GC.SuppressFinalize(this );
}
|
| |||
/// <summary>
/// Finalizer that ensures the object is correctly disposed of.
/// </summary>
~ [[#variable573e3b20]]()
{
// Don't log in the finalizer, it causes problems
// if the output stream is finalized before the batcher.
//log.Debug( "running BatcherImpl.Dispose(false)" );
Dispose(false);
}
/// <summary>
/// Takes care of freeing the managed and unmanaged resources that
/// this class is responsible for.
/// </summary>
public void Dispose()
{
log.Debug( [[#variable54b1eea0]]);
Dispose(true);
}
/// <summary>
/// Takes care of freeing the managed and unmanaged resources that
/// this class is responsible for.
/// </summary>
/// <param name="isDisposing">Indicates if this BatcherImpl is being Disposed of or Finalized.</param>
/// <param name="isDisposing">Indicates if this NHybridDataReader is being Disposed of or Finalized.</param>
/// <remarks>
/// If this BatcherImpl is being Finalized (<c>isDisposing==false</c>) then make sure not
/// to call any methods that could potentially bring this BatcherImpl back to life.
/// If this NHybridDataReader is being Finalized (<c>isDisposing==false</c>) then make sure not
/// to call any methods that could potentially bring this NHybridDataReader back to life.
/// </remarks>
protected virtual void Dispose(bool isDisposing)
{
if (_isAlreadyDisposed)
{
// don't dispose of multiple times.
return;
}
// free managed resources that are being managed by the AdoTransaction if we
// free managed resources that are being managed by the NHybridDataReader if we
// know this call came through Dispose()
if (isDisposing)
{
[[#variable5e425b80]]();
}
// free unmanaged resources here
_isAlreadyDisposed = true;
// nothing for Finalizer to do - so tell the GC to ignore it
GC.SuppressFinalize(this );
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#573e3b20]] | AbstractBatcher |
| 1 | 2 | [[#573e3b20]] | NHybridDataReader |
| 2 | 1 | [[#54b1eea0]] | "running BatcherImpl.Dispose(true)" |
| 2 | 2 | [[#54b1eea0]] | "running NHybridDataReader.Dispose()" |
| 3 | 1 | [[#5e425b80]] | CloseCommands |
| 3 | 2 | [[#5e425b80]] | _reader.Dispose |