nus-yam/ex-repair huggingface dataset:
Program: 108521
Project: 108521
Buggy source:
@Override public void checkVersion(String version) throws SAXException {
  if (!(version.equals("String_Node_Str") || version.equals("String_Node_Str"))) {
    throw new SAXException(Resources.getMessage("String_Node_Str") + version);
  }
}

Fixed version (ground truth):
@Override public void checkVersion(String version) throws SAXException {
  if (!(version.equals("String_Node_Str") || version.equals("String_Node_Str") || version.equals("String_Node_Str"))) {
    throw new SAXException(Resources.getMessage("String_Node_Str") + version);
  }
}
Program: 108522
Project: 108522
Buggy source:
public DataDefinition getInputDefinition(){
  return inputConfig.getInput().getDefinition();
}

Fixed version (ground truth):
public DataDefinition getInputDefinition(){
  Data data=inputConfig.getInput();
  if (data == null)   return null;
  return data.getDefinition();
}
Program: 108523
Project: 108523
Buggy source:
public double getAttributeWeight(String attribute){
  Double value=this.attributeWeights.get(attribute);
  if (value == null)   return 0d;
 else   return value;
}

Fixed version (ground truth):
public double getAttributeWeight(String attribute){
  if (this.attributeWeights == null) {
    this.attributeWeights=new HashMap<String,Double>();
  }
  Double value=this.attributeWeights.get(attribute);
  if (value == null)   return 0d;
 else   return value;
}
Program: 108524
Project: 108524
Buggy source:
public void setAttributeWeight(String attribute,Double weight){
  this.attributeWeights.put(attribute,weight);
}

Fixed version (ground truth):
public void setAttributeWeight(String attribute,Double weight){
  if (this.attributeWeights == null) {
    this.attributeWeights=new HashMap<String,Double>();
  }
  this.attributeWeights.put(attribute,weight);
}
Program: 108525
Project: 108525
Buggy source:
@Override public void checkVersion(String version) throws SAXException {
  if (!(version.equals("String_Node_Str") || version.equals("String_Node_Str") || version.equals("String_Node_Str"))) {
    throw new SAXException(Resources.getMessage("String_Node_Str") + version);
  }
}

Fixed version (ground truth):
@Override public void checkVersion(String version) throws SAXException {
  if (!(version.equals("String_Node_Str") || version.startsWith("String_Node_Str"))) {
    throw new SAXException(Resources.getMessage("String_Node_Str") + version);
  }
}
Program: 108526
Project: 108526
Buggy source:
/** 
 * Removes a snapshot
 * @param node
 */
private final void removeHistoryEntry(final Node node){
  final int[] snapshot=nodeToSnapshot.remove(node);
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
    for (int i=0; i < snapshot.length; i+=config.getSnapshotLength()) {
      for (int j=i + 3; j < snapshot.length - 1; j+=2) {
        dictionarySensValue.decrementRefCount(snapshot[j]);
        dictionarySensFreq.decrementRefCount(snapshot[j + 1]);
      }
    }
  break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
case ARXConfiguration.REQUIREMENT_DISTRIBUTION:
for (int i=0; i < snapshot.length; i+=config.getSnapshotLength()) {
  for (int j=i + 2; j < snapshot.length - 1; j+=2) {
    dictionarySensValue.decrementRefCount(snapshot[j]);
    dictionarySensFreq.decrementRefCount(snapshot[j + 1]);
  }
}
}
}

Fixed version (ground truth):
/** 
 * Removes a snapshot
 * @param node
 */
private final void removeHistoryEntry(final Node node){
  final int[] snapshot=nodeToSnapshot.remove(node);
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
    for (int i=0; i < snapshot.length; i+=config.getSnapshotLength()) {
      for (int j=i + 3; j < i + config.getSnapshotLength() - 1; j+=2) {
        dictionarySensValue.decrementRefCount(snapshot[j]);
        dictionarySensFreq.decrementRefCount(snapshot[j + 1]);
      }
    }
  break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
case ARXConfiguration.REQUIREMENT_DISTRIBUTION:
for (int i=0; i < snapshot.length; i+=config.getSnapshotLength()) {
  for (int j=i + 2; j < i + config.getSnapshotLength() - 1; j+=2) {
    dictionarySensValue.decrementRefCount(snapshot[j]);
    dictionarySensFreq.decrementRefCount(snapshot[j + 1]);
  }
}
}
}
Program: 108527
Project: 108527
Buggy source:
public static void main(final String[] args){
  try {
    if (!isOSX()) {
      splash=new MainSplash();
      splash.setVisible(true);
    }
 else {
      try {
        Class.forName(JDK16_FRAME);
      }
 catch (      Exception e) {
        SWT_AWT.embeddedFrameClass=JDK17_FRAME;
      }
    }
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.addListener(SWT.Show,new Listener(){
      @Override public void handleEvent(      Event arg0){
        hideSplash();
      }
    }
);
    String path=null;
    if (args.length > 0) {
      path=args[0];
    }
    main.show(path);
  }
 catch (  Throwable e) {
    hideSplash();
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    e.printStackTrace(pw);
    final String trace=sw.toString();
    JOptionPane.showMessageDialog(null,trace,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(final String[] args){
  try {
    if (!isOSX()) {
      splash=new MainSplash();
      splash.setVisible(true);
    }
 else {
      try {
        Class.forName(JDK16_FRAME);
      }
 catch (      Exception e) {
        SWT_AWT.embeddedFrameClass=JDK17_FRAME;
      }
    }
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.addListener(SWT.Show,new Listener(){
      @Override public void handleEvent(      Event arg0){
        hideSplash();
      }
    }
);
    String path=null;
    if (args.length > 0 && args[0].endsWith("String_Node_Str")) {
      path=args[0];
    }
    main.show(path);
  }
 catch (  Throwable e) {
    hideSplash();
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    e.printStackTrace(pw);
    final String trace=sw.toString();
    JOptionPane.showMessageDialog(null,trace,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}
Program: 108528
Project: 108528
Buggy source:
/** 
 * Performs data anonymization
 * @param data The data
 * @param config The privacy config
 * @return ARXResult
 * @throws IOException
 */
public ARXResult anonymize(final Data data,ARXConfiguration config) throws IOException {
  if (((DataHandleInput)data.getHandle()).isLocked()) {
    throw new RuntimeException("String_Node_Str");
  }
  if (config.isProtectSensitiveAssociations()) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  DataHandle handle=data.getHandle();
  final long time=System.currentTimeMillis();
  checkBeforeEncoding(handle,config);
  handle.getRegistry().reset();
  handle.getRegistry().createInputSubset(config);
  return anonymizeInternal(handle,handle.getDefinition(),config).asResult(config,handle,time);
}

Fixed version (ground truth):
/** 
 * Performs data anonymization
 * @param data The data
 * @param config The privacy config
 * @return ARXResult
 * @throws IOException
 */
public ARXResult anonymize(final Data data,ARXConfiguration config) throws IOException {
  if (((DataHandleInput)data.getHandle()).isLocked()) {
    throw new RuntimeException("String_Node_Str");
  }
  if (data.getDefinition().getSensitiveAttributes().size() > 1 && config.isProtectSensitiveAssociations()) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  DataHandle handle=data.getHandle();
  final long time=System.currentTimeMillis();
  checkBeforeEncoding(handle,config);
  handle.getRegistry().reset();
  handle.getRegistry().createInputSubset(config);
  return anonymizeInternal(handle,handle.getDefinition(),config).asResult(config,handle,time);
}
Program: 108529
Project: 108529
Buggy source:
/** 
 * Updates the resulting hierarchy and the view
 */
public void update(){
  build();
  if (view != null)   view.update();
}

Fixed version (ground truth):
/** 
 * Updates the resulting hierarchy and the view
 */
public void update(){
  if (visible)   build();
  if (view != null)   view.update();
}
Program: 108530
Project: 108530
Buggy source:
@Override public void setVisible(boolean value){
  if (value) {
    this.model.update();
    Button load=this.wizard.getLoadButton();
    if (load != null)     load.setEnabled(false);
  }
  super.setVisible(value);
}

Fixed version (ground truth):
@Override public void setVisible(boolean value){
  if (value) {
    this.model.update();
    Button load=this.wizard.getLoadButton();
    if (load != null)     load.setEnabled(false);
  }
  super.setVisible(value);
  model.setVisible(value);
}
Program: 108531
Project: 108531
Buggy source:
/** 
 * Creates the header row This returns a string array with the names of the columns that will be returned later on by iterating over this object. Depending upon whether or not names have been assigned explicitly either the appropriate values will be returned, or names from the JDBC metadata will be used.
 */
private String[] createHeader(){
  String[] header=new String[config.getColumns().size()];
  List<ImportColumn> columns=config.getColumns();
  for (int i=0, len=columns.size(); i < len; i++) {
    ImportColumn column=columns.get(i);
    if (column.getAliasName() != null && !column.getAliasName().equals("String_Node_Str")) {
      header[i]=column.getAliasName();
    }
 else {
      try {
        header[i]=resultSet.getMetaData().getColumnName(((ImportColumnJDBC)column).getIndex() + 1);
      }
 catch (      SQLException e) {
        throw new RuntimeException("String_Node_Str");
      }
    }
    column.setAliasName(header[i]);
  }
  return header;
}

Fixed version (ground truth):
/** 
 * Creates the header row This returns a string array with the names of the columns that will be returned later on by iterating over this object. Depending upon whether or not names have been assigned explicitly either the appropriate values will be returned, or names from the JDBC metadata will be used.
 */
private String[] createHeader(){
  String[] header=new String[config.getColumns().size()];
  List<ImportColumn> columns=config.getColumns();
  for (int i=0, len=columns.size(); i < len; i++) {
    ImportColumn column=columns.get(i);
    if (column.getAliasName() != null && !column.getAliasName().equals("String_Node_Str")) {
      header[i]=column.getAliasName();
    }
 else {
      try {
        header[i]=resultSet.getMetaData().getColumnName(((ImportColumnJDBC)column).getIndex() + 1);
      }
 catch (      SQLException e) {
        throw new IllegalArgumentException("String_Node_Str" + ((ImportColumnJDBC)column).getIndex() + "String_Node_Str");
      }
    }
    column.setAliasName(header[i]);
  }
  return header;
}
Program: 108532
Project: 108532
Buggy source:
/** 
 * Sets the indexes based on the header
 * @param row
 */
public void prepare(String[] row){
  for (  ImportColumn c : super.getColumns()) {
    ImportColumnCSV column=(ImportColumnCSV)c;
    if (!column.isIndexSpecified()) {
      for (int i=0; i < row.length; i++) {
        if (row[i].equals(column.getName())) {
          column.setIndex(i);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the indexes based on the header
 * @param row
 */
public void prepare(String[] row){
  for (  ImportColumn c : super.getColumns()) {
    ImportColumnCSV column=(ImportColumnCSV)c;
    if (!column.isIndexSpecified()) {
      boolean found=false;
      for (int i=0; i < row.length; i++) {
        if (row[i].equals(column.getName())) {
          found=true;
          column.setIndex(i);
        }
      }
      if (!found) {
        throw new IllegalArgumentException("String_Node_Str" + column.getName() + "String_Node_Str");
      }
    }
  }
}
Program: 108533
Project: 108533
Buggy source:
/** 
 * Sets the indexes based on the header
 * @param row
 */
public void prepare(Row row){
  for (  ImportColumn c : super.getColumns()) {
    ImportColumnExcel column=(ImportColumnExcel)c;
    if (!column.isIndexSpecified()) {
      for (int i=0; i < row.getPhysicalNumberOfCells(); i++) {
        row.getCell(i).setCellType(Cell.CELL_TYPE_STRING);
        if (row.getCell(i).getStringCellValue().equals(column.getName())) {
          column.setIndex(i);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the indexes based on the header
 * @param row
 */
public void prepare(Row row){
  for (  ImportColumn c : super.getColumns()) {
    ImportColumnExcel column=(ImportColumnExcel)c;
    if (!column.isIndexSpecified()) {
      boolean found=false;
      for (int i=0; i < row.getPhysicalNumberOfCells(); i++) {
        row.getCell(i).setCellType(Cell.CELL_TYPE_STRING);
        if (row.getCell(i).getStringCellValue().equals(column.getName())) {
          found=true;
          column.setIndex(i);
        }
      }
      if (!found) {
        throw new IllegalArgumentException("String_Node_Str" + column.getName() + "String_Node_Str");
      }
    }
  }
}
Program: 108534
Project: 108534
Buggy source:
/** 
 * Converts the input String array to data of type T, performs the masking and writes the results into the input array.
 * @param dataStrings The array of strings that contains the input dictionary and isreplaced by the masked output.
 * @param parser The object used to parse the data - usually a {@link org.deidentifier.arx.DataType DataType}.
 */
public void maskStrings(String[] dataStrings,IDataParser<T> parser){
  List<String> stringList=Arrays.asList(dataStrings);
  Vector<T> dataVector=new Vector<T>();
  for (  String item : stringList)   dataVector.add(parser.fromString(item));
  maskList(dataVector);
  for (int i=0; i < dataVector.size(); ++i)   dataStrings[i]=parser.toString(dataVector.elementAt(i));
}

Fixed version (ground truth):
/** 
 * Converts the input String array to data of type T, performs the masking and writes the results into the input array.
 * @param dataStrings The array of strings that contains the input dictionary and isreplaced by the masked output.
 * @param type The object used to parse the data - usually a {@link org.deidentifier.arx.DataType DataType}.
 */
public void maskStrings(String[] dataStrings,DataType<T> type){
  List<String> stringList=Arrays.asList(dataStrings);
  Vector<T> dataVector=new Vector<T>();
  for (  String item : stringList)   dataVector.add(type.parse(item));
  maskList(dataVector);
  for (int i=0; i < dataVector.size(); ++i)   dataStrings[i]=type.format(dataVector.elementAt(i));
}
Program: 108535
Project: 108535
Buggy source:
/** 
 * Interprets the input string as a data instance of type T, performs data masking on it and returns the masked data, converted back to a string.
 * @param input The string representing a data instance.
 * @param parser The parser used to interpret the string as data - usually a {@link org.deidentifier.arx.DataType DataType}.
 * @return The string representing the masked data.
 */
public String maskString(String input,IDataParser<T> parser){
  return parser.toString(mask(parser.fromString(input)));
}

Fixed version (ground truth):
/** 
 * Interprets the input string as a data instance of type T, performs data masking on it and returns the masked data, converted back to a string.
 * @param input The string representing a data instance.
 * @param type The parser used to interpret the string as data - usually a {@link org.deidentifier.arx.DataType DataType}.
 * @return The string representing the masked data.
 */
public String maskString(String input,DataType<T> type){
  return type.format(mask(type.parse(input)));
}
Program: 108536
Project: 108536
Buggy source:
/** 
 * Interprets the input string as a data instance of type T, performs data masking on it and returns the masked data, converted back to a string.
 * @param input The string representing a data instance.
 * @param parser The parser used to interpret the string as data - usually a {@link org.deidentifier.arx.DataType DataType}.
 * @return The string representing the masked data.
 */
public String maskString(String input,IDataParser<T> parser){
  return parser.toString(mask(parser.fromString(input)));
}

Fixed version (ground truth):
/** 
 * Interprets the input string as a data instance of type T, performs data masking on it and returns the masked data, converted back to a string.
 * @param input The string representing a data instance.
 * @param type The parser used to interpret the string as data - usually a {@link org.deidentifier.arx.DataType DataType}.
 * @return The string representing the masked data.
 */
public String maskString(String input,DataType<T> type){
  return type.format(mask(type.parse(input)));
}
Program: 108537
Project: 108537
Buggy source:
@Override public void process(Lattice lattice,Node node){
  Node other=map.get(new IntArrayWrapper(node.getTransformation()));
  if (other.isAnonymous()) {
    node.setAnonymous(false);
    node.setNotTagged();
    node.setNotChecked();
  }
 else {
    node.setAnonymous(false);
    node.setTagged();
    node.setChecked();
    lattice.triggerTagged();
    lattice.decUntaggedCount(node.getLevel());
  }
}

Fixed version (ground truth):
@Override public void process(Lattice lattice,Node node){
  Node other=map.get(new IntArrayWrapper(node.getTransformation()));
  if (other.isAnonymous()) {
    node.setAnonymous(false);
    node.setNotTagged();
    node.setNotChecked();
  }
 else {
    node.setAnonymous(false);
    node.setTagged();
    node.setChecked();
    lattice.triggerTagged();
    lattice.decUntaggedCount(node.getLevel());
  }
  node.setInformationLoss(other.getInformationLoss());
}
Program: 108539
Project: 108539
Buggy source:
@Override public void traverse(){
  pqueue.clear();
  stack.clear();
  checker.check(lattice.getBottom(),true);
  final int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    Node[] level;
    level=this.sort(i);
    for (    final Node node : level) {
      if (!node.isTagged()) {
        pqueue.add(node);
        while (!pqueue.isEmpty()) {
          Node head=pqueue.poll();
          if (!head.isTagged()) {
            findPath(head);
            head=checkPathBinary(path);
          }
        }
      }
    }
  }
  if (lattice.getTop().getInformationLoss() == null) {
    checker.check(lattice.getTop(),true);
  }
}

Fixed version (ground truth):
@Override public void traverse(){
  pqueue.clear();
  stack.clear();
  if (!lattice.getBottom().isChecked())   checker.check(lattice.getBottom(),true);
  final int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    Node[] level;
    level=this.sort(i);
    for (    final Node node : level) {
      if (!node.isTagged()) {
        pqueue.add(node);
        while (!pqueue.isEmpty()) {
          Node head=pqueue.poll();
          if (!head.isTagged()) {
            findPath(head);
            head=checkPathBinary(path);
          }
        }
      }
    }
  }
  if (lattice.getTop().getInformationLoss() == null) {
    if (!lattice.getTop().isChecked())     checker.check(lattice.getTop(),true);
  }
}
Program: 108540
Project: 108540
Buggy source:
@Override public void traverse(){
  pqueue.clear();
  stack.clear();
  checker.check(lattice.getBottom(),true);
  final int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    Node[] level;
    level=this.sort(i);
    for (    final Node node : level) {
      if (!node.isTagged()) {
        pqueue.add(node);
        while (!pqueue.isEmpty()) {
          Node head=pqueue.poll();
          if (!head.isTagged()) {
            final PruningStrategy pruning=history.getPruningStrategy();
            history.setPruningStrategy(PruningStrategy.CHECKED);
            stack.push(head);
            while (!stack.isEmpty()) {
              final Node start=stack.pop();
              if (!start.isTagged()) {
                findPath(start);
                checkPathLinear(path);
              }
            }
            history.setPruningStrategy(pruning);
          }
        }
      }
    }
  }
  if (lattice.getTop().getInformationLoss() == null) {
    checker.check(lattice.getTop(),true);
  }
}

Fixed version (ground truth):
@Override public void traverse(){
  pqueue.clear();
  stack.clear();
  if (!lattice.getBottom().isChecked())   checker.check(lattice.getBottom(),true);
  final int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    Node[] level;
    level=this.sort(i);
    for (    final Node node : level) {
      if (!node.isTagged()) {
        pqueue.add(node);
        while (!pqueue.isEmpty()) {
          Node head=pqueue.poll();
          if (!head.isTagged()) {
            final PruningStrategy pruning=history.getPruningStrategy();
            history.setPruningStrategy(PruningStrategy.CHECKED);
            stack.push(head);
            while (!stack.isEmpty()) {
              final Node start=stack.pop();
              if (!start.isTagged()) {
                findPath(start);
                checkPathLinear(path);
              }
            }
            history.setPruningStrategy(pruning);
          }
        }
      }
    }
  }
  if (lattice.getTop().getInformationLoss() == null) {
    if (!lattice.getTop().isChecked())     checker.check(lattice.getTop(),true);
  }
}
Program: 108541
Project: 108541
Buggy source:
@Override public void traverse(){
  pqueue.clear();
  stack.clear();
  checker.check(lattice.getBottom(),true);
  final int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    Node[] level;
    level=this.sort(i);
    for (    final Node node : level) {
      if (!node.isTagged()) {
        pqueue.add(node);
        while (!pqueue.isEmpty()) {
          Node head=pqueue.poll();
          if (!head.isTagged()) {
            final PruningStrategy pruning=history.getPruningStrategy();
            history.setPruningStrategy(PruningStrategy.CHECKED);
            stack.push(head);
            while (!stack.isEmpty()) {
              final Node start=stack.pop();
              if (!start.isTagged()) {
                findPath(start);
                checkPathLinear(path);
              }
            }
            history.setPruningStrategy(pruning);
          }
        }
      }
    }
  }
  if (lattice.getTop().getInformationLoss() == null) {
    checker.check(lattice.getTop(),true);
  }
}

Fixed version (ground truth):
@Override public void traverse(){
  pqueue.clear();
  stack.clear();
  if (!lattice.getBottom().isChecked())   checker.check(lattice.getBottom(),true);
  final int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    Node[] level;
    level=this.sort(i);
    for (    final Node node : level) {
      if (!node.isTagged()) {
        pqueue.add(node);
        while (!pqueue.isEmpty()) {
          Node head=pqueue.poll();
          if (!head.isTagged()) {
            final PruningStrategy pruning=history.getPruningStrategy();
            history.setPruningStrategy(PruningStrategy.CHECKED);
            stack.push(head);
            while (!stack.isEmpty()) {
              final Node start=stack.pop();
              if (!start.isTagged()) {
                findPath(start);
                checkPathLinear(path);
              }
            }
            history.setPruningStrategy(pruning);
          }
        }
      }
    }
  }
  if (lattice.getTop().getInformationLoss() == null) {
    if (!lattice.getTop().isChecked())     checker.check(lattice.getTop(),true);
  }
}
Program: 108542
Project: 108542
Buggy source:
@Override public void traverse(){
  pqueue.clear();
  stack.clear();
  checker.check(lattice.getBottom(),true);
  final int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    Node[] level;
    level=this.sort(i);
    for (    final Node node : level) {
      if (!node.isTagged()) {
        pqueue.add(node);
        while (!pqueue.isEmpty()) {
          Node head=pqueue.poll();
          if (!head.isTagged()) {
            findPath(head);
            head=checkPathBinary(path);
            if (head != null) {
              final PruningStrategy pruning=history.getPruningStrategy();
              history.setPruningStrategy(PruningStrategy.CHECKED);
              lattice.doUnTagUpwards(head);
              stack.push(head);
              while (!stack.isEmpty()) {
                final Node start=stack.pop();
                if (!start.isTagged()) {
                  findPath(start);
                  checkPathLinear(path);
                }
              }
              history.setPruningStrategy(pruning);
            }
          }
        }
      }
    }
  }
  if (lattice.getTop().getInformationLoss() == null) {
    checker.check(lattice.getTop(),true);
  }
}

Fixed version (ground truth):
@Override public void traverse(){
  pqueue.clear();
  stack.clear();
  if (!lattice.getBottom().isChecked())   checker.check(lattice.getBottom(),true);
  final int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    Node[] level;
    level=this.sort(i);
    for (    final Node node : level) {
      if (!node.isTagged()) {
        pqueue.add(node);
        while (!pqueue.isEmpty()) {
          Node head=pqueue.poll();
          if (!head.isTagged()) {
            findPath(head);
            head=checkPathBinary(path);
            if (head != null) {
              final PruningStrategy pruning=history.getPruningStrategy();
              history.setPruningStrategy(PruningStrategy.CHECKED);
              lattice.doUnTagUpwards(head);
              stack.push(head);
              while (!stack.isEmpty()) {
                final Node start=stack.pop();
                if (!start.isTagged()) {
                  findPath(start);
                  checkPathLinear(path);
                }
              }
              history.setPruningStrategy(pruning);
            }
          }
        }
      }
    }
  }
  if (lattice.getTop().getInformationLoss() == null) {
    if (!lattice.getTop().isChecked())     checker.check(lattice.getTop(),true);
  }
}
Program: 108543
Project: 108543
Buggy source:
@Override public void update(){
  this.canvascomposite.redraw();
}

Fixed version (ground truth):
@Override public void update(){
  this.canvascomposite.redraw();
  this.editor.update();
}
Program: 108544
Project: 108544
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void update(){
  if (model.getSelectedElement() instanceof HierarchyWizardGroupingGroup) {
    this.group=(HierarchyWizardGroupingGroup<T>)model.getSelectedElement();
    this.editorFunction.setFunction(group.function);
    this.editorSize.update();
    SWTUtil.enable(editorSize.getControl());
    SWTUtil.enable(this.editorFunction.getControl1());
    SWTUtil.enable(this.editorFunction.getControl2());
  }
 else {
    this.group=null;
    this.editorFunction.setFunction(null);
    this.editorSize.update();
    SWTUtil.disable(editorSize.getControl());
    SWTUtil.disable(this.editorFunction.getControl1());
    SWTUtil.disable(this.editorFunction.getControl2());
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void update(){
  if (model.getSelectedElement() instanceof HierarchyWizardGroupingGroup) {
    this.group=(HierarchyWizardGroupingGroup<T>)model.getSelectedElement();
    this.editorFunction.setFunction(group.function);
    this.editorSize.update();
    SWTUtil.enable(editorSize.getControl());
    this.editorFunction.update();
  }
 else {
    this.group=null;
    this.editorFunction.setFunction(null);
    this.editorSize.update();
    SWTUtil.disable(editorSize.getControl());
    SWTUtil.disable(this.editorFunction.getControl1());
    SWTUtil.disable(this.editorFunction.getControl2());
  }
}
Program: 108545
Project: 108545
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void update(){
  if (model.getSelectedElement() instanceof HierarchyWizardGroupingInterval) {
    this.interval=(HierarchyWizardGroupingInterval<T>)model.getSelectedElement();
    this.editorFunction.setFunction(this.interval.function);
    this.editorMin.update();
    this.editorMax.update();
    if (model.isFirst(this.interval)) {
      SWTUtil.enable(editorMin.getControl());
    }
 else {
      SWTUtil.disable(editorMin.getControl());
    }
    if (model.isLast(this.interval)) {
      SWTUtil.enable(editorMax.getControl());
    }
 else {
      SWTUtil.disable(editorMax.getControl());
    }
    SWTUtil.enable(this.editorFunction.getControl1());
    SWTUtil.enable(this.editorFunction.getControl2());
  }
 else {
    this.interval=null;
    this.editorFunction.setFunction(null);
    SWTUtil.disable(editorMin.getControl());
    SWTUtil.disable(editorMax.getControl());
    SWTUtil.disable(this.editorFunction.getControl1());
    SWTUtil.disable(this.editorFunction.getControl2());
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void update(){
  if (model.getSelectedElement() instanceof HierarchyWizardGroupingInterval) {
    this.interval=(HierarchyWizardGroupingInterval<T>)model.getSelectedElement();
    this.editorFunction.setFunction(this.interval.function);
    this.editorMin.update();
    this.editorMax.update();
    if (model.isFirst(this.interval)) {
      SWTUtil.enable(editorMin.getControl());
    }
 else {
      SWTUtil.disable(editorMin.getControl());
    }
    if (model.isLast(this.interval)) {
      SWTUtil.enable(editorMax.getControl());
    }
 else {
      SWTUtil.disable(editorMax.getControl());
    }
    this.editorFunction.update();
  }
 else {
    this.interval=null;
    this.editorFunction.setFunction(null);
    SWTUtil.disable(editorMin.getControl());
    SWTUtil.disable(editorMax.getControl());
    SWTUtil.disable(this.editorFunction.getControl1());
    SWTUtil.disable(this.editorFunction.getControl2());
  }
}
Program: 108546
Project: 108546
Buggy source:
/** 
 * Gets executed once the wizard is about to finish This will build an appropriate   {@link ImportConfiguration} object, dependingupon the  {@link ImportWizardModel#getSourceType() source type} and thechoices the user made during the process of the wizard. {@link #configuration} will hold a reference of the object. This can beretrieved later on by  {@link #getResultingConfiguration()}.
 * @see {@link #getResultingConfiguration()}
 */
@Override public boolean performFinish(){
  if (data.getSourceType() == SourceType.CSV) {
    configuration=new ImportConfigurationCSV(data.getFileLocation(),data.getCsvSeparator(),data.getFirstRowContainsHeader());
  }
 else   if (data.getSourceType() == SourceType.EXCEL) {
    configuration=new ImportConfigurationExcel(data.getFileLocation(),data.getExcelSheetIndex(),data.getFirstRowContainsHeader());
  }
 else   if (data.getSourceType() == SourceType.JDBC) {
    configuration=new ImportConfigurationJDBC(data.getJdbcConnection(),data.getSelectedJdbcTable());
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
  for (  ImportColumn c : data.getEnabledColumns()) {
    configuration.addColumn(c);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Gets executed once the wizard is about to finish This will build an appropriate   {@link ImportConfiguration} object, dependingupon the  {@link ImportWizardModel#getSourceType() source type} and thechoices the user made during the process of the wizard. {@link #configuration} will hold a reference of the object. This can beretrieved later on by  {@link #getResultingConfiguration()}.
 * @see {@link #getResultingConfiguration()}
 */
@Override public boolean performFinish(){
  if (data.getSourceType() == SourceType.CSV) {
    configuration=new ImportConfigurationCSV(data.getFileLocation(),data.getCsvSeparator(),data.getFirstRowContainsHeader());
  }
 else   if (data.getSourceType() == SourceType.EXCEL) {
    configuration=new ImportConfigurationExcel(data.getFileLocation(),data.getExcelSheetIndex(),data.getFirstRowContainsHeader());
  }
 else   if (data.getSourceType() == SourceType.JDBC) {
    configuration=new ImportConfigurationJDBC(data.getJdbcConnection(),data.getSelectedJdbcTable());
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
  for (  ImportColumn c : data.getEnabledColumns()) {
    configuration.addColumn(c);
  }
  if (data.getSourceType() != SourceType.JDBC) {
    try {
      if (data.getJdbcConnection() != null && !data.getJdbcConnection().isClosed()) {
        data.getJdbcConnection().close();
      }
    }
 catch (    Exception e) {
    }
  }
  return true;
}
Program: 108547
Project: 108547
Buggy source:
/** 
 * Reads in the available sheets from file This reads in the available sheets from the file chosen at  {@link #comboLocation} and adds them as items to {@link #comboSheet}.
 */
private void readSheets() throws IOException {
  comboSheet.removeAll();
  try {
    workbook=WorkbookFactory.create(new FileInputStream(comboLocation.getText()));
  }
 catch (  InvalidFormatException e) {
    throw new IOException("String_Node_Str");
  }
  for (int i=0; i < workbook.getNumberOfSheets(); i++) {
    comboSheet.add(workbook.getSheetName(i));
  }
}

Fixed version (ground truth):
/** 
 * Reads in the available sheets from file This reads in the available sheets from the file chosen at  {@link #comboLocation} and adds them as items to {@link #comboSheet}.
 */
private void readSheets() throws IOException {
  comboSheet.removeAll();
  try {
    try {
      if (stream != null)       stream.close();
    }
 catch (    Exception e) {
    }
    stream=new FileInputStream(comboLocation.getText());
    workbook=WorkbookFactory.create(stream);
  }
 catch (  InvalidFormatException e) {
    throw new IOException("String_Node_Str");
  }
  for (int i=0; i < workbook.getNumberOfSheets(); i++) {
    comboSheet.add(workbook.getSheetName(i));
  }
}
Program: 108549
Project: 108549
Buggy source:
/** 
 * Returns the created builder
 * @return
 */
public HierarchyWizardResult<T> getResult(){
  try {
    return new HierarchyWizardResult<T>(model.getHierarchy(),model.getBuilder());
  }
 catch (  Exception e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the created builder
 * @return
 */
public HierarchyWizardResult<T> getResult(){
  try {
    return new HierarchyWizardResult<T>(model.getHierarchy(),model.getBuilder(true));
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 108550
Project: 108550
Buggy source:
/** 
 * Saves the current specification
 */
private void save(){
  final String ERROR_HEADER="String_Node_Str";
  final String ERROR_TEXT="String_Node_Str";
  String file=controller.actionShowSaveFileDialog(getShell(),"String_Node_Str");
  if (file == null)   return;
  try {
    HierarchyBuilder<T> builder=null;
    if (getDialog().getCurrentPage() instanceof HierarchyWizardPageOrder) {
      builder=model.getOrderModel().getBuilder();
    }
 else     if (getDialog().getCurrentPage() instanceof HierarchyWizardPageIntervals) {
      builder=model.getIntervalModel().getBuilder();
    }
 else     if (getDialog().getCurrentPage() instanceof HierarchyWizardPageRedaction) {
      builder=model.getRedactionModel().getBuilder();
    }
    builder.save(file);
  }
 catch (  Exception e) {
    controller.actionShowInfoDialog(getShell(),ERROR_HEADER,ERROR_TEXT + e.getMessage());
    return;
  }
}

Fixed version (ground truth):
/** 
 * Saves the current specification
 */
private void save(){
  final String ERROR_HEADER="String_Node_Str";
  final String ERROR_TEXT="String_Node_Str";
  String file=controller.actionShowSaveFileDialog(getShell(),"String_Node_Str");
  if (file == null)   return;
  try {
    HierarchyBuilder<T> builder=null;
    if (getDialog().getCurrentPage() instanceof HierarchyWizardPageOrder) {
      builder=model.getOrderModel().getBuilder(true);
    }
 else     if (getDialog().getCurrentPage() instanceof HierarchyWizardPageIntervals) {
      builder=model.getIntervalModel().getBuilder(true);
    }
 else     if (getDialog().getCurrentPage() instanceof HierarchyWizardPageRedaction) {
      builder=model.getRedactionModel().getBuilder(true);
    }
    builder.save(file);
  }
 catch (  Exception e) {
    e.printStackTrace();
    controller.actionShowInfoDialog(getShell(),ERROR_HEADER,ERROR_TEXT + e.getMessage());
    return;
  }
}
Program: 108551
Project: 108551
Buggy source:
/** 
 * Returns the current builder
 * @return
 */
public HierarchyBuilder<T> getBuilder() throws Exception {
  if (type == Type.INTERVAL_BASED) {
    return intervalModel.getBuilder();
  }
 else   if (type == Type.REDACTION_BASED) {
    return redactionModel.getBuilder();
  }
 else   if (type == Type.ORDER_BASED) {
    return orderModel.getBuilder();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Returns the current builder
 * @return
 */
public HierarchyBuilder<T> getBuilder(boolean serializable) throws Exception {
  if (type == Type.INTERVAL_BASED) {
    return intervalModel.getBuilder(serializable);
  }
 else   if (type == Type.REDACTION_BASED) {
    return redactionModel.getBuilder(serializable);
  }
 else   if (type == Type.ORDER_BASED) {
    return orderModel.getBuilder(serializable);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 108552
Project: 108552
Buggy source:
/** 
 * Returns the builder currently configured
 * @return
 */
public abstract HierarchyBuilder<T> getBuilder() throws Exception ;

Fixed version (ground truth):
/** 
 * Returns the builder currently configured
 * @return
 */
public abstract HierarchyBuilder<T> getBuilder(boolean serializable) throws Exception ;
Program: 108553
Project: 108553
Buggy source:
@Override public HierarchyBuilderIntervalBased<T> getBuilder() throws Exception {
  HierarchyBuilderIntervalBased<T> builder=HierarchyBuilderIntervalBased.create(super.getDataType(),new Range<T>(super.getLowerRange().repeat,super.getLowerRange().snap,super.getLowerRange().label),new Range<T>(super.getUpperRange().repeat,super.getUpperRange().snap,super.getUpperRange().label));
  builder.setAggregateFunction(this.getDefaultFunction());
  for (  HierarchyWizardGroupingInterval<T> interval : super.getIntervals()) {
    builder.addInterval(interval.min,interval.max,interval.function);
  }
  int level=0;
  for (  List<HierarchyWizardGroupingGroup<T>> list : super.getModelGroups()) {
    for (    HierarchyWizardGroupingGroup<T> group : list) {
      builder.getLevel(level).addGroup(group.size,group.function);
    }
    level++;
  }
  return builder;
}

Fixed version (ground truth):
@Override public HierarchyBuilderIntervalBased<T> getBuilder(boolean serializable) throws Exception {
  HierarchyBuilderIntervalBased<T> builder=HierarchyBuilderIntervalBased.create(super.getDataType(),new Range<T>(super.getLowerRange().repeat,super.getLowerRange().snap,super.getLowerRange().label),new Range<T>(super.getUpperRange().repeat,super.getUpperRange().snap,super.getUpperRange().label));
  builder.setAggregateFunction(this.getDefaultFunction());
  for (  HierarchyWizardGroupingInterval<T> interval : super.getIntervals()) {
    builder.addInterval(interval.min,interval.max,interval.function);
  }
  int level=0;
  for (  List<HierarchyWizardGroupingGroup<T>> list : super.getModelGroups()) {
    for (    HierarchyWizardGroupingGroup<T> group : list) {
      builder.getLevel(level).addGroup(group.size,group.function);
    }
    level++;
  }
  return builder;
}
Program: 108554
Project: 108554
Buggy source:
@Override protected void build(){
  super.hierarchy=null;
  super.error=null;
  super.groupsizes=null;
  HierarchyBuilderIntervalBased<T> builder=null;
  try {
    builder=getBuilder();
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
  String error=builder.isValid();
  if (error != null) {
    super.error=error;
    return;
  }
  try {
    super.groupsizes=builder.prepare(data);
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
  try {
    super.hierarchy=builder.build();
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
}

Fixed version (ground truth):
@Override protected void build(){
  super.hierarchy=null;
  super.error=null;
  super.groupsizes=null;
  HierarchyBuilderIntervalBased<T> builder=null;
  try {
    builder=getBuilder(false);
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
  String error=builder.isValid();
  if (error != null) {
    super.error=error;
    return;
  }
  try {
    super.groupsizes=builder.prepare(data);
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
  try {
    super.hierarchy=builder.build();
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
}
Program: 108555
Project: 108555
Buggy source:
@Override public HierarchyBuilderOrderBased<T> getBuilder() throws Exception {
  HierarchyBuilderOrderBased<T> builder=HierarchyBuilderOrderBased.create(super.getDataType(),false);
  builder.setAggregateFunction(this.getDefaultFunction());
  int level=0;
  for (  List<HierarchyWizardGroupingGroup<T>> list : super.getModelGroups()) {
    for (    HierarchyWizardGroupingGroup<T> group : list) {
      builder.getLevel(level).addGroup(group.size,group.function);
    }
    level++;
  }
  return builder;
}

Fixed version (ground truth):
@Override public HierarchyBuilderOrderBased<T> getBuilder(boolean serializable) throws Exception {
  HierarchyBuilderOrderBased<T> builder;
  if (serializable) {
    builder=HierarchyBuilderOrderBased.create(super.getDataType(),data);
  }
 else {
    builder=HierarchyBuilderOrderBased.create(super.getDataType(),false);
  }
  builder.setAggregateFunction(this.getDefaultFunction());
  int level=0;
  for (  List<HierarchyWizardGroupingGroup<T>> list : super.getModelGroups()) {
    for (    HierarchyWizardGroupingGroup<T> group : list) {
      builder.getLevel(level).addGroup(group.size,group.function);
    }
    level++;
  }
  return builder;
}
Program: 108556
Project: 108556
Buggy source:
@Override protected void build(){
  super.hierarchy=null;
  super.error=null;
  super.groupsizes=null;
  HierarchyBuilderOrderBased<T> builder=null;
  try {
    builder=getBuilder();
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
  String error=builder.isValid();
  if (error != null) {
    super.error=error;
    return;
  }
  try {
    super.groupsizes=builder.prepare(data);
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
  try {
    super.hierarchy=builder.build();
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
}

Fixed version (ground truth):
@Override protected void build(){
  super.hierarchy=null;
  super.error=null;
  super.groupsizes=null;
  HierarchyBuilderOrderBased<T> builder=null;
  try {
    builder=getBuilder(false);
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
  String error=builder.isValid();
  if (error != null) {
    super.error=error;
    return;
  }
  try {
    super.groupsizes=builder.prepare(data);
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
  try {
    super.hierarchy=builder.build();
  }
 catch (  Exception e) {
    super.error=e.getMessage();
    return;
  }
}
Program: 108557
Project: 108557
Buggy source:
@Override public HierarchyBuilderRedactionBased<T> getBuilder(){
  return HierarchyBuilderRedactionBased.create(alignmentOrder,redactionOrder,paddingCharacter,redactionCharacter);
}

Fixed version (ground truth):
@Override public HierarchyBuilderRedactionBased<T> getBuilder(boolean serializable){
  return HierarchyBuilderRedactionBased.create(alignmentOrder,redactionOrder,paddingCharacter,redactionCharacter);
}
Program: 108558
Project: 108558
Buggy source:
@Override protected void build(){
  super.hierarchy=null;
  super.error=null;
  super.groupsizes=null;
  HierarchyBuilderRedactionBased<T> builder=getBuilder();
  try {
    super.groupsizes=builder.prepare(data);
  }
 catch (  Exception e) {
    super.error="String_Node_Str";
    return;
  }
  try {
    super.hierarchy=builder.build();
  }
 catch (  Exception e) {
    super.error="String_Node_Str";
    return;
  }
}

Fixed version (ground truth):
@Override protected void build(){
  super.hierarchy=null;
  super.error=null;
  super.groupsizes=null;
  HierarchyBuilderRedactionBased<T> builder=getBuilder(false);
  try {
    super.groupsizes=builder.prepare(data);
  }
 catch (  Exception e) {
    super.error="String_Node_Str";
    return;
  }
  try {
    super.hierarchy=builder.build();
  }
 catch (  Exception e) {
    super.error="String_Node_Str";
    return;
  }
}
Program: 108560
Project: 108560
Buggy source:
/** 
 * Creates a new instance
 * @param type The data type
 * @param comparator Use this comparator for ordering data items
 */
private HierarchyBuilderOrderBased(final DataType<T> type,final Comparator<T> comparator){
  super(Type.ORDER_BASED,type);
  this.comparator=new Comparator<String>(){
    @Override public int compare(    String o1,    String o2){
      try {
        return comparator.compare(type.parse(o1),type.parse(o2));
      }
 catch (      Exception e) {
        throw new IllegalArgumentException(e);
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates a new instance
 * @param type The data type
 * @param comparator Use this comparator for ordering data items
 */
private HierarchyBuilderOrderBased(final DataType<T> type,final Comparator<T> comparator){
  super(Type.ORDER_BASED,type);
  if (!(comparator instanceof Serializable)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.comparator=new SerializableComparator<String>(){
    private static final long serialVersionUID=-487411642974218418L;
    @Override public int compare(    String o1,    String o2){
      try {
        return comparator.compare(type.parse(o1),type.parse(o2));
      }
 catch (      Exception e) {
        throw new IllegalArgumentException(e);
      }
    }
  }
;
}
Program: 108561
Project: 108561
Buggy source:
/** 
 * Returns the next row The returned element is sorted as defined by   {@link ImportColumn#index}and contains as many elements as there are columns selected to import from   {@link #indexes}. The first row will always contain the names of the columns.   {@link #headerReturned} is used to keep track of that.
 * @throws IllegalArgumentException In case defined datatypes don't match
 */
@Override public String[] next(){
  if (!headerReturned) {
    headerReturned=true;
    return header;
  }
  if (row.getPhysicalNumberOfCells() > numberOfColumns) {
    throw new IllegalArgumentException("String_Node_Str" + currentRow + "String_Node_Str");
  }
  String[] result=new String[indexes.length];
  for (int i=0; i < indexes.length; i++) {
    row.getCell(indexes[i]).setCellType(Cell.CELL_TYPE_STRING);
    result[i]=row.getCell(indexes[i]).getStringCellValue();
    if (!dataTypes[i].isValid(result[i])) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  if (iterator.hasNext()) {
    row=iterator.next();
    currentRow++;
  }
 else {
    row=null;
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Returns the next row The returned element is sorted as defined by   {@link ImportColumn#index}and contains as many elements as there are columns selected to import from   {@link #indexes}. The first row will always contain the names of the columns.   {@link #headerReturned} is used to keep track of that.
 * @throws IllegalArgumentException In case defined datatypes don't match
 */
@Override public String[] next(){
  if (!headerReturned) {
    headerReturned=true;
    return header;
  }
  if (row.getPhysicalNumberOfCells() > numberOfColumns) {
    throw new IllegalArgumentException("String_Node_Str" + currentRow + "String_Node_Str");
  }
  String[] result=new String[indexes.length];
  for (int i=0; i < indexes.length; i++) {
    row.getCell(indexes[i]).setCellType(Cell.CELL_TYPE_STRING);
    result[i]=row.getCell(indexes[i]).getStringCellValue();
    if (!dataTypes[i].isValid(result[i])) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  if (iterator.hasNext()) {
    row=iterator.next();
    currentRow++;
  }
 else {
    row=null;
    try {
      input.close();
    }
 catch (    Exception e) {
    }
  }
  return result;
}