@@ -54,21 +54,21 @@ public void CopyTo(IBasicProperties basicProperties)
54
54
{
55
55
Preconditions . CheckNotNull ( basicProperties , "basicProperties" ) ;
56
56
57
- if ( contentTypePresent ) basicProperties . ContentType = ContentType ;
58
- if ( contentEncodingPresent ) basicProperties . ContentEncoding = ContentEncoding ;
59
- if ( deliveryModePresent ) basicProperties . DeliveryMode = DeliveryMode ;
60
- if ( priorityPresent ) basicProperties . Priority = Priority ;
61
- if ( correlationIdPresent ) basicProperties . CorrelationId = CorrelationId ;
62
- if ( replyToPresent ) basicProperties . ReplyTo = ReplyTo ;
63
- if ( expirationPresent ) basicProperties . Expiration = Expiration ;
64
- if ( messageIdPresent ) basicProperties . MessageId = MessageId ;
65
- if ( timestampPresent ) basicProperties . Timestamp = new AmqpTimestamp ( Timestamp ) ;
66
- if ( typePresent ) basicProperties . Type = Type ;
67
- if ( userIdPresent ) basicProperties . UserId = UserId ;
68
- if ( appIdPresent ) basicProperties . AppId = AppId ;
57
+ if ( contentTypePresent ) basicProperties . ContentType = ContentType ;
58
+ if ( contentEncodingPresent ) basicProperties . ContentEncoding = ContentEncoding ;
59
+ if ( deliveryModePresent ) basicProperties . DeliveryMode = DeliveryMode ;
60
+ if ( priorityPresent ) basicProperties . Priority = Priority ;
61
+ if ( correlationIdPresent ) basicProperties . CorrelationId = CorrelationId ;
62
+ if ( replyToPresent ) basicProperties . ReplyTo = ReplyTo ;
63
+ if ( expirationPresent ) basicProperties . Expiration = Expiration ;
64
+ if ( messageIdPresent ) basicProperties . MessageId = MessageId ;
65
+ if ( timestampPresent ) basicProperties . Timestamp = new AmqpTimestamp ( Timestamp ) ;
66
+ if ( typePresent ) basicProperties . Type = Type ;
67
+ if ( userIdPresent ) basicProperties . UserId = UserId ;
68
+ if ( appIdPresent ) basicProperties . AppId = AppId ;
69
69
if ( clusterIdPresent ) basicProperties . ClusterId = ClusterId ;
70
70
71
- if ( headersPresent )
71
+ if ( headersPresent && Headers . Any ( ) )
72
72
{
73
73
basicProperties . Headers = new Dictionary < string , object > ( Headers ) ;
74
74
}
@@ -91,7 +91,7 @@ public object Clone()
91
91
if ( appIdPresent ) copy . AppId = AppId ;
92
92
if ( clusterIdPresent ) copy . ClusterId = ClusterId ;
93
93
94
- if ( headersPresent )
94
+ if ( headersPresent && Headers . Any ( ) )
95
95
{
96
96
copy . Headers = new Dictionary < string , object > ( Headers ) ;
97
97
}
@@ -117,7 +117,7 @@ public object Clone()
117
117
private string contentType ;
118
118
119
119
/// <summary>
120
- /// MIME Content type
120
+ /// MIME Content type
121
121
/// </summary>
122
122
public string ContentType
123
123
{
@@ -128,7 +128,7 @@ public string ContentType
128
128
private string contentEncoding ;
129
129
130
130
/// <summary>
131
- /// MIME content encoding
131
+ /// MIME content encoding
132
132
/// </summary>
133
133
public string ContentEncoding
134
134
{
@@ -139,7 +139,7 @@ public string ContentEncoding
139
139
private IDictionary < string , object > headers ;
140
140
141
141
/// <summary>
142
- /// message header field table
142
+ /// message header field table
143
143
/// </summary>
144
144
public IDictionary < string , object > Headers
145
145
{
@@ -150,7 +150,7 @@ public IDictionary<string, object> Headers
150
150
private byte deliveryMode ;
151
151
152
152
/// <summary>
153
- /// non-persistent (1) or persistent (2)
153
+ /// non-persistent (1) or persistent (2)
154
154
/// </summary>
155
155
public byte DeliveryMode
156
156
{
@@ -161,7 +161,7 @@ public byte DeliveryMode
161
161
private byte priority ;
162
162
163
163
/// <summary>
164
- /// message priority, 0 to 9
164
+ /// message priority, 0 to 9
165
165
/// </summary>
166
166
public byte Priority
167
167
{
@@ -172,7 +172,7 @@ public byte Priority
172
172
private string correlationId ;
173
173
174
174
/// <summary>
175
- /// application correlation identifier
175
+ /// application correlation identifier
176
176
/// </summary>
177
177
public string CorrelationId
178
178
{
@@ -183,7 +183,7 @@ public string CorrelationId
183
183
private string replyTo ;
184
184
185
185
/// <summary>
186
- /// destination to reply to
186
+ /// destination to reply to
187
187
/// </summary>
188
188
public string ReplyTo
189
189
{
@@ -194,7 +194,7 @@ public string ReplyTo
194
194
private string expiration ;
195
195
196
196
/// <summary>
197
- /// message expiration specification
197
+ /// message expiration specification
198
198
/// </summary>
199
199
public string Expiration
200
200
{
@@ -205,7 +205,7 @@ public string Expiration
205
205
private string messageId ;
206
206
207
207
/// <summary>
208
- /// application message identifier
208
+ /// application message identifier
209
209
/// </summary>
210
210
public string MessageId
211
211
{
@@ -216,7 +216,7 @@ public string MessageId
216
216
private long timestamp ;
217
217
218
218
/// <summary>
219
- /// message timestamp
219
+ /// message timestamp
220
220
/// </summary>
221
221
public long Timestamp
222
222
{
@@ -227,7 +227,7 @@ public long Timestamp
227
227
private string type ;
228
228
229
229
/// <summary>
230
- /// message type name
230
+ /// message type name
231
231
/// </summary>
232
232
public string Type
233
233
{
@@ -238,7 +238,7 @@ public string Type
238
238
private string userId ;
239
239
240
240
/// <summary>
241
- /// creating user id
241
+ /// creating user id
242
242
/// </summary>
243
243
public string UserId
244
244
{
@@ -249,7 +249,7 @@ public string UserId
249
249
private string appId ;
250
250
251
251
/// <summary>
252
- /// creating application id
252
+ /// creating application id
253
253
/// </summary>
254
254
public string AppId
255
255
{
@@ -260,7 +260,7 @@ public string AppId
260
260
private string clusterId ;
261
261
262
262
/// <summary>
263
- /// intra-cluster routing identifier
263
+ /// intra-cluster routing identifier
264
264
/// </summary>
265
265
public string ClusterId
266
266
{
@@ -390,4 +390,4 @@ private static string CheckShortString(string input, string name)
390
390
return input ;
391
391
}
392
392
}
393
- }
393
+ }
0 commit comments