Fix some minor bugs (#745)

* Include other member variables in copy constructor

* Add break to switch cases

* Implement equals() in classes extending Comparable

If equals() is not overridden, the equals() implementation is not consistent
with the compareTo() implementation. If an object of such a class is added
to a collection such as java.util.SortedSet, this collection will violate
the contract of java.util.Set, which is defined in terms of equals().

Co-authored-by: Rob Ekl <xwq876@zebra.com>
This commit is contained in:
robekl
2020-04-25 05:52:14 -04:00
committed by GitHub
parent de9431f649
commit 649258bd2b
22 changed files with 94 additions and 0 deletions

View File

@@ -100,6 +100,8 @@ public class BinaryMessage extends BitSet
this(toCopyFrom.size());
this.or(toCopyFrom);
this.mPointer = toCopyFrom.pointer();
this.mCRC = toCopyFrom.mCRC;
this.mSize = toCopyFrom.mSize;
}
public BinaryMessage(BitSet bitset, int size)