nus-yam/ex-repair huggingface dataset:
Program: 142764
Project: 142764
Buggy source:
public void propertyChange(PropertyChangeEvent evt){
  if (evt.getPropertyName().equals("String_Node_Str")) {
    TextManager.this.model=VizController.getInstance().getVizModel().getTextModel();
    if (model.getNodeTextColumns() == null || model.getNodeTextColumns().length == 0) {
      AttributeController attributeController=Lookup.getDefault().lookup(AttributeController.class);
      if (attributeController != null && attributeController.getModel() != null) {
        AttributeModel attributeModel=attributeController.getModel();
        AttributeColumn[] nodeCols=new AttributeColumn[]{attributeModel.getNodeTable().getColumn(PropertiesColumn.NODE_LABEL.getIndex())};
        AttributeColumn[] edgeCols=new AttributeColumn[]{attributeModel.getEdgeTable().getColumn(PropertiesColumn.EDGE_LABEL.getIndex())};
        model.setTextColumns(nodeCols,edgeCols);
      }
    }
    DynamicController dynamicController=Lookup.getDefault().lookup(DynamicController.class);
    currentTimeInterval=dynamicController.getModel().getVisibleInterval();
  }
}

Fixed version (ground truth):
public void propertyChange(PropertyChangeEvent evt){
  if (evt.getPropertyName().equals("String_Node_Str")) {
    TextManager.this.model=VizController.getInstance().getVizModel().getTextModel();
    if (model.getNodeTextColumns() == null || model.getNodeTextColumns().length == 0) {
      AttributeController attributeController=Lookup.getDefault().lookup(AttributeController.class);
      if (attributeController != null && attributeController.getModel() != null) {
        AttributeModel attributeModel=attributeController.getModel();
        AttributeColumn[] nodeCols=new AttributeColumn[]{attributeModel.getNodeTable().getColumn(PropertiesColumn.NODE_LABEL.getIndex())};
        AttributeColumn[] edgeCols=new AttributeColumn[]{attributeModel.getEdgeTable().getColumn(PropertiesColumn.EDGE_LABEL.getIndex())};
        model.setTextColumns(nodeCols,edgeCols);
      }
    }
    DynamicModel dynamicModel=dynamicController.getModel();
    if (dynamicModel != null) {
      currentTimeInterval=dynamicModel.getVisibleInterval();
    }
 else {
      currentTimeInterval=null;
    }
  }
}
Program: 142766
Project: 142766
Buggy source:
public void run(){
  String title=NbBundle.getMessage(DesktopImportControllerUI.class,"String_Node_Str");
  JPanel panel=pui.getPanel();
  pui.setup(processor);
  final DialogDescriptor dd2=new DialogDescriptor(panel,title);
  if (panel instanceof ValidationPanel) {
    ValidationPanel vp=(ValidationPanel)panel;
    vp.addChangeListener(new ChangeListener(){
      public void stateChanged(      ChangeEvent e){
        dd2.setValid(!((ValidationPanel)e.getSource()).isProblem());
      }
    }
);
    dd2.setValid(!vp.isProblem());
  }
  Object result=DialogDisplayer.getDefault().notify(dd2);
  if (result.equals(NotifyDescriptor.CANCEL_OPTION) || result.equals(NotifyDescriptor.CLOSED_OPTION)) {
    pui.unsetup();
    return;
  }
  pui.unsetup();
}

Fixed version (ground truth):
public void run(){
  String title=NbBundle.getMessage(DesktopImportControllerUI.class,"String_Node_Str");
  JPanel panel=pui.getPanel();
  pui.setup(processor);
  final DialogDescriptor dd2=new DialogDescriptor(panel,title);
  if (panel instanceof ValidationPanel) {
    ValidationPanel vp=(ValidationPanel)panel;
    vp.addChangeListener(new ChangeListener(){
      public void stateChanged(      ChangeEvent e){
        dd2.setValid(!((ValidationPanel)e.getSource()).isProblem());
      }
    }
);
    dd2.setValid(!vp.isProblem());
  }
  Object result=DialogDisplayer.getDefault().notify(dd2);
  if (result.equals(NotifyDescriptor.CANCEL_OPTION) || result.equals(NotifyDescriptor.CLOSED_OPTION)) {
    validResult.setResult(false);
  }
 else {
    pui.unsetup();
    validResult.setResult(true);
  }
}
Program: 142767
Project: 142767
Buggy source:
@Override public BigDecimal getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<BigDecimal> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    BigDecimal total=new BigDecimal(0);
  for (int i=0; i < values.size(); ++i)   total=total.add(values.get(i));
return total.divide(new BigDecimal(values.size()));
case MEDIAN:
if (values.size() % 2 == 1) return values.get(values.size() / 2);
BigDecimal bd=values.get(values.size() / 2 - 1);
bd=bd.add(values.get(values.size() / 2));
return bd.divide(new BigDecimal(2));
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
BigDecimal sum=new BigDecimal(0);
for (int i=0; i < values.size(); ++i) sum=sum.add(values.get(i));
return sum;
case MIN:
BigDecimal minimum=values.get(0);
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(values.get(i)) > 0) minimum=values.get(i);
return minimum;
case MAX:
BigDecimal maximum=values.get(0);
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(values.get(i)) < 0) maximum=values.get(i);
return maximum;
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public BigDecimal getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<BigDecimal>(low,high,false,false),estimator);
}
Program: 142768
Project: 142768
Buggy source:
@Override public BigInteger getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<BigInteger> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    BigInteger total=BigInteger.valueOf(0);
  for (int i=0; i < values.size(); ++i)   total=total.add(values.get(i));
return total.divide(BigInteger.valueOf(values.size()));
case MEDIAN:
if (values.size() % 2 == 1) return values.get(values.size() / 2);
BigInteger bi=values.get(values.size() / 2 - 1);
bi=bi.add(values.get(values.size() / 2));
return bi.divide(BigInteger.valueOf(2));
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
BigInteger sum=BigInteger.valueOf(0);
for (int i=0; i < values.size(); ++i) sum=sum.add(values.get(i));
return sum;
case MIN:
BigInteger minimum=values.get(0);
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(values.get(i)) > 0) minimum=values.get(i);
return minimum;
case MAX:
BigInteger maximum=values.get(0);
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(values.get(i)) < 0) maximum=values.get(i);
return maximum;
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public BigInteger getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<BigInteger>(low,high,false,false),estimator);
}
Program: 142769
Project: 142769
Buggy source:
@Override public Boolean getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<Boolean> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    throw new UnsupportedOperationException("String_Node_Str");
case MEDIAN:
  if (values.size() % 2 == 1)   return values.get(values.size() / 2);
return values.get(values.size() / 2 - 1);
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
throw new UnsupportedOperationException("String_Node_Str");
case MIN:
Boolean minimum=values.get(0);
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(values.get(i)) > 0) minimum=values.get(i);
return minimum;
case MAX:
Boolean maximum=values.get(0);
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(values.get(i)) < 0) maximum=values.get(i);
return maximum;
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public Boolean getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<Boolean>(low,high,false,false),estimator);
}
Program: 142770
Project: 142770
Buggy source:
@Override public Byte getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<Byte> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    BigInteger total=BigInteger.valueOf(0);
  for (int i=0; i < values.size(); ++i)   total=total.add(BigInteger.valueOf(values.get(i)));
return total.divide(BigInteger.valueOf(values.size())).byteValue();
case MEDIAN:
if (values.size() % 2 == 1) return values.get(values.size() / 2);
BigInteger bi=BigInteger.valueOf(values.get(values.size() / 2 - 1));
bi=bi.add(BigInteger.valueOf(values.get(values.size() / 2)));
return bi.divide(BigInteger.valueOf(2)).byteValue();
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
BigInteger sum=BigInteger.valueOf(0);
for (int i=0; i < values.size(); ++i) sum=sum.add(BigInteger.valueOf(values.get(i)));
return sum.byteValue();
case MIN:
BigInteger minimum=BigInteger.valueOf(values.get(0));
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(BigInteger.valueOf(values.get(i))) > 0) minimum=BigInteger.valueOf(values.get(i));
return minimum.byteValue();
case MAX:
BigInteger maximum=BigInteger.valueOf(values.get(0));
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(BigInteger.valueOf(values.get(i))) < 0) maximum=BigInteger.valueOf(values.get(i));
return maximum.byteValue();
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public Byte getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<Byte>(low,high,false,false),estimator);
}
Program: 142771
Project: 142771
Buggy source:
@Override public Character getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<Character> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    throw new UnsupportedOperationException("String_Node_Str");
case MEDIAN:
  if (values.size() % 2 == 1)   return values.get(values.size() / 2);
return values.get(values.size() / 2 - 1);
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
throw new UnsupportedOperationException("String_Node_Str");
case MIN:
Character minimum=values.get(0);
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(values.get(i)) > 0) minimum=values.get(i);
return minimum;
case MAX:
Character maximum=values.get(0);
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(values.get(i)) < 0) maximum=values.get(i);
return maximum;
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public Character getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<Character>(low,high,false,false),estimator);
}
Program: 142772
Project: 142772
Buggy source:
@Override public Double getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<Double> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    BigDecimal total=new BigDecimal(0);
  for (int i=0; i < values.size(); ++i)   total=total.add(new BigDecimal(values.get(i)));
return total.divide(new BigDecimal(values.size())).doubleValue();
case MEDIAN:
if (values.size() % 2 == 1) return values.get(values.size() / 2);
BigDecimal bd=new BigDecimal(values.get(values.size() / 2 - 1));
bd=bd.add(new BigDecimal(values.get(values.size() / 2)));
return bd.divide(new BigDecimal(2)).doubleValue();
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
BigDecimal sum=new BigDecimal(0);
for (int i=0; i < values.size(); ++i) sum=sum.add(new BigDecimal(values.get(i)));
return sum.doubleValue();
case MIN:
BigDecimal minimum=new BigDecimal(values.get(0));
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(new BigDecimal(values.get(i))) > 0) minimum=new BigDecimal(values.get(i));
return minimum.doubleValue();
case MAX:
BigDecimal maximum=new BigDecimal(values.get(0));
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(new BigDecimal(values.get(i))) < 0) maximum=new BigDecimal(values.get(i));
return maximum.doubleValue();
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public Double getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<Double>(low,high,false,false),estimator);
}
Program: 142773
Project: 142773
Buggy source:
@Override public Float getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<Float> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    BigDecimal total=new BigDecimal(0);
  for (int i=0; i < values.size(); ++i)   total=total.add(new BigDecimal(values.get(i)));
return total.divide(new BigDecimal(values.size())).floatValue();
case MEDIAN:
if (values.size() % 2 == 1) return values.get(values.size() / 2);
BigDecimal bd=new BigDecimal(values.get(values.size() / 2 - 1));
bd=bd.add(new BigDecimal(values.get(values.size() / 2)));
return bd.divide(new BigDecimal(2)).floatValue();
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
BigDecimal sum=new BigDecimal(0);
for (int i=0; i < values.size(); ++i) sum=sum.add(new BigDecimal(values.get(i)));
return sum.floatValue();
case MIN:
BigDecimal minimum=new BigDecimal(values.get(0));
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(new BigDecimal(values.get(i))) > 0) minimum=new BigDecimal(values.get(i));
return minimum.floatValue();
case MAX:
BigDecimal maximum=new BigDecimal(values.get(0));
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(new BigDecimal(values.get(i))) < 0) maximum=new BigDecimal(values.get(i));
return maximum.floatValue();
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public Float getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<Float>(low,high,false,false),estimator);
}
Program: 142774
Project: 142774
Buggy source:
@Override public Integer getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<Integer> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    BigInteger total=BigInteger.valueOf(0);
  for (int i=0; i < values.size(); ++i)   total=total.add(BigInteger.valueOf(values.get(i)));
return total.divide(BigInteger.valueOf(values.size())).intValue();
case MEDIAN:
if (values.size() % 2 == 1) return values.get(values.size() / 2);
BigInteger bi=BigInteger.valueOf(values.get(values.size() / 2 - 1));
bi=bi.add(BigInteger.valueOf(values.get(values.size() / 2)));
return bi.divide(BigInteger.valueOf(2)).intValue();
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
BigInteger sum=BigInteger.valueOf(0);
for (int i=0; i < values.size(); ++i) sum=sum.add(BigInteger.valueOf(values.get(i)));
return sum.intValue();
case MIN:
BigInteger minimum=BigInteger.valueOf(values.get(0));
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(BigInteger.valueOf(values.get(i))) > 0) minimum=BigInteger.valueOf(values.get(i));
return minimum.intValue();
case MAX:
BigInteger maximum=BigInteger.valueOf(values.get(0));
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(BigInteger.valueOf(values.get(i))) < 0) maximum=BigInteger.valueOf(values.get(i));
return maximum.intValue();
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public Integer getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<Integer>(low,high,false,false),estimator);
}
Program: 142775
Project: 142775
Buggy source:
@Override public Long getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<Long> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    BigInteger total=BigInteger.valueOf(0);
  for (int i=0; i < values.size(); ++i)   total=total.add(BigInteger.valueOf(values.get(i)));
return total.divide(BigInteger.valueOf(values.size())).longValue();
case MEDIAN:
if (values.size() % 2 == 1) return values.get(values.size() / 2);
BigInteger bi=BigInteger.valueOf(values.get(values.size() / 2 - 1));
bi=bi.add(BigInteger.valueOf(values.get(values.size() / 2)));
return bi.divide(BigInteger.valueOf(2)).longValue();
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
BigInteger sum=BigInteger.valueOf(0);
for (int i=0; i < values.size(); ++i) sum=sum.add(BigInteger.valueOf(values.get(i)));
return sum.longValue();
case MIN:
BigInteger minimum=BigInteger.valueOf(values.get(0));
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(BigInteger.valueOf(values.get(i))) > 0) minimum=BigInteger.valueOf(values.get(i));
return minimum.longValue();
case MAX:
BigInteger maximum=BigInteger.valueOf(values.get(0));
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(BigInteger.valueOf(values.get(i))) < 0) maximum=BigInteger.valueOf(values.get(i));
return maximum.longValue();
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public Long getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<Long>(low,high,false,false),estimator);
}
Program: 142776
Project: 142776
Buggy source:
@Override public Short getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<Short> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    BigInteger total=BigInteger.valueOf(0);
  for (int i=0; i < values.size(); ++i)   total=total.add(BigInteger.valueOf(values.get(i)));
return total.divide(BigInteger.valueOf(values.size())).shortValue();
case MEDIAN:
if (values.size() % 2 == 1) return values.get(values.size() / 2);
BigInteger bi=BigInteger.valueOf(values.get(values.size() / 2 - 1));
bi=bi.add(BigInteger.valueOf(values.get(values.size() / 2)));
return bi.divide(BigInteger.valueOf(2)).shortValue();
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
BigInteger sum=BigInteger.valueOf(0);
for (int i=0; i < values.size(); ++i) sum=sum.add(BigInteger.valueOf(values.get(i)));
return sum.shortValue();
case MIN:
BigInteger minimum=BigInteger.valueOf(values.get(0));
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(BigInteger.valueOf(values.get(i))) > 0) minimum=BigInteger.valueOf(values.get(i));
return minimum.shortValue();
case MAX:
BigInteger maximum=BigInteger.valueOf(values.get(0));
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(BigInteger.valueOf(values.get(i))) < 0) maximum=BigInteger.valueOf(values.get(i));
return maximum.shortValue();
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public Short getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<Short>(low,high,false,false),estimator);
}
Program: 142777
Project: 142777
Buggy source:
@Override public String getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  List<String> values=getValues(low,high);
  if (values.isEmpty())   return null;
switch (estimator) {
case AVERAGE:
    throw new UnsupportedOperationException("String_Node_Str");
case MEDIAN:
  if (values.size() % 2 == 1)   return values.get(values.size() / 2);
return values.get(values.size() / 2 - 1);
case MODE:
Hashtable<Integer,Integer> map=new Hashtable<Integer,Integer>();
for (int i=0; i < values.size(); ++i) {
int prev=0;
if (map.containsKey(values.get(i).hashCode())) prev=map.get(values.get(i).hashCode());
map.put(values.get(i).hashCode(),prev + 1);
}
int max=map.get(values.get(0).hashCode());
int index=0;
for (int i=1; i < values.size(); ++i) if (max < map.get(values.get(i).hashCode())) {
max=map.get(values.get(i).hashCode());
index=i;
}
return values.get(index);
case SUM:
throw new UnsupportedOperationException("String_Node_Str");
case MIN:
String minimum=values.get(0);
for (int i=1; i < values.size(); ++i) if (minimum.compareTo(values.get(i)) > 0) minimum=values.get(i);
return minimum;
case MAX:
String maximum=values.get(0);
for (int i=1; i < values.size(); ++i) if (maximum.compareTo(values.get(i)) < 0) maximum=values.get(i);
return maximum;
case FIRST:
return values.get(0);
case LAST:
return values.get(values.size() - 1);
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public String getValue(double low,double high,Estimator estimator){
  if (low > high)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  return getValue(new Interval<String>(low,high,false,false),estimator);
}
Program: 142778
Project: 142778
Buggy source:
private boolean isSelected(){
  return FiltersTopComponent.findInstance().getUiModel().getSelectedRoot() == query;
}

Fixed version (ground truth):
private boolean isSelected(){
  FilterController fc=Lookup.getDefault().lookup(FilterController.class);
  return fc.getModel().getCurrentQuery() == query;
}
Program: 142779
Project: 142779
Buggy source:
@Override public void restored(){
  initGephi();
  UIManager.put("String_Node_Str","String_Node_Str");
  Logger.getLogger("String_Node_Str").addHandler(new ReporterHandler());
}

Fixed version (ground truth):
@Override public void restored(){
  initGephi();
  UIManager.put("String_Node_Str","String_Node_Str");
  UIManager.put("String_Node_Str",Boolean.FALSE);
  Logger.getLogger("String_Node_Str").addHandler(new ReporterHandler());
}
Program: 142782
Project: 142782
Buggy source:
@Override public Transferable paste() throws IOException {
  QueryNode queryNode=(QueryNode)dropNode;
  FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
  FilterLibrary library=filterController.getModel().getLibrary();
  library.saveQuery(queryNode.qetQuery());
  return null;
}

Fixed version (ground truth):
@Override public Transferable paste() throws IOException {
  QueryNode queryNode=(QueryNode)dropNode;
  FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
  FilterLibrary library=filterController.getModel().getLibrary();
  library.saveQuery(queryNode.getQuery());
  return null;
}
Program: 142783
Project: 142783
Buggy source:
@Override public PasteType getDropType(final Transferable t,int action,int index){
  if (category == null || !category.equals(FiltersExplorer.QUERIES)) {
    return null;
  }
  final Node dropNode=NodeTransfer.node(t,DnDConstants.ACTION_COPY_OR_MOVE);
  if (dropNode != null && dropNode instanceof QueryNode) {
    return new PasteType(){
      @Override public Transferable paste() throws IOException {
        QueryNode queryNode=(QueryNode)dropNode;
        FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
        FilterLibrary library=filterController.getModel().getLibrary();
        library.saveQuery(queryNode.qetQuery());
        return null;
      }
    }
;
  }
  return null;
}

Fixed version (ground truth):
@Override public PasteType getDropType(final Transferable t,int action,int index){
  if (category == null || !category.equals(FiltersExplorer.QUERIES)) {
    return null;
  }
  final Node dropNode=NodeTransfer.node(t,DnDConstants.ACTION_COPY_OR_MOVE);
  if (dropNode != null && dropNode instanceof QueryNode) {
    return new PasteType(){
      @Override public Transferable paste() throws IOException {
        QueryNode queryNode=(QueryNode)dropNode;
        FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
        FilterLibrary library=filterController.getModel().getLibrary();
        library.saveQuery(queryNode.getQuery());
        return null;
      }
    }
;
  }
  return null;
}
Program: 142784
Project: 142784
Buggy source:
private void saveExpandStatus(Node node){
  if (node instanceof RootNode) {
    RootNode rootNode=(RootNode)node;
    for (    Node n : rootNode.getChildren().getNodes()) {
      saveExpandStatus(n);
    }
  }
 else   if (node instanceof QueryNode) {
    QueryNode queryNode=(QueryNode)node;
    Node firstChild=queryNode.getChildren().getNodeAt(0);
    boolean parameterExpanded=false;
    if (firstChild != null && firstChild instanceof ParameterNode) {
      parameterExpanded=isExpanded(firstChild);
    }
    uiModel.setExpand(queryNode.qetQuery(),isExpanded(queryNode),parameterExpanded);
    for (    Node n : queryNode.getChildren().getNodes()) {
      saveExpandStatus(n);
    }
  }
}

Fixed version (ground truth):
private void saveExpandStatus(Node node){
  if (node instanceof RootNode) {
    RootNode rootNode=(RootNode)node;
    for (    Node n : rootNode.getChildren().getNodes()) {
      saveExpandStatus(n);
    }
  }
 else   if (node instanceof QueryNode) {
    QueryNode queryNode=(QueryNode)node;
    Node firstChild=queryNode.getChildren().getNodeAt(0);
    boolean parameterExpanded=false;
    if (firstChild != null && firstChild instanceof ParameterNode) {
      parameterExpanded=isExpanded(firstChild);
    }
    uiModel.setExpand(queryNode.getQuery(),isExpanded(queryNode),parameterExpanded);
    for (    Node n : queryNode.getChildren().getNodes()) {
      saveExpandStatus(n);
    }
  }
}
Program: 142785
Project: 142785
Buggy source:
public void propertyChange(PropertyChangeEvent evt){
  if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
    if (uiModel == null) {
      return;
    }
    Node[] nodeArray=(Node[])evt.getNewValue();
    if (nodeArray.length > 0) {
      Node node=((Node[])evt.getNewValue())[0];
      if (node instanceof RootNode) {
        uiModel.setSelectedQuery(null);
        return;
      }
      while (!(node instanceof QueryNode)) {
        node=node.getParentNode();
        if (node.getParentNode() == null) {
          uiModel.setSelectedQuery(null);
          return;
        }
      }
      QueryNode queryNode=(QueryNode)node;
      final Query query=queryNode.qetQuery();
      new Thread(new Runnable(){
        public void run(){
          uiModel.setSelectedQuery(query);
        }
      }
).start();
    }
  }
}

Fixed version (ground truth):
public void propertyChange(PropertyChangeEvent evt){
  if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
    if (uiModel == null) {
      return;
    }
    Node[] nodeArray=(Node[])evt.getNewValue();
    if (nodeArray.length > 0) {
      Node node=((Node[])evt.getNewValue())[0];
      if (node instanceof RootNode) {
        uiModel.setSelectedQuery(null);
        return;
      }
      while (!(node instanceof QueryNode)) {
        node=node.getParentNode();
        if (node.getParentNode() == null) {
          uiModel.setSelectedQuery(null);
          return;
        }
      }
      QueryNode queryNode=(QueryNode)node;
      final Query query=queryNode.getQuery();
      new Thread(new Runnable(){
        public void run(){
          uiModel.setSelectedQuery(query);
        }
      }
).start();
    }
  }
}
Program: 142786
Project: 142786
Buggy source:
private void loadExpandStatus(Node node){
  if (node instanceof RootNode) {
    RootNode rootNode=(RootNode)node;
    for (    Node n : rootNode.getChildren().getNodes()) {
      loadExpandStatus(n);
    }
  }
 else   if (node instanceof QueryNode) {
    QueryNode queryNode=(QueryNode)node;
    if (uiModel.isExpanded(queryNode.qetQuery())) {
      expandNode(queryNode);
    }
    Node firstChild=queryNode.getChildren().getNodeAt(0);
    if (firstChild != null && firstChild instanceof ParameterNode) {
      if (uiModel.isParametersExpanded(queryNode.qetQuery())) {
        expandNode(firstChild);
      }
    }
    for (    Node n : queryNode.getChildren().getNodes()) {
      loadExpandStatus(n);
    }
  }
}

Fixed version (ground truth):
private void loadExpandStatus(Node node){
  if (node instanceof RootNode) {
    RootNode rootNode=(RootNode)node;
    for (    Node n : rootNode.getChildren().getNodes()) {
      loadExpandStatus(n);
    }
  }
 else   if (node instanceof QueryNode) {
    QueryNode queryNode=(QueryNode)node;
    if (uiModel.isExpanded(queryNode.getQuery())) {
      expandNode(queryNode);
    }
    Node firstChild=queryNode.getChildren().getNodeAt(0);
    if (firstChild != null && firstChild instanceof ParameterNode) {
      if (uiModel.isParametersExpanded(queryNode.getQuery())) {
        expandNode(firstChild);
      }
    }
    for (    Node n : queryNode.getChildren().getNodes()) {
      loadExpandStatus(n);
    }
  }
}
Program: 142787
Project: 142787
Buggy source:
@Override public Transferable paste() throws IOException {
  SavedQueryNode node=(SavedQueryNode)dropNode;
  FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
  filterController.add(node.getQuery());
  return null;
}

Fixed version (ground truth):
@Override public Transferable paste() throws IOException {
  QueryNode queryNode=(QueryNode)dropNode;
  FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
  filterController.removeSubQuery(queryNode.getQuery(),queryNode.getQuery().getParent());
  filterController.add(queryNode.getQuery());
  return null;
}
Program: 142788
Project: 142788
Buggy source:
@Override public PasteType getDropType(Transferable t,int action,int index){
  final Node dropNode=NodeTransfer.node(t,DnDConstants.ACTION_COPY_OR_MOVE);
  if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
    try {
      final FilterBuilder fb=(FilterBuilder)t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
      return new PasteType(){
        @Override public Transferable paste() throws IOException {
          FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
          Query f=filterController.createQuery(fb.getFilter());
          filterController.add(f);
          return null;
        }
      }
;
    }
 catch (    UnsupportedFlavorException ex) {
      ex.printStackTrace();
    }
catch (    IOException ex) {
      ex.printStackTrace();
    }
  }
 else   if (dropNode != null && dropNode instanceof SavedQueryNode) {
    return new PasteType(){
      @Override public Transferable paste() throws IOException {
        SavedQueryNode node=(SavedQueryNode)dropNode;
        FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
        filterController.add(node.getQuery());
        return null;
      }
    }
;
  }
  return null;
}

Fixed version (ground truth):
@Override public PasteType getDropType(Transferable t,int action,int index){
  final Node dropNode=NodeTransfer.node(t,DnDConstants.ACTION_COPY_OR_MOVE);
  if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
    try {
      final FilterBuilder fb=(FilterBuilder)t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
      return new PasteType(){
        @Override public Transferable paste() throws IOException {
          FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
          Query f=filterController.createQuery(fb.getFilter());
          filterController.add(f);
          return null;
        }
      }
;
    }
 catch (    UnsupportedFlavorException ex) {
      ex.printStackTrace();
    }
catch (    IOException ex) {
      ex.printStackTrace();
    }
  }
 else   if (dropNode != null && dropNode instanceof SavedQueryNode) {
    return new PasteType(){
      @Override public Transferable paste() throws IOException {
        SavedQueryNode node=(SavedQueryNode)dropNode;
        FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
        filterController.add(node.getQuery());
        return null;
      }
    }
;
  }
 else   if (dropNode != null && dropNode instanceof QueryNode && ((QueryNode)dropNode).getQuery().getParent() != null) {
    return new PasteType(){
      @Override public Transferable paste() throws IOException {
        QueryNode queryNode=(QueryNode)dropNode;
        FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
        filterController.removeSubQuery(queryNode.getQuery(),queryNode.getQuery().getParent());
        filterController.add(queryNode.getQuery());
        return null;
      }
    }
;
  }
  return null;
}
Program: 142789
Project: 142789
Buggy source:
@Override public PasteType getDropType(final Transferable t,int action,int index){
  final Node dropNode=NodeTransfer.node(t,DnDConstants.ACTION_COPY_OR_MOVE);
  if (dropNode != null && dropNode instanceof QueryNode) {
    return new PasteType(){
      @Override public Transferable paste() throws IOException {
        QueryNode queryNode=(QueryNode)dropNode;
        FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
        filterController.setSubQuery(parent,queryNode.qetQuery());
        return null;
      }
    }
;
  }
 else   if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
    return new PasteType(){
      @Override public Transferable paste() throws IOException {
        try {
          FilterBuilder builder=(FilterBuilder)t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
          FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
          Query query=filterController.createQuery(builder.getFilter());
          filterController.setSubQuery(parent,query);
        }
 catch (        UnsupportedFlavorException ex) {
          Exceptions.printStackTrace(ex);
        }
        return null;
      }
    }
;
  }
  return null;
}

Fixed version (ground truth):
@Override public PasteType getDropType(final Transferable t,int action,int index){
  final Node dropNode=NodeTransfer.node(t,DnDConstants.ACTION_COPY_OR_MOVE);
  if (dropNode != null && dropNode instanceof QueryNode) {
    return new PasteType(){
      @Override public Transferable paste() throws IOException {
        QueryNode queryNode=(QueryNode)dropNode;
        FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
        filterController.setSubQuery(parent,queryNode.getQuery());
        return null;
      }
    }
;
  }
 else   if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
    return new PasteType(){
      @Override public Transferable paste() throws IOException {
        try {
          FilterBuilder builder=(FilterBuilder)t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
          FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
          Query query=filterController.createQuery(builder.getFilter());
          filterController.setSubQuery(parent,query);
        }
 catch (        UnsupportedFlavorException ex) {
          Exceptions.printStackTrace(ex);
        }
        return null;
      }
    }
;
  }
  return null;
}
Program: 142790
Project: 142790
Buggy source:
@Override public boolean accept(File file){
  if (file.isDirectory() || extensions.size() == 0) {
    return true;
  }
  String nomFichier=file.getName().toLowerCase();
  for (  String extension : extensions) {
    if (nomFichier.endsWith(extension)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean accept(File file){
  if (file.isDirectory() || extensions.size() == 0) {
    return true;
  }
  String fileName=file.getName().toLowerCase();
  for (  String extension : extensions) {
    if (fileName.endsWith(extension)) {
      return true;
    }
  }
  return false;
}
Program: 142791
Project: 142791
Buggy source:
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
public BidirectionalEdgeImpl(GraphImpl parent,float thickness,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,thickness,node1,node2,label,labelSize);
  arrows.add(new EdgeArrowB2Out(this));
  arrows.add(new EdgeArrowB1In(this));
  getDirectedEdgeSupervisor().addEdge(this);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
public BidirectionalEdgeImpl(GraphImpl parent,Edge edge,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,edge,node1,node2,label,labelSize);
  arrows.add(new EdgeArrowB2Out(this));
  arrows.add(new EdgeArrowB1In(this));
  getDirectedEdgeSupervisor().addEdge(this);
}
Program: 142792
Project: 142792
Buggy source:
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
protected DirectedEdgeImpl(GraphImpl parent,float thickness,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,thickness,node1,node2,label,labelSize);
  arrows.add(new EdgeArrowB1Out(this));
  arrows.add(new EdgeArrowB2In(this));
  if (node1.hasLabel()) {
    miniLabels.add(new EdgeMiniLabelB1(this));
  }
  if (node2.hasLabel()) {
    miniLabels.add(new EdgeMiniLabelB2(this));
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
protected DirectedEdgeImpl(GraphImpl parent,Edge edge,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,edge,node1,node2,label,labelSize);
  arrows.add(new EdgeArrowB1Out(this));
  arrows.add(new EdgeArrowB2In(this));
  if (node1.hasLabel()) {
    miniLabels.add(new EdgeMiniLabelB1(this));
  }
  if (node2.hasLabel()) {
    miniLabels.add(new EdgeMiniLabelB2(this));
  }
}
Program: 142793
Project: 142793
Buggy source:
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
protected EdgeImpl(GraphImpl parent,float thickness,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,thickness);
  this.node1=node1;
  this.node2=node2;
  direction=new Vector(this.node2.getPosition());
  direction.sub(new Vector(this.node1.getPosition()));
  length=direction.mag();
  direction.normalize();
  genCurves();
  if (null != label) {
    this.label=new EdgeLabelImpl(this,label,labelSize);
  }
 else {
    this.label=null;
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
protected EdgeImpl(GraphImpl parent,Edge edge,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,edge.getWeight());
  this.node1=node1;
  this.node2=node2;
  direction=new Vector(this.node2.getPosition());
  direction.sub(new Vector(this.node1.getPosition()));
  length=direction.mag();
  direction.normalize();
  if (edge.getEdgeData().r() != -1) {
    originalColor=new Color(edge.getEdgeData().r(),edge.getEdgeData().g(),edge.getEdgeData().b(),edge.getEdgeData().alpha());
  }
 else {
    originalColor=null;
  }
  genCurves();
  if (null != label) {
    this.label=new EdgeLabelImpl(this,label,labelSize);
  }
 else {
    this.label=null;
  }
}
Program: 142794
Project: 142794
Buggy source:
/** 
 * Creates a preview unidirectional edge from the given source edge.
 * @param previewGraph  the parent preview graph
 * @param sourceEdge    the source edge
 * @return              the generated preview unidirectional edge
 */
private UnidirectionalEdgeImpl createPreviewUnidirectionalEdge(GraphImpl previewGraph,org.gephi.graph.api.Edge sourceEdge){
  org.gephi.graph.api.EdgeData sourceEdgeData=sourceEdge.getEdgeData();
  org.gephi.graph.api.TextData sourceEdgeTextData=sourceEdgeData.getTextData();
  String label=sourceEdgeData.getLabel();
  if (sourceEdgeTextData != null && sourceEdgeTextData.getText() != null && sourceEdgeTextData.getText().isEmpty()) {
    label=sourceEdgeTextData.getText();
  }
  float labelSize=1f;
  if (sourceEdgeTextData != null) {
    labelSize=sourceEdgeTextData.getSize();
  }
  UnidirectionalEdgeImpl previewEdge=new UnidirectionalEdgeImpl(previewGraph,sourceEdge.getWeight(),nodeMap.get(sourceEdge.getSource().getId()),nodeMap.get(sourceEdge.getTarget().getId()),label,labelSize);
  previewGraph.addUnidirectionalEdge(previewEdge);
  return previewEdge;
}

Fixed version (ground truth):
/** 
 * Creates a preview unidirectional edge from the given source edge.
 * @param previewGraph  the parent preview graph
 * @param sourceEdge    the source edge
 * @return              the generated preview unidirectional edge
 */
private UnidirectionalEdgeImpl createPreviewUnidirectionalEdge(GraphImpl previewGraph,org.gephi.graph.api.Edge sourceEdge){
  org.gephi.graph.api.EdgeData sourceEdgeData=sourceEdge.getEdgeData();
  org.gephi.graph.api.TextData sourceEdgeTextData=sourceEdgeData.getTextData();
  String label=sourceEdgeData.getLabel();
  if (sourceEdgeTextData != null && sourceEdgeTextData.getText() != null && sourceEdgeTextData.getText().isEmpty()) {
    label=sourceEdgeTextData.getText();
  }
  float labelSize=1f;
  if (sourceEdgeTextData != null) {
    labelSize=sourceEdgeTextData.getSize();
  }
  UnidirectionalEdgeImpl previewEdge=new UnidirectionalEdgeImpl(previewGraph,sourceEdge,nodeMap.get(sourceEdge.getSource().getId()),nodeMap.get(sourceEdge.getTarget().getId()),label,labelSize);
  previewGraph.addUnidirectionalEdge(previewEdge);
  return previewEdge;
}