Skip to content

Commit 553cc87

Browse files
author
Mike Doerfler
committed
minor fixes for FxCop rules
SVN: trunk@1096
1 parent 8c31edf commit 553cc87

34 files changed

+129
-90
lines changed

src/NHibernate/ADOException.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ public class ADOException : HibernateException
1414

1515
public ADOException() : this("DataException occured", new InvalidOperationException("Invalid Operation")) { }
1616

17-
public ADOException(string str) : this(str, new InvalidOperationException("Invalid Operation")) { }
17+
public ADOException(string message) : this(message, new InvalidOperationException("Invalid Operation")) { }
1818

1919
public ADOException(DataException root) : this("DataException occurred", root) { }
2020

21-
public ADOException(string str, Exception root) : base(str, root)
21+
public ADOException(string message, Exception root) : base(message, root)
2222
{
2323
sqle = root;
24-
log4net.LogManager.GetLogger( typeof(ADOException) ).Error(str, root);
24+
log4net.LogManager.GetLogger( typeof(ADOException) ).Error(message, root);
2525
}
2626

2727
protected ADOException(SerializationInfo info, StreamingContext context) : base(info, context) { }

src/NHibernate/AssertionFailure.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public AssertionFailure() : base(String.Empty)
1414
log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate");
1515
}
1616

17-
public AssertionFailure(string s) : base(s)
17+
public AssertionFailure(string message) : base(message)
1818
{
1919
log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate", this);
2020
}
2121

22-
public AssertionFailure(string s, Exception e) : base(s, e)
22+
public AssertionFailure(string message, Exception e) : base(message, e)
2323
{
2424
log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate", e);
2525
}

src/NHibernate/Cache/CacheException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace NHibernate.Cache
88
[Serializable]
99
public class CacheException : HibernateException
1010
{
11-
public CacheException(string s) : base(s) { }
11+
public CacheException(string message) : base(message) { }
1212

1313
public CacheException(Exception e) : base(e) { }
1414
}

src/NHibernate/Driver/DriverBase.cs

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ namespace NHibernate.Driver
1212
/// </summary>
1313
public abstract class DriverBase : IDriver
1414
{
15-
public DriverBase()
16-
{
17-
}
1815

1916
#region IDriver Members
2017

src/NHibernate/Expression/LogicalExpression.cs

+16-7
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,7 @@ namespace NHibernate.Expression
1515
public abstract class LogicalExpression : Expression
1616
{
1717

18-
/// <summary>
19-
/// The Expression that will be on the Left Hand Side of the Op.
20-
/// </summary>
2118
protected Expression lhs;
22-
23-
/// <summary>
24-
/// The Expression that will be on the Right Hand Side of the Op.
25-
/// </summary>
2619
protected Expression rhs;
2720

2821
/// <summary>
@@ -37,6 +30,22 @@ internal LogicalExpression(Expression lhs, Expression rhs)
3730
this.rhs = rhs;
3831
}
3932

33+
/// <summary>
34+
/// The Expression that will be on the Left Hand Side of the Op.
35+
/// </summary>
36+
protected Expression LeftHandSide
37+
{
38+
get { return lhs; }
39+
}
40+
41+
/// <summary>
42+
/// The Expression that will be on the Right Hand Side of the Op.
43+
/// </summary>
44+
protected Expression RightHandSide
45+
{
46+
get { return rhs; }
47+
}
48+
4049
/// <summary>
4150
/// Combines the <see cref="TypedValue"/> for the Left Hand Side and the
4251
/// Right Hand Side of the Expression into one array.

src/NHibernate/HibernateException.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public HibernateException() : base (String.Empty) { }
1515

1616
public HibernateException(Exception e) : base(String.Empty, e) { }
1717

18-
public HibernateException(string str, Exception e) : base(str, e) { }
18+
public HibernateException(string message, Exception e) : base(message, e) { }
1919

20-
public HibernateException(string str) : base(str) { }
20+
public HibernateException(string message) : base(message) { }
2121

2222
protected HibernateException(SerializationInfo info, StreamingContext context) : base(info, context) { }
2323
}

src/NHibernate/Id/IdentifierGenerationException.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace NHibernate.Id
88
[Serializable]
99
public class IdentifierGenerationException : HibernateException
1010
{
11-
public IdentifierGenerationException(string msg) : base(msg) {}
11+
public IdentifierGenerationException(string message) : base(message) {}
1212

13-
public IdentifierGenerationException(string msg, Exception e) : base(msg, e) {}
13+
public IdentifierGenerationException(string message, Exception e) : base(message, e) {}
1414
}
1515
}

src/NHibernate/InstantiationException.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ public class InstantiationException : HibernateException
1111
{
1212
private System.Type type;
1313

14-
public InstantiationException(string s, System.Type type, Exception root) : base(s, root)
14+
public InstantiationException(string message, System.Type type, Exception root)
15+
: base(message, root)
1516
{
1617
this.type = type;
1718
}
@@ -26,9 +27,9 @@ public override string Message
2627
get { return base.Message + type.FullName; }
2728
}
2829

29-
public InstantiationException(string s, Exception root) : this(s, typeof(InstantiationException), root) {}
30+
public InstantiationException(string message, Exception root) : this(message, typeof(InstantiationException), root) {}
3031

31-
public InstantiationException(string s) : this(s, typeof(InstantiationException), new InvalidOperationException("Invalid Operation")) {}
32+
public InstantiationException(string message) : this(message, typeof(InstantiationException), new InvalidOperationException("Invalid Operation")) {}
3233

3334
public InstantiationException() : this("Exception occured", typeof(InstantiationException), new InvalidOperationException("Invalid Operation")) {}
3435

src/NHibernate/LazyInitializationException.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ public class LazyInitializationException : Exception
1212
{
1313
public LazyInitializationException(Exception root) : this(root.Message) {}
1414

15-
public LazyInitializationException(string msg) : base(msg)
15+
public LazyInitializationException(string message) : base(message)
1616
{
17-
log4net.LogManager.GetLogger( typeof(LazyInitializationException) ).Error(msg, this);
17+
log4net.LogManager.GetLogger( typeof(LazyInitializationException) ).Error(message, this);
1818
}
1919

20-
public LazyInitializationException(string msg, Exception root) : this(msg + " " + root.Message) {}
20+
public LazyInitializationException(string message, Exception root) : this(message + " " + root.Message) {}
2121

2222
public LazyInitializationException() : this("LazyInitalizationException") {}
2323

src/NHibernate/Mapping/IdentifierCollection.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public abstract class IdentifierCollection : Collection
1111
public static readonly string DefaultIdentifierColumnName = "id";
1212
private Value identifier;
1313

14-
public IdentifierCollection(PersistentClass owner) : base(owner)
14+
protected IdentifierCollection(PersistentClass owner) : base(owner)
1515
{
1616
}
1717

src/NHibernate/Mapping/IndexedCollection.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public abstract class IndexedCollection : Collection
1212

1313
private Value index;
1414

15-
public IndexedCollection(PersistentClass owner) : base(owner)
15+
protected IndexedCollection(PersistentClass owner) : base(owner)
1616
{
1717
}
1818

src/NHibernate/MappingException.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ namespace NHibernate
1010
[Serializable]
1111
public class MappingException : HibernateException
1212
{
13-
public MappingException(string msg, Exception root) : base(msg, root) {}
13+
public MappingException(string message, Exception root) : base(message, root) {}
1414

1515
public MappingException(Exception root) : base(root) { }
1616

17-
public MappingException(string msg) : base(msg) {}
17+
public MappingException(string message) : base(message) {}
1818

1919
public MappingException() : base() {}
2020

src/NHibernate/ObjectDeletedException.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class ObjectDeletedException : HibernateException
1111
{
1212
private object identifier;
1313

14-
public ObjectDeletedException(string msg, object identifier) : base(msg)
14+
public ObjectDeletedException(string message, object identifier) : base(message)
1515
{
1616
this.identifier = identifier;
1717
}
@@ -26,9 +26,9 @@ public override string Message
2626
get { return base.Message + ": " + identifier; }
2727
}
2828

29-
public ObjectDeletedException(string msg, Exception root) : this(msg, root.Message) {}
29+
public ObjectDeletedException(string message, Exception root) : this(message, root.Message) {}
3030

31-
public ObjectDeletedException(string msg) : this(msg, msg) {}
31+
public ObjectDeletedException(string message) : this(message, message) {}
3232

3333
public ObjectDeletedException(Exception root) : this(root.Message, root.Message) {}
3434

src/NHibernate/ObjectNotFoundException.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class ObjectNotFoundException : HibernateException
1313
private object identifier;
1414
private System.Type type;
1515

16-
public ObjectNotFoundException(string msg, object identifier, System.Type type) : base(msg)
16+
public ObjectNotFoundException(string message, object identifier, System.Type type) : base(message)
1717
{
1818
this.identifier = identifier;
1919
this.type = type;
@@ -33,9 +33,9 @@ public System.Type Type
3333
{
3434
get { return type; }
3535
}
36-
public ObjectNotFoundException(string msg, Exception root) : this(msg, root.Message, typeof(ObjectNotFoundException)) {}
36+
public ObjectNotFoundException(string message, Exception root) : this(message, root.Message, typeof(ObjectNotFoundException)) {}
3737

38-
public ObjectNotFoundException(string msg) : this(msg, msg, typeof(ObjectNotFoundException)) {}
38+
public ObjectNotFoundException(string message) : this(message, message, typeof(ObjectNotFoundException)) {}
3939

4040
public ObjectNotFoundException(Exception root) : this(root.Message, root.Message, typeof(ObjectNotFoundException)) {}
4141

src/NHibernate/PersistentObjectException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ namespace NHibernate
99
[Serializable]
1010
public class PersistentObjectException : HibernateException
1111
{
12-
public PersistentObjectException(string s) : base(s) {}
12+
public PersistentObjectException(string message) : base(message) {}
1313
}
1414
}

src/NHibernate/Property/FieldAccessor.cs

+15-5
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,25 @@ namespace NHibernate.Property
1414
/// </remarks>
1515
public class FieldAccessor : IPropertyAccessor
1616
{
17-
protected IFieldNamingStrategy namingStragety;
17+
private IFieldNamingStrategy namingStrategy;
1818

1919
public FieldAccessor()
2020
{
2121
}
2222

23-
public FieldAccessor(IFieldNamingStrategy namingStragety)
23+
public FieldAccessor(IFieldNamingStrategy namingStrategy)
2424
{
25-
this.namingStragety = namingStragety;
25+
this.namingStrategy = namingStrategy;
26+
}
27+
28+
/// <summary>
29+
/// Gets the <see cref="IFieldNamingStrategy"/> used to convert the name of the
30+
/// Property in the hbm.xml file to the name of the field in the class.
31+
/// </summary>
32+
/// <value>The <see cref="IFieldNamingStrategy"/> or <c>null</c>.</value>
33+
public IFieldNamingStrategy NamingStrategy
34+
{
35+
get { return namingStrategy; }
2636
}
2737

2838
#region IPropertyAccessor Members
@@ -70,13 +80,13 @@ internal static FieldInfo GetField(System.Type clazz, string fieldName)
7080
/// </remarks>
7181
private string GetFieldName(string propertyName)
7282
{
73-
if(namingStragety==null)
83+
if( namingStrategy==null )
7484
{
7585
return propertyName;
7686
}
7787
else
7888
{
79-
return namingStragety.GetFieldName(propertyName);
89+
return namingStrategy.GetFieldName(propertyName);
8090
}
8191
}
8292
}

src/NHibernate/PropertyAccessException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class PropertyAccessException : HibernateException
1212
private string propertyName;
1313
private bool wasSetter;
1414

15-
public PropertyAccessException(Exception root, string s, bool wasSetter, System.Type persistentType, string propertyName) : base(s, root)
15+
public PropertyAccessException(Exception root, string message, bool wasSetter, System.Type persistentType, string propertyName) : base(message, root)
1616
{
1717
this.persistentType = persistentType;
1818
this.wasSetter = wasSetter;

src/NHibernate/PropertyNotFoundException.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace NHibernate
88
[Serializable]
99
public class PropertyNotFoundException : MappingException
1010
{
11-
public PropertyNotFoundException(string msg, Exception root) : base(msg, root) {}
11+
public PropertyNotFoundException(string message, Exception root) : base(message, root) {}
1212
public PropertyNotFoundException(Exception root) : base(root) {}
13-
public PropertyNotFoundException(string msg) : base(msg) {}
13+
public PropertyNotFoundException(string message) : base(message) {}
1414
}
1515
}

src/NHibernate/QueryException.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public class QueryException : HibernateException
1010
{
1111
private string queryString;
1212

13-
public QueryException(string msg) : base(msg) {}
13+
public QueryException(string message) : base(message) {}
1414

15-
public QueryException(string msg, Exception e) : base(msg, e) {}
15+
public QueryException(string message, Exception e) : base(message, e) {}
1616

1717
public QueryException(Exception e) : base(e) {}
1818

src/NHibernate/SqlCommand/ISqlStringBuilder.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
using NHibernate.Dialect;
44
using NHibernate.Connection;
55

6-
namespace NHibernate.SqlCommand {
6+
namespace NHibernate.SqlCommand
7+
{
78

8-
public interface ISqlStringBuilder {
9+
public interface ISqlStringBuilder
10+
{
911
/// <summary>
1012
/// Builds a SqlString from the internal data.
1113
/// </summary>

src/NHibernate/SqlCommand/QuerySelect.cs

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public void AddSelectColumn(string columnName, string alias)
9898

9999
public bool Distinct
100100
{
101+
get { return distinct; }
101102
set { this.distinct = value; }
102103
}
103104

0 commit comments

Comments
 (0)