nus-yam/ex-repair huggingface dataset:
Program: 143055
Project: 143055
Buggy source:
public void pushSlice(Workspace workspace,String from,String to,Edge edge){
  AttributeModel am=workspace.getLookup().lookup(AttributeModel.class);
  AttributeColumn col=null;
  if (am.getEdgeTable().hasColumn(COLUMN_KEY)) {
    col=am.getEdgeTable().getColumn(COLUMN_KEY);
  }
 else {
    col=am.getEdgeTable().addColumn(COLUMN_KEY,COLUMN_TYPE);
  }
  DateFormat formatter=new SimpleDateFormat(DATE_FORMAT);
  double f=Double.NEGATIVE_INFINITY, t=Double.POSITIVE_INFINITY;
  try {
    if (from != null && !from.isEmpty()) {
      f=((Date)formatter.parse(from)).getTime();
    }
    if (to != null && !to.isEmpty()) {
      t=((Date)formatter.parse(to)).getTime();
    }
  }
 catch (  ParseException ex) {
    Exceptions.printStackTrace(ex);
  }
  edge.getEdgeData().getAttributes().setValue(col.getIndex(),new TimeInterval(f,t));
}

Fixed version (ground truth):
public void pushSlice(Workspace workspace,String from,String to,Edge edge){
  AttributeModel am=workspace.getLookup().lookup(AttributeModel.class);
  AttributeColumn col=null;
  if (am.getEdgeTable().hasColumn(COLUMN_KEY)) {
    col=am.getEdgeTable().getColumn(COLUMN_KEY);
  }
 else {
    col=am.getEdgeTable().addColumn(COLUMN_KEY,COLUMN_TYPE);
  }
  DateFormat formatter=new SimpleDateFormat(DATE_FORMAT);
  double f=Double.NEGATIVE_INFINITY, t=Double.POSITIVE_INFINITY;
  try {
    if (from != null && !from.isEmpty())     f=((Date)formatter.parse(from)).getTime();
    if (to != null && !to.isEmpty())     t=((Date)formatter.parse(to)).getTime();
    if (model.getUnit() == null) {
      model.setUnit(DateTime.class);
    }
  }
 catch (  ParseException ex) {
    try {
      if (from != null)       f=Double.parseDouble(from);
      if (to != null)       t=Double.parseDouble(to);
      if (model.getUnit() == null) {
        model.setUnit(Double.class);
      }
    }
 catch (    NumberFormatException ex2) {
      Exceptions.printStackTrace(ex);
    }
  }
  edge.getEdgeData().getAttributes().setValue(col.getIndex(),new TimeInterval(f,t));
}
Program: 143056
Project: 143056
Buggy source:
public void init(){
  PropertyChangeEvent evt=new PropertyChangeEvent(this,"String_Node_Str",null,null);
  for (  PropertyChangeListener l : listeners) {
    l.propertyChange(evt);
  }
}

Fixed version (ground truth):
public void init(){
  final PropertyChangeEvent evt=new PropertyChangeEvent(this,"String_Node_Str",null,null);
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      PropertyChangeListener l : listeners) {
        l.propertyChange(evt);
      }
    }
  }
);
}
Program: 143061
Project: 143061
Buggy source:
public void writeLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    Throwable r=new RuntimeException();
    int i=0;
    for (i=0; i < r.getStackTrace().length; i++) {
      if (!r.getStackTrace()[i].toString().startsWith("String_Node_Str")) {
        break;
      }
    }
    System.err.println("String_Node_Str" + r.getStackTrace()[i].toString());
  }
  dhns.getWriteLock().lock();
}

Fixed version (ground truth):
public void writeLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    Throwable r=new RuntimeException();
    int i=0;
    for (i=0; i < r.getStackTrace().length; i++) {
      if (!r.getStackTrace()[i].toString().startsWith("String_Node_Str")) {
        break;
      }
    }
  }
  dhns.getWriteLock().lock();
}
Program: 143062
Project: 143062
Buggy source:
public void readLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    Throwable r=new RuntimeException();
    int i=0;
    for (i=0; i < r.getStackTrace().length; i++) {
      if (!r.getStackTrace()[i].toString().startsWith("String_Node_Str")) {
        break;
      }
    }
    System.err.println("String_Node_Str" + r.getStackTrace()[i].toString());
  }
  dhns.getReadLock().lock();
}

Fixed version (ground truth):
public void readLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    Throwable r=new RuntimeException();
    int i=0;
    for (i=0; i < r.getStackTrace().length; i++) {
      if (!r.getStackTrace()[i].toString().startsWith("String_Node_Str")) {
        break;
      }
    }
  }
  dhns.getReadLock().lock();
}
Program: 143063
Project: 143063
Buggy source:
public boolean isAdjacent(Edge edge1,Edge edge2){
  if (edge1 == edge2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkEdge(edge1);
  checkEdge(edge2);
  return edge1.getSource() == edge2.getSource() || edge1.getSource() == edge2.getTarget() || edge1.getTarget() == edge2.getSource() || edge1.getTarget() == edge2.getTarget();
}

Fixed version (ground truth):
public boolean isAdjacent(Edge edge1,Edge edge2){
  if (edge1 == edge2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  AbstractEdge absEdge1=checkEdge(edge1);
  AbstractEdge absEdge2=checkEdge(edge2);
  return absEdge1.getSource(view.getViewId()) == absEdge2.getSource(view.getViewId()) || absEdge1.getSource(view.getViewId()) == absEdge2.getTarget(view.getViewId()) || absEdge1.getTarget(view.getViewId()) == absEdge2.getSource(view.getViewId()) || absEdge1.getTarget(view.getViewId()) == absEdge2.getTarget(view.getViewId());
}
Program: 143064
Project: 143064
Buggy source:
public boolean isSelfLoop(Edge edge){
  checkEdge(edge);
  return edge.getSource() == edge.getTarget();
}

Fixed version (ground truth):
public boolean isSelfLoop(Edge edge){
  AbstractEdge absEdge=checkEdge(edge);
  return absEdge.getSource(view.getViewId()) == absEdge.getTarget(view.getViewId());
}
Program: 143065
Project: 143065
Buggy source:
public Node getOpposite(Node node,Edge edge){
  checkNode(node);
  checkEdge(edge);
  if (edge.getSource() == node) {
    return edge.getTarget();
  }
 else   if (edge.getTarget() == node) {
    return edge.getSource();
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
public Node getOpposite(Node node,Edge edge){
  checkNode(node);
  AbstractEdge absEdge=checkEdge(edge);
  if (absEdge.getSource(view.getViewId()) == node) {
    return absEdge.getTarget();
  }
 else   if (absEdge.getTarget(view.getViewId()) == node) {
    return absEdge.getSource(view.getViewId());
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 143066
Project: 143066
Buggy source:
public void transform(Transformer transformer){
  AbstractTransformer abstractTransformer=(AbstractTransformer)transformer;
  Ranking ranking=abstractTransformer.getRanking();
  RankingResultImpl rankingResult=new RankingResultImpl();
  rankingResult.transformer=transformer;
  rankingResult.ranking=ranking;
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraph();
  if (ranking instanceof NodeRanking) {
    for (    Node node : graph.getNodes().toArray()) {
      Object rank=ranking.getValue(node);
      Object result=null;
      if (rank != null) {
        float normalizedValue=ranking.normalize(rank);
        if (transformer.isInBounds(normalizedValue)) {
          result=transformer.transform(node,normalizedValue);
        }
      }
      rankingResult.addResult(node,rank,result);
    }
  }
 else {
    for (    Edge edge : graph.getEdges().toArray()) {
      Object rank=ranking.getValue(edge);
      Object result=null;
      if (rank != null) {
        float normalizedValue=ranking.normalize(rank);
        if (transformer.isInBounds(normalizedValue)) {
          result=transformer.transform(edge,normalizedValue);
        }
      }
      rankingResult.addResult(edge,rank,result);
    }
  }
  rankingEventBus.publishResults(rankingResult);
}

Fixed version (ground truth):
public void transform(Transformer transformer){
  AbstractTransformer abstractTransformer=(AbstractTransformer)transformer;
  Ranking ranking=abstractTransformer.getRanking();
  RankingResultImpl rankingResult=new RankingResultImpl();
  rankingResult.transformer=transformer;
  rankingResult.ranking=ranking;
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraphVisible();
  if (ranking instanceof NodeRanking) {
    ((AbstractRanking)ranking).setGraph(graph);
    for (    Node node : graph.getNodes().toArray()) {
      Object rank=ranking.getValue(node);
      Object result=null;
      if (rank != null) {
        float normalizedValue=ranking.normalize(rank);
        if (transformer.isInBounds(normalizedValue)) {
          result=transformer.transform(node,normalizedValue);
        }
      }
      rankingResult.addResult(node,rank,result);
    }
  }
 else {
    ((AbstractRanking)ranking).setGraph(graph);
    for (    Edge edge : graph.getEdges().toArray()) {
      Object rank=ranking.getValue(edge);
      Object result=null;
      if (rank != null) {
        float normalizedValue=ranking.normalize(rank);
        if (transformer.isInBounds(normalizedValue)) {
          result=transformer.transform(edge,normalizedValue);
        }
      }
      rankingResult.addResult(edge,rank,result);
    }
  }
  rankingEventBus.publishResults(rankingResult);
}
Program: 143067
Project: 143067
Buggy source:
public EdgeRanking[] getEdgeRanking(){
  AttributeController attributeController=Lookup.getDefault().lookup(AttributeController.class);
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraph();
  List<Ranking> rankingList=new ArrayList<Ranking>();
  for (  AttributeColumn column : attributeController.getModel().getEdgeTable().getColumns()) {
    if (RankingFactory.isNumberColumn(column)) {
      EdgeRanking r=RankingFactory.getEdgeAttributeRanking(column,graph);
      if (r.getMinimumValue() != null && r.getMaximumValue() != null && !r.getMinimumValue().equals(r.getMaximumValue())) {
        rankingList.add(r);
      }
    }
  }
  return rankingList.toArray(new EdgeRanking[0]);
}

Fixed version (ground truth):
public EdgeRanking[] getEdgeRanking(){
  AttributeController attributeController=Lookup.getDefault().lookup(AttributeController.class);
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraphVisible();
  List<Ranking> rankingList=new ArrayList<Ranking>();
  for (  AttributeColumn column : attributeController.getModel().getEdgeTable().getColumns()) {
    if (RankingFactory.isNumberColumn(column)) {
      EdgeRanking r=RankingFactory.getEdgeAttributeRanking(column,graph);
      if (r.getMinimumValue() != null && r.getMaximumValue() != null && !r.getMinimumValue().equals(r.getMaximumValue())) {
        rankingList.add(r);
      }
    }
  }
  return rankingList.toArray(new EdgeRanking[0]);
}
Program: 143072
Project: 143072
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
  setOpaque(enabled);
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
  setOpaque(enabled);
}
Program: 143073
Project: 143073
Buggy source:
public JComponent getComponent(){
  JPanel panel=new JPanel(new FlowLayout(FlowLayout.RIGHT,0,0)){
    @Override public void setEnabled(    boolean enabled){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
      setOpaque(enabled);
    }
  }
;
  panel.add(new HierarchyAddonButton());
  panel.setBackground(Color.WHITE);
  return panel;
}

Fixed version (ground truth):
public JComponent getComponent(){
  JPanel panel=new JPanel(new FlowLayout(FlowLayout.RIGHT,0,0)){
    @Override public void setEnabled(    final boolean enabled){
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          for (          Component c : getComponents()) {
            c.setEnabled(enabled);
          }
        }
      }
);
      setOpaque(enabled);
    }
  }
;
  panel.add(new HierarchyAddonButton());
  panel.setBackground(Color.WHITE);
  return panel;
}
Program: 143074
Project: 143074
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 143075
Project: 143075
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 143076
Project: 143076
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
  selectionBar.setEnabled(enabled);
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
      selectionBar.setEnabled(enabled);
    }
  }
);
}
Program: 143077
Project: 143077
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 143078
Project: 143078
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 143079
Project: 143079
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 143080
Project: 143080
Buggy source:
private Element createAttribute(Document document,AttributeColumn column) throws Exception {
  Element attributeE=document.createElement("String_Node_Str");
  attributeE.setAttribute("String_Node_Str",column.getId());
  attributeE.setAttribute("String_Node_Str",column.getTitle());
  attributeE.setAttribute("String_Node_Str",column.getType().getTypeString().toLowerCase());
  if (column.getDefaultValue() != null) {
    Element defaultE=document.createElement("String_Node_Str");
    Text defaultTextE=document.createTextNode(column.getDefaultValue().toString());
    defaultE.appendChild(defaultTextE);
  }
  return attributeE;
}

Fixed version (ground truth):
private Element createAttribute(Document document,AttributeColumn column) throws Exception {
  Element attributeE=document.createElement("String_Node_Str");
  attributeE.setAttribute("String_Node_Str",column.getId());
  attributeE.setAttribute("String_Node_Str",column.getTitle());
switch (column.getType()) {
case INT:
    attributeE.setAttribute("String_Node_Str","String_Node_Str");
  break;
case LIST_STRING:
attributeE.setAttribute("String_Node_Str","String_Node_Str");
break;
case TIME_INTERVAL:
break;
default :
attributeE.setAttribute("String_Node_Str",column.getType().getTypeString().toLowerCase());
break;
}
if (column.getDefaultValue() != null) {
Element defaultE=document.createElement("String_Node_Str");
Text defaultTextE=document.createTextNode(column.getDefaultValue().toString());
defaultE.appendChild(defaultTextE);
}
return attributeE;
}
Program: 143081
Project: 143081
Buggy source:
public boolean sendDocument(Document document){
  try {
    TransformerFactory factory=TransformerFactory.newInstance();
    Transformer transformer=factory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
    transformer.setOutputProperty(OutputKeys.ENCODING,"String_Node_Str");
    StringWriter sw=new StringWriter();
    StreamResult result=new StreamResult(sw);
    DOMSource source=new DOMSource(document);
    transformer.transform(source,result);
    String xmlString="String_Node_Str" + sw.toString();
    URL url=new URL(POST_URL);
    URLConnection con=url.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setDefaultUseCaches(false);
    OutputStreamWriter writer=new OutputStreamWriter(con.getOutputStream());
    writer.write(xmlString);
    writer.flush();
    writer.close();
    InputStreamReader reader=new InputStreamReader(con.getInputStream());
    StringBuilder buf=new StringBuilder();
    char[] cbuf=new char[2048];
    int num;
    while (-1 != (num=reader.read(cbuf))) {
      buf.append(cbuf,0,num);
    }
    String serverResult=buf.toString();
    System.err.println("String_Node_Str" + serverResult);
    return true;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return false;
}

Fixed version (ground truth):
public boolean sendDocument(Document document){
  try {
    TransformerFactory factory=TransformerFactory.newInstance();
    Transformer transformer=factory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
    transformer.setOutputProperty(OutputKeys.ENCODING,"String_Node_Str");
    StringWriter sw=new StringWriter();
    StreamResult result=new StreamResult(sw);
    DOMSource source=new DOMSource(document);
    transformer.transform(source,result);
    String xmlString="String_Node_Str" + URLEncoder.encode(sw.toString(),"String_Node_Str");
    URL url=new URL(POST_URL);
    URLConnection con=url.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setDefaultUseCaches(false);
    OutputStreamWriter writer=new OutputStreamWriter(con.getOutputStream());
    writer.write(xmlString);
    writer.flush();
    writer.close();
    InputStreamReader reader=new InputStreamReader(con.getInputStream());
    StringBuilder buf=new StringBuilder();
    char[] cbuf=new char[2048];
    int num;
    while (-1 != (num=reader.read(cbuf))) {
      buf.append(cbuf,0,num);
    }
    String serverResult=buf.toString();
    System.err.println("String_Node_Str" + serverResult);
    return true;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return false;
}
Program: 143082
Project: 143082
Buggy source:
private void logMessageLog(Report report){
  System.err.flush();
  System.out.flush();
  String ud=System.getProperty("String_Node_Str");
  if (ud == null || "String_Node_Str".equals(ud)) {
    return;
  }
  File userDir=new File(ud);
  File directory=new File(new File(userDir,"String_Node_Str"),"String_Node_Str");
  File messagesLog=new File(directory,"String_Node_Str");
  String log="String_Node_Str";
  try {
    byte[] buffer=new byte[(int)messagesLog.length()];
    BufferedInputStream f=new BufferedInputStream(new FileInputStream(messagesLog));
    f.read(buffer);
    log=new String(buffer);
  }
 catch (  Exception e) {
  }
  report.setLog(log);
}

Fixed version (ground truth):
private void logMessageLog(Report report){
  System.err.flush();
  System.out.flush();
  String ud=System.getProperty("String_Node_Str");
  if (ud == null || "String_Node_Str".equals(ud)) {
    return;
  }
  Handler[] handlers=Logger.getLogger("String_Node_Str").getHandlers();
  handlers[0].flush();
  File userDir=new File(ud);
  File directory=new File(new File(userDir,"String_Node_Str"),"String_Node_Str");
  File messagesLog=new File(directory,"String_Node_Str");
  String log="String_Node_Str";
  try {
    byte[] buffer=new byte[(int)messagesLog.length()];
    BufferedInputStream f=new BufferedInputStream(new FileInputStream(messagesLog));
    f.read(buffer);
    log=new String(buffer);
  }
 catch (  Exception e) {
  }
  report.setLog(log);
}
Program: 143083
Project: 143083
Buggy source:
public double getAttributeValue(int from,int to);

Fixed version (ground truth):
/** 
 * @param from
 * @param to
 * @return
 */
public double getAttributeValue(int from,int to);
Program: 143084
Project: 143084
Buggy source:
public void setRangeFromRealValues(double from,double to);

Fixed version (ground truth):
/** 
 * Set the range using real values
 * @param from
 * @param to
 */
public void setRangeFromRealValues(double from,double to);
Program: 143085
Project: 143085
Buggy source:
public double getFromFloat();

Fixed version (ground truth):
/** 
 * @return
 */
public double getFromFloat();
Program: 143086
Project: 143086
Buggy source:
public double getFromValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getFromValue();
Program: 143087
Project: 143087
Buggy source:
public double getMaxValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getMaxValue();
Program: 143088
Project: 143088
Buggy source:
public void setToValue(double to);

Fixed version (ground truth):
/** 
 * @param to
 */
public void setToValue(double to);
Program: 143089
Project: 143089
Buggy source:
public void setToFloat(double to);

Fixed version (ground truth):
/** 
 * @param to
 */
public void setToFloat(double to);
Program: 143090
Project: 143090
Buggy source:
public void addListener(TimelineModelListener listener);

Fixed version (ground truth):
/** 
 * @param listener
 */
public void addListener(TimelineModelListener listener);
Program: 143091
Project: 143091
Buggy source:
public String getLastAttributeLabel();

Fixed version (ground truth):
/** 
 * @return
 */
public String getLastAttributeLabel();
Program: 143092
Project: 143092
Buggy source:
public double getRangeSizeFloat();

Fixed version (ground truth):
/** 
 * @return
 */
public double getRangeSizeFloat();
Program: 143093
Project: 143093
Buggy source:
public void removeListener(TimelineModelListener listener);

Fixed version (ground truth):
/** 
 * @param listener
 */
public void removeListener(TimelineModelListener listener);
Program: 143094
Project: 143094
Buggy source:
public double getTotalSize();

Fixed version (ground truth):
/** 
 * @return
 */
public double getTotalSize();
Program: 143095
Project: 143095
Buggy source:
public void setFromValue(double from);

Fixed version (ground truth):
/** 
 * @param from
 */
public void setFromValue(double from);
Program: 143096
Project: 143096
Buggy source:
public void setRangeFromFloat(double from,double to);

Fixed version (ground truth):
/** 
 * @param from
 * @param to
 */
public void setRangeFromFloat(double from,double to);
Program: 143097
Project: 143097
Buggy source:
public void setMaxValue(double max);

Fixed version (ground truth):
/** 
 * @param max
 */
public void setMaxValue(double max);
Program: 143098
Project: 143098
Buggy source:
public double getMinValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getMinValue();
Program: 143099
Project: 143099
Buggy source:
public double getRangeSizeValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getRangeSizeValue();
Program: 143100
Project: 143100
Buggy source:
public void setMinMax(double min,double max);

Fixed version (ground truth):
/** 
 * @param min
 * @param max
 */
public void setMinMax(double min,double max);
Program: 143101
Project: 143101
Buggy source:
public double getToValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getToValue();
Program: 143102
Project: 143102
Buggy source:
public String getAttributeLabel(int from,int to);

Fixed version (ground truth):
/** 
 * @param from
 * @param to
 * @return
 */
public String getAttributeLabel(int from,int to);
Program: 143103
Project: 143103
Buggy source:
public TimeInterval getTimeInterval();

Fixed version (ground truth):
/** 
 * @return
 */
public TimeInterval getTimeInterval();
Program: 143104
Project: 143104
Buggy source:
public void setFromFloat(double from);

Fixed version (ground truth):
/** 
 * @param from
 */
public void setFromFloat(double from);
Program: 143105
Project: 143105
Buggy source:
public double getToFloat();

Fixed version (ground truth):
/** 
 * @return
 */
public double getToFloat();
Program: 143106
Project: 143106
Buggy source:
public void setMinValue(double min);

Fixed version (ground truth):
/** 
 * @param min
 */
public void setMinValue(double min);
Program: 143107
Project: 143107
Buggy source:
public void mouseDragged(MouseEvent evt){
  int x=evt.getX();
  double w=getWidth();
  int r=settings.selection.visibleHookWidth;
  double sf=(model.getFromFloat() * w);
  double st=(model.getToFloat() * w);
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
  double delta=0;
  if (mousex != null) {
    delta=x - mousex;
  }
  mousex=x;
switch (currentState) {
case RESIZE_FROM:
    if ((sf + delta <= 0)) {
      sf=0;
    }
 else     if (Math.abs(st - sf + delta) > settings.selection.minimalWidth) {
      sf+=delta;
    }
 else {
    }
  break;
case RESIZE_TO:
if ((st + delta >= w)) {
  st=w;
}
 else if (Math.abs((st + delta) - sf) > settings.selection.minimalWidth) {
  st+=delta;
}
break;
case MOVING:
if ((sf + delta <= 0)) {
sf=0;
}
 else if (st + delta >= w) {
st=w;
}
 else {
sf+=delta;
st+=delta;
}
break;
}
if (model != null && w != 0) {
model.setRangeFromFloat(sf * (1.0 / w),st * (1.0 / w));
}
this.repaint();
}

Fixed version (ground truth):
public void mouseDragged(MouseEvent evt){
  if (model == null)   return;
  int x=evt.getX();
  double w=getWidth();
  int r=settings.selection.visibleHookWidth;
  double sf=(model.getFromFloat() * w);
  double st=(model.getToFloat() * w);
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
  double delta=0;
  if (mousex != null) {
    delta=x - mousex;
  }
  mousex=x;
switch (currentState) {
case RESIZE_FROM:
    if ((sf + delta <= 0)) {
      sf=0;
    }
 else     if (Math.abs(st - sf + delta) > settings.selection.minimalWidth) {
      sf+=delta;
    }
 else {
    }
  break;
case RESIZE_TO:
if ((st + delta >= w)) {
  st=w;
}
 else if (Math.abs((st + delta) - sf) > settings.selection.minimalWidth) {
  st+=delta;
}
break;
case MOVING:
if ((sf + delta <= 0)) {
sf=0;
}
 else if (st + delta >= w) {
st=w;
}
 else {
sf+=delta;
st+=delta;
}
break;
}
if (model != null && w != 0) {
model.setRangeFromFloat(sf * (1.0 / w),st * (1.0 / w));
}
this.repaint();
}
Program: 143108
Project: 143108
Buggy source:
private void paintSmallGraduations(Graphics2D g2d,int x,int y,int numOfGrads){
  int width=y - x;
  int height=getHeight();
  int leftMargin=x;
  int topMargin=height - settings.informations.fontSize - 2;
  for (int i=1; i < numOfGrads; i++) {
    int xi=leftMargin + i * (width / numOfGrads);
    g2d.drawLine(xi,topMargin,xi,height - settings.informations.textBottomMargin);
  }
}

Fixed version (ground truth):
private void paintSmallGraduations(Graphics2D g2d,int x,int y,int numOfGrads){
  int width=y - x;
  int height=getHeight();
  int leftMargin=x;
  int topMargin=height - settings.informations.fontSize - 2;
  int unitSize=3;
  if (numOfGrads > (width / unitSize)) {
    return;
  }
  for (int i=1; i < numOfGrads; i++) {
    int xi=leftMargin + i * (width / numOfGrads);
    g2d.drawLine(xi,topMargin,xi,height - settings.informations.textBottomMargin);
  }
}
Program: 143110
Project: 143110
Buggy source:
public synchronized void setRangeFromRealValues(double from,double to){
  if (from >= to)   return;
  fromValue=from;
  toValue=to;
  filter.setValue(new Range(from,to));
}

Fixed version (ground truth):
public synchronized void setRangeFromRealValues(double from,double to){
  if (from >= to)   return;
  fromValue=from;
  toValue=to;
  if (filter != null)   filter.setValue(new Range(from,to));
}
Program: 143111
Project: 143111
Buggy source:
public synchronized void setToValue(double to){
  if (to <= fromValue)   return;
  toValue=to;
}

Fixed version (ground truth):
public synchronized void setToValue(double to){
  toValue=to;
}
Program: 143112
Project: 143112
Buggy source:
public synchronized void setToFloat(double to){
  if (to <= toFloat)   return;
  toFloat=to;
  setToValue(getMinValue() + getFromFloat() * getTotalSize());
}

Fixed version (ground truth):
public synchronized void setToFloat(double to){
  toFloat=to;
  setToValue(getMinValue() + getFromFloat() * getTotalSize());
  if (filter != null)   filter.setValue(new Range(getFromValue(),getToValue()));
}
Program: 143113
Project: 143113
Buggy source:
public synchronized void setFromValue(double from){
  if (from >= toValue)   return;
  fromValue=from;
}

Fixed version (ground truth):
public synchronized void setFromValue(double from){
  fromValue=from;
}
Program: 143114
Project: 143114
Buggy source:
public synchronized void setMaxValue(double max){
  if (max <= minValue)   return;
  this.maxValue=max;
  setFromValue(getMaxValue() + getToFloat() * getTotalSize());
}

Fixed version (ground truth):
public synchronized void setMaxValue(double max){
  this.maxValue=max;
  setFromValue(getMaxValue() + getToFloat() * getTotalSize());
}
Program: 143115
Project: 143115
Buggy source:
public synchronized void setFromFloat(double from){
  if (from >= toFloat)   return;
  fromFloat=from;
  setFromValue(getMinValue() + getFromFloat() * getTotalSize());
}

Fixed version (ground truth):
public synchronized void setFromFloat(double from){
  fromFloat=from;
  setFromValue(getMinValue() + getFromFloat() * getTotalSize());
  if (filter != null)   filter.setValue(new Range(getFromValue(),getToValue()));
}
Program: 143116
Project: 143116
Buggy source:
public synchronized void setMinValue(double min){
  if (min >= maxValue)   return;
  this.minValue=min;
  setFromValue(getMinValue() + getFromFloat() * getTotalSize());
}

Fixed version (ground truth):
public synchronized void setMinValue(double min){
  this.minValue=min;
  setFromValue(getMinValue() + getFromFloat() * getTotalSize());
}
Program: 143117
Project: 143117
Buggy source:
public void fatalError(Throwable t){
  Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str",t.getCause());
}

Fixed version (ground truth):
public void fatalError(Throwable t){
  Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str",t.getCause() != null ? t.getCause() : t);
}
Program: 143118
Project: 143118
Buggy source:
public LayoutModelImpl(){
  listeners=new ArrayList<PropertyChangeListener>();
  savedProperties=new HashMap<LayoutPropertyKey,Object>();
  executor=new LongTaskExecutor(true,"String_Node_Str",5);
  executor.setLongTaskListener(new LongTaskListener(){
    public void taskFinished(    LongTask task){
      setRunning(false);
    }
  }
);
  executor.setDefaultErrorHandler(new LongTaskErrorHandler(){
    public void fatalError(    Throwable t){
      Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str",t.getCause());
    }
  }
);
}

Fixed version (ground truth):
public LayoutModelImpl(){
  listeners=new ArrayList<PropertyChangeListener>();
  savedProperties=new HashMap<LayoutPropertyKey,Object>();
  executor=new LongTaskExecutor(true,"String_Node_Str",5);
  executor.setLongTaskListener(new LongTaskListener(){
    public void taskFinished(    LongTask task){
      setRunning(false);
    }
  }
);
  executor.setDefaultErrorHandler(new LongTaskErrorHandler(){
    public void fatalError(    Throwable t){
      Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str",t.getCause() != null ? t.getCause() : t);
    }
  }
);
}
Program: 143119
Project: 143119
Buggy source:
private void afterTaking(){
  WindowManager.getDefault().getMainWindow().setCursor(Cursor.getDefaultCursor());
  if (finishedMessage && file != null) {
    String msg=NbBundle.getMessage(ScreenshotMaker.class,"String_Node_Str",file.getName());
    JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),msg,NbBundle.getMessage(ScreenshotMaker.class,"String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
  }
}

Fixed version (ground truth):
private void afterTaking(){
  WindowManager.getDefault().getMainWindow().setCursor(Cursor.getDefaultCursor());
  if (finishedMessage && file != null) {
    final String msg=NbBundle.getMessage(ScreenshotMaker.class,"String_Node_Str",file.getName());
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),msg,NbBundle.getMessage(ScreenshotMaker.class,"String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
      }
    }
);
  }
}
Program: 143120
Project: 143120
Buggy source:
private void setSelectedLayout(LayoutBuilder builder){
  controller.setLayout(model.getLayout(builder));
}

Fixed version (ground truth):
private void setSelectedLayout(LayoutBuilder builder){
  controller.setLayout(builder != null ? model.getLayout(builder) : null);
}
Program: 143121
Project: 143121
Buggy source:
public void writeLock(){
  dhns.getWriteLock().lock();
}

Fixed version (ground truth):
public void writeLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    System.err.println("String_Node_Str");
  }
  dhns.getWriteLock().lock();
}
Program: 143122
Project: 143122
Buggy source:
public void readLock(){
  dhns.getReadLock().lock();
}

Fixed version (ground truth):
public void readLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    System.err.println("String_Node_Str");
  }
  dhns.getReadLock().lock();
}
Program: 143123
Project: 143123
Buggy source:
public NodeDataTable(){
  outlineTable=new Outline();
  quickFilter=new QuickFilter(){
    public boolean accept(    Object value){
      if (value == null) {
        return false;
      }
      if (value instanceof ImmutableTreeNode) {
        return pattern.matcher(((ImmutableTreeNode)value).getNode().getNodeData().getLabel()).find();
      }
      return pattern.matcher(value.toString()).find();
    }
  }
;
  outlineTable.addMouseListener(new PopupAdapter());
}

Fixed version (ground truth):
public NodeDataTable(){
  outlineTable=new Outline();
  quickFilter=new QuickFilter(){
    public boolean accept(    Object value){
      if (value == null) {
        return false;
      }
      if (value instanceof ImmutableTreeNode) {
        String label=((ImmutableTreeNode)value).getNode().getNodeData().getLabel();
        if (label != null) {
          return pattern.matcher(label).find();
        }
        return false;
      }
      return pattern.matcher(value.toString()).find();
    }
  }
;
  outlineTable.addMouseListener(new PopupAdapter());
}
Program: 143124
Project: 143124
Buggy source:
public boolean accept(Object value){
  if (value == null) {
    return false;
  }
  if (value instanceof ImmutableTreeNode) {
    return pattern.matcher(((ImmutableTreeNode)value).getNode().getNodeData().getLabel()).find();
  }
  return pattern.matcher(value.toString()).find();
}

Fixed version (ground truth):
public boolean accept(Object value){
  if (value == null) {
    return false;
  }
  if (value instanceof ImmutableTreeNode) {
    String label=((ImmutableTreeNode)value).getNode().getNodeData().getLabel();
    if (label != null) {
      return pattern.matcher(label).find();
    }
    return false;
  }
  return pattern.matcher(value.toString()).find();
}
Program: 143125
Project: 143125
Buggy source:
private void refreshPie(){
  if (model.getSelectedPartition() != null) {
    pieLink.setEnabled(true);
    if (model.isPie()) {
      pieLink.setText(HIDE_PIE);
      partitionPie=new PartitionPie();
      partitionPie.setup(model.getSelectedPartition());
      remove(centerScrollPane);
      add(partitionPie,BorderLayout.CENTER);
      revalidate();
      repaint();
      return;
    }
 else {
      pieLink.setText(SHOW_PIE);
    }
  }
 else {
    pieLink.setText(SHOW_PIE);
    pieLink.setEnabled(false);
  }
  if (!isAncestorOf(centerScrollPane)) {
    remove(partitionPie);
    add(centerScrollPane,BorderLayout.CENTER);
    revalidate();
    repaint();
  }
}

Fixed version (ground truth):
private void refreshPie(){
  if (model.getSelectedPartition() != null) {
    pieLink.setEnabled(true);
    if (model.isPie()) {
      pieLink.setText(HIDE_PIE);
      partitionPie=new PartitionPie();
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          partitionPie.setup(model.getSelectedPartition());
          remove(centerScrollPane);
          add(partitionPie,BorderLayout.CENTER);
          revalidate();
          repaint();
        }
      }
);
      return;
    }
 else {
      pieLink.setText(SHOW_PIE);
    }
  }
 else {
    pieLink.setText(SHOW_PIE);
    pieLink.setEnabled(false);
  }
  if (!isAncestorOf(centerScrollPane)) {
    remove(partitionPie);
    add(centerScrollPane,BorderLayout.CENTER);
    revalidate();
    repaint();
  }
}
Program: 143126
Project: 143126
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));
  miniLabels.add(new EdgeMiniLabelB1(this));
  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,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));
  }
}
Program: 143127
Project: 143127
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);
  }
}

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,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;
  }
}
Program: 143128
Project: 143128
Buggy source:
/** 
 * Constructor.
 * @param parent  the parent graph
 * @param label   the node label
 * @param x       the 'x' position component
 * @param y       the 'y' position component
 * @param radius  the node radius
 * @param r       the red color component
 * @param g       the green color component
 * @param b       the blue color component
 */
public NodeImpl(GraphImpl parent,float x,float y,float radius,String label,float labelSize,float r,float g,float b){
  this.parent=parent;
  this.position=new PointImpl(x,y);
  this.radius=radius;
  this.originalColor=new SimpleColor(r,g,b,0);
  this.label=new NodeLabelImpl(this,label,labelSize);
  this.labelBorder=new NodeLabelBorderImpl(this);
  Vector topLeftVector=new Vector(position);
  topLeftVector.sub(radius,radius,0);
  topLeftPosition=new PointImpl(topLeftVector);
  Vector bottomRightVector=new Vector(position);
  bottomRightVector.add(radius,radius,0);
  bottomRightPosition=new PointImpl(bottomRightVector);
  getNodeSupervisor().addNode(this);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent  the parent graph
 * @param label   the node label
 * @param x       the 'x' position component
 * @param y       the 'y' position component
 * @param radius  the node radius
 * @param r       the red color component
 * @param g       the green color component
 * @param b       the blue color component
 */
public NodeImpl(GraphImpl parent,float x,float y,float radius,String label,float labelSize,float r,float g,float b){
  this.parent=parent;
  this.position=new PointImpl(x,y);
  this.radius=radius;
  this.originalColor=new SimpleColor(r,g,b,0);
  if (label != null) {
    this.label=new NodeLabelImpl(this,label,labelSize);
    this.labelBorder=new NodeLabelBorderImpl(this);
  }
 else {
    this.label=null;
    this.labelBorder=null;
  }
  Vector topLeftVector=new Vector(position);
  topLeftVector.sub(radius,radius,0);
  topLeftPosition=new PointImpl(topLeftVector);
  Vector bottomRightVector=new Vector(position);
  bottomRightVector.add(radius,radius,0);
  bottomRightPosition=new PointImpl(bottomRightVector);
  getNodeSupervisor().addNode(this);
}
Program: 143129
Project: 143129
Buggy source:
/** 
 * Colors the given node label border with the node label border colorizer.
 * @param node  the node label border to color
 */
private void colorNodeLabelBorder(NodeLabelBorderImpl nodeLabelBorder){
  nodeLabelBorderColorizer.color(nodeLabelBorder);
}

Fixed version (ground truth):
/** 
 * Colors the given node label border with the node label border colorizer.
 * @param node  the node label border to color
 */
private void colorNodeLabelBorder(NodeLabelBorderImpl nodeLabelBorder){
  if (nodeLabelBorder != null) {
    nodeLabelBorderColorizer.color(nodeLabelBorder);
  }
}
Program: 143130
Project: 143130
Buggy source:
/** 
 * Updates the node label by shortening its value or by reverting its original one.
 */
private void updateLabelValue(NodeLabelImpl nodeLabel){
  if (shortenLabelsFlag) {
    shortenNodeLabel(nodeLabel);
  }
 else {
    revertLabel(nodeLabel);
  }
}

Fixed version (ground truth):
/** 
 * Updates the node label by shortening its value or by reverting its original one.
 */
private void updateLabelValue(NodeLabelImpl nodeLabel){
  if (nodeLabel != null) {
    if (shortenLabelsFlag) {
      shortenNodeLabel(nodeLabel);
    }
 else {
      revertLabel(nodeLabel);
    }
  }
}
Program: 143131
Project: 143131
Buggy source:
/** 
 * Colors the given node label with the node label colorizer.
 * @param node  the node label to color
 */
private void colorNodeLabel(NodeLabelImpl nodeLabel){
  nodeLabelColorizer.color(nodeLabel);
}

Fixed version (ground truth):
/** 
 * Colors the given node label with the node label colorizer.
 * @param node  the node label to color
 */
private void colorNodeLabel(NodeLabelImpl nodeLabel){
  if (nodeLabel != null) {
    nodeLabelColorizer.color(nodeLabel);
  }
}
Program: 143132
Project: 143132
Buggy source:
private void walkFile(BufferedReader reader) throws Exception {
  int cptLine=0;
  while (reader.ready() && !cancel) {
    String line=reader.readLine();
    if (!isComment(line)) {
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length > 0) {
        if (tokens[0].equals("String_Node_Str")) {
          parseNodes(tokens);
        }
 else         if (tokens[0].equals("String_Node_Str")) {
          parseEdge(tokens,cptLine);
        }
      }
    }
    cptLine++;
  }
}

Fixed version (ground truth):
private void walkFile(BufferedReader reader) throws Exception {
  int cptLine=0;
  int state=0;
  while (reader.ready() && !cancel) {
    String line=reader.readLine();
    if (!isComment(line)) {
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length > 0) {
        if (state == 0) {
          if (tokens[0].equals("String_Node_Str")) {
            parseNodes(tokens);
          }
 else           if (tokens[0].equals("String_Node_Str")) {
            parseEdge(tokens,cptLine);
          }
 else           if (tokens[0].equals("String_Node_Str")) {
            state=1;
          }
        }
        if (state == 1) {
          return;
        }
      }
    }
    cptLine++;
  }
}
Program: 143133
Project: 143133
Buggy source:
/** 
 * Colors the label of the supervised nodes with the node label colorizer.
 */
private void colorNodeLabels(){
  for (  NodeImpl n : supervisedNodes) {
    colorNodeLabel(n.getLabel());
  }
}

Fixed version (ground truth):
/** 
 * Colors the label of the supervised nodes with the node label colorizer.
 */
private void colorNodeLabels(){
  for (  NodeImpl n : supervisedNodes) {
    if (n.hasLabel()) {
      colorNodeLabel(n.getLabel());
    }
  }
}
Program: 143134
Project: 143134
Buggy source:
/** 
 * Shortens the labels of the supervised nodes.
 */
private void shortenNodeLabels(){
  for (  NodeImpl n : supervisedNodes) {
    shortenNodeLabel(n.getLabel());
  }
}

Fixed version (ground truth):
/** 
 * Shortens the labels of the supervised nodes.
 */
private void shortenNodeLabels(){
  for (  NodeImpl n : supervisedNodes) {
    if (n.hasLabel()) {
      shortenNodeLabel(n.getLabel());
    }
  }
}
Program: 143135
Project: 143135
Buggy source:
/** 
 * Constructor.
 */
public PreviewControllerImpl(){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
    }
    public void select(    Workspace workspace){
      updateFlag=true;
    }
    public void unselect(    Workspace workspace){
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      graphSheet=null;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public PreviewControllerImpl(){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() != null) {
    updateFlag=true;
  }
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
    }
    public void select(    Workspace workspace){
      updateFlag=true;
    }
    public void unselect(    Workspace workspace){
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      graphSheet=null;
    }
  }
);
}