From: <fab...@us...> - 2009-01-10 15:42:50
|
Revision: 3990 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3990&view=rev Author: fabiomaulo Date: 2009-01-10 15:42:47 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Refactoring (removed compilation warning) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Id/Enhanced/OptimizerFactory.cs Modified: trunk/nhibernate/src/NHibernate/Id/Enhanced/OptimizerFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Id/Enhanced/OptimizerFactory.cs 2009-01-10 15:40:05 UTC (rev 3989) +++ trunk/nhibernate/src/NHibernate/Id/Enhanced/OptimizerFactory.cs 2009-01-10 15:42:47 UTC (rev 3990) @@ -10,7 +10,7 @@ public const string HiLo = "hilo"; public const string None = "none"; public const string Pool = "pooled"; - private static readonly System.Type[] CtorSignature = new System.Type[] {typeof (System.Type), typeof (int)}; + private static readonly System.Type[] CtorSignature = new[] {typeof (System.Type), typeof (int)}; private static readonly ILog log = LogManager.GetLogger(typeof (OptimizerFactory)); public static IOptimizer BuildOptimizer(string type, System.Type returnClass, int incrementSize) @@ -105,13 +105,13 @@ { lastSourceValue = callback.NextValue; } - hiValue = (lastSourceValue * incrementSize) + 1; - value_Renamed = hiValue - incrementSize; + hiValue = (lastSourceValue * IncrementSize) + 1; + value_Renamed = hiValue - IncrementSize; } else if (value_Renamed >= hiValue) { lastSourceValue = callback.NextValue; - hiValue = (lastSourceValue * incrementSize) + 1; + hiValue = (lastSourceValue * IncrementSize) + 1; } return Make(value_Renamed++); } @@ -160,30 +160,21 @@ public abstract class OptimizerSupport : IOptimizer { - protected int incrementSize; - protected System.Type returnClass; - protected OptimizerSupport(System.Type returnClass, int incrementSize) { if (returnClass == null) { throw new HibernateException("return class is required"); } - this.returnClass = returnClass; - this.incrementSize = incrementSize; + ReturnClass = returnClass; + IncrementSize = incrementSize; } - public System.Type ReturnClass - { - get { return returnClass; } - } + public System.Type ReturnClass { get; protected set; } #region IOptimizer Members - public int IncrementSize - { - get { return incrementSize; } - } + public int IncrementSize { get; protected set; } public abstract long LastSourceValue { get; } @@ -194,7 +185,7 @@ protected virtual object Make(long value) { - return IdentifierGeneratorFactory.CreateNumber(value, returnClass); + return IdentifierGeneratorFactory.CreateNumber(value, ReturnClass); } } @@ -254,7 +245,7 @@ else if (value_Renamed >= hiValue) { hiValue = callback.NextValue; - value_Renamed = hiValue - incrementSize; + value_Renamed = hiValue - IncrementSize; } return Make(value_Renamed++); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |