/** * Returns true if this version hold has an exception in the exception list for the given version * number. * * This differs from contains because it returns true if v is greater than the last seen version * for this holder. */ synchronized boolean hasExceptionFor(long v) { if (this.bitSet != null && v >= this.bitSetVersion) { if (v > this.bitSetVersion + this.bitSet.length()) { return false; } return this.bitSet.get((int) (v - this.bitSetVersion)); } if (this.exceptions == null) { return false; } for (Iterator<RVVException> it = this.exceptions.iterator(); it.hasNext();) { RVVException e = it.next(); if (e.nextVersion <= v) { return false; // there is no RVVException for this version } if (e.previousVersion < v) { return !e.contains(v); } } return false; }
/** * returns true if this version holder has seen the given version number */ synchronized boolean contains(long v) { if (v > getVersion()) { return false; } else { if (this.bitSet != null && v >= this.bitSetVersion) { return this.bitSet.get((int) (v - this.bitSetVersion)); } if (this.exceptions == null) { return true; } for (Iterator<RVVException> it = this.exceptions.iterator(); it.hasNext();) { RVVException e = it.next(); if (e.nextVersion <= v) { return true; // there is no RVVException for this version } if (e.previousVersion < v) { return e.contains(v); } } return true; } }