Skip to content

Commit 5bbfe99

Browse files
bollhalsmichaelklishin
authored andcommitted
style cleanup
1 parent 1fcfa56 commit 5bbfe99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+717
-1936
lines changed

projects/RabbitMQ.Client/client/api/IModel.cs

Lines changed: 13 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
using System;
3333
using System.Collections.Generic;
3434

35-
using RabbitMQ.Client.Apigen.Attributes;
3635
using RabbitMQ.Client.Events;
3736

3837
namespace RabbitMQ.Client
@@ -154,7 +153,6 @@ public interface IModel : IDisposable
154153
/// In comparison to normal <see cref="Close()"/> method, <see cref="Abort()"/> will not throw
155154
/// <see cref="Exceptions.AlreadyClosedException"/> or <see cref="System.IO.IOException"/> or any other <see cref="Exception"/> during closing model.
156155
/// </remarks>
157-
[AmqpMethodDoNotImplement(null)]
158156
void Abort();
159157

160158
/// <summary>
@@ -170,7 +168,6 @@ public interface IModel : IDisposable
170168
/// A message indicating the reason for closing the model
171169
/// </para>
172170
/// </remarks>
173-
[AmqpMethodDoNotImplement(null)]
174171
void Abort(ushort replyCode, string replyText);
175172

176173
/// <summary>
@@ -181,7 +178,6 @@ public interface IModel : IDisposable
181178
/// <summary>
182179
/// Delete a Basic content-class consumer.
183180
/// </summary>
184-
[AmqpMethodDoNotImplement(null)]
185181
void BasicCancel(string consumerTag);
186182

187183
/// <summary>
@@ -191,7 +187,6 @@ public interface IModel : IDisposable
191187
void BasicCancelNoWait(string consumerTag);
192188

193189
/// <summary>Start a Basic content-class consumer.</summary>
194-
[AmqpMethodDoNotImplement(null)]
195190
string BasicConsume(
196191
string queue,
197192
bool autoAck,
@@ -206,7 +201,6 @@ string BasicConsume(
206201
/// one is available; returns null if the server answers that
207202
/// no messages are currently available. See also <see cref="IModel.BasicAck"/>.
208203
/// </summary>
209-
[AmqpMethodDoNotImplement(null)]
210204
BasicGetResult BasicGet(string queue, bool autoAck);
211205

212206
/// <summary>Reject one or more delivered message(s).</summary>
@@ -220,9 +214,7 @@ string BasicConsume(
220214
/// Routing key must be shorter than 255 bytes.
221215
/// </para>
222216
/// </remarks>
223-
[AmqpMethodDoNotImplement(null)]
224-
void BasicPublish(string exchange, string routingKey, bool mandatory,
225-
IBasicProperties basicProperties, ReadOnlyMemory<byte> body);
217+
void BasicPublish(string exchange, string routingKey, bool mandatory, IBasicProperties basicProperties, ReadOnlyMemory<byte> body);
226218

227219
/// <summary>
228220
/// Configures QoS parameters of the Basic content-class.
@@ -233,7 +225,6 @@ void BasicPublish(string exchange, string routingKey, bool mandatory,
233225
/// Indicates that a consumer has recovered.
234226
/// Deprecated. Should not be used.
235227
/// </summary>
236-
[AmqpMethodDoNotImplement(null)]
237228
void BasicRecover(bool requeue);
238229

239230
/// <summary>
@@ -252,7 +243,6 @@ void BasicPublish(string exchange, string routingKey, bool mandatory,
252243
/// operation to complete. This method will not return to the
253244
/// caller until the shutdown is complete.
254245
/// </remarks>
255-
[AmqpMethodDoNotImplement(null)]
256246
void Close();
257247

258248
/// <summary>Close this session.</summary>
@@ -267,31 +257,26 @@ void BasicPublish(string exchange, string routingKey, bool mandatory,
267257
/// A message indicating the reason for closing the model
268258
/// </para>
269259
/// </remarks>
270-
[AmqpMethodDoNotImplement(null)]
271260
void Close(ushort replyCode, string replyText);
272261

273262
/// <summary>
274263
/// Enable publisher acknowledgements.
275264
/// </summary>
276-
[AmqpMethodDoNotImplement(null)]
277265
void ConfirmSelect();
278266

279267
/// <summary>
280268
/// Creates a BasicPublishBatch instance
281269
/// </summary>
282-
[AmqpMethodDoNotImplement(null)]
283270
IBasicPublishBatch CreateBasicPublishBatch();
284271

285272
/// <summary>
286273
/// Creates a BasicPublishBatch instance
287274
/// </summary>
288-
[AmqpMethodDoNotImplement(null)]
289275
IBasicPublishBatch CreateBasicPublishBatch(int sizeHint);
290276

291277
/// <summary>
292278
/// Construct a completely empty content header for use with the Basic content class.
293279
/// </summary>
294-
[AmqpContentHeaderFactory("basic")]
295280
IBasicProperties CreateBasicProperties();
296281

297282
/// <summary>
@@ -301,8 +286,7 @@ void BasicPublish(string exchange, string routingKey, bool mandatory,
301286
/// <para>
302287
/// Routing key must be shorter than 255 bytes.
303288
/// </para>
304-
/// </remarks>
305-
[AmqpMethodDoNotImplement(null)]
289+
/// </remarks>
306290
void ExchangeBind(string destination, string source, string routingKey, IDictionary<string, object> arguments);
307291

308292
/// <summary>
@@ -312,25 +296,21 @@ void BasicPublish(string exchange, string routingKey, bool mandatory,
312296
/// <para>
313297
/// Routing key must be shorter than 255 bytes.
314298
/// </para>
315-
/// </remarks>
316-
void ExchangeBindNoWait(string destination, string source, string routingKey,
317-
IDictionary<string, object> arguments);
299+
/// </remarks>
300+
void ExchangeBindNoWait(string destination, string source, string routingKey, IDictionary<string, object> arguments);
318301

319302
/// <summary>Declare an exchange.</summary>
320303
/// <remarks>
321304
/// The exchange is declared non-passive and non-internal.
322305
/// The "nowait" option is not exercised.
323306
/// </remarks>
324-
[AmqpMethodDoNotImplement(null)]
325-
void ExchangeDeclare(string exchange, string type, bool durable, bool autoDelete,
326-
IDictionary<string, object> arguments);
307+
void ExchangeDeclare(string exchange, string type, bool durable, bool autoDelete, IDictionary<string, object> arguments);
327308

328309
/// <summary>
329310
/// Same as ExchangeDeclare but sets nowait to true and returns void (as there
330311
/// will be no response from the server).
331312
/// </summary>
332-
void ExchangeDeclareNoWait(string exchange, string type, bool durable, bool autoDelete,
333-
IDictionary<string, object> arguments);
313+
void ExchangeDeclareNoWait(string exchange, string type, bool durable, bool autoDelete, IDictionary<string, object> arguments);
334314

335315
/// <summary>
336316
/// Do a passive exchange declaration.
@@ -341,13 +321,11 @@ void ExchangeDeclareNoWait(string exchange, string type, bool durable, bool auto
341321
/// It will do nothing if the exchange already exists and result
342322
/// in a channel-level protocol exception (channel closure) if not.
343323
/// </remarks>
344-
[AmqpMethodDoNotImplement(null)]
345324
void ExchangeDeclarePassive(string exchange);
346325

347326
/// <summary>
348327
/// Delete an exchange.
349328
/// </summary>
350-
[AmqpMethodDoNotImplement(null)]
351329
void ExchangeDelete(string exchange, bool ifUnused);
352330

353331
/// <summary>
@@ -361,11 +339,7 @@ void ExchangeDeclareNoWait(string exchange, string type, bool durable, bool auto
361339
/// <remarks>
362340
/// Routing key must be shorter than 255 bytes.
363341
/// </remarks>
364-
[AmqpMethodDoNotImplement(null)]
365-
void ExchangeUnbind(string destination,
366-
string source,
367-
string routingKey,
368-
IDictionary<string, object> arguments);
342+
void ExchangeUnbind(string destination, string source, string routingKey, IDictionary<string, object> arguments);
369343

370344
/// <summary>
371345
/// Like ExchangeUnbind but sets nowait to true.
@@ -375,9 +349,7 @@ void ExchangeUnbind(string destination,
375349
/// Routing key must be shorter than 255 bytes.
376350
/// </para>
377351
/// </remarks>
378-
[AmqpMethodDoNotImplement(null)]
379-
void ExchangeUnbindNoWait(string destination, string source, string routingKey,
380-
IDictionary<string, object> arguments);
352+
void ExchangeUnbindNoWait(string destination, string source, string routingKey, IDictionary<string, object> arguments);
381353

382354
/// <summary>
383355
/// Bind a queue to an exchange.
@@ -386,38 +358,32 @@ void ExchangeUnbindNoWait(string destination, string source, string routingKey,
386358
/// <para>
387359
/// Routing key must be shorter than 255 bytes.
388360
/// </para>
389-
/// </remarks>
390-
[AmqpMethodDoNotImplement(null)]
361+
/// </remarks>
391362
void QueueBind(string queue, string exchange, string routingKey, IDictionary<string, object> arguments);
392363

393364
/// <summary>Same as QueueBind but sets nowait parameter to true.</summary>
394365
/// <remarks>
395366
/// <para>
396367
/// Routing key must be shorter than 255 bytes.
397368
/// </para>
398-
/// </remarks>
369+
/// </remarks>
399370
void QueueBindNoWait(string queue, string exchange, string routingKey, IDictionary<string, object> arguments);
400371

401372
/// <summary> Declare a queue.</summary>
402-
[AmqpMethodDoNotImplement(null)]
403-
QueueDeclareOk QueueDeclare(string queue, bool durable, bool exclusive,
404-
bool autoDelete, IDictionary<string, object> arguments);
373+
QueueDeclareOk QueueDeclare(string queue, bool durable, bool exclusive, bool autoDelete, IDictionary<string, object> arguments);
405374

406375
/// <summary>
407376
/// Same as QueueDeclare but sets nowait to true and returns void (as there
408377
/// will be no response from the server).
409378
/// </summary>
410-
void QueueDeclareNoWait(string queue, bool durable,
411-
bool exclusive, bool autoDelete,
412-
IDictionary<string, object> arguments);
379+
void QueueDeclareNoWait(string queue, bool durable, bool exclusive, bool autoDelete, IDictionary<string, object> arguments);
413380

414381
/// <summary>Declare a queue passively.</summary>
415382
/// <remarks>
416383
///The queue is declared passive, non-durable,
417384
///non-exclusive, and non-autodelete, with no arguments.
418385
///The queue is declared passively; i.e. only check if it exists.
419386
/// </remarks>
420-
[AmqpMethodDoNotImplement(null)]
421387
QueueDeclareOk QueueDeclarePassive(string queue);
422388

423389
/// <summary>
@@ -426,7 +392,6 @@ void QueueDeclareNoWait(string queue, bool durable,
426392
/// an exception will be closed with an exception.
427393
/// </summary>
428394
/// <param name="queue">The name of the queue</param>
429-
[AmqpMethodDoNotImplement(null)]
430395
uint MessageCount(string queue);
431396

432397
/// <summary>
@@ -435,7 +400,6 @@ void QueueDeclareNoWait(string queue, bool durable,
435400
/// an exception will be closed with an exception.
436401
/// </summary>
437402
/// <param name="queue">The name of the queue</param>
438-
[AmqpMethodDoNotImplement(null)]
439403
uint ConsumerCount(string queue);
440404

441405
/// <summary>
@@ -445,7 +409,6 @@ void QueueDeclareNoWait(string queue, bool durable,
445409
///Returns the number of messages purged during queue deletion.
446410
/// <code>uint.MaxValue</code>.
447411
/// </remarks>
448-
[AmqpMethodDoNotImplement(null)]
449412
uint QueueDelete(string queue, bool ifUnused, bool ifEmpty);
450413

451414
/// <summary>
@@ -460,7 +423,6 @@ void QueueDeclareNoWait(string queue, bool durable,
460423
/// <remarks>
461424
/// Returns the number of messages purged.
462425
/// </remarks>
463-
[AmqpMethodDoNotImplement(null)]
464426
uint QueuePurge(string queue);
465427

466428
/// <summary>
@@ -470,7 +432,7 @@ void QueueDeclareNoWait(string queue, bool durable,
470432
/// <para>
471433
/// Routing key must be shorter than 255 bytes.
472434
/// </para>
473-
/// </remarks>
435+
/// </remarks>
474436
void QueueUnbind(string queue, string exchange, string routingKey, IDictionary<string, object> arguments);
475437

476438
/// <summary>
@@ -496,7 +458,6 @@ void QueueDeclareNoWait(string queue, bool durable,
496458
/// all the messages were ack'd (and none were nack'd). Note,
497459
/// throws an exception when called on a non-Confirm channel.
498460
/// </remarks>
499-
[AmqpMethodDoNotImplement(null)]
500461
bool WaitForConfirms();
501462

502463
/// <summary>
@@ -512,7 +473,6 @@ void QueueDeclareNoWait(string queue, bool durable,
512473
/// all the messages were ack'd (and none were nack'd). Note,
513474
/// throws an exception when called on a non-Confirm channel.
514475
/// </remarks>
515-
[AmqpMethodDoNotImplement(null)]
516476
bool WaitForConfirms(TimeSpan timeout);
517477

518478
/// <summary>
@@ -531,7 +491,6 @@ void QueueDeclareNoWait(string queue, bool durable,
531491
/// all the messages were ack'd (and none were nack'd). Note,
532492
/// throws an exception when called on a non-Confirm channel.
533493
/// </remarks>
534-
[AmqpMethodDoNotImplement(null)]
535494
bool WaitForConfirms(TimeSpan timeout, out bool timedOut);
536495

537496
/// <summary>
@@ -542,7 +501,6 @@ void QueueDeclareNoWait(string queue, bool durable,
542501
/// been ack'd by the broker. If a nack is received, throws an
543502
/// OperationInterrupedException exception immediately.
544503
/// </remarks>
545-
[AmqpMethodDoNotImplement(null)]
546504
void WaitForConfirmsOrDie();
547505

548506
/// <summary>
@@ -553,7 +511,6 @@ void QueueDeclareNoWait(string queue, bool durable,
553511
/// been ack'd by the broker. If a nack is received or the timeout
554512
/// elapses, throws an OperationInterrupedException exception immediately.
555513
/// </remarks>
556-
[AmqpMethodDoNotImplement(null)]
557514
void WaitForConfirmsOrDie(TimeSpan timeout);
558515

559516
/// <summary>

projects/RabbitMQ.Client/client/framing/BasicAck.cs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,21 @@
2929
// Copyright (c) 2007-2020 VMware, Inc. All rights reserved.
3030
//---------------------------------------------------------------------------
3131

32-
using System.Text;
33-
3432
namespace RabbitMQ.Client.Framing.Impl
3533
{
36-
/// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
3734
internal sealed class BasicAck : Client.Impl.MethodBase
3835
{
3936
public ulong _deliveryTag;
4037
public bool _multiple;
4138

42-
ulong DeliveryTag => _deliveryTag;
43-
bool Multiple => _multiple;
39+
public BasicAck()
40+
{
41+
}
4442

45-
public BasicAck() {}
46-
public BasicAck(ulong @DeliveryTag, bool @Multiple)
43+
public BasicAck(ulong DeliveryTag, bool Multiple)
4744
{
48-
_deliveryTag = @DeliveryTag;
49-
_multiple = @Multiple;
45+
_deliveryTag = DeliveryTag;
46+
_multiple = Multiple;
5047
}
5148

5249
public override ushort ProtocolClassId => ClassConstants.Basic;
@@ -69,16 +66,7 @@ public override void WriteArgumentsTo(ref Client.Impl.MethodArgumentWriter write
6966

7067
public override int GetRequiredBufferSize()
7168
{
72-
int bufferSize = 9; // bytes for _deliveryTag, bit fields
73-
return bufferSize;
74-
}
75-
76-
public override void AppendArgumentDebugStringTo(StringBuilder sb)
77-
{
78-
sb.Append('(');
79-
sb.Append(_deliveryTag).Append(',');
80-
sb.Append(_multiple);
81-
sb.Append(')');
69+
return 8 + 1;
8270
}
8371
}
8472
}

0 commit comments

Comments
 (0)