Skip to content

Commit cfc4094

Browse files
rjpereshazzik
authored andcommitted
NH-3706 - Make some classes static
1 parent 5684575 commit cfc4094

File tree

11 files changed

+11
-54
lines changed

11 files changed

+11
-54
lines changed

src/NHibernate/Cache/Timestamper.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace NHibernate.Cache
99
/// Not valid across multiple application domains. Identifiers are not necessarily
1010
/// strictly increasing, but usually are.
1111
/// </remarks>
12-
public sealed class Timestamper
12+
public static class Timestamper
1313
{
1414
private static object lockObject = new object();
1515

@@ -47,9 +47,5 @@ public static long Next()
4747
return time + counter;
4848
}
4949
}
50-
51-
private Timestamper()
52-
{
53-
}
5450
}
5551
}

src/NHibernate/Connection/ConnectionProviderFactory.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@ namespace NHibernate.Connection
99
/// <summary>
1010
/// Instanciates a connection provider given configuration properties.
1111
/// </summary>
12-
public sealed class ConnectionProviderFactory
12+
public static class ConnectionProviderFactory
1313
{
1414
private static readonly IInternalLogger log = LoggerProvider.LoggerFor(typeof(ConnectionProviderFactory));
1515

1616
// cannot be instantiated
17-
private ConnectionProviderFactory()
18-
{
19-
throw new InvalidOperationException("ConnectionProviderFactory can not be instantiated.");
20-
}
21-
2217
public static IConnectionProvider NewConnectionProvider(IDictionary<string, string> settings)
2318
{
2419
IConnectionProvider connections;

src/NHibernate/Engine/JoinHelper.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44

55
namespace NHibernate.Engine
66
{
7-
public sealed class JoinHelper
7+
public static class JoinHelper
88
{
9-
private JoinHelper()
10-
{
11-
}
12-
139
public static ILhsAssociationTypeSqlInfo GetLhsSqlInfo(string alias, int property,
1410
IOuterJoinLoadable lhsPersister, IMapping mapping)
1511
{

src/NHibernate/Engine/UnsavedValueFactory.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55

66
namespace NHibernate.Engine
77
{
8-
public sealed class UnsavedValueFactory
8+
public static class UnsavedValueFactory
99
{
10-
private UnsavedValueFactory()
11-
{
12-
}
13-
1410
private static readonly object[] NoParameters = new object[0];
1511

1612
private static object Instantiate(ConstructorInfo constructor)

src/NHibernate/Id/IdentifierGeneratorFactory.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace NHibernate.Id
8282
/// </item>
8383
/// </list>
8484
/// </remarks>
85-
public sealed class IdentifierGeneratorFactory
85+
public static class IdentifierGeneratorFactory
8686
{
8787
private static readonly IInternalLogger log = LoggerProvider.LoggerFor(typeof (IdentifierGeneratorFactory));
8888

@@ -180,11 +180,6 @@ static IdentifierGeneratorFactory()
180180
idgenerators.Add("enhanced-table", typeof(Enhanced.TableGenerator));
181181
}
182182

183-
private IdentifierGeneratorFactory()
184-
{
185-
//cannot be instantiated
186-
}
187-
188183
/// <summary>
189184
/// Creates an <see cref="IIdentifierGenerator"/> from the named strategy.
190185
/// </summary>

src/NHibernate/Impl/MessageHelper.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ namespace NHibernate.Impl
1212
/// <summary>
1313
/// Helper methods for rendering log messages and exception messages
1414
/// </summary>
15-
public sealed class MessageHelper
15+
public static class MessageHelper
1616
{
17-
private MessageHelper()
18-
{
19-
// should not be created
20-
}
21-
2217
/// <summary>
2318
/// Generate small message that can be used in traces and exception messages.
2419
/// </summary>

src/NHibernate/Persister/PersisterFactory.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ namespace NHibernate.Persister
1313
/// <summary>
1414
/// Factory for <c>IEntityPersister</c> and <c>ICollectionPersister</c> instances.
1515
/// </summary>
16-
public sealed class PersisterFactory
16+
public static class PersisterFactory
1717
{
1818
//TODO: make ClassPersisters *not* depend on ISessionFactoryImplementor
1919
// interface, if possible
2020

21-
private PersisterFactory()
22-
{
23-
}
24-
2521
private static readonly System.Type[] PersisterConstructorArgs = new System.Type[]
2622
{
2723
typeof(PersistentClass),

src/NHibernate/Properties/PropertyAccessorFactory.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace NHibernate.Properties
99
/// <summary>
1010
/// Factory for creating the various PropertyAccessor strategies.
1111
/// </summary>
12-
public sealed class PropertyAccessorFactory
12+
public static class PropertyAccessorFactory
1313
{
1414
private static readonly IDictionary<string, IPropertyAccessor> accessors;
1515
private const string DefaultAccessorName = "property";
@@ -45,10 +45,6 @@ static PropertyAccessorFactory()
4545
accessors["none"] = new NoopAccessor();
4646
}
4747

48-
private PropertyAccessorFactory()
49-
{
50-
}
51-
5248
/// <summary>
5349
/// Gets or creates the <see cref="IPropertyAccessor" /> specified by the type.
5450
/// </summary>

src/NHibernate/SqlCommand/Template.cs

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

99
namespace NHibernate.SqlCommand
1010
{
11-
public sealed class Template
11+
public static class Template
1212
{
1313
private static readonly HashSet<string> Keywords = new HashSet<string>();
1414
private static readonly HashSet<string> BeforeTableKeywords = new HashSet<string>();
@@ -62,10 +62,6 @@ static Template()
6262

6363
public static readonly string Placeholder = "$PlaceHolder$";
6464

65-
private Template()
66-
{
67-
}
68-
6965
public static string RenderWhereStringTemplate(string sqlWhereString, Dialect.Dialect dialect,
7066
SQLFunctionRegistry functionRegistry)
7167
{

src/NHibernate/Transform/Transformers.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22

33
namespace NHibernate.Transform
44
{
5-
public sealed class Transformers
5+
public static class Transformers
66
{
7-
private Transformers()
8-
{
9-
}
10-
117
/// <summary>
128
/// Each row of results is a map (<see cref="IDictionary" />) from alias to values/entities
139
/// </summary>

0 commit comments

Comments
 (0)