Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/NHapi.Base/EventMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal class EventMapper
{
private static readonly EventMapper InstanceValue = new EventMapper();

private Hashtable map = new Hashtable();
private readonly Hashtable map = new Hashtable();

static EventMapper()
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHapi.Base/Log/HapiLogImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace NHapi.Base.Log
/// </version>
public class HapiLogImpl : IHapiLog
{
private ILog innerLog;
private readonly ILog innerLog;

internal HapiLogImpl(ILog log)
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHapi.Base/Model/AbstractGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public abstract class AbstractGroup : IGroup
{
private static readonly IHapiLog Log;

private readonly IModelClassFactory myFactory;
private List<AbstractGroupItem> items;
private IModelClassFactory myFactory;

static AbstractGroup()
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHapi.Base/Model/AbstractSegmentItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace NHapi.Base.Model

internal class AbstractSegmentItem
{
private List<object> args = new List<object>();
private readonly List<object> args = new List<object>();
private int maxReps = -1;

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/NHapi.Base/Model/ExtraComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace NHapi.Base.Model
/// <author>Bryan Tripp.</author>
public class ExtraComponents
{
private ArrayList comps;
private IMessage message;
private readonly ArrayList comps;
private readonly IMessage message;

/// <summary>
/// Creates a new instance of ExtraComponents.
Expand Down
2 changes: 1 addition & 1 deletion src/NHapi.Base/Model/GenericComposite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace NHapi.Base.Model
/// <author>Bryan Tripp.</author>
public class GenericComposite : AbstractType, IComposite
{
private ArrayList components;
private readonly ArrayList components;

/// <summary>
/// Creates a new instance of GenericComposite.
Expand Down
2 changes: 1 addition & 1 deletion src/NHapi.Base/Model/GenericGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace NHapi.Base.Model
/// <author>Bryan Tripp.</author>
public class GenericGroup : AbstractGroup
{
private string name;
private readonly string name;

/// <summary>Creates a new instance of GenericGroup. </summary>
public GenericGroup(IGroup parent, string name, IModelClassFactory factory)
Expand Down
4 changes: 2 additions & 2 deletions src/NHapi.Base/Parser/EncodingCharacters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ public virtual object Clone()
return new EncodingCharacters(this);
}

public override bool Equals(object o)
public override bool Equals(object obj)
{
if (o is EncodingCharacters other)
if (obj is EncodingCharacters other)
{
return FieldSeparator == other.FieldSeparator &&
ComponentSeparator == other.ComponentSeparator &&
Expand Down
8 changes: 4 additions & 4 deletions src/NHapi.Base/Parser/MessageIterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,14 @@ public int Rep
/// <summary>
/// Override equals.
/// </summary>
/// <param name="o"></param>
/// <param name="obj"></param>
/// <returns></returns>
public override bool Equals(object o)
public override bool Equals(object obj)
{
var equals = false;
if (o != null && o is Index)
if (obj != null && obj is Index)
{
var i = (Index)o;
var i = (Index)obj;
if (i.Rep == Rep && i.Name.Equals(Name))
{
equals = true;
Expand Down
2 changes: 1 addition & 1 deletion src/NHapi.Base/Parser/XMLParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public abstract class XMLParser : ParserBase
{
private static readonly IHapiLog Log;

private XmlDocument parser;
private readonly XmlDocument parser;

/// <summary>
/// The nodes whose names match these strings will be kept as original,
Expand Down
4 changes: 2 additions & 2 deletions src/NHapi.Base/Util/FilterIterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ namespace NHapi.Base.Util
/// </summary>
public class FilterIterator : IEnumerator
{
private IPredicate predicate;
private IEnumerator iter;
private readonly IPredicate predicate;
private readonly IEnumerator iter;
private object nextObject;
private bool nextObjectSet = false;

Expand Down
10 changes: 5 additions & 5 deletions src/NHapi.Base/Util/MessageIterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public class MessageIterator : IEnumerator
{
private static readonly IHapiLog Log;

private readonly bool handleUnexpectedSegments;
private IStructure currentStructure;
private string direction;
private Position nextRenamedField;
private bool handleUnexpectedSegments;

static MessageIterator()
{
Expand Down Expand Up @@ -662,14 +662,14 @@ public Index Index
/// <summary>
/// Override equals operator.
/// </summary>
/// <param name="o">Object o.</param>
/// <param name="obj">Object obj.</param>
/// <returns>true if objects are equal.</returns>
public override bool Equals(object o)
public override bool Equals(object obj)
{
var equals = false;
if (o != null && o is Position)
if (obj != null && obj is Position)
{
var p = (Position)o;
var p = (Position)obj;
if (p.Parent.Equals(Parent) && p.Index.Equals(Index))
{
equals = true;
Expand Down
6 changes: 3 additions & 3 deletions src/NHapi.Base/Util/MessageNavigator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public virtual bool drillUp()
public virtual bool DrillUp()
{
// pop the top group and resume search there
if (!(ancestors.Count == 0))
if (ancestors.Count != 0)
{
var gc = (GroupContext)SupportClass.StackSupport.Pop(ancestors);
CurrentGroup = gc.Group;
Expand Down Expand Up @@ -375,12 +375,12 @@ private void DrillHere(IStructure destination)
}

Reset();
while (!(pathStack.Count == 0))
while (pathStack.Count != 0)
{
var parent = (IGroup)SupportClass.StackSupport.Pop(pathStack);
var index = (MessageIterator.Index)SupportClass.StackSupport.Pop(indexStack);
var child = Search(parent.Names, index.Name);
if (!(pathStack.Count == 0))
if (pathStack.Count != 0)
{
DrillDown(child, 0);
}
Expand Down
4 changes: 2 additions & 2 deletions src/NHapi.Base/Validation/MessageValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class MessageValidator
{
private static readonly IHapiLog OurLog;

private IValidationContext myContext;
private bool failOnError;
private readonly IValidationContext myContext;
private readonly bool failOnError;

static MessageValidator()
{
Expand Down