File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
main/java/org/springframework/amqp/core
test/java/org/springframework/amqp/core Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -568,6 +568,14 @@ else if (!this.contentType.equals(other.contentType)) {
568
568
if (!Arrays .equals (this .correlationId , other .correlationId )) {
569
569
return false ;
570
570
}
571
+ if (this .correlationIdString == null ) {
572
+ if (other .correlationIdString != null ) {
573
+ return false ;
574
+ }
575
+ }
576
+ else if (!this .correlationIdString .equals (other .correlationIdString )) {
577
+ return false ;
578
+ }
571
579
if (this .deliveryMode != other .deliveryMode ) {
572
580
return false ;
573
581
}
Original file line number Diff line number Diff line change 17
17
package org .springframework .amqp .core ;
18
18
19
19
import static org .junit .Assert .assertEquals ;
20
+ import static org .junit .Assert .assertTrue ;
20
21
21
22
import org .junit .Test ;
22
23
@@ -41,4 +42,11 @@ public void testReplyToNullByDefault() throws Exception {
41
42
assertEquals (null , properties .getReplyToAddress ());
42
43
}
43
44
45
+ @ Test
46
+ public void tesNoNullPointerInEquals () {
47
+ MessageProperties mp = new MessageProperties ();
48
+ MessageProperties mp2 = new MessageProperties ();
49
+ assertTrue (mp .equals (mp2 ));
50
+ }
51
+
44
52
}
You can’t perform that action at this time.
0 commit comments