Program: 189791
Project: 189791
Buggy source:
public boolean init(Filter filter,Graph graph){
  boolean res=true;
  if (filter instanceof NodeFilter) {
    res=((NodeFilter)filter).init(graph);
  }
 else   if (filter instanceof EdgeFilter) {
    res=((EdgeFilter)filter).init(graph);
  }
 else   if (filter instanceof NodeFilter) {
    res=((AttributableFilter)filter).init(graph);
  }
  if (filter instanceof RangeFilter) {
    RangeFilter rangeFilter=(RangeFilter)filter;
    Number[] values=rangeFilter.getValues(graph);
    NumberComparator comparator=new NumberComparator();
    Number min=null;
    Number max=null;
    if (values != null) {
      for (      Number n : values) {
        min=min == null ? n : comparator.min(min,n);
        max=max == null ? n : comparator.max(max,n);
      }
    }
    Range previousRange=(Range)rangeFilter.getRangeProperty().getValue();
    Range newRange;
    if (min == null || max == null) {
      newRange=null;
      rangeFilter.getRangeProperty().setValue(newRange);
    }
 else {
      if (previousRange == null) {
        newRange=new Range(min,max,min,max,values);
        rangeFilter.getRangeProperty().setValue(newRange);
      }
 else       if (previousRange != null && (previousRange.getMinimum() == null || previousRange.getMaximum() == null)) {
        newRange=new Range(previousRange.getLowerBound(),previousRange.getUpperBound(),min,max,values);
        rangeFilter.getRangeProperty().setValue(newRange);
      }
 else {
        boolean stickyLeft=previousRange.getMinimum().equals(previousRange.getLowerBound());
        boolean stickyRight=previousRange.getMaximum().equals(previousRange.getUpperBound());
        Number lowerBound=previousRange.getLowerBound();
        Number upperBound=previousRange.getUpperBound();
        if (stickyRight && comparator.superior(max,upperBound)) {
          upperBound=max;
        }
        if (stickyLeft && comparator.inferior(min,lowerBound)) {
          lowerBound=min;
        }
        if (comparator.superior(upperBound,max)) {
          upperBound=max;
        }
        if (comparator.inferior(lowerBound,min)) {
          lowerBound=min;
        }
        newRange=new Range(lowerBound,upperBound,min,max,values);
        if (!newRange.equals(previousRange)) {
          rangeFilter.getRangeProperty().setValue(newRange);
        }
      }
    }
  }
  return res;
}

Fixed version (ground truth):
public boolean init(Filter filter,Graph graph){
  boolean res=true;
  if (filter instanceof NodeFilter) {
    res=((NodeFilter)filter).init(graph);
  }
 else   if (filter instanceof EdgeFilter) {
    res=((EdgeFilter)filter).init(graph);
  }
 else   if (filter instanceof NodeFilter) {
    res=((AttributableFilter)filter).init(graph);
  }
  if (filter instanceof RangeFilter) {
    RangeFilter rangeFilter=(RangeFilter)filter;
    Number[] values=rangeFilter.getValues(graph);
    NumberComparator comparator=new NumberComparator();
    Number min=null;
    Number max=null;
    if (values != null) {
      for (      Number n : values) {
        min=min == null ? n : comparator.min(min,n);
        max=max == null ? n : comparator.max(max,n);
      }
    }
    Range previousRange=(Range)rangeFilter.getRangeProperty().getValue();
    Range newRange;
    if (min == null || max == null) {
      newRange=null;
      rangeFilter.getRangeProperty().setValue(newRange);
    }
 else {
      if (previousRange == null) {
        newRange=new Range(min,max,min,max,values);
        rangeFilter.getRangeProperty().setValue(newRange);
      }
 else       if (previousRange != null && (previousRange.getMinimum() == null || previousRange.getMaximum() == null)) {
        newRange=new Range(previousRange.getLowerBound(),previousRange.getUpperBound(),min,max,previousRange.isLeftInclusive(),previousRange.isRightInclusive(),values);
        rangeFilter.getRangeProperty().setValue(newRange);
      }
 else {
        boolean stickyLeft=previousRange.getMinimum().equals(previousRange.getLowerBound());
        boolean stickyRight=previousRange.getMaximum().equals(previousRange.getUpperBound());
        Number lowerBound=previousRange.getLowerBound();
        Number upperBound=previousRange.getUpperBound();
        if (stickyRight && comparator.superior(max,upperBound)) {
          upperBound=max;
        }
        if (stickyLeft && comparator.inferior(min,lowerBound)) {
          lowerBound=min;
        }
        if (comparator.superior(upperBound,max)) {
          upperBound=max;
        }
        if (comparator.inferior(lowerBound,min)) {
          lowerBound=min;
        }
        newRange=new Range(lowerBound,upperBound,min,max,previousRange.isLeftInclusive(),previousRange.isRightInclusive(),values);
        if (!newRange.equals(previousRange)) {
          rangeFilter.getRangeProperty().setValue(newRange);
        }
      }
    }
  }
  return res;
}