Open ymarcon opened 17 years ago
Comment created by @plaflamme:
This issue will be documented in the concerned Javadoc methods. For efficiency, we don't want to implement a size check every time a bitwise operation is done. Therefore, the Javadoc will clearly mention that there should be no expected behaviour when two BitVector operands are of different size.
Comment created by @plaflamme:
It might be interesting later to investigate what the cost of an additional validation for robustness.
Jira issue originally created by user dbujold:
This happens in the case where the two BitVectors are storing bits in "long" vectors of different sizes. If the size of the BitVector on which the bitwise method is called is bigger than the one passed in parameter, there will be an "ArrayOutOfBound" exception.
Example: BitVector x = new BitVector(70); BitVector y = new BitVector(60);
"x.and(y)" will crash because y stores its bits in a single "long", while x stores its bits in two "longs".