Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit d8de7a9

Browse files
committed
Small cleanup
1 parent 2068cbe commit d8de7a9

File tree

2 files changed

+8
-42
lines changed

2 files changed

+8
-42
lines changed

src/GitTools.Core/GitTools.Core.Shared/Diposable.cs

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,22 @@
88
/// </summary>
99
public abstract class Disposable : IDisposable
1010
{
11-
#region Fields
12-
private static readonly ILog Log = LogProvider.GetCurrentClassLogger();
11+
static readonly ILog Log = LogProvider.GetCurrentClassLogger();
1312

14-
private readonly object _syncRoot = new object();
13+
readonly object _syncRoot = new object();
1514

16-
private bool _disposing;
17-
#endregion
18-
19-
#region Constructors
15+
bool _disposing;
16+
2017
/// <summary>
2118
/// Finalizes an instance of the <see cref="Disposable"/> class.
2219
/// </summary>
2320
~Disposable()
2421
{
2522
Dispose(false);
2623
}
27-
#endregion
28-
29-
#region Properties
30-
private bool IsDisposed { get; set; }
31-
#endregion
24+
25+
bool IsDisposed { get; set; }
3226

33-
#region Methods
3427
/// <summary>
3528
/// Disposes this instance.
3629
/// </summary>
@@ -40,21 +33,6 @@ public void Dispose()
4033
GC.SuppressFinalize(this);
4134
}
4235

43-
/// <summary>
44-
/// Checks whether the object is disposed. If so, it will throw the <see cref="ObjectDisposedException"/>.
45-
/// </summary>
46-
/// <exception cref="System.ObjectDisposedException">The object is disposed.</exception>
47-
protected void CheckDisposed()
48-
{
49-
lock (_syncRoot)
50-
{
51-
if (IsDisposed)
52-
{
53-
throw new ObjectDisposedException(GetType().FullName);
54-
}
55-
}
56-
}
57-
5836
/// <summary>
5937
/// Disposes the managed resources.
6038
/// </summary>
@@ -73,7 +51,7 @@ protected virtual void DisposeUnmanaged()
7351
/// Releases unmanaged and - optionally - managed resources.
7452
/// </summary>
7553
/// <param name="isDisposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
76-
private void Dispose(bool isDisposing)
54+
void Dispose(bool isDisposing)
7755
{
7856
lock (_syncRoot)
7957
{
@@ -91,11 +69,6 @@ private void Dispose(bool isDisposing)
9169
}
9270
catch (Exception ex)
9371
{
94-
//if (ex.IsCritical())
95-
//{
96-
// throw;
97-
//}
98-
9972
Log.ErrorException("Error while disposing managed resources of '{0}'.", ex, GetType().FullName);
10073
}
10174
}
@@ -106,11 +79,6 @@ private void Dispose(bool isDisposing)
10679
}
10780
catch (Exception ex)
10881
{
109-
//if (ex.IsCritical())
110-
//{
111-
// throw;
112-
//}
113-
11482
Log.ErrorException("Error while disposing unmanaged resources of '{0}'.", ex, GetType().FullName);
11583
}
11684

@@ -120,6 +88,5 @@ private void Dispose(bool isDisposing)
12088
}
12189
}
12290
}
123-
#endregion
12491
}
12592
}

src/GitTools.Core/GitTools.Core.Shared/Git/GitRepositoryFactory.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
public static class GitRepositoryFactory
1010
{
11-
private static readonly ILog Log = LogProvider.GetCurrentClassLogger();
11+
static readonly ILog Log = LogProvider.GetCurrentClassLogger();
1212

1313
/// <summary>
1414
/// Creates the repository based on the repository info. If the <see cref="RepositoryInfo.Directory"/> points
@@ -49,7 +49,6 @@ public static GitRepository CreateRepository(RepositoryInfo repositoryInfo, bool
4949
}
5050

5151
// TODO: Should we do something with fetch for existing repositoriess?
52-
5352
var repository = new Repository(repositoryDirectory);
5453
return new GitRepository(repository, isDynamicRepository);
5554
}

0 commit comments

Comments
 (0)