nus-yam/ex-repair huggingface dataset:
Program: 18369
Project: 18369
Buggy source:
public void process(){
  javaFileContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HashSet<String> processedFeatures=new HashSet<String>();
  for (  String feature : meta.getFeatures()) {
    if (!processedFeatures.contains(feature)) {
      processedFeatures.add(feature);
      if (addJPF_BDD_Annotation)       javaFileContents+="String_Node_Str";
      javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
    }
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str"+ feature+ "String_Node_Str";
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  javaFileContents+="String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
  }
  javaFileContents+="String_Node_Str";
  processRestrictions();
  javaFileContents+="String_Node_Str";
}

Fixed version (ground truth):
public void process(){
  javaFileContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HashSet<String> processedFeatures=new HashSet<String>();
  Set<String> featureSet=new HashSet<String>(meta.getFeatures());
  for (  String feature : featureSet) {
    if (!processedFeatures.contains(feature)) {
      processedFeatures.add(feature);
      if (addJPF_BDD_Annotation)       javaFileContents+="String_Node_Str";
      javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
    }
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str"+ feature+ "String_Node_Str";
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  javaFileContents+="String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
  }
  javaFileContents+="String_Node_Str";
  processRestrictions();
  javaFileContents+="String_Node_Str";
}
Program: 18370
Project: 18370
Buggy source:
public void process(){
  javaFileContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HashSet<String> processedFeatures=new HashSet<String>();
  Set<String> featureSet=new HashSet<String>(meta.getFeatures());
  for (  String feature : featureSet) {
    if (!processedFeatures.contains(feature)) {
      processedFeatures.add(feature);
      if (addJPF_BDD_Annotation)       javaFileContents+="String_Node_Str";
      javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
    }
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str"+ feature+ "String_Node_Str";
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  javaFileContents+="String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
  }
  javaFileContents+="String_Node_Str";
  processRestrictions();
  javaFileContents+="String_Node_Str";
}

Fixed version (ground truth):
public void process(){
  javaFileContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  List<String> features=meta.getFeatures();
  for (  String feature : features) {
    if (addJPF_BDD_Annotation)     javaFileContents+="String_Node_Str";
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  for (  String feature : features) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str"+ feature+ "String_Node_Str";
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  javaFileContents+="String_Node_Str";
  for (  String feature : features) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
  }
  javaFileContents+="String_Node_Str";
  processRestrictions();
  javaFileContents+="String_Node_Str";
}
Program: 18371
Project: 18371
Buggy source:
public List<String> getFeatures(){
  return new ArrayList<String>(features);
}

Fixed version (ground truth):
/** 
 * Returns a list of all feature names of the subject system.  Each name occurs only once in the list. We chose a List instead of a Set because the order of the features is important (same order as in the expression file).
 */
public List<String> getFeatures(){
  return new ArrayList<String>(features);
}
Program: 18372
Project: 18372
Buggy source:
public void addFeature(String feature){
  features.add(feature);
}

Fixed version (ground truth):
public void addFeature(String feature){
  if (!features.contains(feature))   features.add(feature);
}
Program: 18380
Project: 18380
Buggy source:
public void process(){
  javaFileContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HashSet<String> processedFeatures=new HashSet<String>();
  for (  String feature : meta.getFeatures()) {
    if (!processedFeatures.contains(feature)) {
      processedFeatures.add(feature);
      javaFileContents+="String_Node_Str";
      javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
    }
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str"+ feature+ "String_Node_Str";
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  javaFileContents+="String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
  }
  javaFileContents+="String_Node_Str";
  processRestrictions();
  javaFileContents+="String_Node_Str";
}

Fixed version (ground truth):
public void process(){
  javaFileContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HashSet<String> processedFeatures=new HashSet<String>();
  for (  String feature : meta.getFeatures()) {
    if (!processedFeatures.contains(feature)) {
      processedFeatures.add(feature);
      if (addJPF_BDD_Annotation)       javaFileContents+="String_Node_Str";
      javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
    }
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str"+ feature+ "String_Node_Str";
  }
  javaFileContents+="String_Node_Str" + "String_Node_Str";
  javaFileContents+="String_Node_Str";
  for (  String feature : processedFeatures) {
    javaFileContents+="String_Node_Str" + feature + "String_Node_Str";
  }
  javaFileContents+="String_Node_Str";
  processRestrictions();
  javaFileContents+="String_Node_Str";
}
Program: 18381
Project: 18381
Buggy source:
public void processNode(FSTNonTerminal parent,StringTokenizer st,File inputFile) throws FileNotFoundException, ParseException {
  FSTNonTerminal rootDocument=new FSTNonTerminal("String_Node_Str",st.nextToken());
  parent.addChild(rootDocument);
  PythonParser p=new PythonParser(new OffsetCharStream(new FileInputStream(inputFile)));
  p.file_input(false);
  rootDocument.addChild(p.getRoot());
}

Fixed version (ground truth):
public void processNode(FSTNonTerminal parent,StringTokenizer st,File inputFile) throws FileNotFoundException, ParseException {
  FSTNonTerminal rootDocument=new FSTNonTerminal("String_Node_Str",st.nextToken());
  parent.addChild(rootDocument);
  PythonParser p=new PythonParser(new OffsetCharStream(new FileInputStream(inputFile)));
  p.file_input(false);
  rootDocument.addChild(p.getRoot());
  if (isPreprocessNode()) {
    for (    FSTNode child : rootDocument.getChildren()) {
      SimplePrintVisitor visitor;
      try {
        visitor=new SimplePrintVisitor(new PrintStream(inputFile));
        visitor.visit((FSTNonTerminal)child);
        visitor.getResult();
      }
 catch (      FileNotFoundException e) {
      }
    }
  }
}
Program: 18383
Project: 18383
Buggy source:
public void run(String[] args){
  cmd.parseCmdLineArguments(args);
  try {
    try {
      fileLoader.loadFiles(cmd.equationFileName,cmd.equationBaseDirectoryName,false);
    }
 catch (    cide.gparser.ParseException e1) {
      fireParseErrorOccured(e1);
      e1.printStackTrace();
    }
    String outputDir=cmd.equationBaseDirectoryName;
    if (cmd.outputDirectoryName != null)     outputDir=cmd.outputDirectoryName;
    featureVisitor.setWorkingDir(outputDir);
    featureVisitor.setExpressionName(cmd.equationFileName);
    for (    ArtifactBuilderInterface builder : getArtifactBuilders()) {
      LinkedList<FSTNonTerminal> features=builder.getFeatures();
      for (      FSTNonTerminal feature : features)       System.out.println(feature.toString());
      FSTNode merged;
      if (features.size() != 0) {
        merged=merge(features);
        mergeVisitor.visit(merged);
        System.err.println(merged.toString());
        try {
          featureVisitor.visit((FSTNonTerminal)merged);
        }
 catch (        PrintVisitorException e) {
          e.printStackTrace();
        }
      }
    }
    setFstnodes(AbstractFSTParser.fstnodes);
  }
 catch (  MergeException me) {
    System.err.println(me.toString());
    me.printStackTrace();
  }
catch (  FileNotFoundException e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(String[] args){
  cmd.parseCmdLineArguments(args);
  try {
    try {
      if (cmd.preprocessFiles)       fileLoader.setPreprocessFiles(true);
      fileLoader.loadFiles(cmd.equationFileName,cmd.equationBaseDirectoryName,false);
    }
 catch (    cide.gparser.ParseException e1) {
      fireParseErrorOccured(e1);
      e1.printStackTrace();
    }
    String outputDir=cmd.equationBaseDirectoryName;
    if (cmd.outputDirectoryName != null)     outputDir=cmd.outputDirectoryName;
    featureVisitor.setWorkingDir(outputDir);
    featureVisitor.setExpressionName(cmd.equationFileName);
    for (    ArtifactBuilderInterface builder : getArtifactBuilders()) {
      LinkedList<FSTNonTerminal> features=builder.getFeatures();
      for (      FSTNonTerminal feature : features)       System.out.println(feature.toString());
      FSTNode merged;
      if (features.size() != 0) {
        merged=merge(features);
        mergeVisitor.visit(merged);
        System.err.println(merged.toString());
        try {
          featureVisitor.visit((FSTNonTerminal)merged);
        }
 catch (        PrintVisitorException e) {
          e.printStackTrace();
        }
      }
    }
    setFstnodes(AbstractFSTParser.fstnodes);
  }
 catch (  MergeException me) {
    System.err.println(me.toString());
    me.printStackTrace();
  }
catch (  FileNotFoundException e1) {
    e1.printStackTrace();
  }
}
Program: 18385
Project: 18385
Buggy source:
public boolean visit(FSTNonTerminal nonTerminal){
  if (nonTerminal.getType().equals(FILE_TYPE)) {
    FSTNonTerminal parent=findNonTerminal(nonTerminal,GUARD_PARENT);
    String identifier=fitString(nonTerminal.getName());
    parent.getChildren().add(0,new FSTTerminal(HEADER_GUARD_IFNDEF_LINE_TYPE,HEADER_GUARD_IFNDEF_LINE_NAME,HEADER_GUARD_IFNDEF_LINE_CONTENT + "String_Node_Str" + identifier,"String_Node_Str"));
    parent.getChildren().add(0,new FSTTerminal(HEADER_GUARD_DEFINE_LINE_TYPE,HEADER_GUARD_DEFINE_LINE_NAME,HEADER_GUARD_DEFINE_LINE_CONTENT + "String_Node_Str" + identifier,"String_Node_Str"));
    parent.getChildren().add(new FSTTerminal(HEADER_GUARD_ENDIF_LINE_TYPE,HEADER_GUARD_ENDIF_LINE_NAME,HEADER_GUARD_ENDIF_LINE_CONTENT,"String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
public boolean visit(FSTNonTerminal nonTerminal){
  if (nonTerminal.getType().equals(FILE_TYPE)) {
    FSTNonTerminal parent=findNonTerminal(nonTerminal,GUARD_PARENT);
    String identifier=fitString(nonTerminal.getName());
    parent.getChildren().add(0,new FSTTerminal(HEADER_GUARD_DEFINE_LINE_TYPE,HEADER_GUARD_DEFINE_LINE_NAME,HEADER_GUARD_DEFINE_LINE_CONTENT + "String_Node_Str" + identifier,"String_Node_Str"));
    parent.getChildren().add(0,new FSTTerminal(HEADER_GUARD_IFNDEF_LINE_TYPE,HEADER_GUARD_IFNDEF_LINE_NAME,HEADER_GUARD_IFNDEF_LINE_CONTENT + "String_Node_Str" + identifier,"String_Node_Str"));
    parent.getChildren().add(new FSTTerminal(HEADER_GUARD_ENDIF_LINE_TYPE,HEADER_GUARD_ENDIF_LINE_NAME,HEADER_GUARD_ENDIF_LINE_CONTENT,"String_Node_Str"));
  }
  return true;
}
Program: 18387
Project: 18387
Buggy source:
/** 
 * @param args
 * @throws Exception
 */
public static void main(String[] args) throws Exception {
  System.out.println(new JavaMethodBody("String_Node_Str").getFST());
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws Exception
 */
public static void main(String[] args) throws Exception {
  JavaMethod jmOld=new JavaMethod("String_Node_Str");
  FSTNode jmOldFST=jmOld.getFST();
  List<FSTNode> l=new LinkedList<FSTNode>();
  l.add(jmOldFST);
  FSTNode featOld=new FSTNonTerminal("String_Node_Str","String_Node_Str",l);
  JavaMethod jmNew=new JavaMethod("String_Node_Str");
  FSTNode par=new FSTNonTerminal("String_Node_Str","String_Node_Str");
  System.out.println(FSTGenComposer.compose(jmNew.getFST(),jmOldFST,par));
}
Program: 18388
Project: 18388
Buggy source:
/** 
 * This method invoked after the user want to edit specified shelf.
 * @param shelf - shelf to edit
 */
public void startEditShelf(Shelf shelf){
  if (getLoggedUser() == null) {
    return;
  }
  if (!canViewShelf(shelf)) {
    showError(Constants.HAVENT_ACCESS);
    return;
  }
  model.resetModel(NavigationEnum.SHELF_EDIT,shelf.getOwner(),shelf,null,null,null);
}

Fixed version (ground truth):
/** 
 * This method invoked after the user want to edit specified shelf.
 * @param shelf - shelf to edit
 */
public void startEditShelf(Shelf shelf){
  if (getLoggedUser() == null) {
    return;
  }
  if (!canViewShelf(shelf)) {
    showError("String_Node_Str",Constants.HAVENT_ACCESS);
    return;
  }
  model.resetModel(NavigationEnum.SHELF_EDIT,shelf.getOwner(),shelf,null,null,null);
}
Program: 18389
Project: 18389
Buggy source:
/** 
 * This method invoked after the user want to see specified image independently is it her image or not.
 * @param album - album to show
 */
public void showImage(Image image){
  pushEvent(Events.CLEAR_EDITOR_EVENT);
  if (!canViewImage(image)) {
    showError(Constants.HAVENT_ACCESS);
    return;
  }
  if (!fileManager.isFilePresent(image.getFullPath())) {
    showError("String_Node_Str",Constants.IMAGE_RECENTLY_DELETED_ERROR);
    model.resetModel(NavigationEnum.ALBUM_PREVIEW,image.getAlbum().getOwner(),image.getAlbum().getShelf(),image.getAlbum(),null,image.getAlbum().getImages());
    return;
  }
  model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW,image.getAlbum().getOwner(),image.getAlbum().getShelf(),image.getAlbum(),image,image.getAlbum().getImages());
  image.setVisited(true);
}

Fixed version (ground truth):
/** 
 * This method invoked after the user want to see specified image independently is it her image or not.
 * @param album - album to show
 */
public void showImage(Image image){
  pushEvent(Events.CLEAR_EDITOR_EVENT);
  if (!canViewImage(image)) {
    showError("String_Node_Str",Constants.HAVENT_ACCESS);
    return;
  }
  if (!fileManager.isFilePresent(image.getFullPath())) {
    showError("String_Node_Str",Constants.IMAGE_RECENTLY_DELETED_ERROR);
    model.resetModel(NavigationEnum.ALBUM_PREVIEW,image.getAlbum().getOwner(),image.getAlbum().getShelf(),image.getAlbum(),null,image.getAlbum().getImages());
    return;
  }
  model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW,image.getAlbum().getOwner(),image.getAlbum().getShelf(),image.getAlbum(),image,image.getAlbum().getImages());
  image.setVisited(true);
}
Program: 18390
Project: 18390
Buggy source:
/** 
 * This method invoked after the user want to see specified album independently is it her album or not.
 * @param album - album to show
 */
public void showAlbum(Album album){
  if (!canViewAlbum(album)) {
    showError(Constants.HAVENT_ACCESS);
    return;
  }
  if (!fileManager.isDirectoryPresent(album.getPath())) {
    showError("String_Node_Str",Constants.ALBUM_RECENTLY_DELETED_ERROR);
    model.resetModel(NavigationEnum.SHELF_PREVIEW,album.getOwner(),album.getShelf(),null,null,null);
    return;
  }
  setPage(0);
  model.resetModel(NavigationEnum.ALBUM_PREVIEW,album.getOwner(),album.getShelf(),album,null,album.getImages());
}

Fixed version (ground truth):
/** 
 * This method invoked after the user want to see specified album independently is it her album or not.
 * @param album - album to show
 */
public void showAlbum(Album album){
  if (!canViewAlbum(album)) {
    showError("String_Node_Str",Constants.HAVENT_ACCESS);
    return;
  }
  if (!fileManager.isDirectoryPresent(album.getPath())) {
    showError("String_Node_Str",Constants.ALBUM_RECENTLY_DELETED_ERROR);
    model.resetModel(NavigationEnum.SHELF_PREVIEW,album.getOwner(),album.getShelf(),null,null,null);
    return;
  }
  setPage(0);
  model.resetModel(NavigationEnum.ALBUM_PREVIEW,album.getOwner(),album.getShelf(),album,null,album.getImages());
}
Program: 18391
Project: 18391
Buggy source:
/** 
 * This method invoked after the user want to edit specified album.
 * @param album - album to edit
 */
public void startEditAlbum(Album album){
  if (getLoggedUser() == null) {
    return;
  }
  if (!album.isOwner(getLoggedUser())) {
    showError(Constants.HAVENT_ACCESS);
    return;
  }
  model.resetModel(NavigationEnum.ALBUM_EDIT,album.getOwner(),album.getShelf(),album,null,album.getImages());
}

Fixed version (ground truth):
/** 
 * This method invoked after the user want to edit specified album.
 * @param album - album to edit
 */
public void startEditAlbum(Album album){
  if (getLoggedUser() == null) {
    return;
  }
  if (!album.isOwner(getLoggedUser())) {
    showError("String_Node_Str",Constants.HAVENT_ACCESS);
    return;
  }
  model.resetModel(NavigationEnum.ALBUM_EDIT,album.getOwner(),album.getShelf(),album,null,album.getImages());
}
Program: 18392
Project: 18392
Buggy source:
/** 
 * This method invoked after the user want to see specified shelf independently is it her shelf or not.
 * @param album - album to show
 */
public void showShelf(Shelf shelf){
  if (!fileManager.isDirectoryPresent(shelf.getPath())) {
    showError(Constants.SHELF_RECENTLY_DELETED_ERROR);
    model.resetModel(NavigationEnum.ANONYM,shelf.getOwner(),null,null,null,null);
    return;
  }
  model.resetModel(NavigationEnum.SHELF_PREVIEW,shelf.getOwner(),shelf,null,null,null);
}

Fixed version (ground truth):
/** 
 * This method invoked after the user want to see specified shelf independently is it her shelf or not.
 * @param album - album to show
 */
public void showShelf(Shelf shelf){
  if (!fileManager.isDirectoryPresent(shelf.getPath())) {
    showError("String_Node_Str",Constants.SHELF_RECENTLY_DELETED_ERROR);
    model.resetModel(NavigationEnum.ANONYM,shelf.getOwner(),null,null,null,null);
    return;
  }
  model.resetModel(NavigationEnum.SHELF_PREVIEW,shelf.getOwner(),shelf,null,null,null);
}
Program: 18393
Project: 18393
Buggy source:
private boolean canViewShelf(Shelf shelf){
  return shelf != null && shelf.isOwner(getLoggedUser() || shelf.isShared());
}

Fixed version (ground truth):
private boolean canViewShelf(Shelf shelf){
  return shelf != null && shelf.isOwner(getLoggedUser()) || shelf.isShared();
}
Program: 18394
Project: 18394
Buggy source:
public void showEvent(Event event){
  model.resetModel(NavigationEnum.EVENT_PREVIEW,loggedUser,null,null,null,null,event);
  pushEvent(Events.EVENT_DISPLAYED_EVENT);
}

Fixed version (ground truth):
public void showEvent(Event event){
  model.resetModel(NavigationEnum.EVENT_PREVIEW,getLoggedUser(),null,null,null,null,event);
  pushEvent(Events.EVENT_DISPLAYED_EVENT);
}
Program: 18395
Project: 18395
Buggy source:
public void showGPlusAlbum(){
  model.resetModel(NavigationEnum.GPLUS_ALBUM_PREVIEW,loggedUser,null,null,null,null);
}

Fixed version (ground truth):
public void showGPlusAlbum(){
  model.resetModel(NavigationEnum.GPLUS_ALBUM_PREVIEW,getLoggedUser(),null,null,null,null);
}
Program: 18396
Project: 18396
Buggy source:
public void showFbImage(String imageId){
  fac.setCurrentImageId(imageId);
  model.resetModel(NavigationEnum.FB_IMAGE_PREVIEW,loggedUser,null,null,null,null);
}

Fixed version (ground truth):
public void showFbImage(String imageId){
  fac.setCurrentImageId(imageId);
  model.resetModel(NavigationEnum.FB_IMAGE_PREVIEW,getLoggedUser(),null,null,null,null);
}
Program: 18397
Project: 18397
Buggy source:
public void onEventEdited(@Observes @EventType(Events.EVENT_EDITED_EVENT) ShelfEvent se){
  model.resetModel(NavigationEnum.EVENT_PREVIEW,loggedUser,null,null,null,null,se.getEvent());
  pushEvent(Events.EVENT_DISPLAYED_EVENT);
}

Fixed version (ground truth):
public void onEventEdited(@Observes @EventType(Events.EVENT_EDITED_EVENT) ShelfEvent se){
  model.resetModel(NavigationEnum.EVENT_PREVIEW,getLoggedUser(),null,null,null,null,se.getEvent());
  pushEvent(Events.EVENT_DISPLAYED_EVENT);
}
Program: 18398
Project: 18398
Buggy source:
public void showFBAlbum(String albumId){
  fac.setCurrentAlbumId(albumId);
  model.resetModel(NavigationEnum.FB_ALBUM_PREVIEW,loggedUser,null,null,null,null);
}

Fixed version (ground truth):
public void showFBAlbum(String albumId){
  fac.setCurrentAlbumId(albumId);
  model.resetModel(NavigationEnum.FB_ALBUM_PREVIEW,getLoggedUser(),null,null,null,null);
}
Program: 18399
Project: 18399
Buggy source:
public void showGPlusImage(String imageId){
  gpac.setCurrentImageId(imageId);
  model.resetModel(NavigationEnum.GPLUS_IMAGE_PREVIEW,loggedUser,null,null,null,null);
}

Fixed version (ground truth):
public void showGPlusImage(String imageId){
  gpac.setCurrentImageId(imageId);
  model.resetModel(NavigationEnum.GPLUS_IMAGE_PREVIEW,getLoggedUser(),null,null,null,null);
}
Program: 18400
Project: 18400
Buggy source:
public void showFbShelf(){
  model.resetModel(NavigationEnum.FB_SHELF,loggedUser,null,null,null,null);
}

Fixed version (ground truth):
public void showFbShelf(){
  model.resetModel(NavigationEnum.FB_SHELF,getLoggedUser(),null,null,null,null);
}
Program: 18401
Project: 18401
Buggy source:
public void showGPlusShelf(){
  model.resetModel(NavigationEnum.GPLUS_SHELF,loggedUser,null,null,null,null);
}

Fixed version (ground truth):
public void showGPlusShelf(){
  model.resetModel(NavigationEnum.GPLUS_SHELF,getLoggedUser(),null,null,null,null);
}
Program: 18402
Project: 18402
Buggy source:
public void onEventDeleted(@Observes @EventType(Events.EVENT_DELETED_EVENT) ShelfEvent se){
  model.resetModel(NavigationEnum.ANONYM,loggedUser,null,null,null,null,null);
}

Fixed version (ground truth):
public void onEventDeleted(@Observes @EventType(Events.EVENT_DELETED_EVENT) ShelfEvent se){
  model.resetModel(NavigationEnum.ANONYM,getLoggedUser(),null,null,null,null,null);
}
Program: 18403
Project: 18403
Buggy source:
public void onEventAdded(@Observes @EventType(Events.EVENT_ADDED_EVENT) ShelfEvent se){
  model.resetModel(NavigationEnum.EVENT_PREVIEW,loggedUser,null,null,null,null,se.getEvent());
  pushEvent(Events.EVENT_DISPLAYED_EVENT);
}

Fixed version (ground truth):
public void onEventAdded(@Observes @EventType(Events.EVENT_ADDED_EVENT) ShelfEvent se){
  model.resetModel(NavigationEnum.EVENT_PREVIEW,getLoggedUser(),null,null,null,null,se.getEvent());
  pushEvent(Events.EVENT_DISPLAYED_EVENT);
}
Program: 18404
Project: 18404
Buggy source:
public void processEvent(DropEvent event){
  String value=(String)event.getDragSource().getDragValue();
  dropValues.add(value);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void processEvent(DropEvent event){
  String value=(String)event.getDragValue();
  dropValues.add(value);
  System.out.println("String_Node_Str");
}
Program: 18406
Project: 18406
Buggy source:
@Override public void run(){
  if (isRunning)   return;
  requestStop=false;
  isRunning=true;
  Camera cam=Camera.open();
  Camera.Parameters pon=cam.getParameters(), poff=cam.getParameters();
  pon.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
  poff.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
  while (!requestStop) {
    try {
      cam.setParameters(pon);
      Thread.sleep(delay);
      cam.setParameters(poff);
      Thread.sleep(delayoff);
    }
 catch (    InterruptedException ex) {
    }
  }
  cam.release();
  isRunning=false;
  requestStop=false;
}

Fixed version (ground truth):
@Override public void run(){
  if (isRunning)   return;
  requestStop=false;
  isRunning=true;
  Camera cam=Camera.open();
  Camera.Parameters pon=cam.getParameters(), poff=cam.getParameters();
  pon.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
  poff.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
  while (!requestStop) {
    try {
      cam.setParameters(pon);
      Thread.sleep(delay);
      cam.setParameters(poff);
      Thread.sleep(delayoff);
    }
 catch (    InterruptedException ex) {
    }
catch (    RuntimeException ex) {
      requestStop=true;
      errorMessage="String_Node_Str";
    }
  }
  cam.release();
  isRunning=false;
  requestStop=false;
  controller.mHandler.post(controller.mShowToastRunnable);
}
Program: 18407
Project: 18407
Buggy source:
public void close() throws IOException {
  if (!open) {
    return;
  }
  open=false;
  flush();
  List<Entity> entities=new ArrayList<Entity>(buckets.size() + 1);
  Entity metaDataEntity=new Entity(GoogleAppEngineDirectory.META_KEY_KIND,fileName,dir.getIndexKey());
  metaDataEntity.setProperty("String_Node_Str",length);
  metaDataEntity.setProperty("String_Node_Str",System.currentTimeMillis());
  entities.add(metaDataEntity);
  for (int i=0; i < (buckets.size()); i++) {
    Entity contentEntity=new Entity(GoogleAppEngineDirectory.CONTENT_KEY_KIND,fileName + i,dir.getIndexKey());
    if (i == (buckets.size() - 1)) {
      byte[] buff=new byte[(int)(length - (bucketSize * i))];
      System.arraycopy(buckets.get(i),0,buff,0,buff.length);
      contentEntity.setProperty("String_Node_Str",new Blob(buff));
    }
 else {
      contentEntity.setProperty("String_Node_Str",new Blob(buckets.get(i)));
    }
    entities.add(contentEntity);
  }
  try {
    dir.getDatastoreService().put(entities);
  }
  finally {
    dir.getOnGoingIndexOutputs().remove(fileName);
  }
  currentBuffer=null;
}

Fixed version (ground truth):
public void close() throws IOException {
  if (!open) {
    return;
  }
  open=false;
  flush();
  List<Entity> entities=new ArrayList<Entity>(buckets.size() + 1);
  Entity metaDataEntity=new Entity(GoogleAppEngineDirectory.META_KEY_KIND,fileName,dir.getIndexKey());
  metaDataEntity.setProperty("String_Node_Str",length);
  metaDataEntity.setProperty("String_Node_Str",System.currentTimeMillis());
  entities.add(metaDataEntity);
  for (int i=0; i < (buckets.size()); i++) {
    Entity contentEntity=new Entity(GoogleAppEngineDirectory.CONTENT_KEY_KIND,fileName + i,metaDataEntity.getKey());
    if (i == (buckets.size() - 1)) {
      byte[] buff=new byte[(int)(length - (bucketSize * i))];
      System.arraycopy(buckets.get(i),0,buff,0,buff.length);
      contentEntity.setProperty("String_Node_Str",new Blob(buff));
    }
 else {
      contentEntity.setProperty("String_Node_Str",new Blob(buckets.get(i)));
    }
    entities.add(contentEntity);
  }
  try {
    dir.getDatastoreService().put(entities);
  }
  finally {
    dir.getOnGoingIndexOutputs().remove(fileName);
  }
  currentBuffer=null;
}
Program: 18408
Project: 18408
Buggy source:
public void closeDelegate() throws SearchEngineException {
}

Fixed version (ground truth):
public void closeDelegate() throws SearchEngineException {
  close(false);
}
Program: 18409
Project: 18409
Buggy source:
public void close() throws SearchEngineException {
}

Fixed version (ground truth):
private void close(boolean removeDelegate) throws SearchEngineException {
  if (internalSearch != null) {
    try {
      internalSearch.close();
    }
  finally {
      internalSearch=null;
      if (removeDelegate) {
        searchEngine.removeDelegatedClose(this);
      }
    }
  }
}
Program: 18410
Project: 18410
Buggy source:
public LuceneSearchEngineFactory(PropertyNamingStrategy propertyNamingStrategy,CompassSettings settings,CompassMapping mapping,ExecutorManager executorManager){
  this.propertyNamingStrategy=propertyNamingStrategy;
  this.mapping=mapping;
  this.executorManager=executorManager;
  this.settings=settings;
  this.luceneSettings=new LuceneSettings();
  luceneSettings.configure(settings);
  configure(settings,mapping);
}

Fixed version (ground truth):
public LuceneSearchEngineFactory(PropertyNamingStrategy propertyNamingStrategy,CompassSettings settings,CompassMapping mapping,ExecutorManager executorManager){
  this.propertyNamingStrategy=propertyNamingStrategy;
  this.mapping=mapping;
  this.executorManager=executorManager;
  this.settings=settings;
  this.luceneSettings=new LuceneSettings();
  luceneSettings.configure(settings);
  resourceFactory=new LuceneResourceFactory(this);
  analyzerManager=new LuceneAnalyzerManager();
  analyzerManager.configure(settings,mapping,luceneSettings);
  LuceneSearchEngineStore searchEngineStore=new DefaultLuceneSearchEngineStore();
  searchEngineStore.configure(this,settings,mapping);
  indexManager=new DefaultLuceneSearchEngineIndexManager(this,searchEngineStore);
  indexDeletionPolicyManager=new IndexDeletionPolicyFactory(indexManager);
  indexDeletionPolicyManager.configure(settings);
  try {
    ClassUtils.forName("String_Node_Str",settings.getClassLoader());
    highlighterManager=new LuceneHighlighterManager();
    highlighterManager.configure(settings);
  }
 catch (  ClassNotFoundException e1) {
    log.info("String_Node_Str");
  }
  searchEngineOptimizer=new LuceneSearchEngineOptimizerManager(this);
  ((CompassConfigurable)searchEngineOptimizer).configure(settings);
  if (settings.getSettingAsBoolean(LuceneEnvironment.SpellCheck.ENABLE,false)) {
    spellCheckManager=(InternalLuceneSearchEngineSpellCheckManager)settings.getSettingAsInstance(LuceneEnvironment.SpellCheck.CLASS,DefaultLuceneSpellCheckManager.class.getName());
    spellCheckManager.configure(this,settings,mapping);
  }
  queryParserManager=new LuceneQueryParserManager(this);
  queryParserManager.configure(settings);
  similarityManager=new LuceneSimilarityManager();
  similarityManager.configure(settings);
  transactionProcessorManager=new TransactionProcessorManager(this);
  debug=settings.getSettingAsBoolean(CompassEnvironment.DEBUG,false);
  if (debug) {
    debugOpenHoldersCount=new ConcurrentHashMap<String,AtomicInteger>();
  }
 else {
    debugOpenHoldersCount=null;
  }
}
Program: 18411
Project: 18411
Buggy source:
private LuceneIndexHolder internalRefreshCache(String subIndex) throws SearchEngineException {
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + subIndex + "String_Node_Str");
  }
  LuceneIndexHolder indexHolder=indexHolders.get(subIndex);
  if (indexHolder != null) {
    IndexReader reader;
    try {
      reader=indexHolder.getIndexReader().reopen();
    }
 catch (    IOException e) {
      throw new SearchEngineException("String_Node_Str" + subIndex + "String_Node_Str",e);
    }
    if (reader != indexHolder.getIndexReader()) {
      LuceneIndexHolder origHolder=indexHolder;
      indexHolder=new LuceneIndexHolder(subIndex,indexManager.openIndexSearcher(reader));
      LuceneIndexHolder oldHolder=indexHolders.put(subIndex,indexHolder);
      if (oldHolder != null) {
        oldHolder.markForClose();
      }
      origHolder.markForClose();
    }
 else {
      indexHolder.setInvalidated(false);
      indexHolder.markLastCacheInvalidation();
    }
  }
 else {
    try {
      IndexReader reader=IndexReader.open(indexManager.getDirectory(subIndex),true);
      indexHolder=new LuceneIndexHolder(subIndex,indexManager.openIndexSearcher(reader));
    }
 catch (    IOException e) {
      throw new SearchEngineException("String_Node_Str" + subIndex + "String_Node_Str",e);
    }
    LuceneIndexHolder oldHolder=indexHolders.put(subIndex,indexHolder);
    if (oldHolder != null) {
      oldHolder.markForClose();
    }
  }
  return indexHolder;
}

Fixed version (ground truth):
private LuceneIndexHolder internalRefreshCache(String subIndex) throws SearchEngineException {
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + subIndex + "String_Node_Str");
  }
  LuceneIndexHolder indexHolder=indexHolders.get(subIndex);
  if (indexHolder != null) {
    IndexReader reader;
    try {
      reader=indexHolder.getIndexReader().reopen();
    }
 catch (    IOException e) {
      throw new SearchEngineException("String_Node_Str" + subIndex + "String_Node_Str",e);
    }
    if (reader != indexHolder.getIndexReader()) {
      LuceneIndexHolder origHolder=indexHolder;
      indexHolder=new LuceneIndexHolder(indexManager.getSearchEngineFactory(),subIndex,indexManager.openIndexSearcher(reader));
      LuceneIndexHolder oldHolder=indexHolders.put(subIndex,indexHolder);
      if (oldHolder != null) {
        oldHolder.markForClose();
      }
      origHolder.markForClose();
    }
 else {
      indexHolder.setInvalidated(false);
      indexHolder.markLastCacheInvalidation();
    }
  }
 else {
    try {
      IndexReader reader=IndexReader.open(indexManager.getDirectory(subIndex),true);
      indexHolder=new LuceneIndexHolder(indexManager.getSearchEngineFactory(),subIndex,indexManager.openIndexSearcher(reader));
    }
 catch (    IOException e) {
      throw new SearchEngineException("String_Node_Str" + subIndex + "String_Node_Str",e);
    }
    LuceneIndexHolder oldHolder=indexHolders.put(subIndex,indexHolder);
    if (oldHolder != null) {
      oldHolder.markForClose();
    }
  }
  return indexHolder;
}
Program: 18412
Project: 18412
Buggy source:
public LuceneIndexHolder(String subIndex,IndexSearcher indexSearcher){
  this.subIndex=subIndex;
  this.indexSearcher=indexSearcher;
  this.indexReader=indexSearcher.getIndexReader();
}

Fixed version (ground truth):
public LuceneIndexHolder(LuceneSearchEngineFactory searchEngineFactory,String subIndex,IndexSearcher indexSearcher){
  this.searchEngineFactory=searchEngineFactory;
  this.subIndex=subIndex;
  this.indexSearcher=indexSearcher;
  this.indexReader=indexSearcher.getIndexReader();
  if (searchEngineFactory.isDebug()) {
    AtomicInteger count=searchEngineFactory.getDebugHoldersCount().get(subIndex);
    if (count == null) {
      AtomicInteger newCount=new AtomicInteger();
      count=searchEngineFactory.getDebugHoldersCount().putIfAbsent(subIndex,newCount);
      if (count == null) {
        count=newCount;
      }
    }
    count.incrementAndGet();
  }
}
Program: 18413
Project: 18413
Buggy source:
private void checkIfCanClose(){
  if (markForClose && count <= 0 && !closed) {
    closed=true;
    try {
      indexSearcher.close();
    }
 catch (    Exception e) {
    }
    try {
      indexReader.close();
    }
 catch (    Exception e) {
    }
  }
}

Fixed version (ground truth):
private void checkIfCanClose(){
  if (markForClose && count <= 0 && !closed) {
    if (searchEngineFactory.isDebug()) {
      searchEngineFactory.getDebugHoldersCount().get(subIndex).decrementAndGet();
    }
    closed=true;
    try {
      indexSearcher.close();
    }
 catch (    Exception e) {
    }
    try {
      indexReader.close();
    }
 catch (    Exception e) {
    }
  }
}
Program: 18414
Project: 18414
Buggy source:
protected IndexEntity[] doGetIndexEntities() throws CompassGpsException {
  ExtendedSqlMapClient extSqlMapClient=(ExtendedSqlMapClient)sqlMapClient;
  IndexEntity[] entities=new IndexEntity[selectStatementsIds.length];
  for (int i=0; i < selectStatementsIds.length; i++) {
    String statementId=selectStatementsIds[i];
    MappedStatement statement=extSqlMapClient.getDelegate().getMappedStatement(statementId);
    if (statement == null) {
      throw new IllegalArgumentException("String_Node_Str" + statementId + "String_Node_Str");
    }
    Class resultClass=statement.getResultMap().getResultClass();
    ResourceMapping resourceMapping=((CompassGpsInterfaceDevice)getGps()).getMappingForEntityForIndex(resultClass);
    if (resourceMapping == null) {
      throw new IllegalArgumentException("String_Node_Str" + resultClass.getClass() + "String_Node_Str");
    }
    Object parameterObject=null;
    if (statementsParameterObjects != null) {
      parameterObject=statementsParameterObjects[i];
    }
    entities[i]=new SqlMapIndexEntity(resultClass.getName(),resourceMapping.getSubIndexHash().getSubIndexes(),statementId,parameterObject);
  }
  return entities;
}

Fixed version (ground truth):
protected IndexEntity[] doGetIndexEntities() throws CompassGpsException {
  ExtendedSqlMapClient extSqlMapClient=(ExtendedSqlMapClient)sqlMapClient;
  IndexEntity[] entities=new IndexEntity[selectStatementsIds.length];
  for (int i=0; i < selectStatementsIds.length; i++) {
    String statementId=selectStatementsIds[i];
    MappedStatement statement=extSqlMapClient.getDelegate().getMappedStatement(statementId);
    if (statement == null) {
      throw new IllegalArgumentException("String_Node_Str" + statementId + "String_Node_Str");
    }
    Class resultClass=statement.getResultMap().getResultClass();
    ResourceMapping resourceMapping=((CompassGpsInterfaceDevice)getGps()).getMappingForEntityForIndex(resultClass);
    if (resourceMapping == null) {
      throw new IllegalArgumentException("String_Node_Str" + resultClass.getName() + "String_Node_Str");
    }
    Object parameterObject=null;
    if (statementsParameterObjects != null) {
      parameterObject=statementsParameterObjects[i];
    }
    entities[i]=new SqlMapIndexEntity(resultClass.getName(),resourceMapping.getSubIndexHash().getSubIndexes(),statementId,parameterObject);
  }
  return entities;
}
Program: 18415
Project: 18415
Buggy source:
public void testPolyQuery() throws Exception {
  CompassSession session=openSession();
  CompassTransaction tr=session.beginTransaction();
  Long id=new Long(1);
  ExtendsA extendsA=new ExtendsA();
  extendsA.setId(id);
  extendsA.setValue("String_Node_Str");
  extendsA.setExtendsValue("String_Node_Str");
  session.save("String_Node_Str",extendsA);
  extendsA=(ExtendsA)session.load("String_Node_Str",id);
  assertEquals("String_Node_Str",extendsA.getValue());
  id=new Long(1);
  extendsA=new ExtendsA();
  extendsA.setId(id);
  extendsA.setValue("String_Node_Str");
  extendsA.setExtendsValue("String_Node_Str");
  session.save("String_Node_Str",extendsA);
  extendsA=(ExtendsA)session.load("String_Node_Str",id);
  assertEquals("String_Node_Str",extendsA.getValue());
  CompassHits hits=session.queryBuilder().polyAlias("String_Node_Str").hits();
  assertEquals(2,hits.length());
  tr.commit();
  session.close();
}

Fixed version (ground truth):
public void testPolyQuery() throws Exception {
  CompassSession session=openSession();
  CompassTransaction tr=session.beginTransaction();
  Long id=new Long(1);
  ExtendsA extendsA=new ExtendsA();
  extendsA.setId(id);
  extendsA.setValue("String_Node_Str");
  extendsA.setExtendsValue("String_Node_Str");
  session.save("String_Node_Str",extendsA);
  extendsA=(ExtendsA)session.load("String_Node_Str",id);
  assertEquals("String_Node_Str",extendsA.getValue());
  id=new Long(1);
  extendsA=new ExtendsA();
  extendsA.setId(id);
  extendsA.setValue("String_Node_Str");
  extendsA.setExtendsValue("String_Node_Str");
  session.save("String_Node_Str",extendsA);
  extendsA=(ExtendsA)session.load("String_Node_Str",id);
  assertEquals("String_Node_Str",extendsA.getValue());
  CompassHits hits=session.queryBuilder().polyAlias("String_Node_Str").hits();
  assertEquals(2,hits.length());
  hits=session.find("String_Node_Str");
  assertEquals(2,hits.length());
  tr.commit();
  session.close();
}
Program: 18417
Project: 18417
Buggy source:
public void deleteFile(String name) throws IOException {
  if (shouldPerformOperationOnActualDirectory(name)) {
    dir.deleteFile(name);
    if (log.isTraceEnabled()) {
      log.trace(logMessage("String_Node_Str" + name + "String_Node_Str"));
    }
  }
  if (localCacheDir.fileExists(name)) {
    if (log.isTraceEnabled()) {
      log.trace(logMessage("String_Node_Str" + name + "String_Node_Str"));
    }
    localCacheDir.deleteFile(name);
  }
  if (searchEngineFactory.getLuceneSettings().isUseCompoundFile() && IndexFileNameFilter.getFilter().isCFSFile(name)) {
    return;
  }
  dir.deleteFile(name);
  if (log.isTraceEnabled()) {
    log.trace(logMessage("String_Node_Str" + name + "String_Node_Str"));
  }
}

Fixed version (ground truth):
public void deleteFile(String name) throws IOException {
  if (shouldPerformOperationOnActualDirectory(name)) {
    dir.deleteFile(name);
    if (log.isTraceEnabled()) {
      log.trace(logMessage("String_Node_Str" + name + "String_Node_Str"));
    }
    return;
  }
  if (localCacheDir.fileExists(name)) {
    if (log.isTraceEnabled()) {
      log.trace(logMessage("String_Node_Str" + name + "String_Node_Str"));
    }
    localCacheDir.deleteFile(name);
  }
  if (searchEngineFactory.getLuceneSettings().isUseCompoundFile() && IndexFileNameFilter.getFilter().isCFSFile(name)) {
    return;
  }
  dir.deleteFile(name);
  if (log.isTraceEnabled()) {
    log.trace(logMessage("String_Node_Str" + name + "String_Node_Str"));
  }
}
Program: 18418
Project: 18418
Buggy source:
public LocalDirectoryCache(String subIndex,Directory dir,Directory localCacheDir,int bufferSize,LuceneSearchEngineFactory searchEngineFactory){
  this.subIndex=subIndex;
  this.dir=dir;
  this.localCacheDir=localCacheDir;
  this.bufferSize=bufferSize;
  this.searchEngineFactory=searchEngineFactory;
}

Fixed version (ground truth):
public LocalDirectoryCache(String subIndex,Directory dir,Directory localCacheDir,int bufferSize,LuceneSearchEngineFactory searchEngineFactory){
  this.subIndex=subIndex;
  this.dir=dir;
  this.localCacheDir=localCacheDir;
  this.bufferSize=bufferSize;
  this.searchEngineFactory=searchEngineFactory;
  for (int i=0; i < monitors.length; i++) {
    monitors[i]=new Object();
  }
}
Program: 18419
Project: 18419
Buggy source:
public void touchFile(String name) throws IOException {
  if (shouldPerformOperationOnActualDirectory(name)) {
    dir.touchFile(name);
  }
  fetchFileIfNotExists(name);
  localCacheDir.touchFile(name);
  dir.touchFile(name);
}

Fixed version (ground truth):
public void touchFile(String name) throws IOException {
  if (shouldPerformOperationOnActualDirectory(name)) {
    dir.touchFile(name);
    return;
  }
  fetchFileIfNotExists(name);
  localCacheDir.touchFile(name);
  dir.touchFile(name);
}
Program: 18420
Project: 18420
Buggy source:
private void fetchFileIfNotExists(String name) throws IOException {
  if (localCacheDir.fileExists(name)) {
    return;
  }
  if (log.isTraceEnabled()) {
    log.trace(logMessage("String_Node_Str" + name + "String_Node_Str"));
  }
  copy(dir,localCacheDir,name);
}

Fixed version (ground truth):
private void fetchFileIfNotExists(String name) throws IOException {
synchronized (monitors[Math.abs(name.hashCode()) % monitors.length]) {
    if (localCacheDir.fileExists(name)) {
      return;
    }
    if (log.isTraceEnabled()) {
      log.trace(logMessage("String_Node_Str" + name + "String_Node_Str"));
    }
    copy(dir,localCacheDir,name);
  }
}
Program: 18421
Project: 18421
Buggy source:
public void renameFile(String from,String to) throws IOException {
  if (shouldPerformOperationOnActualDirectory(from)) {
    dir.renameFile(from,to);
  }
  fetchFileIfNotExists(from);
  localCacheDir.renameFile(from,to);
  dir.renameFile(from,to);
}

Fixed version (ground truth):
public void renameFile(String from,String to) throws IOException {
  if (shouldPerformOperationOnActualDirectory(from)) {
    dir.renameFile(from,to);
    return;
  }
  fetchFileIfNotExists(from);
  localCacheDir.renameFile(from,to);
  dir.renameFile(from,to);
}
Program: 18422
Project: 18422
Buggy source:
public long fileModified(String name) throws IOException {
  if (shouldPerformOperationOnActualDirectory(name)) {
    return dir.fileLength(name);
  }
  fetchFileIfNotExists(name);
  return localCacheDir.fileModified(name);
}

Fixed version (ground truth):
public long fileModified(String name) throws IOException {
  if (shouldPerformOperationOnActualDirectory(name)) {
    return dir.fileModified(name);
  }
  fetchFileIfNotExists(name);
  return localCacheDir.fileModified(name);
}
Program: 18423
Project: 18423
Buggy source:
public TransIndexManager(LuceneSearchEngineFactory searchEngineFactory){
  this.indexManager=searchEngineFactory.getLuceneIndexManager();
  this.luceneSettings=searchEngineFactory.getLuceneSettings();
}

Fixed version (ground truth):
public TransIndexManager(LuceneSearchEngineFactory searchEngineFactory){
  this.indexManager=searchEngineFactory.getLuceneIndexManager();
}
Program: 18424
Project: 18424
Buggy source:
private void bindReference(ConfigurationHelper referenceConf,AliasMapping aliasMapping,ReferenceMapping referenceMapping){
  String name=referenceConf.getAttribute("String_Node_Str");
  referenceMapping.setName(name);
  String refAlias=referenceConf.getAttribute("String_Node_Str",null);
  referenceMapping.setRefAliases(getAliases(refAlias));
  referenceMapping.setDefinedInAlias(aliasMapping.getAlias());
  String refCompAlias=referenceConf.getAttribute("String_Node_Str",null);
  if (refCompAlias != null) {
    referenceMapping.setRefCompAlias(valueLookup.lookupAliasName(refCompAlias));
  }
  bindConverter(referenceConf,referenceMapping);
  referenceMapping.setAccessor(referenceConf.getAttribute("String_Node_Str",null));
  if (aliasMapping instanceof ClassMapping) {
    referenceMapping.setObjClass(((ClassMapping)aliasMapping).getClazz());
  }
  referenceMapping.setPropertyName(name);
}

Fixed version (ground truth):
private void bindReference(ConfigurationHelper referenceConf,AliasMapping aliasMapping,ReferenceMapping referenceMapping){
  String name=referenceConf.getAttribute("String_Node_Str");
  referenceMapping.setName(name);
  String refAlias=referenceConf.getAttribute("String_Node_Str",null);
  referenceMapping.setRefAliases(getAliases(refAlias));
  referenceMapping.setDefinedInAlias(aliasMapping.getAlias());
  String refCompAlias=referenceConf.getAttribute("String_Node_Str",null);
  if (refCompAlias != null) {
    referenceMapping.setRefCompAlias(valueLookup.lookupAliasName(refCompAlias));
  }
  bindConverter(referenceConf,referenceMapping);
  referenceMapping.setAccessor(referenceConf.getAttribute("String_Node_Str",null));
  referenceMapping.setPropertyName(name);
}
Program: 18425
Project: 18425
Buggy source:
private void bindParent(ConfigurationHelper parentConf,AliasMapping aliasMapping,ParentMapping parentMapping){
  String name=parentConf.getAttribute("String_Node_Str");
  parentMapping.setName(name);
  bindConverter(parentConf,parentMapping);
  parentMapping.setAccessor(parentConf.getAttribute("String_Node_Str",null));
  if (aliasMapping instanceof ClassMapping) {
    parentMapping.setObjClass(((ClassMapping)aliasMapping).getClazz());
  }
  parentMapping.setPropertyName(name);
  parentMapping.setDefinedInAlias(aliasMapping.getAlias());
}

Fixed version (ground truth):
private void bindParent(ConfigurationHelper parentConf,AliasMapping aliasMapping,ParentMapping parentMapping){
  String name=parentConf.getAttribute("String_Node_Str");
  parentMapping.setName(name);
  bindConverter(parentConf,parentMapping);
  parentMapping.setAccessor(parentConf.getAttribute("String_Node_Str",null));
  parentMapping.setPropertyName(name);
  parentMapping.setDefinedInAlias(aliasMapping.getAlias());
}