Skip to content

Commit 64beaa6

Browse files
Use parametrized IDictionary instead of Dictionary where we can
1 parent a01a196 commit 64beaa6

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ protected virtual IConnection CreateConnection(int maxRedirects,
320320
///each endpoint tried.</summary>
321321
public virtual IConnection CreateConnection(int maxRedirects)
322322
{
323-
Dictionary<AmqpTcpEndpoint, int> connectionAttempts = new Dictionary<AmqpTcpEndpoint, int>();
323+
IDictionary<AmqpTcpEndpoint, int> connectionAttempts = new Dictionary<AmqpTcpEndpoint, int>();
324324
Dictionary<AmqpTcpEndpoint, Exception> connectionErrors = new Dictionary<AmqpTcpEndpoint, Exception>();
325325
IConnection conn = CreateConnection(maxRedirects,
326326
connectionAttempts,

projects/client/RabbitMQ.Client/src/client/content/MapWireFormatting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static IDictionary<string, object> ReadMap(NetworkBinaryReader reader) {
6060
throw new ProtocolViolationException(message);
6161
}
6262

63-
Dictionary<string, object> table = new Dictionary<string, object>(entryCount);
63+
IDictionary<string, object> table = new Dictionary<string, object>(entryCount);
6464
for (int entryIndex = 0; entryIndex < entryCount; entryIndex++) {
6565
string key = StreamWireFormatting.ReadUntypedString(reader);
6666
object value = StreamWireFormatting.ReadObject(reader);

projects/client/RabbitMQ.Client/src/client/exceptions/BrokerUnreachableException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace RabbitMQ.Client.Exceptions {
5858
///</remarks>
5959
public class BrokerUnreachableException: IOException
6060
{
61-
private Dictionary<AmqpTcpEndpoint, int> m_connectionAttempts;
61+
private IDictionary<AmqpTcpEndpoint, int> m_connectionAttempts;
6262
private Dictionary<AmqpTcpEndpoint, Exception> m_connectionErrors;
6363

6464
///<summary>A map from AmqpTcpEndpoint to int, counting the
@@ -78,7 +78,7 @@ public class BrokerUnreachableException: IOException
7878
///maps as per the description of the ConnectionAttempts and
7979
///ConnectionErrors properties. The inner exception is associated
8080
///with only one connection attempt.</summary>
81-
public BrokerUnreachableException(Dictionary<AmqpTcpEndpoint, int> connectionAttempts,
81+
public BrokerUnreachableException(IDictionary<AmqpTcpEndpoint, int> connectionAttempts,
8282
Dictionary<AmqpTcpEndpoint, Exception> connectionErrors,
8383
Exception Inner)
8484
: base("None of the specified endpoints were reachable", Inner)

projects/client/RabbitMQ.Client/src/client/impl/ConnectionBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ public static IDictionary<string, object> DefaultClientProperties()
910910
System.Reflection.Assembly.GetAssembly(typeof(ConnectionBase));
911911
string version = assembly.GetName().Version.ToString();
912912
//TODO: Get the rest of this data from the Assembly Attributes
913-
Dictionary<string, object> table = new Dictionary<string, object>();
913+
IDictionary<string, object> table = new Dictionary<string, object>();
914914
table["product"] = Encoding.UTF8.GetBytes("RabbitMQ");
915915
table["version"] = Encoding.UTF8.GetBytes(version);
916916
table["platform"] = Encoding.UTF8.GetBytes(".NET");

projects/client/RabbitMQ.Client/src/client/impl/WireFormatting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static decimal ReadDecimal(NetworkBinaryReader reader)
118118
/// <returns>A <seealso cref="System.Collections.Generic.IDictionary{TKey,TValue}"/>.</returns>
119119
public static IDictionary<string, object> ReadTable(NetworkBinaryReader reader)
120120
{
121-
Dictionary<string, object> table = new Dictionary<string, object>();
121+
IDictionary<string, object> table = new Dictionary<string, object>();
122122
long tableLength = reader.ReadUInt32();
123123

124124
Stream backingStream = reader.BaseStream;

0 commit comments

Comments
 (0)