Program: 91672
Project: 91672
Buggy source:
/** 
 * Returns   {@code true} if this envelope completely encloses the specified rectangle. If thisenvelope or the given rectangle have at least one  {@link java.lang.Double#NaN NaN} value,then this method returns  {@code false}. <div class="section">Spanning the anti-meridian of a Geographic CRS</div> This method supports anti-meridian spanning in the same way than  {@link AbstractEnvelope#contains(Envelope)}.
 * @param rx  the <var>x</var> ordinate of the lower corner of the rectangle to test for inclusion.
 * @param ry  the <var>y</var> ordinate of the lower corner of the rectangle to test for inclusion.
 * @param rw  the width of the rectangle to test for inclusion. May be negative if the rectangle spans the anti-meridian.
 * @param rh  the height of the rectangle to test for inclusion. May be negative.
 * @return {@code true} if this envelope completely encloses the specified one.
 */
@Override public boolean contains(final double rx,final double ry,final double rw,final double rh){
  for (int i=0; i != DIMENSION; i++) {
    final double min0, min1, span0, span1;
    if (i == 0) {
      min0=x;
      span0=width;
      min1=rx;
      span1=rw;
    }
 else {
      min0=y;
      span0=height;
      min1=ry;
      span1=rh;
    }
    final boolean minCondition=(min1 >= min0);
    final boolean maxCondition=(min1 + span1 <= min0 + span0);
    if (minCondition & maxCondition) {
      if (!isNegativeUnsafe(span1) || isNegativeUnsafe(span0)) {
        continue;
      }
      if (span0 >= AbstractEnvelope.getSpan(getAxis(getCoordinateReferenceSystem(),i))) {
        continue;
      }
    }
 else     if (minCondition != maxCondition) {
      if (isNegative(span0) && isPositive(span1)) {
        continue;
      }
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if this envelope completely encloses the specified rectangle. If thisenvelope or the given rectangle have at least one  {@link java.lang.Double#NaN NaN} value,then this method returns  {@code false}. <div class="section">Spanning the anti-meridian of a Geographic CRS</div> This method supports anti-meridian spanning in the same way than  {@link AbstractEnvelope#contains(Envelope)}.
 * @param rx  the <var>x</var> ordinate of the lower corner of the rectangle to test for inclusion.
 * @param ry  the <var>y</var> ordinate of the lower corner of the rectangle to test for inclusion.
 * @param rw  the width of the rectangle to test for inclusion. May be negative if the rectangle spans the anti-meridian.
 * @param rh  the height of the rectangle to test for inclusion. May be negative.
 * @return {@code true} if this envelope completely encloses the specified one.
 */
@Override public boolean contains(final double rx,final double ry,final double rw,final double rh){
  for (int i=0; i != DIMENSION; i++) {
    final double min0, min1, span0, span1;
    if (i == 0) {
      min0=x;
      span0=width;
      min1=rx;
      span1=rw;
    }
 else {
      min0=y;
      span0=height;
      min1=ry;
      span1=rh;
    }
    final boolean minCondition=(min1 >= min0);
    final boolean maxCondition=(min1 + span1 <= min0 + span0);
    if (minCondition & maxCondition) {
      if (!isNegativeUnsafe(span1) || isNegativeUnsafe(span0)) {
        continue;
      }
      if (span0 >= AbstractEnvelope.getSpan(getAxis(crs,i))) {
        continue;
      }
    }
 else     if (minCondition != maxCondition) {
      if (isNegative(span0) && isPositive(span1)) {
        continue;
      }
    }
 else     if (isNegativeZero(span0)) {
      continue;
    }
    return false;
  }
  return true;
}