Skip to content

Commit 9d9ba0d

Browse files
authored
Merge pull request #11 from dhickin/equality
Fix bug in PVStructure equals() method and add unit tests
2 parents 5fa54eb + 479f2f8 commit 9d9ba0d

2 files changed

Lines changed: 500 additions & 1 deletion

File tree

pvDataJava/src/org/epics/pvdata/factory/BasePVStructure.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,13 +455,16 @@ public boolean equals(Object obj) {
455455
// TODO anything else?
456456
if (obj instanceof PVStructure) {
457457
PVStructure b = (PVStructure)obj;
458+
if (!getStructure().equals(b.getStructure()))
459+
return false;
460+
458461
final PVField[] bfields = b.getPVFields();
459462
if (bfields.length == pvFields.length)
460463
{
461464
for (int i = 0; i < pvFields.length; i++)
462465
if (!pvFields[i].equals(bfields[i]))
463466
return false;
464-
467+
465468
return true;
466469
}
467470
else

0 commit comments

Comments
 (0)