nus-yam/ex-repair huggingface dataset:
Program: 12069
Project: 12069
Buggy source:
/** 
 * trim inside of the second level braces.
 * @param source
 * @return
 */
protected static String trimInsideOfBraces(String source){
  int len=source.length();
  boolean isInsideOfFirstLevel=false;
  boolean isInsideOfSecondLevel=false;
  Stack<Character> braceStack=new Stack<Character>();
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < len; i++) {
    if (!isInsideOfFirstLevel) {
      sb.append(source.charAt(i));
      if (source.charAt(i) == '{') {
        isInsideOfFirstLevel=true;
      }
      continue;
    }
    if (!isInsideOfSecondLevel) {
      sb.append(source.charAt(i));
    }
    if (source.charAt(i) == '{') {
      isInsideOfSecondLevel=true;
      braceStack.push(source.charAt(i));
    }
    if (!braceStack.empty() && source.charAt(i) == '}') {
      braceStack.pop();
    }
    if (braceStack.empty()) {
      isInsideOfSecondLevel=false;
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * trim inside of the second level braces.
 * @param source
 * @return
 */
protected static String trimInsideOfBraces(String source){
  int len=source.length();
  boolean isInsideOfTargetClass=false;
  boolean isInsideOfFirstLevel=false;
  boolean isInsideOfSecondLevel=false;
  Stack<Character> braceStack=new Stack<Character>();
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < len; i++) {
    if (!isInsideOfTargetClass) {
      sb.append(source.charAt(i));
      if (i >= 6 && source.charAt(i - 6) == ' ' && source.charAt(i - 5) == 'c' && source.charAt(i - 4) == 'l' && source.charAt(i - 3) == 'a' && source.charAt(i - 2) == 's' && source.charAt(i - 1) == 's' && source.charAt(i) == ' ') {
        isInsideOfTargetClass=true;
      }
      continue;
    }
    if (!isInsideOfFirstLevel) {
      sb.append(source.charAt(i));
      if (source.charAt(i) == '{') {
        isInsideOfFirstLevel=true;
      }
      continue;
    }
    if (!isInsideOfSecondLevel) {
      sb.append(source.charAt(i));
    }
    if (source.charAt(i) == '{') {
      isInsideOfSecondLevel=true;
      braceStack.push(source.charAt(i));
    }
    if (!braceStack.empty() && source.charAt(i) == '}') {
      braceStack.pop();
    }
    if (braceStack.empty()) {
      isInsideOfSecondLevel=false;
    }
  }
  return sb.toString();
}
Program: 12076
Project: 12076
Buggy source:
public static List<String> getAllSourceCodeLineList(IFile javaFile) throws Exception {
  List<String> lines=new ArrayList<String>();
  InputStream is=null;
  BufferedReader br=null;
  try {
    is=javaFile.getContents();
    br=new BufferedReader(new InputStreamReader(is));
    String line=null;
    while ((line=br.readLine()) != null)     lines.add(line.replace("String_Node_Str",STR.EMPTY));
  }
  finally {
    FileResourceUtil.close(is);
    FileResourceUtil.close(br);
  }
  return lines;
}

Fixed version (ground truth):
public static List<String> getAllSourceCodeLineList(IFile javaFile) throws Exception {
  List<String> lines=new ArrayList<String>();
  InputStream is=null;
  BufferedReader br=null;
  try {
    is=javaFile.getContents();
    String encoding=FileResourceUtil.detectEncoding(javaFile);
    if (encoding == null)     encoding=Charset.defaultCharset().name();
    is=javaFile.getContents();
    br=new BufferedReader(new InputStreamReader(is,encoding));
    String line=null;
    while ((line=br.readLine()) != null)     lines.add(line.replace("String_Node_Str",STR.EMPTY));
  }
  finally {
    FileResourceUtil.close(is);
    FileResourceUtil.close(br);
  }
  return lines;
}
Program: 12080
Project: 12080
Buggy source:
@Override public void initializeDefaultPreferences(){
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
  store.setDefault(STR.Preference.Common.SRC_MAIN_PATH,"String_Node_Str");
  store.setDefault(STR.Preference.Common.SRC_TEST_PATH,"String_Node_Str");
  store.setDefault(STR.Preference.TestMethodAutoGenerate.ENABLE,true);
  store.setDefault(STR.Preference.TestMethodAutoGenerate.DELIMITER,"String_Node_Str");
  store.setDefault(STR.Preference.TestMethodAutoGenerate.ARGS,true);
  store.setDefault(STR.Preference.TestMethodAutoGenerate.ARGS_PREFIX,"String_Node_Str");
  store.setDefault(STR.Preference.TestMethodAutoGenerate.ARGS_DELIMITER,"String_Node_Str");
  store.setDefault(STR.Preference.TestMethodAutoGenerate.RETURN,false);
  store.setDefault(STR.Preference.TestMethodAutoGenerate.RETURN_PREFIX,"String_Node_Str");
  store.setDefault(STR.Preference.TestMethodAutoGenerate.RETURN_DELIMITER,"String_Node_Str");
  store.setDefault(STR.Preference.TestMethodAutoGenerate.METHOD_SAMPLE_IMPLEMENTATION,false);
}

Fixed version (ground truth):
@Override public void initializeDefaultPreferences(){
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
{
    store.setDefault(STR.Preference.Common.SRC_MAIN_PATH,"String_Node_Str");
    store.setDefault(STR.Preference.Common.SRC_TEST_PATH,"String_Node_Str");
  }
{
    store.setDefault(STR.Preference.TestMethodGen.ENABLE,true);
    store.setDefault(STR.Preference.TestMethodGen.DELIMITER,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.ARGS,true);
    store.setDefault(STR.Preference.TestMethodGen.ARGS_PREFIX,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.ARGS_DELIMITER,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.RETURN,false);
    store.setDefault(STR.Preference.TestMethodGen.RETURN_PREFIX,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.RETURN_DELIMITER,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.EXLCUDES_ACCESSORS,true);
    store.setDefault(STR.Preference.TestMethodGen.METHOD_SAMPLE_IMPLEMENTATION,true);
  }
}
Program: 12083
Project: 12083
Buggy source:
public static List<GeneratingMethodInfo> getUnimplementedTestMethodNames(IFile testTarget,IFile testCase) throws Exception {
  List<GeneratingMethodInfo> unimplementedMethodNames=new ArrayList<GeneratingMethodInfo>();
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
  boolean enabled=store.getBoolean(STR.Preference.TestMethodAutoGenerate.ENABLE);
  if (enabled) {
    List<GeneratingMethodInfo> expectedList=getTestMethodsFromTarget(testTarget);
    List<GeneratingMethodInfo> actualList=getMethodNames(testCase);
    for (    GeneratingMethodInfo expected : expectedList) {
      boolean exist=false;
      for (      GeneratingMethodInfo actual : actualList) {
        String escapedExp=expected.testMethodName.replaceAll("String_Node_Str","String_Node_Str");
        if (actual.testMethodName.matches(escapedExp + "String_Node_Str")) {
          exist=true;
          break;
        }
      }
      if (!exist)       unimplementedMethodNames.add(expected);
    }
  }
  return unimplementedMethodNames;
}

Fixed version (ground truth):
public static List<GeneratingMethodInfo> getUnimplementedTestMethodNames(IFile testTarget,IFile testCase) throws Exception {
  List<GeneratingMethodInfo> unimplementedMethodNames=new ArrayList<GeneratingMethodInfo>();
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
  boolean enabled=store.getBoolean(STR.Preference.TestMethodGen.ENABLE);
  if (enabled) {
    List<GeneratingMethodInfo> expectedList=getTestMethodsFromTarget(testTarget);
    List<GeneratingMethodInfo> actualList=getMethodNames(testCase);
    for (    GeneratingMethodInfo expected : expectedList) {
      boolean exist=false;
      for (      GeneratingMethodInfo actual : actualList) {
        String escapedExp=expected.testMethodName.replaceAll("String_Node_Str","String_Node_Str");
        if (actual.testMethodName.matches(escapedExp + "String_Node_Str")) {
          exist=true;
          break;
        }
      }
      if (!exist)       unimplementedMethodNames.add(expected);
    }
  }
  return unimplementedMethodNames;
}
Program: 12086
Project: 12086
Buggy source:
@Override public void initializeDefaultPreferences(){
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
{
    store.setDefault(STR.Preference.Common.SRC_MAIN_PATH,"String_Node_Str");
    store.setDefault(STR.Preference.Common.SRC_TEST_PATH,"String_Node_Str");
  }
{
    store.setDefault(STR.Preference.TestMethodGen.ENABLE,true);
    store.setDefault(STR.Preference.TestMethodGen.DELIMITER,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.ARGS,true);
    store.setDefault(STR.Preference.TestMethodGen.ARGS_PREFIX,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.ARGS_DELIMITER,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.RETURN,false);
    store.setDefault(STR.Preference.TestMethodGen.RETURN_PREFIX,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.RETURN_DELIMITER,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.EXLCUDES_ACCESSORS,true);
    store.setDefault(STR.Preference.TestMethodGen.METHOD_SAMPLE_IMPLEMENTATION,true);
  }
}

Fixed version (ground truth):
@Override public void initializeDefaultPreferences(){
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
{
    store.setDefault(STR.Preference.Common.SRC_MAIN_PATH,"String_Node_Str");
    store.setDefault(STR.Preference.Common.SRC_TEST_PATH,"String_Node_Str");
    store.setDefault(STR.Preference.Common.CLASS_TO_EXTEND,"String_Node_Str");
  }
{
    store.setDefault(STR.Preference.TestMethodGen.ENABLE,true);
    store.setDefault(STR.Preference.TestMethodGen.DELIMITER,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.ARGS,true);
    store.setDefault(STR.Preference.TestMethodGen.ARGS_PREFIX,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.ARGS_DELIMITER,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.RETURN,false);
    store.setDefault(STR.Preference.TestMethodGen.RETURN_PREFIX,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.RETURN_DELIMITER,"String_Node_Str");
    store.setDefault(STR.Preference.TestMethodGen.EXLCUDES_ACCESSORS,true);
    store.setDefault(STR.Preference.TestMethodGen.METHOD_SAMPLE_IMPLEMENTATION,true);
  }
}
Program: 12090
Project: 12090
Buggy source:
public static List<GeneratingMethodInfo> getUnimplementedTestMethodNames(IFile testTarget,IFile testCase) throws Exception {
  List<GeneratingMethodInfo> unimplementedMethodNames=new ArrayList<GeneratingMethodInfo>();
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
  boolean enabled=store.getBoolean(STR.Preference.TestMethodGen.ENABLE);
  if (enabled) {
    List<GeneratingMethodInfo> expectedList=getTestMethodsFromTarget(testTarget);
    List<GeneratingMethodInfo> actualList=getMethodNames(testCase);
    for (    GeneratingMethodInfo expected : expectedList) {
      boolean exist=false;
      for (      GeneratingMethodInfo actual : actualList) {
        String escapedExp=expected.testMethodName.replaceAll("String_Node_Str","String_Node_Str");
        if (actual.testMethodName.matches(escapedExp + "String_Node_Str")) {
          exist=true;
          break;
        }
      }
      if (!exist)       unimplementedMethodNames.add(expected);
    }
  }
  return unimplementedMethodNames;
}

Fixed version (ground truth):
public static List<GeneratingMethodInfo> getUnimplementedTestMethodNames(IFile testTarget,IFile testCase) throws Exception {
  List<GeneratingMethodInfo> unimplementedMethodNames=new ArrayList<GeneratingMethodInfo>();
  IPreferenceStore store=Activator.getDefault().getPreferenceStore();
  boolean enabled=store.getBoolean(STR.Preference.TestMethodGen.ENABLE);
  boolean enabledNotBlankMethods=store.getBoolean(STR.Preference.TestMethodGen.METHOD_SAMPLE_IMPLEMENTATION);
  if (enabled) {
    List<GeneratingMethodInfo> expectedList=getTestMethodsFromTarget(testTarget);
    List<GeneratingMethodInfo> actualList=getMethodNames(testCase);
    for (    GeneratingMethodInfo expected : expectedList) {
      boolean exist=false;
      for (      GeneratingMethodInfo actual : actualList) {
        String escapedExp=expected.testMethodName.replaceAll("String_Node_Str","String_Node_Str");
        if (actual.testMethodName.matches(escapedExp + "String_Node_Str")) {
          exist=true;
          break;
        }
      }
      if (!exist)       unimplementedMethodNames.add(expected);
    }
    if (enabledNotBlankMethods) {
      List<String> notImportedList=new ArrayList<String>();
      List<String> expImportedList=expectedList.get(0).importList;
      List<String> actImportedList=actualList.get(0).importList;
      for (      String expImported : expImportedList) {
        boolean found=false;
        for (        String actImported : actImportedList) {
          if (expImported.equals(actImported)) {
            found=true;
            break;
          }
        }
        if (!found)         notImportedList.add(expImported);
      }
      unimplementedMethodNames.get(0).importList=notImportedList;
    }
  }
  return unimplementedMethodNames;
}
Program: 12091
Project: 12091
Buggy source:
public void stop(BundleContext context) throws Exception {
  plugin=null;
  super.stop(context);
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
 */
public void stop(BundleContext context) throws Exception {
  plugin=null;
  super.stop(context);
}
Program: 12092
Project: 12092
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
}
Program: 12096
Project: 12096
Buggy source:
public static List<String> getMethodNames(IFile javaFile) throws Exception {
  List<String> methodNames=new ArrayList<String>();
  boolean enabled=Activator.getDefault().getPreferenceStore().getBoolean(STR.Preference.TestMethodAutoGenerate.ENABLE);
  if (enabled) {
    InputStream is=null;
    BufferedReader br=null;
    try {
      is=javaFile.getContents();
      br=new BufferedReader(new InputStreamReader(is));
      StringBuffer tmpsb=new StringBuffer();
      String line=null;
      while ((line=br.readLine()) != null)       tmpsb.append(line + "String_Node_Str");
      String allSrc=tmpsb.toString();
      String[] publics=allSrc.split("String_Node_Str");
      for (      String publicsEach : publics) {
        if (publicsEach.matches("String_Node_Str")) {
          Matcher matcher=Pattern.compile("String_Node_Str").matcher(publicsEach);
          if (matcher.find()) {
            String methodName=matcher.group(1);
            methodNames.add(methodName);
          }
        }
      }
    }
  finally {
      if (is != null)       try {
        is.close();
      }
 catch (      Exception ignore) {
      }
      if (br != null)       try {
        br.close();
      }
 catch (      Exception ignore) {
      }
    }
  }
  return methodNames;
}

Fixed version (ground truth):
public static List<String> getMethodNames(IFile javaFile) throws Exception {
  List<String> methodNames=new ArrayList<String>();
  boolean enabled=Activator.getDefault().getPreferenceStore().getBoolean(STR.Preference.TestMethodAutoGenerate.ENABLE);
  if (enabled) {
    InputStream is=null;
    BufferedReader br=null;
    try {
      is=javaFile.getContents();
      br=new BufferedReader(new InputStreamReader(is));
      StringBuffer tmpsb=new StringBuffer();
      String line=null;
      while ((line=br.readLine()) != null)       tmpsb.append(line + "String_Node_Str");
      String allSrc=tmpsb.toString();
      String[] publics=allSrc.split("String_Node_Str");
      for (      String publicsEach : publics) {
        if (publicsEach.matches(RXP_WS + RXP_ANY_RQ + "String_Node_Str"+ RXP_ANY_RQ+ RXP_WS+ "String_Node_Str"+ RXP_ANY_NRQ+ "String_Node_Str"+ RXP_WS+ RXP_ANY_NRQ+ RXP_WS+ RXP_ANY_NRQ+ "String_Node_Str")) {
          Matcher matcher=Pattern.compile(RXP_WS + "String_Node_Str" + RXP_ANY_RQ+ "String_Node_Str"+ RXP_ANY_RQ+ "String_Node_Str"+ RXP_WS+ "String_Node_Str"+ RXP_ANY_NRQ+ "String_Node_Str"+ RXP_WS+ RXP_ANY_NRQ+ RXP_WS+ RXP_ANY_NRQ+ "String_Node_Str").matcher(publicsEach);
          if (matcher.find()) {
            String methodReturnType=matcher.group(1);
            String methodName=matcher.group(2);
            if (methodReturnType.equals("String_Node_Str"))             methodName=methodName.split("String_Node_Str")[1];
            methodNames.add(methodName);
          }
        }
      }
    }
  finally {
      if (is != null)       try {
        is.close();
      }
 catch (      Exception ignore) {
      }
      if (br != null)       try {
        br.close();
      }
 catch (      Exception ignore) {
      }
    }
  }
  return methodNames;
}
Program: 12097
Project: 12097
Buggy source:
public static List<String> getAllSourceCodeLineList(IFile javaFile) throws Exception {
  List<String> lines=new ArrayList<String>();
  InputStream is=null;
  BufferedReader br=null;
  try {
    is=javaFile.getContents();
    br=new BufferedReader(new InputStreamReader(is));
    String line=null;
    while ((line=br.readLine()) != null)     lines.add(line.replace("String_Node_Str","String_Node_Str"));
  }
  finally {
    if (is != null)     try {
      is.close();
    }
 catch (    Exception ignore) {
    }
    if (br != null)     try {
      br.close();
    }
 catch (    Exception ignore) {
    }
  }
  return lines;
}

Fixed version (ground truth):
public static List<String> getAllSourceCodeLineList(IFile javaFile) throws Exception {
  List<String> lines=new ArrayList<String>();
  InputStream is=null;
  BufferedReader br=null;
  try {
    is=javaFile.getContents();
    br=new BufferedReader(new InputStreamReader(is));
    String line=null;
    while ((line=br.readLine()) != null)     lines.add(line.replace("String_Node_Str",STR.EMPTY));
  }
  finally {
    if (is != null)     try {
      is.close();
    }
 catch (    Exception ignore) {
    }
    if (br != null)     try {
      br.close();
    }
 catch (    Exception ignore) {
    }
  }
  return lines;
}
Program: 12099
Project: 12099
Buggy source:
private void writeHandler(String section,String handlerIdentifier,VirtualMouseMoveAnalogReplayHandler handler){
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.getSensitivityX());
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.getSensitivityY());
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.isInvertY());
}

Fixed version (ground truth):
private void writeHandler(String section,String handlerIdentifier,VirtualMouseMoveAnalogReplayHandler handler){
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.getSensitivityX());
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.getSensitivityY());
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.getSensitivitySecondaryX());
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.getSensitivitySecondaryY());
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.isInvertY());
}
Program: 12100
Project: 12100
Buggy source:
private VirtualMouseMoveAnalogReplayHandler readMouseMoveAnalogHandler(String section,String handlerIdentifier){
  int sensitivityX=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",VirtualMouseMoveAnalogReplayHandler.DefaultSensitivity);
  int sensitivityY=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",VirtualMouseMoveAnalogReplayHandler.DefaultSensitivity);
  boolean invertY=this.propertiesStorage.readBoolean(section,handlerIdentifier + "String_Node_Str");
  return new VirtualMouseMoveAnalogReplayHandler(sensitivityX,sensitivityY,invertY);
}

Fixed version (ground truth):
private VirtualMouseMoveAnalogReplayHandler readMouseMoveAnalogHandler(String section,String handlerIdentifier){
  int sensitivityX=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",VirtualMouseMoveAnalogReplayHandler.DefaultSensitivity);
  int sensitivityY=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",VirtualMouseMoveAnalogReplayHandler.DefaultSensitivity);
  int sensitivitySecondaryX=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",VirtualMouseMoveAnalogReplayHandler.DefaultSecondarySensitivity);
  int sensitivitySecondaryY=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",VirtualMouseMoveAnalogReplayHandler.DefaultSecondarySensitivity);
  boolean invertY=this.propertiesStorage.readBoolean(section,handlerIdentifier + "String_Node_Str");
  return new VirtualMouseMoveAnalogReplayHandler(sensitivityX,sensitivityY,sensitivitySecondaryX,sensitivitySecondaryY,invertY);
}
Program: 12101
Project: 12101
Buggy source:
public VirtualMouseMoveAnalogReplayHandler(){
  this(DefaultSensitivity,DefaultSensitivity,false);
}

Fixed version (ground truth):
public VirtualMouseMoveAnalogReplayHandler(){
  this(DefaultSensitivity,DefaultSensitivity,DefaultSecondarySensitivity,DefaultSecondarySensitivity,false);
}
Program: 12103
Project: 12103
Buggy source:
public void stateChanged(ChangeEvent e){
}

Fixed version (ground truth):
public void stateChanged(ChangeEvent e){
  dataContext.setMouseMode2SensitivityY(lookMouseVerticalSlider.getValue());
}
Program: 12104
Project: 12104
Buggy source:
public ControllerProfile(){
  this.leftThumbStickXHandler=new VirtualKeyAnalogReplayHandler(KeyEvent.VK_D,KeyEvent.VK_A,1.6f);
  this.leftThumbStickYHandler=new VirtualKeyAnalogReplayHandler(KeyEvent.VK_S,KeyEvent.VK_W,1.6f);
  this.rightThumbStickHandler=new VirtualMouseMoveAnalogReplayHandler();
  this.leftTriggerHandler=new VirtualMouseAnalogReplayHandler(KeyEvent.BUTTON3_MASK,false);
  this.rightTriggerHandler=new VirtualMouseAnalogReplayHandler(KeyEvent.BUTTON1_MASK,false);
}

Fixed version (ground truth):
public ControllerProfile(){
  this.leftThumbStickXHandler=new VirtualKeyAnalogReplayHandler(DefaultLeftThumbStickXPositiveMask,DefaultLeftThumbStickXNegativeMask,VirtualKeyAnalogReplayHandler.DefaultTolerance);
  this.leftThumbStickYHandler=new VirtualKeyAnalogReplayHandler(DefaultLeftThumbStickYPositiveMask,DefaultLeftThumbStickYNegativeMask,VirtualKeyAnalogReplayHandler.DefaultTolerance);
  this.rightThumbStickHandler=new VirtualMouseMoveAnalogReplayHandler();
  this.leftTriggerHandler=new VirtualMouseAnalogReplayHandler(KeyEvent.BUTTON3_MASK,false);
  this.rightTriggerHandler=new VirtualMouseAnalogReplayHandler(KeyEvent.BUTTON1_MASK,false);
}
Program: 12105
Project: 12105
Buggy source:
private static VirtualKeyAnalogReplayHandler readKeyAnalogHandler(String section,String handlerIdentifier,IStorage propertiesStorage){
  return null;
}

Fixed version (ground truth):
private VirtualKeyAnalogReplayHandler readKeyAnalogHandler(String section,String handlerIdentifier,int defaultPositiveMask,int defaultNegativeMask){
  int positiveVirtualKeyMask=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",defaultPositiveMask);
  int negativeVirtualKeyMask=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",defaultNegativeMask);
  float tolerance=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",VirtualKeyAnalogReplayHandler.DefaultTolerance);
  return new VirtualKeyAnalogReplayHandler(positiveVirtualKeyMask,negativeVirtualKeyMask,tolerance);
}
Program: 12106
Project: 12106
Buggy source:
public ControllerProfile load(String identifier){
  this.propertiesStorage.load();
  ControllerProfile profile=new ControllerProfile();
  String section=getControllerProfileSectionName(identifier);
  readKeyAnalogHandler(section,"String_Node_Str",this.propertiesStorage);
  readKeyAnalogHandler(section,"String_Node_Str",this.propertiesStorage);
  readMouseMoveAnalogHandler(section,"String_Node_Str",this.propertiesStorage);
  for (  Entry<Buttons,IButtonsReplayHandler> mapping : profile.getButtonMappingReplayHandlers().entrySet()) {
    IButtonsReplayHandler handler=readHandler(section,"String_Node_Str" + mapping.getKey().name(),mapping.getKey(),mapping.getValue(),this.propertiesStorage);
    profile.getButtonMappingReplayHandlers().put(mapping.getKey(),handler);
  }
  return profile;
}

Fixed version (ground truth):
public ControllerProfile load(String identifier){
  this.propertiesStorage.load();
  ControllerProfile profile=new ControllerProfile();
  String section=getControllerProfileSectionName(identifier);
  profile.setLeftThumbStickXHandler(readKeyAnalogHandler(section,"String_Node_Str",ControllerProfile.DefaultLeftThumbStickXPositiveMask,ControllerProfile.DefaultLeftThumbStickXNegativeMask));
  profile.setLeftThumbStickYHandler(readKeyAnalogHandler(section,"String_Node_Str",ControllerProfile.DefaultLeftThumbStickYPositiveMask,ControllerProfile.DefaultLeftThumbStickYNegativeMask));
  profile.setRightThumbStickHandler(readMouseMoveAnalogHandler(section,"String_Node_Str"));
  for (  Entry<Buttons,IButtonsReplayHandler> mapping : profile.getButtonMappingReplayHandlers().entrySet()) {
    IButtonsReplayHandler handler=readHandler(section,"String_Node_Str" + mapping.getKey().name(),mapping.getKey(),mapping.getValue(),this.propertiesStorage);
    profile.getButtonMappingReplayHandlers().put(mapping.getKey(),handler);
  }
  return profile;
}
Program: 12107
Project: 12107
Buggy source:
public void store(ControllerProfile profile){
  String identifier=profile.getIdentifier();
  String section=getControllerProfileSectionName(identifier);
  writeHandler(section,"String_Node_Str",profile.getLeftThumbStickXHandler(),this.propertiesStorage);
  writeHandler(section,"String_Node_Str",profile.getLeftThumbStickYHandler(),this.propertiesStorage);
  writeHandler(section,"String_Node_Str",profile.getRightThumbStickHandler(),this.propertiesStorage);
  for (  Entry<Buttons,IButtonsReplayHandler> mapping : profile.getButtonMappingReplayHandlers().entrySet()) {
    writeHandler(section,"String_Node_Str" + mapping.getKey().name(),mapping.getValue(),this.propertiesStorage);
  }
  this.propertiesStorage.commit();
}

Fixed version (ground truth):
public void store(ControllerProfile profile){
  String identifier=profile.getIdentifier();
  String section=getControllerProfileSectionName(identifier);
  writeHandler(section,"String_Node_Str",profile.getLeftThumbStickXHandler());
  writeHandler(section,"String_Node_Str",profile.getLeftThumbStickYHandler());
  writeHandler(section,"String_Node_Str",profile.getRightThumbStickHandler());
  for (  Entry<Buttons,IButtonsReplayHandler> mapping : profile.getButtonMappingReplayHandlers().entrySet()) {
    writeHandler(section,"String_Node_Str" + mapping.getKey().name(),mapping.getValue());
  }
  this.propertiesStorage.commit();
}
Program: 12108
Project: 12108
Buggy source:
private IButtonsReplayHandler readHandler(String section,String handlerIdentifier,Buttons activationButton,IButtonsReplayHandler fallbackValue,IStorage propertiesStorage){
  String mappingType=propertiesStorage.read(section,handlerIdentifier + "String_Node_Str");
  if (mappingType == null) {
    return fallbackValue;
  }
  ButtonMappingType buttonMappingType=ButtonMappingType.valueOf(mappingType);
  int eventCode=propertiesStorage.readInt(section,handlerIdentifier + "String_Node_Str",0);
  int variant=propertiesStorage.readInt(section,handlerIdentifier + "String_Node_Str",0);
  ButtonMapping buttonMapping=new ButtonMapping(buttonMappingType,eventCode,variant);
  return this.replayHandlerFactory.create(activationButton,buttonMapping,false);
}

Fixed version (ground truth):
private IButtonsReplayHandler readHandler(String section,String handlerIdentifier,Buttons activationButton,IButtonsReplayHandler fallbackValue,IStorage propertiesStorage){
  String mappingType=propertiesStorage.read(section,handlerIdentifier + "String_Node_Str");
  if (mappingType == null) {
    return fallbackValue;
  }
  ButtonMappingType buttonMappingType=ButtonMappingType.valueOf(mappingType);
  int eventCode=propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",0);
  int variant=propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",0);
  ButtonMapping buttonMapping=new ButtonMapping(buttonMappingType,eventCode,variant);
  return this.replayHandlerFactory.create(activationButton,buttonMapping,false);
}
Program: 12109
Project: 12109
Buggy source:
private static void writeHandler(String section,String handlerIdentifier,VirtualMouseMoveAnalogReplayHandler handler,IStorage propertiesStorage){
  propertiesStorage.writeInt(section,handlerIdentifier,handler.hashCode());
  propertiesStorage.writeBoolean(section,handlerIdentifier + "String_Node_Str",handler.isInvertY());
}

Fixed version (ground truth):
private void writeHandler(String section,String handlerIdentifier,VirtualMouseMoveAnalogReplayHandler handler){
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.getSensitivityX());
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.getSensitivityY());
  this.propertiesStorage.write(section,handlerIdentifier + "String_Node_Str",handler.isInvertY());
}
Program: 12110
Project: 12110
Buggy source:
private static VirtualMouseMoveAnalogReplayHandler readMouseMoveAnalogHandler(String section,String handlerIdentifier,IStorage propertiesStorage){
  return null;
}

Fixed version (ground truth):
private VirtualMouseMoveAnalogReplayHandler readMouseMoveAnalogHandler(String section,String handlerIdentifier){
  int sensitivityX=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",VirtualMouseMoveAnalogReplayHandler.DefaultSensitivity);
  int sensitivityY=this.propertiesStorage.read(section,handlerIdentifier + "String_Node_Str",VirtualMouseMoveAnalogReplayHandler.DefaultSensitivity);
  boolean invertY=this.propertiesStorage.readBoolean(section,handlerIdentifier + "String_Node_Str");
  return new VirtualMouseMoveAnalogReplayHandler(sensitivityX,sensitivityY,invertY);
}
Program: 12111
Project: 12111
Buggy source:
public abstract String read(String section,String name);

Fixed version (ground truth):
public abstract int read(String section,String name,int defaultValue);
Program: 12112
Project: 12112
Buggy source:
public abstract void write(String section,String name,String value);

Fixed version (ground truth):
public abstract void write(String section,String name,int value);
Program: 12113
Project: 12113
Buggy source:
public String read(String section,String name){
  return this.cache.fetch(section,name);
}

Fixed version (ground truth):
public int read(String section,String name,int defaultValue){
  try {
    return this.cache.fetch(section,name,Integer.class);
  }
 catch (  Exception e) {
    return defaultValue;
  }
}
Program: 12114
Project: 12114
Buggy source:
public boolean readBoolean(String section,String name){
  return this.cache.fetch(section,name,Boolean.class);
}

Fixed version (ground truth):
public boolean readBoolean(String section,String name){
  try {
    return this.cache.fetch(section,name,Boolean.class);
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 12115
Project: 12115
Buggy source:
public void write(String section,String name,String value){
  this.cache.put(section,name,value);
}

Fixed version (ground truth):
public void write(String section,String name,int value){
  this.cache.put(section,name,value);
}
Program: 12116
Project: 12116
Buggy source:
public String read(String section,String name){
  return this.cache.getProperty(section + "String_Node_Str" + name);
}

Fixed version (ground truth):
public int read(String section,String name,int defaultValue){
  String stringValue=this.read(section,name);
  try {
    return Integer.parseInt(stringValue);
  }
 catch (  NumberFormatException ex) {
    return defaultValue;
  }
}
Program: 12117
Project: 12117
Buggy source:
public void write(String section,String name,String value){
  this.cache.put(section + "String_Node_Str" + name,value);
}

Fixed version (ground truth):
public void write(String section,String name,int value){
  this.write(section,name,String.valueOf(value));
}
Program: 12118
Project: 12118
Buggy source:
/** 
 * Our socket thread got disconnect and is exiting.
 */
void handleDisconnected() throws IOException {
synchronized (this.asyncMutex) {
    socket.close();
    this.socket=new Socket(server,port);
    this.in=new BufferedReader(new InputStreamReader(this.socket.getInputStream()));
    this.out=new BufferedWriter(new OutputStreamWriter(this.socket.getOutputStream()));
    this.listenThread=new SocketThread(this.in,this,this.resultParser);
    this.listenThread.start();
    if (lastWatch != null) {
      this.syncCommand("String_Node_Str" + lastWatch,WatchObject.class);
    }
  }
}

Fixed version (ground truth):
/** 
 * Our socket thread got disconnect and is exiting.
 */
void handleDisconnected() throws IOException {
synchronized (this.asyncMutex) {
    socket.close();
    this.socket=new Socket(server,port);
    this.in=new BufferedReader(new InputStreamReader(this.socket.getInputStream()));
    this.out=new BufferedWriter(new OutputStreamWriter(this.socket.getOutputStream()));
    this.listenThread=new SocketThread(this.in,this,this.resultParser);
    this.listenThread.start();
    if (lastWatch != null) {
      this.syncCommand(lastWatch,WatchObject.class);
    }
  }
}
Program: 12119
Project: 12119
Buggy source:
/** 
 * Stops the endpoint.
 */
public void stop(){
  try {
    socket.close();
  }
 catch (  final IOException e1) {
    GPSdEndpoint.LOG.debug("String_Node_Str" + e1.getMessage());
  }
  try {
    this.listeners.clear();
    if (listenThread != null) {
      this.listenThread.halt();
    }
  }
 catch (  final Exception e) {
    GPSdEndpoint.LOG.debug("String_Node_Str",e);
  }
  this.listenThread=null;
}

Fixed version (ground truth):
/** 
 * Stops the endpoint.
 */
public void stop(){
  try {
    this.socket.close();
  }
 catch (  final IOException e1) {
    GPSdEndpoint.LOG.debug("String_Node_Str" + e1.getMessage());
  }
  try {
    this.listeners.clear();
    if (this.listenThread != null) {
      this.listenThread.halt();
    }
  }
 catch (  final Exception e) {
    GPSdEndpoint.LOG.debug("String_Node_Str",e);
  }
  this.listenThread=null;
}
Program: 12120
Project: 12120
Buggy source:
/** 
 * Attempt to kick a failed device back into life on gpsd server.
 * @see https://lists.gnu.org/archive/html/gpsd-dev/2015-06/msg00001.html
 * @param path Path of device known to gpsd
 * @throws IOException
 * @throws JSONException
 */
public void kickDevice(String path) throws IOException, JSONException {
  final JSONObject d=new JSONObject();
  d.put("String_Node_Str","String_Node_Str");
  d.put("String_Node_Str",path);
  voidCommand("String_Node_Str" + d);
}

Fixed version (ground truth):
/** 
 * Attempt to kick a failed device back into life on gpsd server. see: https://lists.gnu.org/archive/html/gpsd-dev/2015-06/msg00001.html
 * @param path Path of device known to gpsd
 * @throws IOException
 * @throws JSONException
 */
public void kickDevice(String path) throws IOException, JSONException {
  final JSONObject d=new JSONObject();
  d.put("String_Node_Str","String_Node_Str");
  d.put("String_Node_Str",path);
  this.voidCommand("String_Node_Str" + d);
}
Program: 12123
Project: 12123
Buggy source:
/** 
 * This normalizes URLs by converting them to URIs and using the URI normalization method Unlike the standard URI normalization method, it also handles paths inside jars properly TODO: Should catch and rethrow different exceptions, like   {@link XmlTools}?
 * @param url
 * @return
 * @throws URISyntaxException
 * @throws MalformedURLException
 */
public static URL normalize(URL url) throws URISyntaxException, MalformedURLException {
  URI uri=url.toURI();
  if (uri.getScheme().equals("String_Node_Str")) {
    logger.debug("String_Node_Str" + uri);
    URI ssp1=new URI(uri.getSchemeSpecificPart());
    logger.debug("String_Node_Str" + ssp1);
    URI ssp2=new URI(ssp1.getSchemeSpecificPart());
    logger.debug("String_Node_Str" + ssp2);
    String sspScheme=ssp1.getScheme();
    logger.debug("String_Node_Str" + sspScheme);
    URI normalizedSsp2=new URI(ssp2.getSchemeSpecificPart()).normalize();
    logger.debug("String_Node_Str" + normalizedSsp2);
    URI normalized=new URI("String_Node_Str" + sspScheme + "String_Node_Str"+ normalizedSsp2);
    logger.debug("String_Node_Str" + normalized);
    url=normalized.toURL();
  }
 else {
    url=uri.normalize().toURL();
  }
  return url;
}

Fixed version (ground truth):
/** 
 * This normalizes URLs by converting them to URIs and using the URI normalization method Unlike the standard URI normalization method, it also handles paths inside jars properly TODO: Should catch and rethrow different exceptions, like   {@link XmlTools}?
 * @param url
 * @return
 * @throws URISyntaxException
 * @throws MalformedURLException
 */
public static URL normalize(URL url) throws URISyntaxException, MalformedURLException {
  URI uri=url.toURI();
  if (uri.getScheme().equals("String_Node_Str")) {
    logger.debug("String_Node_Str" + uri);
    URI ssp1=new URI(uri.getRawSchemeSpecificPart());
    logger.debug("String_Node_Str" + ssp1);
    URI ssp2=new URI(ssp1.getRawSchemeSpecificPart());
    logger.debug("String_Node_Str" + ssp2);
    String sspScheme=ssp1.getScheme();
    logger.debug("String_Node_Str" + sspScheme);
    URI normalizedSsp2=new URI(ssp2.getRawSchemeSpecificPart()).normalize();
    logger.debug("String_Node_Str" + normalizedSsp2);
    URI normalized=new URI("String_Node_Str" + sspScheme + "String_Node_Str"+ normalizedSsp2);
    logger.debug("String_Node_Str" + normalized);
    url=normalized.toURL();
  }
 else {
    url=uri.normalize().toURL();
  }
  return url;
}
Program: 12124
Project: 12124
Buggy source:
@Test public void readCSoarDB() throws Exception {
  agent.initialize();
  URL db=getClass().getResource("String_Node_Str");
  assertNotNull("String_Node_Str",db);
  agent.getInterpreter().eval("String_Node_Str" + db.getPath());
  agent.getInterpreter().eval("String_Node_Str");
  agent.getInterpreter().eval("String_Node_Str");
  String actualResult=agent.getInterpreter().eval("String_Node_Str");
  String expectedResult="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  assertTrue("String_Node_Str",actualResult.equals(expectedResult));
}

Fixed version (ground truth):
@Test public void readCSoarDB() throws Exception {
  agent.initialize();
  URL db=getClass().getResource("String_Node_Str");
  assertNotNull("String_Node_Str",db);
  agent.getInterpreter().eval("String_Node_Str" + db.getPath());
  agent.getInterpreter().eval("String_Node_Str");
  agent.getInterpreter().eval("String_Node_Str");
  String actualResult=agent.getInterpreter().eval("String_Node_Str");
  String expectedResult="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  logger.info("String_Node_Str" + actualResult);
  assertTrue("String_Node_Str",actualResult.equals(expectedResult));
}
Program: 12126
Project: 12126
Buggy source:
/** 
 * episodic_memory.cpp: 2760: bool epmem_valid_episode( agent *my_agent, epmem_time_id memory_id )
 * @param memory_id
 * @return Returns true if the temporal id is valid
 * @throws SQLException 
 */
private boolean epmem_valid_episode(long memory_id) throws SQLException {
  boolean return_val=false;
{
    PreparedStatement my_q=db.valid_episode;
    my_q.setLong(1,memory_id);
    ResultSet resultSet=my_q.executeQuery();
    return_val=(resultSet.getLong(0 + 1) > 0);
    resultSet.close();
  }
  return return_val;
}

Fixed version (ground truth):
/** 
 * episodic_memory.cpp: 2760: bool epmem_valid_episode( agent *my_agent, epmem_time_id memory_id )
 * @param memory_id
 * @return Returns true if the temporal id is valid
 * @throws SQLException 
 */
private boolean epmem_valid_episode(long memory_id) throws SQLException {
  boolean return_val=false;
{
    PreparedStatement my_q=db.valid_episode;
    my_q.setLong(1,memory_id);
    ResultSet resultSet=my_q.executeQuery();
    resultSet.next();
    return_val=(resultSet.getLong(0 + 1) > 0);
    resultSet.close();
  }
  return return_val;
}
Program: 12127
Project: 12127
Buggy source:
private long epmem_temporal_hash_add_type(int sym_type){
  long toReturn=-1;
  try {
    db.hash_add_type.setInt(1,sym_type);
    db.hash_add_type.execute();
    ResultSet rs=db.hash_add_type.getGeneratedKeys();
    try {
      toReturn=rs.getLong(1);
    }
  finally {
      rs.close();
    }
  }
 catch (  SQLException e) {
    logger.error(e.getMessage());
  }
  return toReturn;
}

Fixed version (ground truth):
private long epmem_temporal_hash_add_type(int sym_type){
  long toReturn=-1;
  try {
    db.hash_add_type.setInt(1,sym_type);
    db.hash_add_type.execute();
    ResultSet rs=db.hash_add_type.getGeneratedKeys();
    rs.next();
    try {
      toReturn=rs.getLong(1);
    }
  finally {
      rs.close();
    }
  }
 catch (  SQLException e) {
    logger.error(e.getMessage());
  }
  return toReturn;
}
Program: 12128
Project: 12128
Buggy source:
private boolean epmem_parse_chunks_safe(String chunkString) throws SoarException, IOException, SQLException {
  boolean return_val=false;
  long clause_count=0;
  epmem_init_db();
  long time_counter=stats.getTime();
  final StringWriter errorWriter=new StringWriter();
  final Lexer lexer=new Lexer(new Printer(errorWriter),new StringReader(chunkString));
  lexer.getNextLexeme();
  lexer.setAllowIds(true);
  boolean good_chunk=true;
  final Map<String,epmem_chunk_lti> chunks=new LinkedHashMap<String,epmem_chunk_lti>();
  Map<String,IdentifierImpl> ids=new HashMap<String,IdentifierImpl>();
  Set<WmeImpl> wmes=new HashSet<WmeImpl>();
  lexer.getNextLexeme();
  if (lexer.getCurrentLexeme().type == LexemeType.L_BRACE) {
    good_chunk=false;
  }
  while ((lexer.getCurrentLexeme().type == LexemeType.L_PAREN) && (good_chunk)) {
    good_chunk=epmem_parse_chunk(symbols,lexer,ids,wmes);
  }
  return_val=good_chunk;
  if (return_val) {
    Set<IdentifierImpl> possibleRoots=new HashSet<IdentifierImpl>(ids.values());
    for (    WmeImpl wme : wmes) {
      IdentifierImpl id=wme.value.asIdentifier();
      if (id != null)       possibleRoots.remove(id);
    }
    if (possibleRoots.size() != 1)     return_val=false;
 else {
      IdentifierImpl root=possibleRoots.iterator().next();
      System.err.println(root.toString());
    }
  }
  for (  epmem_chunk_lti c_old : chunks.values()) {
    epmem_deallocate_chunk(c_old,true);
  }
  chunks.clear();
  if (!return_val) {
    throw new SoarException("String_Node_Str" + clause_count);
  }
  return return_val;
}

Fixed version (ground truth):
private boolean epmem_parse_chunks_safe(String chunkString) throws SoarException, IOException, SQLException {
  boolean return_val=false;
  long clause_count=0;
  epmem_init_db();
  long time_counter=stats.getTime();
  final StringWriter errorWriter=new StringWriter();
  final Lexer lexer=new Lexer(new Printer(errorWriter),new StringReader(chunkString));
  lexer.getNextLexeme();
  lexer.setAllowIds(true);
  boolean good_chunk=true;
  final Map<String,epmem_chunk_lti> chunks=new LinkedHashMap<String,epmem_chunk_lti>();
  Map<String,IdentifierImpl> ids=new HashMap<String,IdentifierImpl>();
  Set<WmeImpl> wmes=new HashSet<WmeImpl>();
  lexer.getNextLexeme();
  if (lexer.getCurrentLexeme().type == LexemeType.L_BRACE) {
    good_chunk=false;
  }
  while ((lexer.getCurrentLexeme().type == LexemeType.L_PAREN) && (good_chunk)) {
    good_chunk=epmem_parse_chunk(symbols,lexer,ids,wmes);
  }
  return_val=good_chunk;
  if (return_val) {
    Set<IdentifierImpl> possibleRoots=new HashSet<IdentifierImpl>(ids.values());
    for (    WmeImpl wme : wmes) {
      IdentifierImpl id=wme.value.asIdentifier();
      if (id != null)       possibleRoots.remove(id);
    }
    if (possibleRoots.size() != 1)     return_val=false;
 else {
      IdentifierImpl root=possibleRoots.iterator().next();
      System.err.println(root.toString());
    }
  }
  chunks.clear();
  if (!return_val) {
    throw new SoarException("String_Node_Str" + clause_count);
  }
  return return_val;
}
Program: 12132
Project: 12132
Buggy source:
private int smem_reverse_hash_int(long hash_value) throws SQLException {
  db.hash_rev_int.setLong(1,hash_value);
  final ResultSet rs=db.hash_rev_int.executeQuery();
  try {
    if (!rs.next()) {
      throw new IllegalStateException("String_Node_Str");
    }
    return rs.getInt(0 + 1);
  }
  finally {
    rs.close();
  }
}

Fixed version (ground truth):
private int smem_reverse_hash_int(long hash_value) throws SQLException {
  db.hash_rev_int.setLong(1,hash_value);
  final ResultSet rs=db.hash_rev_int.executeQuery();
  try {
    if (!rs.next()) {
      throw new IllegalStateException("String_Node_Str");
    }
    int toReturn=rs.getInt(0 + 1);
    rs.close();
    return toReturn;
  }
  finally {
    rs.close();
  }
}
Program: 12133
Project: 12133
Buggy source:
private double smem_reverse_hash_float(long hash_value) throws SQLException {
  db.hash_rev_float.setLong(1,hash_value);
  final ResultSet rs=db.hash_rev_float.executeQuery();
  try {
    rs.next();
    return rs.getDouble(0 + 1);
  }
  finally {
    rs.close();
  }
}

Fixed version (ground truth):
private double smem_reverse_hash_float(long hash_value) throws SQLException {
  db.hash_rev_float.setLong(1,hash_value);
  final ResultSet rs=db.hash_rev_float.executeQuery();
  try {
    rs.next();
    double toReturn=rs.getDouble(0 + 1);
    rs.close();
    return toReturn;
  }
  finally {
    rs.close();
  }
}
Program: 12134
Project: 12134
Buggy source:
private String smem_reverse_hash_str(long hash_value) throws SQLException {
  db.hash_rev_str.setLong(1,hash_value);
  final ResultSet rs=db.hash_rev_str.executeQuery();
  try {
    rs.next();
    return rs.getString(0 + 1);
  }
  finally {
    rs.close();
  }
}

Fixed version (ground truth):
private String smem_reverse_hash_str(long hash_value) throws SQLException {
  db.hash_rev_str.setLong(1,hash_value);
  final ResultSet rs=db.hash_rev_str.executeQuery();
  try {
    rs.next();
    String toReturn=rs.getString(0 + 1);
    rs.close();
    return toReturn;
  }
  finally {
    rs.close();
  }
}