Skip to content

Commit adf987b

Browse files
author
Emile Joubert
committed
Mostly cosmetic
Rename variables, better inline docs, remove redundancies
1 parent 580e2f6 commit adf987b

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

projects/client/Apigen/src/apigen/AmqpField.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,5 @@ public string Domain {
7070
return result;
7171
}
7272
}
73-
74-
public bool Reserved
75-
{
76-
get
77-
{
78-
return GetString("@reserved", "") == "1";
79-
}
80-
}
8173
}
8274
}

projects/client/Apigen/src/apigen/Apigen.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,19 @@ public static int GetInt(XmlNode n0, string path) {
103103
return int.Parse(GetString(n0, path));
104104
}
105105

106-
private static string xmlStringMapper(string name)
106+
/// <summary>
107+
/// Rename all instances of an entire string from the XML spec
108+
/// </summary>
109+
/// <param name="xmlString">input string from XML spec</param>
110+
/// <returns>renamed string</returns>
111+
private static string xmlStringMapper(string xmlString)
107112
{
108-
switch (name)
113+
switch (xmlString)
109114
{
110115
case "no-wait":
111116
return "nowait";
112117
default:
113-
return name;
114-
118+
return xmlString;
115119
}
116120
}
117121

@@ -300,7 +304,6 @@ public void ParseSpec() {
300304
{
301305
m_revision = GetInt(m_spec, "/amqp/@revision");
302306
}
303-
304307
}
305308
foreach (XmlNode n in m_spec.SelectNodes("/amqp/constant")) {
306309
m_constants.Add(new DictionaryEntry(GetString(n, "@name"), GetInt(n, "@value")));
@@ -440,7 +443,7 @@ public void EmitPublic() {
440443
EmitLine(" ///<summary>Protocol minor version (= "+m_minorVersion+")</summary>");
441444
EmitLine(" public override int MinorVersion { get { return " + m_minorVersion + "; } }");
442445
EmitLine(" ///<summary>Protocol revision (= " + m_revision + ")</summary>");
443-
EmitLine(" public override int? Revision { get { return " + m_revision + "; } }");
446+
EmitLine(" public override int Revision { get { return " + m_revision + "; } }");
444447
EmitLine(" ///<summary>Protocol API name (= "+m_apiName+")</summary>");
445448
EmitLine(" public override string ApiName { get { return \"" + m_apiName + "\"; } }");
446449
int port = GetInt(m_spec, "/amqp/@port");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public interface IProtocol
6767
///<summary>Retrieve the protocol's minor version number</summary>
6868
int MinorVersion { get; }
6969
///<summary>Retrieve the protocol's revision (if specified)</summary>
70-
int? Revision { get; }
70+
int Revision { get; }
7171
///<summary>Retrieve the protocol's API name, used for
7272
///printing, configuration properties, IDE integration,
7373
///Protocols.cs etc.</summary>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace RabbitMQ.Client.Impl {
6262
public abstract class AbstractProtocolBase: IProtocol {
6363
public abstract int MajorVersion { get; }
6464
public abstract int MinorVersion { get; }
65-
public abstract int? Revision { get; }
65+
public abstract int Revision { get; }
6666
public abstract string ApiName { get; }
6767
public abstract int DefaultPort { get; }
6868
public abstract bool SupportsRedirect { get; }

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
//---------------------------------------------------------------------------
5757
using System;
5858
using System.Collections;
59-
using RabbitMQ.Client.Apigen.Attributes;
6059

6160
namespace RabbitMQ.Client.Impl
6261
{

0 commit comments

Comments
 (0)