nus-yam/ex-repair huggingface dataset:
Program: 93001
Project: 93001
Buggy source:
private ArrayList<ILaunchConfiguration> findCDTLaunchConfigFromProject(final IProject project){
  ArrayList<ILaunchConfiguration> applicableLaunchConfigs=new ArrayList<ILaunchConfiguration>();
  try {
    ILaunchManager mgr=DebugPlugin.getDefault().getLaunchManager();
    final ILaunchConfiguration[] configs=mgr.getLaunchConfigurations();
    for (    ILaunchConfiguration currentConfig : configs) {
      String configProjectName=currentConfig.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME,"String_Node_Str");
      if (configProjectName.length() > 0 && project.getName().equals(configProjectName)) {
        applicableLaunchConfigs.add(currentConfig);
      }
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  return applicableLaunchConfigs;
}

Fixed version (ground truth):
private ArrayList<ILaunchConfiguration> findCDTLaunchConfigFromProject(final IProject project){
  ArrayList<ILaunchConfiguration> applicableLaunchConfigs=new ArrayList<ILaunchConfiguration>();
  if (project != null) {
    try {
      ILaunchManager mgr=DebugPlugin.getDefault().getLaunchManager();
      final ILaunchConfiguration[] configs=mgr.getLaunchConfigurations();
      for (      ILaunchConfiguration currentConfig : configs) {
        String configProjectName=currentConfig.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME,"String_Node_Str");
        if (configProjectName.length() > 0 && project.getName().equals(configProjectName)) {
          applicableLaunchConfigs.add(currentConfig);
        }
      }
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
  return applicableLaunchConfigs;
}
Program: 93002
Project: 93002
Buggy source:
public void launch(final Object element,String mode){
  final IProject project;
  if (element instanceof IFile) {
    project=((IFile)element).getProject();
  }
 else   if (element instanceof IProject) {
    project=(IProject)element;
  }
 else {
    project=null;
    System.out.println(element);
  }
  if (project == null) {
    MessageDialog.openError(LaunchPlugin.getActiveWorkbenchShell(),OprofileLaunchMessages.getString("String_Node_Str"),OprofileLaunchMessages.getString("String_Node_Str"));
  }
  ConfigRunner configRunner=new ConfigRunner(project);
  ProgressMonitorDialog dialog=new ProgressMonitorDialog(LaunchPlugin.getActiveWorkbenchShell());
  try {
    dialog.run(true,false,configRunner);
  }
 catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
  ArrayList<ILaunchConfiguration> profilingLaunchConfigs=configRunner.getProfilingConfigs();
  if (profilingLaunchConfigs == null) {
    MessageDialog.openError(null,OprofileLaunchMessages.getString("String_Node_Str"),OprofileLaunchMessages.getString("String_Node_Str"));
  }
 else   if (profilingLaunchConfigs.size() == 1) {
    launchProfilingLaunchConfiguration(profilingLaunchConfigs.get(0),mode);
  }
 else   if (profilingLaunchConfigs.size() > 1) {
    openLaunchSelectionDialog(profilingLaunchConfigs,mode);
  }
}

Fixed version (ground truth):
public void launch(final Object element,String mode){
  final IProject project;
  if (element instanceof IFile) {
    project=((IFile)element).getProject();
  }
 else   if (element instanceof IProject) {
    project=(IProject)element;
  }
 else   if (element instanceof IBinary) {
    project=((IBinary)element).getCProject().getProject();
  }
 else {
    project=null;
    System.out.println(element);
  }
  if (project == null) {
    MessageDialog.openError(LaunchPlugin.getActiveWorkbenchShell(),OprofileLaunchMessages.getString("String_Node_Str"),OprofileLaunchMessages.getString("String_Node_Str"));
  }
 else {
    ConfigRunner configRunner=new ConfigRunner(project);
    ProgressMonitorDialog dialog=new ProgressMonitorDialog(LaunchPlugin.getActiveWorkbenchShell());
    try {
      dialog.run(true,false,configRunner);
    }
 catch (    InvocationTargetException e) {
      e.printStackTrace();
    }
catch (    InterruptedException e) {
      e.printStackTrace();
    }
    ArrayList<ILaunchConfiguration> profilingLaunchConfigs=configRunner.getProfilingConfigs();
    if (profilingLaunchConfigs == null) {
      MessageDialog.openError(null,OprofileLaunchMessages.getString("String_Node_Str"),OprofileLaunchMessages.getString("String_Node_Str"));
    }
 else     if (profilingLaunchConfigs.size() == 1) {
      launchProfilingLaunchConfiguration(profilingLaunchConfigs.get(0),mode);
    }
 else     if (profilingLaunchConfigs.size() > 1) {
      openLaunchSelectionDialog(profilingLaunchConfigs,mode);
    }
  }
}
Program: 93003
Project: 93003
Buggy source:
public void run(){
  OprofileView view=OprofileUiPlugin.getDefault().getOprofileView();
  if (view != null) {
    view.refreshView();
  }
}

Fixed version (ground truth):
public void run(){
  OprofileView view=OprofileUiPlugin.getDefault().getOprofileView();
  if (view != null) {
    view.refreshView();
  }
 else {
    try {
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(OprofileUiPlugin.ID_OPROFILE_VIEW);
    }
 catch (    PartInitException e) {
      e.printStackTrace();
    }
    OprofileUiPlugin.getDefault().getOprofileView().refreshView();
  }
}
Program: 93004
Project: 93004
Buggy source:
public void launchesTerminated(ILaunch[] launches){
  try {
    for (    ILaunch l : launches) {
      if (l.equals(launch)) {
        OprofileCorePlugin.getDefault().getOpcontrolProvider().dumpSamples();
        OprofileCorePlugin.getDefault().getOpcontrolProvider().shutdownDaemon();
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            OprofileView view=OprofileUiPlugin.getDefault().getOprofileView();
            if (view != null) {
              view.refreshView();
            }
          }
        }
);
      }
    }
  }
 catch (  OpcontrolException ignore) {
  }
}

Fixed version (ground truth):
public void launchesTerminated(ILaunch[] launches){
  try {
    for (    ILaunch l : launches) {
      if (l.equals(launch)) {
        OprofileCorePlugin.getDefault().getOpcontrolProvider().dumpSamples();
        OprofileCorePlugin.getDefault().getOpcontrolProvider().shutdownDaemon();
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            OprofileView view=OprofileUiPlugin.getDefault().getOprofileView();
            if (view != null) {
              view.refreshView();
            }
 else {
              try {
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(OprofileUiPlugin.ID_OPROFILE_VIEW);
              }
 catch (              PartInitException e) {
                e.printStackTrace();
              }
              OprofileUiPlugin.getDefault().getOprofileView().refreshView();
            }
          }
        }
);
      }
    }
  }
 catch (  OpcontrolException ignore) {
  }
}
Program: 93005
Project: 93005
Buggy source:
public void launch(IBinary bin,String mode){
  super.initialize();
  this.bin=bin;
  name="String_Node_Str";
  binName=getName(bin);
  partialScriptPath=PluginConstants.getPluginLocation() + "String_Node_Str";
  viewID="String_Node_Str";
  if (projectName == null || projectName.length() < 1)   projectName=bin.getCProject().getElementName();
  try {
    config=createConfiguration(bin,name);
    binaryPath=bin.getResource().getLocation().toString();
    arguments=binaryPath;
    outputPath=PluginConstants.STAP_GRAPH_DEFAULT_IO_PATH;
    writeFunctionListToScript(resourceToSearchFor);
    if (funcs == null || funcs.length() < 0)     return;
    needToGenerate=true;
    finishLaunch(name,mode);
  }
 catch (  IOException e) {
    SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages("String_Node_Str",Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    mess.schedule();
    e.printStackTrace();
  }
catch (  CoreException e1) {
    e1.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    resourceToSearchFor="String_Node_Str";
    searchForResource=false;
  }
}

Fixed version (ground truth):
public void launch(IBinary bin,String mode){
  super.initialize();
  this.bin=bin;
  name="String_Node_Str";
  binName=getName(bin);
  partialScriptPath=PluginConstants.getPluginLocation() + "String_Node_Str";
  viewID="String_Node_Str";
  if (projectName == null || projectName.length() < 1)   projectName=bin.getCProject().getElementName();
  try {
    config=createConfiguration(bin,name);
    binaryPath=bin.getResource().getLocation().toString();
    arguments=binaryPath;
    outputPath=PluginConstants.STAP_GRAPH_DEFAULT_IO_PATH;
    if (writeFunctionListToScript(resourceToSearchFor) == null)     return;
    if (funcs == null || funcs.length() < 0)     return;
    needToGenerate=true;
    finishLaunch(name,mode);
  }
 catch (  IOException e) {
    SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages("String_Node_Str",Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    mess.schedule();
    e.printStackTrace();
  }
catch (  CoreException e1) {
    e1.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    resourceToSearchFor="String_Node_Str";
    searchForResource=false;
  }
}
Program: 93007
Project: 93007
Buggy source:
private void parseMarked(String msg){
  if (msg.length() < 1)   return;
  int id=idList.get(idList.size() - 1);
  if (msg.equals("String_Node_Str")) {
    msg=msg + Messages.getString("String_Node_Str");
  }
  markedMap.put(id,markedMap.get(id) + msg);
}

Fixed version (ground truth):
private void parseMarked(String msg){
  if (msg.length() < 1 || idList.size() < 1)   return;
  int id=idList.get(idList.size() - 1);
  if (msg.equals("String_Node_Str")) {
    msg=msg + Messages.getString("String_Node_Str");
  }
  markedMap.put(id,(markedMap.get(id) == null ? "String_Node_Str" : markedMap.get(id)) + msg);
}
Program: 93010
Project: 93010
Buggy source:
/** 
 * Called at the end of a non-realtime run.  Feel free to override this method if using non-realtime functions. The setData method will be called after executeParsing() is run. The getData() method will be used by the SystemTapView to get the data associated with this parser. <br><br> Alternatively, you can cast the parser within SystemTapView to your own parser class and access its data structures that way. 
 */
protected void setData(Object obj){
  data=obj;
}

Fixed version (ground truth):
/** 
 * Called at the end of a non-realtime run.  Feel free to override this method if using non-realtime functions. The setData method will be called after executeParsing() is run. The getData() method will be used by the SystemTapView to get the data associated with this parser. <br><br> Alternatively, you can cast the parser within SystemTapView to your own parser class and access its data structures that way. 
 */
public void setData(Object obj){
  data=obj;
}
Program: 93011
Project: 93011
Buggy source:
public boolean isPartOfCollapsedNode(){
  return (partOfCollapsedNode == NOT_PART_OF_COLLAPSED_NODE);
}

Fixed version (ground truth):
public boolean isPartOfCollapsedNode(){
  return (partOfCollapsedNode != NOT_PART_OF_COLLAPSED_NODE);
}
Program: 93012
Project: 93012
Buggy source:
public void setCollapseMode(boolean value){
  if (draw_mode == StapGraph.CONSTANT_DRAWMODE_AGGREGATE)   return;
  if (collapse_mode != value) {
    if (collapse_mode && !value) {
      if (!getRootData().isOnlyChildWithThisName()) {
        rootVisibleNodeNumber=getRootData().uncollapsedPiece;
      }
    }
    if (!collapse_mode && value) {
      if (!getRootData().isOnlyChildWithThisName()) {
        int temp=getRootData().getPartOfCollapsedNode();
        if (temp != StapData.NOT_PART_OF_COLLAPSED_NODE) {
          rootVisibleNodeNumber=temp;
        }
      }
    }
    collapse_mode=value;
    callgraphView.getMode_collapsednodes().setChecked(value);
  }
  nextMarkedNode=-1;
}

Fixed version (ground truth):
public void setCollapseMode(boolean value){
  if (draw_mode == StapGraph.CONSTANT_DRAWMODE_AGGREGATE)   return;
  if (collapse_mode != value) {
    if (draw_mode != StapGraph.CONSTANT_DRAWMODE_LEVEL) {
      if (collapse_mode && !value) {
        if (!getRootData().isOnlyChildWithThisName()) {
          rootVisibleNodeNumber=getRootData().uncollapsedPiece;
        }
      }
      if (!collapse_mode && value) {
        if (!getRootData().isOnlyChildWithThisName()) {
          int temp=getRootData().getPartOfCollapsedNode();
          if (temp != StapData.NOT_PART_OF_COLLAPSED_NODE) {
            rootVisibleNodeNumber=temp;
          }
        }
      }
    }
    collapse_mode=value;
    callgraphView.getMode_collapsednodes().setChecked(value);
  }
  nextMarkedNode=-1;
}
Program: 93014
Project: 93014
Buggy source:
/** 
 * Draws a tree roughly starting from node id
 */
public void drawBox(int id,int x,int y){
  setLevelLimits(id);
  int MaxLevelPixelWidth=1;
  int currPixelWidth=1;
  int count;
  for (int i=topLevelToDraw; i <= bottomLevelToDraw; i++) {
    count=0;
    levels.get(i).add(0,count);
    int size=levels.get(i).size();
    for (int j=1; j < size; j++) {
      int val=levels.get(i).get(j);
      if (collapse_mode && nodeDataMap.get(val).isPartOfCollapsedNode()) {
        continue;
      }
      if (!collapse_mode && nodeDataMap.get(val).isCollapsed)       continue;
      currPixelWidth+=nodeDataMap.get(val).name.length() * 10 + StapGraph.CONSTANT_HORIZONTAL_SPACING_FOR_LEVEL;
      if (MaxLevelPixelWidth < currPixelWidth) {
        MaxLevelPixelWidth=currPixelWidth;
      }
      count++;
      levels.get(i).remove(0);
      levels.get(i).add(0,count);
    }
    currPixelWidth=1;
  }
  MaxLevelPixelWidth=(int)(MaxLevelPixelWidth / scale);
  counter=0;
  if (id == getFirstUsefulNode())   nodeMap.get(id).setLocation(150 + (MaxLevelPixelWidth / 2),y);
  drawFromBottomToTop(bottomLevelToDraw,y + ((bottomLevelToDraw - topLevelToDraw) * 3 * (int)(CONSTANT_VERTICAL_INCREMENT / scale)),MaxLevelPixelWidth);
  if (id == getFirstUsefulNode())   nodeMap.get(id).setLocation(150 + (MaxLevelPixelWidth / 2),y);
}

Fixed version (ground truth):
/** 
 * Draws a tree roughly starting from node id
 */
public void drawBox(int id,int x,int y){
  setLevelLimits(id);
  int MaxLevelPixelWidth=1;
  int currPixelWidth=1;
  int count;
  for (int i=topLevelToDraw; i <= bottomLevelToDraw; i++) {
    count=0;
    levels.get(i).add(0,count);
    int size=levels.get(i).size();
    for (int j=1; j < size; j++) {
      int val=levels.get(i).get(j);
      StapData data=nodeDataMap.get(val);
      if (!data.isOnlyChildWithThisName()) {
        if (collapse_mode && data.isPartOfCollapsedNode()) {
          continue;
        }
        if (!collapse_mode && data.isCollapsed)         continue;
      }
      currPixelWidth+=data.name.length() * 10 + StapGraph.CONSTANT_HORIZONTAL_SPACING_FOR_LEVEL;
      if (MaxLevelPixelWidth < currPixelWidth) {
        MaxLevelPixelWidth=currPixelWidth;
      }
      count++;
      levels.get(i).remove(0);
      levels.get(i).add(0,count);
    }
    currPixelWidth=1;
  }
  MaxLevelPixelWidth=(int)(MaxLevelPixelWidth / scale);
  counter=0;
  if (id == getFirstUsefulNode())   nodeMap.get(id).setLocation(150 + (MaxLevelPixelWidth / 2),y);
  drawFromBottomToTop(bottomLevelToDraw,y + ((bottomLevelToDraw - topLevelToDraw) * 3 * (int)(CONSTANT_VERTICAL_INCREMENT / scale)),MaxLevelPixelWidth);
  if (id == getFirstUsefulNode())   nodeMap.get(id).setLocation(150 + (MaxLevelPixelWidth / 2),y);
}
Program: 93016
Project: 93016
Buggy source:
@Override public void updateMethod(){
  loadData(null);
  if (parser.totalTime > 0) {
    finishLoad(new NullProgressMonitor());
  }
  g.draw(StapGraph.CONSTANT_DRAWMODE_RADIAL,StapGraph.CONSTANT_ANIMATION_SLOW,g.getFirstUsefulNode());
}

Fixed version (ground truth):
@Override public void updateMethod(){
  if (parser.isRealTime()) {
    loadData(null);
    if (parser.totalTime > 0) {
      finishLoad(new NullProgressMonitor());
    }
    g.draw(StapGraph.CONSTANT_DRAWMODE_RADIAL,StapGraph.CONSTANT_ANIMATION_SLOW,g.getFirstUsefulNode());
  }
}
Program: 93017
Project: 93017
Buggy source:
public void cancelJob(){
  if (job != null)   job.cancel();
}

Fixed version (ground truth):
/** 
 * Cancels the RunTimeJob affiliated with this parser.
 */
public void cancelJob(){
  if (job != null)   job.cancel();
}
Program: 93018
Project: 93018
Buggy source:
/** 
 * For easier JUnit testing only. Allows public access to run method without scheduling an extra job.
 * @param m
 * @return
 */
public IStatus testRun(IProgressMonitor m){
  return run(m);
}

Fixed version (ground truth):
/** 
 * For easier JUnit testing only. Allows public access to run method without scheduling an extra job.
 * @param m
 * @return
 */
public IStatus testRun(IProgressMonitor m){
  GraphUIJob uijob=new GraphUIJob(Messages.getString("String_Node_Str"),this,viewID);
  uijob.schedule();
  view=uijob.getViewer();
  return Status.OK_STATUS;
}
Program: 93019
Project: 93019
Buggy source:
public static Test suite(){
  SystemTapUIErrorMessages.setActive(false);
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(SystemTapGraphViewTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  SystemTapUIErrorMessages.setActive(false);
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(StapGraphParserTest.class);
  suite.addTestSuite(SystemTapGraphViewTest.class);
  return suite;
}
Program: 93022
Project: 93022
Buggy source:
public static void setBufferedWriter(String absoluteFilePath){
  try {
    File f=new File(absoluteFilePath);
    f.delete();
    f.createNewFile();
    FileWriter fstream;
    fstream=new FileWriter(absoluteFilePath,true);
    bw=new BufferedWriter(fstream);
  }
 catch (  Exception e) {
    SystemTapUIErrorMessages err=new SystemTapUIErrorMessages(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    err.schedule();
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void setBufferedWriter(String absoluteFilePath){
  try {
    File f=new File(absoluteFilePath);
    f.delete();
    f.createNewFile();
    FileWriter fstream;
    fstream=new FileWriter(absoluteFilePath,true);
    bw=new BufferedWriter(fstream);
  }
 catch (  Exception e) {
    SystemTapUIErrorMessages err=new SystemTapUIErrorMessages(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    err.schedule();
    e.printStackTrace();
  }
}
Program: 93023
Project: 93023
Buggy source:
public static void closeBufferedWriter() throws IOException {
  bw.close();
}

Fixed version (ground truth):
public void closeBufferedWriter() throws IOException {
  bw.close();
}
Program: 93024
Project: 93024
Buggy source:
public static void appendToExistingFile(String content) throws IOException {
  bw.append(content);
}

Fixed version (ground truth):
public void appendToExistingFile(String content) throws IOException {
  bw.append(content);
}
Program: 93025
Project: 93025
Buggy source:
public void handle(FileReader f) throws IOException {
  BufferedReader br=new BufferedReader(f);
  String line;
  StringBuilder builder=new StringBuilder();
  int counter=0;
  while ((line=br.readLine()) != null) {
    counter++;
    builder.append(line);
    builder.append("String_Node_Str");
    if (counter == 300) {
      handle(builder.toString());
      builder=new StringBuilder();
      counter=0;
    }
  }
}

Fixed version (ground truth):
public void handle(FileReader f) throws IOException {
  BufferedReader br=new BufferedReader(f);
  String line;
  StringBuilder builder=new StringBuilder();
  int counter=0;
  while ((line=br.readLine()) != null) {
    counter++;
    builder.append(line);
    builder.append("String_Node_Str");
    if (counter == 300) {
      handle(builder.toString());
      builder=new StringBuilder();
      counter=0;
    }
  }
  handle(builder.toString());
}
Program: 93027
Project: 93027
Buggy source:
@Override public String generateScript() throws IOException {
  String scriptContents="String_Node_Str";
  File scriptFile=new File(scriptPath);
  scriptFile.delete();
  scriptFile.createNewFile();
  scriptContents+=writeGlobalVariables();
  scriptContents+=funcs;
  scriptContents+=writeFromPartialScript(projectName);
  BufferedWriter bw=new BufferedWriter(new FileWriter(scriptFile));
  bw.write(scriptContents);
  bw.close();
  return scriptContents;
}

Fixed version (ground truth):
@Override public String generateScript() throws IOException {
  String scriptContents="String_Node_Str";
  File scriptFile=new File(scriptPath);
  scriptFile.delete();
  scriptFile.createNewFile();
  scriptContents+=writeGlobalVariables();
  scriptContents+=funcs;
  scriptContents+=writeFromPartialScript(projectName);
  return scriptContents;
}
Program: 93028
Project: 93028
Buggy source:
public void launch(IBinary bin,String mode){
  super.Init();
  this.bin=bin;
  name="String_Node_Str";
  binName=getName(bin);
  partialScriptPath=PluginConstants.getPluginLocation() + "String_Node_Str";
  scriptPath=PluginConstants.DEFAULT_OUTPUT + "String_Node_Str";
  if (projectName == null || projectName.length() < 1)   projectName=bin.getCProject().getElementName();
  try {
    config=createConfiguration(bin,name);
    binaryPath=bin.getResource().getLocation().toString();
    arguments=binaryPath;
    outputPath=PluginConstants.STAP_GRAPH_DEFAULT_IO_PATH;
    if (funcs == null || funcs.length() < 1) {
      funcs=writeFunctionListToScript(resourceToSearchFor);
      if (funcs == null || funcs.length() < 0)       return;
    }
    String scriptContents=generateScript();
    if (scriptContents == null || scriptContents.length() < 0)     return;
    ILaunchConfigurationWorkingCopy wc;
    wc=config.getWorkingCopy();
    wc.setAttribute("String_Node_Str",funcs);
    wc.setAttribute("String_Node_Str",bin.getCProject().getElementName());
    wc.setAttribute(LaunchConfigurationConstants.GRAPHICS_MODE,true);
    wc.setAttribute(LaunchConfigurationConstants.GENERATED_SCRIPT,scriptContents);
    wc.doSave();
    finishLaunch(name,mode);
  }
 catch (  IOException e) {
    SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages("String_Node_Str",Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    mess.schedule();
    e.printStackTrace();
  }
catch (  CoreException e1) {
    e1.printStackTrace();
  }
 finally {
    resourceToSearchFor="String_Node_Str";
    searchForResource=false;
  }
}

Fixed version (ground truth):
public void launch(IBinary bin,String mode){
  super.Init();
  this.bin=bin;
  name="String_Node_Str";
  binName=getName(bin);
  partialScriptPath=PluginConstants.getPluginLocation() + "String_Node_Str";
  scriptPath=PluginConstants.DEFAULT_OUTPUT + "String_Node_Str";
  if (projectName == null || projectName.length() < 1)   projectName=bin.getCProject().getElementName();
  try {
    config=createConfiguration(bin,name);
    binaryPath=bin.getResource().getLocation().toString();
    arguments=binaryPath;
    outputPath=PluginConstants.STAP_GRAPH_DEFAULT_IO_PATH;
    funcs=writeFunctionListToScript(resourceToSearchFor);
    if (funcs == null || funcs.length() < 0)     return;
    String scriptContents=generateScript();
    if (scriptContents == null || scriptContents.length() < 0)     return;
    ILaunchConfigurationWorkingCopy wc;
    needToGenerate=true;
    generatedScript=scriptContents;
    wc=config.getWorkingCopy();
    wc.setAttribute(LaunchConfigurationConstants.GRAPHICS_MODE,true);
    wc.doSave();
    finishLaunch(name,mode);
  }
 catch (  IOException e) {
    SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages("String_Node_Str",Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    mess.schedule();
    e.printStackTrace();
  }
catch (  CoreException e1) {
    e1.printStackTrace();
  }
 finally {
    resourceToSearchFor="String_Node_Str";
    searchForResource=false;
  }
}
Program: 93031
Project: 93031
Buggy source:
@Override public void streamAppended(String text,IStreamMonitor monitor){
  try {
    Helper.appendToExistingFile(text);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void streamAppended(String text,IStreamMonitor monitor){
  try {
    h.appendToExistingFile(text);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 93032
Project: 93032
Buggy source:
public StreamListener() throws IOException {
  Helper.setBufferedWriter(outputPath + "String_Node_Str");
}

Fixed version (ground truth):
public StreamListener() throws IOException {
  h=new Helper();
  h.setBufferedWriter(outputPath + "String_Node_Str");
}
Program: 93034
Project: 93034
Buggy source:
/** 
 * Writes the contents of logContents to the error log, along with date and time.
 */
public void writeToLog(){
  File errorLog=new File(PluginConstants.DEFAULT_OUTPUT + "String_Node_Str");
  try {
    if (!errorLog.exists() || errorLog.length() > MAX_LOG_SIZE) {
      errorLog.delete();
      errorLog.createNewFile();
    }
    Calendar cal=Calendar.getInstance(TimeZone.getDefault());
    int year=cal.get(Calendar.YEAR);
    int month=cal.get(Calendar.MONTH);
    int day=cal.get(Calendar.DAY_OF_MONTH);
    int hour=cal.get(Calendar.HOUR_OF_DAY);
    int minute=cal.get(Calendar.MINUTE);
    int second=cal.get(Calendar.SECOND);
    Helper.appendToFile(errorLog.getAbsolutePath(),Messages.getString("String_Node_Str") + PluginConstants.NEW_LINE + day+ "String_Node_Str"+ month+ "String_Node_Str"+ year+ "String_Node_Str"+ hour+ "String_Node_Str"+ minute+ "String_Node_Str"+ second+ PluginConstants.NEW_LINE+ logContents+ PluginConstants.NEW_LINE+ PluginConstants.NEW_LINE);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  logContents="String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Writes the contents of logContents to the error log, along with date and time.
 */
public void writeToLog(){
  File errorLog=new File(PluginConstants.DEFAULT_OUTPUT + "String_Node_Str");
  try {
    if (!errorLog.exists() || errorLog.length() > MAX_LOG_SIZE) {
      errorLog.delete();
      errorLog.createNewFile();
    }
    Calendar cal=Calendar.getInstance(TimeZone.getDefault());
    int year=cal.get(Calendar.YEAR);
    int month=cal.get(Calendar.MONTH);
    int day=cal.get(Calendar.DAY_OF_MONTH);
    int hour=cal.get(Calendar.HOUR_OF_DAY);
    int minute=cal.get(Calendar.MINUTE);
    int second=cal.get(Calendar.SECOND);
    Helper.appendToFile(errorLog.getAbsolutePath(),Messages.getString("String_Node_Str") + PluginConstants.NEW_LINE + day+ "String_Node_Str"+ month+ "String_Node_Str"+ year+ "String_Node_Str"+ hour+ "String_Node_Str"+ minute+ "String_Node_Str"+ second+ PluginConstants.NEW_LINE+ logContents+ PluginConstants.NEW_LINE+ PluginConstants.NEW_LINE);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  logContents=new StringBuilder();
}
Program: 93035
Project: 93035
Buggy source:
/** 
 * Search given string for recognizable error messages. Can append the contents of  the string to the error log if writeToLog() or finishHandling() are called. A call to finishHandling() will also open a popup window with user-friendly messages corresponding to the recognizable errors.
 * @param doc
 */
public void handle(String message){
  mismatchedProbePoints=false;
  if (errorMessage.length() < 1) {
    errorMessage=Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str");
  }
  File file=new File(PluginConstants.PLUGIN_LOCATION + FILE_PROP);
  try {
    BufferedReader buff=new BufferedReader(new FileReader(file));
    String line;
    int index;
    boolean firstLine=true;
    while ((line=buff.readLine()) != null) {
      index=line.indexOf('=');
      String matchString=line.substring(0,index);
      Pattern pat=Pattern.compile(matchString,Pattern.DOTALL);
      Matcher matcher=pat.matcher(message);
      if (matcher.matches()) {
        if (!isErrorRecognized()) {
          errorMessage+=Messages.getString("String_Node_Str");
          setErrorRecognized(true);
        }
        errorMessage+=line.substring(index + 1) + PluginConstants.NEW_LINE + PluginConstants.NEW_LINE;
        if (firstLine) {
          functions.clear();
          findFunctions(message,pat);
          mismatchedProbePoints=true;
        }
      }
      firstLine=false;
    }
    logContents+=message;
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void handle(FileReader f) throws IOException {
  BufferedReader br=new BufferedReader(f);
  String line;
  StringBuilder builder=new StringBuilder();
  int counter=0;
  while ((line=br.readLine()) != null) {
    counter++;
    builder.append(line);
    builder.append("String_Node_Str");
    if (counter == 300) {
      handle(builder.toString());
      builder=new StringBuilder();
      counter=0;
    }
  }
}
Program: 93037
Project: 93037
Buggy source:
public SystemTapErrorHandler(){
  errorRecognized=false;
  errorMessage="String_Node_Str";
  logContents="String_Node_Str";
}

Fixed version (ground truth):
public SystemTapErrorHandler(){
  mismatchedProbePoints=false;
  errorRecognized=false;
  if (errorMessage.length() < 1) {
    errorMessage=Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str");
  }
  logContents=new StringBuilder();
}
Program: 93041
Project: 93041
Buggy source:
private String getLicense(){
  String license=valueNoFoundMessage;
  URLEntryModel licenseModel=featureModel.getLicenseModel();
  if (licenseModel != null) {
    String urlString=resolveFeatureProperties(licenseModel.getURLString());
    String urlAnotation=resolveFeatureProperties(licenseModel.getAnnotation());
    if (urlString.indexOf("String_Node_Str") > -1 || urlAnotation.indexOf("String_Node_Str")) {
      license="String_Node_Str";
    }
  }
  return license;
}

Fixed version (ground truth):
private String getLicense(){
  String license=valueNoFoundMessage;
  URLEntryModel licenseModel=featureModel.getLicenseModel();
  if (licenseModel != null) {
    String urlString=resolveFeatureProperties(licenseModel.getURLString());
    String urlAnotation=resolveFeatureProperties(licenseModel.getAnnotation());
    if (urlString.indexOf("String_Node_Str") > -1 || urlAnotation.indexOf("String_Node_Str") > -1) {
      license="String_Node_Str";
    }
  }
  return license;
}
Program: 93042
Project: 93042
Buggy source:
/** 
 * Called when this app is activated by CicadaService.  onDraw() will be triggered at the conlusion of this method.
 * @param mode the mode that the app is being activated in
 */
public abstract void onActivate(AppType mode);

Fixed version (ground truth):
/** 
 * Called when this app is activated by CicadaService.  onDraw() will be triggered at the conclusion of this method.
 * @param mode the mode that the app is being activated in
 */
public abstract void onActivate(AppType mode);
Program: 93043
Project: 93043
Buggy source:
@Override public void run(){
  try {
    Date since=null;
    if (lookback > 0) {
      Date now=new Date();
      since=new Date(now.getTime() - lookback);
    }
    List<RecordSource> recordSourceList=new ResourceManager().loadRecordSources();
    if ("String_Node_Str".equalsIgnoreCase(method)) {
      while (true) {
        work(recordSourceList,since);
        Thread.sleep(interval);
      }
    }
 else {
      DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
      while (true) {
        String currentTime=dateFormat.format(new Date());
        if (currentTime.equalsIgnoreCase(timeOfDay)) {
          work(recordSourceList,since);
        }
      }
    }
  }
 catch (  InterruptedException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
    System.exit(1);
  }
catch (  BadRecordSourceException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
    System.exit(1);
  }
catch (  ParserConfigurationException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
    System.exit(1);
  }
catch (  SAXException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
    System.exit(1);
  }
catch (  IOException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
    System.exit(1);
  }
catch (  SQLException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
    System.exit(1);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Date since=null;
    if (lookback > 0) {
      Date now=new Date();
      since=new Date(now.getTime() - lookback);
    }
    List<RecordSource> recordSourceList=new ResourceManager().loadRecordSources();
    if ("String_Node_Str".equalsIgnoreCase(method)) {
      while (true) {
        work(recordSourceList,since);
        Thread.sleep(interval);
      }
    }
 else {
      DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
      while (true) {
        String currentTime=dateFormat.format(new Date());
        if (currentTime.equalsIgnoreCase(timeOfDay)) {
          work(recordSourceList,since);
        }
      }
    }
  }
 catch (  InterruptedException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  BadRecordSourceException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
    System.exit(1);
  }
catch (  ParserConfigurationException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
    System.exit(1);
  }
catch (  SAXException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
    System.exit(1);
  }
catch (  IOException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  SQLException ex) {
    Mediator.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
  }
}
Program: 93044
Project: 93044
Buggy source:
private static void log(Level level,String msg,boolean quit,int exitCode){
  Logger.getLogger(CpadDataExtract.class.getName()).log(level,msg);
  if (quit) {
    System.exit(exitCode);
  }
}

Fixed version (ground truth):
private static void log(Level level,String msg,boolean quit,int exitCode){
  Mediator.getLogger(CpadDataExtract.class.getName()).log(level,msg);
  if (quit) {
    System.exit(exitCode);
  }
}
Program: 93047
Project: 93047
Buggy source:
public static void main(String[] args){
  try {
    companionProps=loadProperties("String_Node_Str");
    String method=companionProps.getProperty("String_Node_Str");
    int interval=Integer.parseInt(companionProps.getProperty("String_Node_Str"));
    String timeOfDay=companionProps.getProperty("String_Node_Str");
    if ("String_Node_Str".equalsIgnoreCase("String_Node_Str")) {
      while (true) {
        CpadDataExtract.work();
        Thread.sleep(interval);
      }
    }
 else     if ("String_Node_Str".equalsIgnoreCase("String_Node_Str")) {
      DateFormat sdf=new SimpleDateFormat("String_Node_Str");
      String currentTime=sdf.format(new java.util.Date());
      while (true) {
        if (currentTime.equalsIgnoreCase(timeOfDay)) {
          CpadDataExtract.work();
        }
      }
    }
 else {
      log(Level.SEVERE,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",1);
    }
  }
 catch (  InterruptedException ex) {
    Logger.getLogger(CpadDataExtract.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  FileNotFoundException ex) {
    Logger.getLogger(CpadDataExtract.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    new Mediator();
    companionProps=loadProperties("String_Node_Str");
    String method=companionProps.getProperty("String_Node_Str");
    int interval=Integer.parseInt(companionProps.getProperty("String_Node_Str"));
    String timeOfDay=companionProps.getProperty("String_Node_Str");
    if ("String_Node_Str".equalsIgnoreCase(method)) {
      while (true) {
        CpadDataExtract.work();
        Thread.sleep(interval);
      }
    }
 else {
      DateFormat sdf=new SimpleDateFormat("String_Node_Str");
      String currentTime=sdf.format(new java.util.Date());
      while (true) {
        if (currentTime.equalsIgnoreCase(timeOfDay)) {
          CpadDataExtract.work();
        }
      }
    }
  }
 catch (  InterruptedException ex) {
    Mediator.getLogger(CpadDataExtract.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  FileNotFoundException ex) {
    Mediator.getLogger(CpadDataExtract.class.getName()).log(Level.SEVERE,null,ex);
  }
}
Program: 93048
Project: 93048
Buggy source:
private static Properties loadProperties(String propertiesFile) throws FileNotFoundException {
  try {
    Properties properties=new Properties();
    File propFile=new File(propertiesFile);
    String propFilePath=propFile.getAbsolutePath();
    FileInputStream fis=new FileInputStream(propFilePath);
    properties.load(fis);
    return properties;
  }
 catch (  IOException ex) {
    Logger.getLogger(CpadDataExtract.class.getName()).log(Level.SEVERE,"String_Node_Str" + propertiesFile,ex);
    throw new FileNotFoundException("String_Node_Str" + propertiesFile);
  }
}

Fixed version (ground truth):
private static Properties loadProperties(String propertiesFile) throws FileNotFoundException {
  try {
    Properties properties=new Properties();
    File propFile=new File(propertiesFile);
    String propFilePath=propFile.getAbsolutePath();
    FileInputStream fis=new FileInputStream(propFilePath);
    properties.load(fis);
    return properties;
  }
 catch (  IOException ex) {
    Mediator.getLogger(CpadDataExtract.class.getName()).log(Level.SEVERE,"String_Node_Str" + propertiesFile,ex);
    throw new FileNotFoundException("String_Node_Str" + propertiesFile);
  }
}
Program: 93049
Project: 93049
Buggy source:
private void minimizeToTray(){
  if (!SystemTray.isSupported()) {
    System.out.println("String_Node_Str");
    return;
  }
  final PopupMenu popup=new PopupMenu();
  final TrayIcon trayIcon=new TrayIcon(Toolkit.getDefaultToolkit().getImage("String_Node_Str"),"String_Node_Str",popup);
  final SystemTray tray=SystemTray.getSystemTray();
  MenuItem showItem=new MenuItem("String_Node_Str");
  MenuItem hideItem=new MenuItem("String_Node_Str");
  MenuItem exitItem=new MenuItem("String_Node_Str");
  showItem.addActionListener(showListener);
  hideItem.addActionListener(hideListener);
  exitItem.addActionListener(exitListener);
  popup.add(showItem);
  popup.addSeparator();
  popup.add(hideItem);
  popup.addSeparator();
  popup.add(exitItem);
  trayIcon.setPopupMenu(popup);
  try {
    tray.add(trayIcon);
  }
 catch (  AWTException ex) {
    System.out.println(ex.toString() + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void minimizeToTray(){
  if (!SystemTray.isSupported()) {
    Mediator.getLogger(DaemonManager.class.getName()).log(Level.INFO,"String_Node_Str");
    return;
  }
  final PopupMenu popup=new PopupMenu();
  final TrayIcon trayIcon=new TrayIcon(Toolkit.getDefaultToolkit().getImage("String_Node_Str"),"String_Node_Str",popup);
  final SystemTray tray=SystemTray.getSystemTray();
  MenuItem showItem=new MenuItem("String_Node_Str");
  MenuItem hideItem=new MenuItem("String_Node_Str");
  MenuItem exitItem=new MenuItem("String_Node_Str");
  showItem.addActionListener(showListener);
  hideItem.addActionListener(hideListener);
  exitItem.addActionListener(exitListener);
  popup.add(showItem);
  popup.addSeparator();
  popup.add(hideItem);
  popup.addSeparator();
  popup.add(exitItem);
  trayIcon.setPopupMenu(popup);
  try {
    tray.add(trayIcon);
  }
 catch (  AWTException ex) {
    Mediator.getLogger(DaemonManager.class.getName()).log(Level.INFO,null,ex);
  }
}
Program: 93050
Project: 93050
Buggy source:
public ShadowResultSet mine(Table table) throws InaccessibleConfigurationFileException, SQLException, DriverNotFoundException {
  ShadowResultSet srs=null;
  try {
    String sql="String_Node_Str";
    for (    Column c : table.getColumnList()) {
      sql+=c.getId() + "String_Node_Str";
    }
    sql=sql.substring(0,sql.length() - 2);
    sql+="String_Node_Str";
    ResultSet rs=statement.executeQuery(sql);
    Mediator.getLogger(ShadowDataMiner.class.getName()).log(Level.FINEST,sql);
    srs=new ShadowResultSet(rs);
  }
  finally {
  }
  return srs;
}

Fixed version (ground truth):
public ShadowResultSet mine(Table table) throws InaccessibleConfigurationFileException, SQLException, DriverNotFoundException {
  ShadowResultSet srs=null;
  try {
    String sql="String_Node_Str";
    for (    Column c : table.getColumnList()) {
      sql+=c.getId() + "String_Node_Str";
    }
    sql=sql.substring(0,sql.length() - 2);
    sql+="String_Node_Str";
    Mediator.getLogger(ShadowDataMiner.class.getName()).log(Level.FINEST,sql);
    ResultSet rs=statement.executeQuery(sql);
    srs=new ShadowResultSet(rs);
  }
  finally {
  }
  return srs;
}
Program: 93051
Project: 93051
Buggy source:
/** 
 * Gets all the rows from a source table, returned as a ResultSet
 * @param table
 * @return
 * @throws SQLException 
 */
public SourceResultSet mine(Table table) throws SQLException {
  SourceResultSet srs=null;
  try {
    String compositePK=getQueryCustomizer().buildCompositePrimaryKey(table);
    String asciiCompositePK=getQueryCustomizer().buildAsciiCompositePrimaryKey(compositePK);
    String sql="String_Node_Str" + asciiCompositePK + "String_Node_Str"+ compositePK+ "String_Node_Str";
    String prefix=getQueryCustomizer().getOpenningSafetyPad();
    String suffix=getQueryCustomizer().getClosingSafetyPad();
    for (    Column column : table.getColumnList()) {
      sql+="String_Node_Str" + prefix + column.getName()+ suffix+ "String_Node_Str"+ column.getId();
    }
    sql+="String_Node_Str" + prefix + table.getName()+ suffix+ "String_Node_Str"+ compositePK+ "String_Node_Str";
    ResultSet rs=statement.executeQuery(sql);
    Mediator.getLogger(SourceDataMiner.class.getName()).log(Level.FINEST,sql);
    srs=new SourceResultSet(rs);
  }
  finally {
  }
  return srs;
}

Fixed version (ground truth):
/** 
 * Gets all the rows from a source table, returned as a ResultSet
 * @param table
 * @return
 * @throws SQLException
 */
public SourceResultSet mine(Table table) throws SQLException {
  SourceResultSet srs=null;
  try {
    String compositePK=getQueryCustomizer().buildCompositePrimaryKey(table);
    String asciiCompositePK=getQueryCustomizer().buildAsciiCompositePrimaryKey(compositePK);
    String sql="String_Node_Str" + asciiCompositePK + "String_Node_Str"+ compositePK+ "String_Node_Str";
    String prefix=getQueryCustomizer().getOpenningSafetyPad();
    String suffix=getQueryCustomizer().getClosingSafetyPad();
    for (    Column column : table.getColumnList()) {
      sql+="String_Node_Str" + prefix + column.getName()+ suffix+ "String_Node_Str"+ column.getId();
    }
    sql+="String_Node_Str" + prefix + table.getName()+ suffix+ "String_Node_Str"+ compositePK+ "String_Node_Str";
    Mediator.getLogger(SourceDataMiner.class.getName()).log(Level.FINEST,sql);
    ResultSet rs=statement.executeQuery(sql);
    srs=new SourceResultSet(rs);
  }
  finally {
  }
  return srs;
}
Program: 93052
Project: 93052
Buggy source:
public void synchronize() throws InaccessibleConfigurationFileException, DriverNotFoundException, SQLException {
  try {
    List<SchemaTransaction> schemaTransactionList=new SchemaSynchronizer().generate();
    connectToShadow();
    connection.setAutoCommit(false);
    Statement statement=connection.createStatement();
    for (    SchemaTransaction schemaTransaction : schemaTransactionList) {
      Mediator.getLogger(SchemaSynchronizer.class.getName()).log(Level.FINEST,TransactionConverter.convertToSQL(schemaTransaction));
      System.out.println(TransactionConverter.convertToSQL(schemaTransaction));
      if (statement.executeUpdate(TransactionConverter.convertToSQL(schemaTransaction),Statement.RETURN_GENERATED_KEYS) == 1) {
        ResultSet rs=statement.getGeneratedKeys();
        if (rs.next()) {
          if (schemaTransaction.getTarget().getClass() == Database.class) {
            ((Database)schemaTransaction.getTarget()).setId(rs.getInt(1));
          }
 else           if (schemaTransaction.getTarget().getClass() == Table.class) {
            ((Table)schemaTransaction.getTarget()).setId(rs.getInt(1));
          }
 else           if (schemaTransaction.getTarget().getClass() == Column.class) {
            ((Column)schemaTransaction.getTarget()).setId(rs.getInt(1));
          }
        }
      }
    }
    connection.commit();
    statement.close();
  }
  finally {
    disconnectFromShadow();
  }
}

Fixed version (ground truth):
public void synchronize() throws InaccessibleConfigurationFileException, DriverNotFoundException, SQLException {
  try {
    List<SchemaTransaction> schemaTransactionList=new SchemaSynchronizer().generate();
    connectToShadow();
    connection.setAutoCommit(false);
    Statement statement=connection.createStatement();
    for (    SchemaTransaction schemaTransaction : schemaTransactionList) {
      Mediator.getLogger(SchemaSynchronizer.class.getName()).log(Level.FINEST,TransactionConverter.convertToSQL(schemaTransaction));
      if (statement.executeUpdate(TransactionConverter.convertToSQL(schemaTransaction),Statement.RETURN_GENERATED_KEYS) == 1) {
        ResultSet rs=statement.getGeneratedKeys();
        if (rs.next()) {
          if (schemaTransaction.getTarget().getClass() == Database.class) {
            ((Database)schemaTransaction.getTarget()).setId(rs.getInt(1));
          }
 else           if (schemaTransaction.getTarget().getClass() == Table.class) {
            ((Table)schemaTransaction.getTarget()).setId(rs.getInt(1));
          }
 else           if (schemaTransaction.getTarget().getClass() == Column.class) {
            ((Column)schemaTransaction.getTarget()).setId(rs.getInt(1));
          }
        }
      }
    }
    connection.commit();
    statement.close();
  }
  finally {
    disconnectFromShadow();
  }
}
Program: 93053
Project: 93053
Buggy source:
private void populateTableList(Database db,boolean replicable) throws SQLException {
  Statement statement=connection.createStatement();
  String sql="String_Node_Str";
  ResultSet rs=statement.executeQuery(sql);
  Mediator.getLogger(ShadowSchemaMiner.class.getName()).log(Level.FINEST,sql);
  while (rs.next()) {
    Table table=new Table(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getString("String_Node_Str"));
    table.setDatabase(db);
    if (replicable) {
      populateColumnList(table);
    }
 else {
      populateReplicableColumnList(table);
    }
    db.getTableList().add(table);
  }
  rs.close();
  statement.close();
}

Fixed version (ground truth):
private void populateTableList(Database db,boolean replicable) throws SQLException {
  Statement statement=connection.createStatement();
  String sql="String_Node_Str" + db.getId() + "String_Node_Str";
  Mediator.getLogger(ShadowSchemaMiner.class.getName()).log(Level.FINEST,sql);
  ResultSet rs=statement.executeQuery(sql);
  while (rs.next()) {
    Table table=new Table(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getString("String_Node_Str"));
    table.setDatabase(db);
    if (replicable) {
      populateColumnList(table);
    }
 else {
      populateReplicableColumnList(table);
    }
    db.getTableList().add(table);
  }
  rs.close();
  statement.close();
}
Program: 93054
Project: 93054
Buggy source:
private Database extractDatabase() throws SQLException {
  Database db=null;
  Statement statement=connection.createStatement();
  String sql="String_Node_Str" + database + "String_Node_Str";
  ResultSet rs=statement.executeQuery(sql);
  Mediator.getLogger(ShadowSchemaMiner.class.getName()).log(Level.FINEST,sql);
  if (rs.next()) {
    db=new Database(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"));
  }
  rs.close();
  statement.close();
  return db;
}

Fixed version (ground truth):
private Database extractDatabase() throws SQLException {
  Database db=null;
  Statement statement=connection.createStatement();
  String sql="String_Node_Str" + database + "String_Node_Str";
  Mediator.getLogger(ShadowSchemaMiner.class.getName()).log(Level.FINEST,sql);
  ResultSet rs=statement.executeQuery(sql);
  if (rs.next()) {
    db=new Database(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"));
  }
  rs.close();
  statement.close();
  return db;
}