Skip to content

Commit

Permalink
NH-3706 - Make some classes static
Browse files Browse the repository at this point in the history
  • Loading branch information
rjperes authored and hazzik committed Feb 22, 2015
1 parent 5684575 commit cfc4094
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 54 deletions.
6 changes: 1 addition & 5 deletions src/NHibernate/Cache/Timestamper.cs
Expand Up @@ -9,7 +9,7 @@ namespace NHibernate.Cache
/// Not valid across multiple application domains. Identifiers are not necessarily
/// strictly increasing, but usually are.
/// </remarks>
public sealed class Timestamper
public static class Timestamper
{
private static object lockObject = new object();

Expand Down Expand Up @@ -47,9 +47,5 @@ public static long Next()
return time + counter;
}
}

private Timestamper()
{
}
}
}
7 changes: 1 addition & 6 deletions src/NHibernate/Connection/ConnectionProviderFactory.cs
Expand Up @@ -9,16 +9,11 @@ namespace NHibernate.Connection
/// <summary>
/// Instanciates a connection provider given configuration properties.
/// </summary>
public sealed class ConnectionProviderFactory
public static class ConnectionProviderFactory
{
private static readonly IInternalLogger log = LoggerProvider.LoggerFor(typeof(ConnectionProviderFactory));

// cannot be instantiated
private ConnectionProviderFactory()
{
throw new InvalidOperationException("ConnectionProviderFactory can not be instantiated.");
}

public static IConnectionProvider NewConnectionProvider(IDictionary<string, string> settings)
{
IConnectionProvider connections;
Expand Down
6 changes: 1 addition & 5 deletions src/NHibernate/Engine/JoinHelper.cs
Expand Up @@ -4,12 +4,8 @@

namespace NHibernate.Engine
{
public sealed class JoinHelper
public static class JoinHelper
{
private JoinHelper()
{
}

public static ILhsAssociationTypeSqlInfo GetLhsSqlInfo(string alias, int property,
IOuterJoinLoadable lhsPersister, IMapping mapping)
{
Expand Down
6 changes: 1 addition & 5 deletions src/NHibernate/Engine/UnsavedValueFactory.cs
Expand Up @@ -5,12 +5,8 @@

namespace NHibernate.Engine
{
public sealed class UnsavedValueFactory
public static class UnsavedValueFactory
{
private UnsavedValueFactory()
{
}

private static readonly object[] NoParameters = new object[0];

private static object Instantiate(ConstructorInfo constructor)
Expand Down
7 changes: 1 addition & 6 deletions src/NHibernate/Id/IdentifierGeneratorFactory.cs
Expand Up @@ -82,7 +82,7 @@ namespace NHibernate.Id
/// </item>
/// </list>
/// </remarks>
public sealed class IdentifierGeneratorFactory
public static class IdentifierGeneratorFactory
{
private static readonly IInternalLogger log = LoggerProvider.LoggerFor(typeof (IdentifierGeneratorFactory));

Expand Down Expand Up @@ -180,11 +180,6 @@ static IdentifierGeneratorFactory()
idgenerators.Add("enhanced-table", typeof(Enhanced.TableGenerator));
}

private IdentifierGeneratorFactory()
{
//cannot be instantiated
}

/// <summary>
/// Creates an <see cref="IIdentifierGenerator"/> from the named strategy.
/// </summary>
Expand Down
7 changes: 1 addition & 6 deletions src/NHibernate/Impl/MessageHelper.cs
Expand Up @@ -12,13 +12,8 @@ namespace NHibernate.Impl
/// <summary>
/// Helper methods for rendering log messages and exception messages
/// </summary>
public sealed class MessageHelper
public static class MessageHelper
{
private MessageHelper()
{
// should not be created
}

/// <summary>
/// Generate small message that can be used in traces and exception messages.
/// </summary>
Expand Down
6 changes: 1 addition & 5 deletions src/NHibernate/Persister/PersisterFactory.cs
Expand Up @@ -13,15 +13,11 @@ namespace NHibernate.Persister
/// <summary>
/// Factory for <c>IEntityPersister</c> and <c>ICollectionPersister</c> instances.
/// </summary>
public sealed class PersisterFactory
public static class PersisterFactory
{
//TODO: make ClassPersisters *not* depend on ISessionFactoryImplementor
// interface, if possible

private PersisterFactory()
{
}

private static readonly System.Type[] PersisterConstructorArgs = new System.Type[]
{
typeof(PersistentClass),
Expand Down
6 changes: 1 addition & 5 deletions src/NHibernate/Properties/PropertyAccessorFactory.cs
Expand Up @@ -9,7 +9,7 @@ namespace NHibernate.Properties
/// <summary>
/// Factory for creating the various PropertyAccessor strategies.
/// </summary>
public sealed class PropertyAccessorFactory
public static class PropertyAccessorFactory
{
private static readonly IDictionary<string, IPropertyAccessor> accessors;
private const string DefaultAccessorName = "property";
Expand Down Expand Up @@ -45,10 +45,6 @@ static PropertyAccessorFactory()
accessors["none"] = new NoopAccessor();
}

private PropertyAccessorFactory()
{
}

/// <summary>
/// Gets or creates the <see cref="IPropertyAccessor" /> specified by the type.
/// </summary>
Expand Down
6 changes: 1 addition & 5 deletions src/NHibernate/SqlCommand/Template.cs
Expand Up @@ -8,7 +8,7 @@

namespace NHibernate.SqlCommand
{
public sealed class Template
public static class Template
{
private static readonly HashSet<string> Keywords = new HashSet<string>();
private static readonly HashSet<string> BeforeTableKeywords = new HashSet<string>();
Expand Down Expand Up @@ -62,10 +62,6 @@ static Template()

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

private Template()
{
}

public static string RenderWhereStringTemplate(string sqlWhereString, Dialect.Dialect dialect,
SQLFunctionRegistry functionRegistry)
{
Expand Down
6 changes: 1 addition & 5 deletions src/NHibernate/Transform/Transformers.cs
Expand Up @@ -2,12 +2,8 @@

namespace NHibernate.Transform
{
public sealed class Transformers
public static class Transformers
{
private Transformers()
{
}

/// <summary>
/// Each row of results is a map (<see cref="IDictionary" />) from alias to values/entities
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Util/CollectionPrinter.cs
Expand Up @@ -13,7 +13,7 @@ namespace NHibernate.Util
/// To print collections of entities or typed values, use
/// <see cref="NHibernate.Impl.Printer" />.
/// </remarks>
public sealed class CollectionPrinter
public static class CollectionPrinter
{
private static void AppendNullOrValue(StringBuilder builder, object value)
{
Expand Down

0 comments on commit cfc4094

Please sign in to comment.