nus-yam/ex-repair huggingface dataset:
Program: 81021
Project: 81021
Buggy source:
/** 
 * 拷贝一个文件
 * @param src 原始文件
 * @param target 新文件
 * @return 是否拷贝成功
 * @throws IOException
 */
public static boolean copyFile(File src,File target) throws IOException {
  if (src == null || target == null)   return false;
  if (!src.exists())   return false;
  if (!target.exists())   if (!createNewFile(target))   return false;
  InputStream ins=new BufferedInputStream(new FileInputStream(src));
  OutputStream ops=new BufferedOutputStream(new FileOutputStream(target));
  int b;
  while (-1 != (b=ins.read()))   ops.write(b);
  ins.close();
  ops.close();
  target.setLastModified(src.lastModified());
  return true;
}

Fixed version (ground truth):
/** 
 * 拷贝一个文件
 * @param src 原始文件
 * @param target 新文件
 * @return 是否拷贝成功
 * @throws IOException
 */
public static boolean copyFile(File src,File target) throws IOException {
  if (src == null || target == null)   return false;
  if (!src.exists())   return false;
  if (!target.exists())   if (!createNewFile(target))   return false;
  InputStream ins=new BufferedInputStream(new FileInputStream(src));
  OutputStream ops=new BufferedOutputStream(new FileOutputStream(target));
  int b;
  while (-1 != (b=ins.read()))   ops.write(b);
  ins.close();
  ops.close();
  return target.setLastModified(src.lastModified());
}
Program: 81022
Project: 81022
Buggy source:
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null) {
        String path=url.getFile();
        try {
          path=URLDecoder.decode(path,Charset.defaultCharset().name());
        }
 catch (        Exception e) {
        }
        file=new File(path);
      }
    }
    if (null == file)     file=Files.findFile(base);
    if (null == file)     return null;
    try {
      if (file.isDirectory())       return file;
    }
 catch (    SecurityException e) {
    }
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null) {
        String path=url.getFile();
        path=decodePath(path);
        file=new File(path);
      }
    }
    if (null == file)     file=Files.findFile(base);
    if (null == file)     return null;
    try {
      if (file.isDirectory())       return file;
    }
 catch (    SecurityException e) {
    }
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}
Program: 81023
Project: 81023
Buggy source:
private static String[] findInJar(String jarPath,Class<?> baseClass){
  try {
    try {
      jarPath=URLDecoder.decode(jarPath,Charset.defaultCharset().name());
    }
 catch (    UnsupportedEncodingException e) {
    }
    ZipEntry[] entrys=Files.findEntryInZip(new ZipFile(jarPath),baseClass.getPackage().getName().replace('.','/') + "String_Node_Str");
    if (null != entrys && entrys.length > 0) {
      String[] classNames=new String[entrys.length];
      for (int i=0; i < entrys.length; i++) {
        String ph=entrys[i].getName();
        classNames[i]=ph.substring(0,ph.lastIndexOf('.')).replaceAll("String_Node_Str","String_Node_Str");
      }
      return classNames;
    }
  }
 catch (  IOException e) {
  }
  return null;
}

Fixed version (ground truth):
private static String[] findInJar(String jarPath,Class<?> baseClass){
  try {
    jarPath=decodePath(jarPath);
    ZipEntry[] entrys=Files.findEntryInZip(new ZipFile(jarPath),baseClass.getPackage().getName().replace('.','/') + "String_Node_Str");
    if (null != entrys && entrys.length > 0) {
      String[] classNames=new String[entrys.length];
      for (int i=0; i < entrys.length; i++) {
        String ph=entrys[i].getName();
        classNames[i]=ph.substring(0,ph.lastIndexOf('.')).replaceAll("String_Node_Str","String_Node_Str");
      }
      return classNames;
    }
  }
 catch (  IOException e) {
  }
  return null;
}
Program: 81026
Project: 81026
Buggy source:
private Log4jAdapter(String className) throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
  if (false == isInited) {
    initLevelStuff();
    isInited=true;
  }
  log4jImpl=getLogger.invoke(null,className);
  isFatalEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelFatal);
  isErrorEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelError);
  isWarnEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelWarn);
  isInfoEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelInfo);
  isDebugEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelDebug);
  isTraceEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelTrace);
}

Fixed version (ground truth):
private Log4jAdapter(String className) throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
  if (false == isInited) {
    initLevelStuff();
    isInited=true;
  }
  log4jImpl=getLogger.invoke(null,className);
  isFatalEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelFatal);
  isErrorEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelError);
  isWarnEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelWarn);
  isInfoEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelInfo);
  isDebugEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelDebug);
  isTraceEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelTrace);
  System.out.println("String_Node_Str");
}
Program: 81027
Project: 81027
Buggy source:
public boolean canWork(NutPluginConfig config){
  try {
    LoggerFactory.getILoggerFactory();
    return true;
  }
 catch (  Throwable e) {
  }
  return false;
}

Fixed version (ground truth):
public boolean canWork(NutPluginConfig config){
  try {
    Class.forName("String_Node_Str");
    return true;
  }
 catch (  Throwable e) {
  }
  return false;
}
Program: 81028
Project: 81028
Buggy source:
private static void loadPlugin(String pluginClassName){
  try {
    Class<?> pluginClass=Class.forName(pluginClassName);
    NutPlugin nutPlugin=(NutPlugin)pluginClass.newInstance();
    if (nutPlugin.canWork(nutPluginConfig)) {
      nutPlugin.init(nutPluginConfig);
      Class<?> workForClass=nutPlugin.workFor();
      List<NutPlugin> list=plugins.get(workForClass);
      if (list == null) {
        list=new ArrayList<NutPlugin>();
        plugins.put(workForClass,list);
      }
      list.add(nutPlugin);
    }
  }
 catch (  Throwable e) {
    LogFactory.getLog(NutPluginManagement.class).warnf("String_Node_Str",pluginClassName);
  }
}

Fixed version (ground truth):
private static void loadPlugin(String pluginClassName){
  try {
    Class<?> pluginClass=Class.forName(pluginClassName);
    NutPlugin nutPlugin=(NutPlugin)pluginClass.newInstance();
    if (nutPlugin.canWork(nutPluginConfig)) {
      nutPlugin.init(nutPluginConfig);
      Class<?> workForClass=nutPlugin.workFor();
      List<NutPlugin> list=plugins.get(workForClass);
      if (list == null) {
        list=new ArrayList<NutPlugin>();
        plugins.put(workForClass,list);
      }
      list.add(nutPlugin);
    }
  }
 catch (  Throwable e) {
  }
}
Program: 81029
Project: 81029
Buggy source:
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null)       file=new File(url.getFile());
    }
    if (null == file)     file=Files.findFile(base);
    if (null == file)     return null;
    if (file.isDirectory())     return file;
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null)       file=new File(url.getFile());
    }
    if (null == file)     file=Files.findFile(base);
    if (null == file)     return null;
    try {
      if (file.isDirectory())       return file;
    }
 catch (    SecurityException e) {
    }
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}
Program: 81031
Project: 81031
Buggy source:
private String getFormattedMessage(String message,int colorResourceId,long timeStamp){
  SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
  String dateStamp=sdf.format(new Date(timeStamp)) + "String_Node_Str";
  String messageFormat="String_Node_Str";
  return String.format(messageFormat,dateStamp,Integer.toHexString(ContextCompat.getColor(getActivity(),colorResourceId)).substring(2),message);
}

Fixed version (ground truth):
private String getFormattedMessage(String message,int colorResourceId,long timeStamp){
  SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
  String dateStamp=sdf.format(new Date(timeStamp)) + "String_Node_Str";
  String messageFormat="String_Node_Str";
  return String.format(messageFormat,dateStamp,Integer.toHexString(ContextCompat.getColor(rootView.getContext(),colorResourceId)).substring(2),message);
}
Program: 81033
Project: 81033
Buggy source:
private static void logServerReply(FTPClient client){
  String singleReply=client.getReplyString();
  if (!Strings.isNullOrEmpty(singleReply)) {
    ftpServerResponses.add(singleReply);
    LOG.debug("String_Node_Str" + singleReply);
  }
  String[] replies=client.getReplyStrings();
  if (replies != null && replies.length > 0) {
    for (    String aReply : replies) {
      if (!Strings.isNullOrEmpty(aReply)) {
        ftpServerResponses.add(aReply);
        LOG.debug("String_Node_Str" + aReply);
      }
    }
  }
}

Fixed version (ground truth):
private static void logServerReply(FTPClient client){
  String singleReply=client.getReplyString();
  if (!Strings.isNullOrEmpty(singleReply)) {
    ftpServerResponses.add(singleReply);
  }
  String[] replies=client.getReplyStrings();
  if (replies != null && replies.length > 0) {
    for (    String aReply : replies) {
      if (!Strings.isNullOrEmpty(aReply)) {
        ftpServerResponses.add(aReply);
      }
    }
  }
}
Program: 81034
Project: 81034
Buggy source:
public String getLatestHdop(){
  if (nmeaParts[0].equalsIgnoreCase("String_Node_Str")) {
    if (nmeaParts.length > 8 && !Utilities.IsNullOrEmpty(nmeaParts[8])) {
      return nmeaParts[8];
    }
  }
 else   if (nmeaParts.length > 16 && !Utilities.IsNullOrEmpty(nmeaParts[16])) {
    return nmeaParts[16];
  }
  return null;
}

Fixed version (ground truth):
public String getLatestHdop(){
  if (nmeaParts[0].equalsIgnoreCase("String_Node_Str")) {
    if (nmeaParts.length > 8 && !Utilities.IsNullOrEmpty(nmeaParts[8])) {
      return nmeaParts[8];
    }
  }
 else   if (nmeaParts[0].equalsIgnoreCase("String_Node_Str")) {
    if (nmeaParts.length > 16 && !Utilities.IsNullOrEmpty(nmeaParts[16])) {
      return nmeaParts[16];
    }
  }
  return null;
}
Program: 81035
Project: 81035
Buggy source:
/** 
 * Stops logging, removes notification, stops GPS manager, stops email timer
 */
public void StopLogging(){
  tracer.debug("String_Node_Str");
  Session.setAddNewTrackSegment(true);
  Session.setTotalTravelled(0);
  Session.setPreviousLocationInfo(null);
  Session.setStarted(false);
  Session.setUserStillSinceTimeStamp(0);
  stopAbsoluteTimer();
  AutoSendLogFileOnStop();
  CancelAlarm();
  Session.setCurrentLocationInfo(null);
  Session.setSinglePointMode(false);
  stopForeground(true);
  RemoveNotification();
  StopAlarm();
  StopGpsManager();
  StopPassiveManager();
  StopActivityRecognitionUpdates();
  NotifyClientStopped();
}

Fixed version (ground truth):
/** 
 * Stops logging, removes notification, stops GPS manager, stops email timer
 */
public void StopLogging(){
  tracer.debug("String_Node_Str");
  Session.setAddNewTrackSegment(true);
  Session.setTotalTravelled(0);
  Session.setPreviousLocationInfo(null);
  Session.setStarted(false);
  Session.setUserStillSinceTimeStamp(0);
  Session.setLatestTimeStamp(0);
  stopAbsoluteTimer();
  AutoSendLogFileOnStop();
  CancelAlarm();
  Session.setCurrentLocationInfo(null);
  Session.setSinglePointMode(false);
  stopForeground(true);
  RemoveNotification();
  StopAlarm();
  StopGpsManager();
  StopPassiveManager();
  StopActivityRecognitionUpdates();
  NotifyClientStopped();
}
Program: 81036
Project: 81036
Buggy source:
/** 
 * Sets the current file name based on user preference.
 */
private void ResetCurrentFileName(boolean newLogEachStart){
  String currentFileName=Session.getCurrentFormattedFileName();
  String newFileName=Session.getCurrentFileName();
  if (AppSettings.isCustomFile()) {
    newFileName=AppSettings.getCustomFileName();
    Session.setCurrentFileName(AppSettings.getCustomFileName());
  }
 else   if (AppSettings.shouldCreateNewFileOnceADay()) {
    SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    newFileName=sdf.format(new Date());
    Session.setCurrentFileName(newFileName);
  }
 else   if (newLogEachStart) {
    SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    newFileName=sdf.format(new Date());
    Session.setCurrentFileName(newFileName);
  }
  if (!Utilities.IsNullOrEmpty(currentFileName) && !currentFileName.equalsIgnoreCase(Utilities.GetFormattedCustomFileName(newFileName)) && Session.isStarted()) {
    tracer.info("String_Node_Str");
    EventBus.getDefault().post(new CommandEvents.AutoSend(currentFileName));
  }
  Session.setCurrentFormattedFileName(Session.getCurrentFileName());
  tracer.info("String_Node_Str" + newFileName);
  EventBus.getDefault().post(new ServiceEvents.FileNamed(newFileName));
}

Fixed version (ground truth):
/** 
 * Sets the current file name based on user preference.
 */
private void ResetCurrentFileName(boolean newLogEachStart){
  String oldFileName=Session.getCurrentFormattedFileName();
  String newFileName=Session.getCurrentFileName();
  if (AppSettings.isCustomFile()) {
    newFileName=AppSettings.getCustomFileName();
    Session.setCurrentFileName(AppSettings.getCustomFileName());
  }
 else   if (AppSettings.shouldCreateNewFileOnceADay()) {
    SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    newFileName=sdf.format(new Date());
    Session.setCurrentFileName(newFileName);
  }
 else   if (newLogEachStart) {
    SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    newFileName=sdf.format(new Date());
    Session.setCurrentFileName(newFileName);
  }
  if (!Utilities.IsNullOrEmpty(oldFileName) && !oldFileName.equalsIgnoreCase(Session.getCurrentFileName()) && Session.isStarted()) {
    tracer.info("String_Node_Str");
    EventBus.getDefault().post(new CommandEvents.AutoSend(oldFileName));
  }
  Session.setCurrentFormattedFileName(Session.getCurrentFileName());
  tracer.info("String_Node_Str" + Session.getCurrentFileName());
  EventBus.getDefault().post(new ServiceEvents.FileNamed(Session.getCurrentFileName()));
}
Program: 81037
Project: 81037
Buggy source:
/** 
 * Event raised when the form is created for the first time
 */
@Override public void onCreate(Bundle savedInstanceState){
  tracer.debug("String_Node_Str");
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_faq);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  browser=(WebView)findViewById(R.id.faqwebview);
  WebSettings settings=browser.getSettings();
  settings.setLoadWithOverviewMode(true);
  settings.setUseWideViewPort(true);
  settings.setBuiltInZoomControls(true);
  settings.setJavaScriptEnabled(true);
  settings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
  browser.loadUrl("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Event raised when the form is created for the first time
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_faq);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  browser=(WebView)findViewById(R.id.faqwebview);
  WebSettings settings=browser.getSettings();
  settings.setLoadWithOverviewMode(true);
  settings.setUseWideViewPort(true);
  settings.setBuiltInZoomControls(true);
  settings.setDisplayZoomControls(false);
  settings.setJavaScriptEnabled(true);
  settings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
  browser.loadUrl("String_Node_Str");
}
Program: 81038
Project: 81038
Buggy source:
GeneralLocationListener(GpsLoggingService activity,String name){
  tracer.debug("String_Node_Str");
  loggingService=activity;
  listenerName=name;
}

Fixed version (ground truth):
GeneralLocationListener(GpsLoggingService activity,String name){
  loggingService=activity;
  listenerName=name;
}
Program: 81039
Project: 81039
Buggy source:
public void onStatusChanged(String provider,int status,Bundle extras){
  if (status == LocationProvider.OUT_OF_SERVICE) {
    tracer.debug(provider + "String_Node_Str");
    loggingService.StopManagerAndResetAlarm();
  }
  if (status == LocationProvider.AVAILABLE) {
    tracer.debug(provider + "String_Node_Str");
  }
  if (status == LocationProvider.TEMPORARILY_UNAVAILABLE) {
    tracer.debug(provider + "String_Node_Str");
    loggingService.StopManagerAndResetAlarm();
  }
}

Fixed version (ground truth):
public void onStatusChanged(String provider,int status,Bundle extras){
  if (status == LocationProvider.OUT_OF_SERVICE) {
    tracer.info(provider + "String_Node_Str");
    loggingService.StopManagerAndResetAlarm();
  }
  if (status == LocationProvider.AVAILABLE) {
    tracer.info(provider + "String_Node_Str");
  }
  if (status == LocationProvider.TEMPORARILY_UNAVAILABLE) {
    tracer.info(provider + "String_Node_Str");
    loggingService.StopManagerAndResetAlarm();
  }
}
Program: 81040
Project: 81040
Buggy source:
private String GetMimeTypeFromFileName(String fileName){
  if (fileName.endsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
  if (fileName.endsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
  if (fileName.endsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String GetMimeTypeFromFileName(String fileName){
  if (fileName.endsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
  if (fileName.endsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
  if (fileName.endsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
  if (fileName.endsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}
Program: 81041
Project: 81041
Buggy source:
@Override public void run(){
  try {
    String token=GoogleAuthUtil.getTokenWithNotification(ctx,GetAccountName(ctx),GetOauth2Scope(),new Bundle());
    GDocsHelper.SaveAuthToken(ctx,token);
    Utilities.LogDebug(token);
    String gpsLoggerFolderId=GetFileIdFromFileName(token,"String_Node_Str");
    if (Utilities.IsNullOrEmpty(gpsLoggerFolderId)) {
      gpsLoggerFolderId=CreateEmptyFile(token,"String_Node_Str",GetMimeTypeFromFileName(fileName),"String_Node_Str");
      if (Utilities.IsNullOrEmpty(gpsLoggerFolderId)) {
        callback.OnFailure();
        return;
      }
    }
    String gpxFileId=GetFileIdFromFileName(token,fileName);
    if (Utilities.IsNullOrEmpty(gpxFileId)) {
      gpxFileId=CreateEmptyFile(token,fileName,GetMimeTypeFromFileName(fileName),gpsLoggerFolderId);
      if (Utilities.IsNullOrEmpty(gpxFileId)) {
        callback.OnFailure();
        return;
      }
    }
    if (!Utilities.IsNullOrEmpty(gpxFileId)) {
      UpdateFileContents(token,gpxFileId,Utilities.GetByteArrayFromInputStream(inputStream),fileName);
    }
    callback.OnComplete();
  }
 catch (  Exception e) {
    Utilities.LogError("String_Node_Str",e);
    callback.OnFailure();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    String token=GoogleAuthUtil.getTokenWithNotification(ctx,GetAccountName(ctx),GetOauth2Scope(),new Bundle());
    GDocsHelper.SaveAuthToken(ctx,token);
    Utilities.LogDebug(token);
    String gpsLoggerFolderId=GetFileIdFromFileName(token,"String_Node_Str");
    if (Utilities.IsNullOrEmpty(gpsLoggerFolderId)) {
      gpsLoggerFolderId=CreateEmptyFile(token,"String_Node_Str","String_Node_Str","String_Node_Str");
      if (Utilities.IsNullOrEmpty(gpsLoggerFolderId)) {
        callback.OnFailure();
        return;
      }
    }
    String gpxFileId=GetFileIdFromFileName(token,fileName);
    if (Utilities.IsNullOrEmpty(gpxFileId)) {
      gpxFileId=CreateEmptyFile(token,fileName,GetMimeTypeFromFileName(fileName),gpsLoggerFolderId);
      if (Utilities.IsNullOrEmpty(gpxFileId)) {
        callback.OnFailure();
        return;
      }
    }
    if (!Utilities.IsNullOrEmpty(gpxFileId)) {
      UpdateFileContents(token,gpxFileId,Utilities.GetByteArrayFromInputStream(inputStream),fileName);
    }
    callback.OnComplete();
  }
 catch (  Exception e) {
    Utilities.LogError("String_Node_Str",e);
    callback.OnFailure();
  }
}
Program: 81042
Project: 81042
Buggy source:
private void UploadTestFileToGoogleDocs(){
  Utilities.ShowProgress(GDocsSettingsActivity.this,getString(R.string.please_wait),getString(R.string.please_wait));
  File gpxFolder=new File(AppSettings.getGpsLoggerFolder());
  if (!gpxFolder.exists()) {
    gpxFolder.mkdirs();
  }
  File testFile=new File(gpxFolder.getPath(),"String_Node_Str");
  try {
    if (!testFile.exists()) {
      testFile.createNewFile();
      FileOutputStream initialWriter=new FileOutputStream(testFile,true);
      BufferedOutputStream initialOutput=new BufferedOutputStream(initialWriter);
      StringBuilder initialString=new StringBuilder();
      initialString.append("String_Node_Str");
      initialOutput.write(initialString.toString().getBytes());
      initialOutput.flush();
      initialOutput.close();
    }
  }
 catch (  Exception ex) {
    OnFailure();
  }
  GDocsHelper helper=new GDocsHelper(getApplicationContext(),this);
  ArrayList<File> files=new ArrayList<File>();
  files.add(testFile);
  helper.UploadFile(files);
}

Fixed version (ground truth):
private void UploadTestFileToGoogleDocs(){
  Utilities.ShowProgress(GDocsSettingsActivity.this,getString(R.string.please_wait),getString(R.string.please_wait));
  File gpxFolder=new File(AppSettings.getGpsLoggerFolder());
  if (!gpxFolder.exists()) {
    gpxFolder.mkdirs();
  }
  Utilities.LogDebug("String_Node_Str");
  File testFile=new File(gpxFolder.getPath(),"String_Node_Str");
  try {
    if (!testFile.exists()) {
      testFile.createNewFile();
      FileOutputStream initialWriter=new FileOutputStream(testFile,true);
      BufferedOutputStream initialOutput=new BufferedOutputStream(initialWriter);
      StringBuilder initialString=new StringBuilder();
      initialString.append("String_Node_Str");
      initialOutput.write(initialString.toString().getBytes());
      initialOutput.flush();
      initialOutput.close();
    }
  }
 catch (  Exception ex) {
    OnFailure();
  }
  GDocsHelper helper=new GDocsHelper(getApplicationContext(),this);
  ArrayList<File> files=new ArrayList<File>();
  files.add(testFile);
  helper.UploadFile(files);
}
Program: 81043
Project: 81043
Buggy source:
/** 
 * Resets the form, resets file name if required, reobtains preferences
 */
protected void StartLogging(){
  Utilities.LogDebug("String_Node_Str");
  Session.setAddNewTrackSegment(true);
  if (Session.isStarted()) {
    return;
  }
  Utilities.LogInfo("String_Node_Str");
  try {
    startForeground(NOTIFICATION_ID,new Notification());
  }
 catch (  Exception ex) {
    System.out.print(ex.getMessage());
  }
  Session.setStarted(true);
  GetPreferences();
  Notify();
  ResetCurrentFileName();
  ClearForm();
  StartGpsManager();
}

Fixed version (ground truth):
/** 
 * Resets the form, resets file name if required, reobtains preferences
 */
protected void StartLogging(){
  Utilities.LogDebug("String_Node_Str");
  Session.setAddNewTrackSegment(true);
  if (Session.isStarted()) {
    return;
  }
  Utilities.LogInfo("String_Node_Str");
  try {
    startForeground(NOTIFICATION_ID,new Notification());
  }
 catch (  Exception ex) {
    System.out.print(ex.getMessage());
  }
  Session.setStarted(true);
  GetPreferences();
  Notify();
  ResetCurrentFileName(true);
  ClearForm();
  StartGpsManager();
}
Program: 81044
Project: 81044
Buggy source:
/** 
 * This event is raised when the GeneralLocationListener has a new location. This method in turn updates notification, writes to file, reobtains preferences, notifies main service client and resets location managers.
 * @param loc Location object
 */
void OnLocationChanged(Location loc){
  if (!Session.isStarted()) {
    Utilities.LogDebug("String_Node_Str");
    StopLogging();
    return;
  }
  Utilities.LogDebug("String_Node_Str");
  long currentTimeStamp=System.currentTimeMillis();
  if ((currentTimeStamp - Session.getLatestTimeStamp()) < 1000) {
    return;
  }
  if ((currentTimeStamp - Session.getLatestTimeStamp()) < (AppSettings.getMinimumSeconds() * 1000)) {
    return;
  }
  if (AppSettings.getMinimumDistanceInMeters() > 0 && Session.hasValidLocation()) {
    double distanceTraveled=Utilities.CalculateDistance(loc.getLatitude(),loc.getLongitude(),Session.getCurrentLatitude(),Session.getCurrentLongitude());
    if (AppSettings.getMinimumDistanceInMeters() > distanceTraveled) {
      SetStatus("String_Node_Str" + String.valueOf(Math.floor(distanceTraveled)) + "String_Node_Str");
      StopManagerAndResetAlarm();
      return;
    }
  }
  Utilities.LogInfo("String_Node_Str");
  ResetCurrentFileName();
  Session.setLatestTimeStamp(System.currentTimeMillis());
  Session.setCurrentLocationInfo(loc);
  Notify();
  WriteToFile(loc);
  GetPreferences();
  StopManagerAndResetAlarm();
  if (IsMainFormVisible()) {
    mainServiceClient.OnLocationUpdate(loc);
  }
}

Fixed version (ground truth):
/** 
 * This event is raised when the GeneralLocationListener has a new location. This method in turn updates notification, writes to file, reobtains preferences, notifies main service client and resets location managers.
 * @param loc Location object
 */
void OnLocationChanged(Location loc){
  if (!Session.isStarted()) {
    Utilities.LogDebug("String_Node_Str");
    StopLogging();
    return;
  }
  Utilities.LogDebug("String_Node_Str");
  long currentTimeStamp=System.currentTimeMillis();
  if ((currentTimeStamp - Session.getLatestTimeStamp()) < 1000) {
    return;
  }
  if ((currentTimeStamp - Session.getLatestTimeStamp()) < (AppSettings.getMinimumSeconds() * 1000)) {
    return;
  }
  if (AppSettings.getMinimumDistanceInMeters() > 0 && Session.hasValidLocation()) {
    double distanceTraveled=Utilities.CalculateDistance(loc.getLatitude(),loc.getLongitude(),Session.getCurrentLatitude(),Session.getCurrentLongitude());
    if (AppSettings.getMinimumDistanceInMeters() > distanceTraveled) {
      SetStatus("String_Node_Str" + String.valueOf(Math.floor(distanceTraveled)) + "String_Node_Str");
      StopManagerAndResetAlarm();
      return;
    }
  }
  Utilities.LogInfo("String_Node_Str");
  ResetCurrentFileName(false);
  Session.setLatestTimeStamp(System.currentTimeMillis());
  Session.setCurrentLocationInfo(loc);
  Notify();
  WriteToFile(loc);
  GetPreferences();
  StopManagerAndResetAlarm();
  if (IsMainFormVisible()) {
    mainServiceClient.OnLocationUpdate(loc);
  }
}
Program: 81045
Project: 81045
Buggy source:
/** 
 * Sets the current file name based on user preference.
 */
private void ResetCurrentFileName(){
  Utilities.LogDebug("String_Node_Str");
  String newFileName;
  if (AppSettings.shouldCreateNewFileOnceADay()) {
    SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    newFileName=sdf.format(new Date());
    Session.setCurrentFileName(newFileName);
  }
 else {
    SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    newFileName=sdf.format(new Date());
    Session.setCurrentFileName(newFileName);
  }
  if (IsMainFormVisible()) {
    mainServiceClient.onFileName(newFileName);
  }
}

Fixed version (ground truth):
/** 
 * Sets the current file name based on user preference.
 */
private void ResetCurrentFileName(boolean newStart){
  Utilities.LogDebug("String_Node_Str");
  String newFileName=Session.getCurrentFileName();
  if (AppSettings.shouldCreateNewFileOnceADay()) {
    SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    newFileName=sdf.format(new Date());
    Session.setCurrentFileName(newFileName);
  }
 else   if (newStart) {
    SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    newFileName=sdf.format(new Date());
    Session.setCurrentFileName(newFileName);
  }
  if (IsMainFormVisible()) {
    mainServiceClient.onFileName(newFileName);
  }
}
Program: 81046
Project: 81046
Buggy source:
public Gpx10AnnotateHandler(String description,File gpxFile){
  this.description=description;
  this.gpxFile=gpxFile;
}

Fixed version (ground truth):
public Gpx10AnnotateHandler(String description,File gpxFile,Location loc,String dateTimeString){
  this.description=description;
  this.gpxFile=gpxFile;
  this.loc=loc;
  this.dateTimeString=dateTimeString;
}
Program: 81047
Project: 81047
Buggy source:
public void Annotate(String description,Location loc) throws Exception {
  Gpx10AnnotateHandler annotateHandler=new Gpx10AnnotateHandler(description,gpxFile);
  Utilities.LogDebug(String.format("String_Node_Str",EXECUTOR.getQueue().size()));
  EXECUTOR.execute(annotateHandler);
}

Fixed version (ground truth):
public void Annotate(String description,Location loc) throws Exception {
  Date now;
  if (useSatelliteTime) {
    now=new Date(loc.getTime());
  }
 else {
    now=new Date();
  }
  String dateTimeString=Utilities.GetIsoDateTime(now);
  Gpx10AnnotateHandler annotateHandler=new Gpx10AnnotateHandler(description,gpxFile,loc,dateTimeString);
  Utilities.LogDebug(String.format("String_Node_Str",EXECUTOR.getQueue().size()));
  EXECUTOR.execute(annotateHandler);
}
Program: 81048
Project: 81048
Buggy source:
public String[] forbids(){
  return depends;
}

Fixed version (ground truth):
public String[] forbids(){
  return forbids;
}
Program: 81050
Project: 81050
Buggy source:
private void addValue(Object key,Object value) throws IllegalArgumentException, IllegalAccessException {
  Map map=(Map)f.get(bean);
  if (map == null) {
    map=new HashMap();
    f.set(bean,map);
  }
  map.put(key,value);
}

Fixed version (ground truth):
protected void addValue(String key,String value) throws IllegalArgumentException, IllegalAccessException {
  Map map=(Map)f.get(bean);
  if (map == null) {
    map=new HashMap();
    f.set(bean,map);
  }
  map.put(key,value);
}
Program: 81051
Project: 81051
Buggy source:
@Override public int parseArguments(Parameters params) throws CmdLineException {
  String s=params.getParameter(0);
  T value=null;
  for (  T o : enumType.getEnumConstants())   if (o.name().equalsIgnoreCase(s)) {
    value=o;
    break;
  }
  if (value == null)   throw new CmdLineException(owner,Messages.ILLEGAL_OPERAND.format(option.toString(),s));
  setter.addValue(value);
  return 1;
}

Fixed version (ground truth):
@Override public int parseArguments(Parameters params) throws CmdLineException {
  String s=params.getParameter(0);
  T value=null;
  for (  T o : enumType.getEnumConstants())   if (o.name().equalsIgnoreCase(s)) {
    value=o;
    break;
  }
  if (value == null)   throw new CmdLineException(owner,Messages.ILLEGAL_OPERAND.format(params.getParameter(-1),s));
  setter.addValue(value);
  return 1;
}
Program: 81052
Project: 81052
Buggy source:
@Override public int parseArguments(Parameters params) throws CmdLineException {
  String token=params.getParameter(0);
  try {
    T value=parse(token);
    setter.addValue(value);
  }
 catch (  NumberFormatException ex) {
    throw new CmdLineException(owner,Messages.ILLEGAL_OPERAND.format(option.toString(),token));
  }
  return 1;
}

Fixed version (ground truth):
@Override public int parseArguments(Parameters params) throws CmdLineException {
  String token=params.getParameter(0);
  try {
    T value=parse(token);
    setter.addValue(value);
  }
 catch (  NumberFormatException ex) {
    throw new CmdLineException(owner,Messages.ILLEGAL_OPERAND.format(params.getParameter(-1),token));
  }
  return 1;
}
Program: 81053
Project: 81053
Buggy source:
@Override public int parseArguments(Parameters params) throws CmdLineException {
  String param=params.getParameter(0);
  try {
    setter.addValue(new URI(param));
    return 1;
  }
 catch (  URISyntaxException e) {
    throw new CmdLineException(owner,Messages.ILLEGAL_OPERAND.format(param));
  }
}

Fixed version (ground truth):
@Override public int parseArguments(Parameters params) throws CmdLineException {
  String param=params.getParameter(0);
  try {
    setter.addValue(new URI(param));
    return 1;
  }
 catch (  URISyntaxException e) {
    throw new CmdLineException(owner,Messages.ILLEGAL_OPERAND.format(params.getParameter(-1),param));
  }
}
Program: 81054
Project: 81054
Buggy source:
@Override public int parseArguments(Parameters params) throws CmdLineException {
  String param=params.getParameter(0);
  try {
    setter.addValue(new URL(param));
    return 1;
  }
 catch (  MalformedURLException e) {
    throw new CmdLineException(owner,Messages.ILLEGAL_OPERAND.format(param));
  }
}

Fixed version (ground truth):
@Override public int parseArguments(Parameters params) throws CmdLineException {
  String param=params.getParameter(0);
  try {
    setter.addValue(new URL(param));
    return 1;
  }
 catch (  MalformedURLException e) {
    throw new CmdLineException(owner,Messages.ILLEGAL_OPERAND.format(params.getParameter(-1),param));
  }
}
Program: 81055
Project: 81055
Buggy source:
/** 
 * Prints the usage information for a given option.
 * @param out      Writer to write into
 * @param handler  handler where to receive the informations
 * @param len      Maximum length of metadata column
 * @param rb       ResourceBundle for I18N
 */
private void printOption(PrintWriter out,OptionHandler handler,int len,ResourceBundle rb){
  if (handler.option.usage() == null || handler.option.usage().length() == 0) {
    return;
  }
  int widthMetadata=Math.min(len,(usageWidth - 4) / 2);
  int widthUsage=usageWidth - 4 - widthMetadata;
  List<String> namesAndMetas=wrapLines(handler.getNameAndMeta(rb),widthMetadata);
  List<String> usages=wrapLines(handler.option.usage(),widthUsage);
  for (int i=0; i < Math.max(namesAndMetas.size(),usages.size()); i++) {
    String nameAndMeta=(i >= namesAndMetas.size()) ? "String_Node_Str" : namesAndMetas.get(i);
    String usage=(i >= usages.size()) ? "String_Node_Str" : usages.get(i);
    String format=(nameAndMeta.length() > 0) ? "String_Node_Str" + widthMetadata + "String_Node_Str" : "String_Node_Str" + widthMetadata + "String_Node_Str";
    String output=String.format(format,nameAndMeta,usage);
    out.println(output);
  }
}

Fixed version (ground truth):
/** 
 * Prints the usage information for a given option.
 * @param out      Writer to write into
 * @param handler  handler where to receive the informations
 * @param len      Maximum length of metadata column
 * @param rb       ResourceBundle for I18N
 */
private void printOption(PrintWriter out,OptionHandler handler,int len,ResourceBundle rb){
  if (handler.option.usage() == null || handler.option.usage().length() == 0) {
    return;
  }
  int widthMetadata=Math.min(len,(usageWidth - 4) / 2);
  int widthUsage=usageWidth - 4 - widthMetadata;
  List<String> namesAndMetas=wrapLines(handler.getNameAndMeta(rb),widthMetadata);
  List<String> usages=wrapLines(localize(handler.option.usage(),rb),widthUsage);
  for (int i=0; i < Math.max(namesAndMetas.size(),usages.size()); i++) {
    String nameAndMeta=(i >= namesAndMetas.size()) ? "String_Node_Str" : namesAndMetas.get(i);
    String usage=(i >= usages.size()) ? "String_Node_Str" : usages.get(i);
    String format=(nameAndMeta.length() > 0) ? "String_Node_Str" + widthMetadata + "String_Node_Str" : "String_Node_Str" + widthMetadata + "String_Node_Str";
    String output=String.format(format,nameAndMeta,usage);
    out.println(output);
  }
}
Program: 81056
Project: 81056
Buggy source:
/** 
 * Wraps a line so that the resulting parts are not longer than a given maximum length.
 * @param line       Line to wrap
 * @param maxLength  maximum length for the resulting parts
 * @return list of all wrapped parts
 */
private List<String> wrapLines(String line,int maxLength){
  List<String> rv=new ArrayList<String>();
  String[] hardWrapedLines=line.split("String_Node_Str");
  for (int i=0; i < hardWrapedLines.length; i++) {
    String restOfLine=hardWrapedLines[i];
    while (restOfLine.length() > maxLength) {
      rv.add(restOfLine.substring(0,maxLength));
      restOfLine=restOfLine.substring(maxLength);
    }
    rv.add(hardWrapedLines[i]);
  }
  return rv;
}

Fixed version (ground truth):
/** 
 * Wraps a line so that the resulting parts are not longer than a given maximum length.
 * @param line       Line to wrap
 * @param maxLength  maximum length for the resulting parts
 * @return list of all wrapped parts
 */
private List<String> wrapLines(String line,int maxLength){
  List<String> rv=new ArrayList<String>();
  String[] hardWrapedLines=line.split("String_Node_Str");
  for (int i=0; i < hardWrapedLines.length; i++) {
    String restOfLine=hardWrapedLines[i];
    while (restOfLine.length() > maxLength) {
      rv.add(restOfLine.substring(0,maxLength));
      restOfLine=restOfLine.substring(maxLength);
    }
    rv.add(restOfLine);
  }
  return rv;
}
Program: 81057
Project: 81057
Buggy source:
@Override public int parseArguments(Parameters params) throws CmdLineException {
  MapSetter mapSetter=(MapSetter)setter;
  mapSetter.addValue(params.getParameter(0));
  return 1;
}

Fixed version (ground truth):
@Override public int parseArguments(Parameters params) throws CmdLineException {
  MapSetter mapSetter=(MapSetter)setter;
  try {
    mapSetter.addValue(params.getParameter(0));
  }
 catch (  RuntimeException e) {
    throw new CmdLineException(e.getMessage());
  }
  return 1;
}
Program: 81058
Project: 81058
Buggy source:
public void testNoSplitCharacter(){
  args=new String[]{"String_Node_Str","String_Node_Str"};
  try {
    parser.parseArgument(args);
  }
 catch (  CmdLineException e) {
  }
}

Fixed version (ground truth):
public void testNoSplitCharacter(){
  args=new String[]{"String_Node_Str","String_Node_Str"};
  try {
    parser.parseArgument(args);
    fail("String_Node_Str");
  }
 catch (  CmdLineException e) {
    assertEquals("String_Node_Str","String_Node_Str",e.getMessage());
  }
}
Program: 81059
Project: 81059
Buggy source:
public void testNoKey(){
  args=new String[]{"String_Node_Str","String_Node_Str"};
  try {
    parser.parseArgument(args);
  }
 catch (  CmdLineException e) {
  }
}

Fixed version (ground truth):
public void testNoKey(){
  args=new String[]{"String_Node_Str","String_Node_Str"};
  try {
    parser.parseArgument(args);
    fail("String_Node_Str");
  }
 catch (  CmdLineException e) {
    assertEquals("String_Node_Str","String_Node_Str",e.getMessage());
  }
}
Program: 81060
Project: 81060
Buggy source:
public AnnotationProcessorFactoryImpl(){
  outDir=new File(System.getProperty("String_Node_Str"));
  format=System.getProperty("String_Node_Str");
  String res=System.getProperty("String_Node_Str");
  if (res != null) {
    try {
      resource=new Properties();
      resource.load(new FileInputStream(res));
    }
 catch (    IOException e) {
      throw new Error(e);
    }
  }
}

Fixed version (ground truth):
public AnnotationProcessorFactoryImpl(){
  outDir=new File(System.getProperty("String_Node_Str"));
  format=System.getProperty("String_Node_Str");
  String res=System.getProperty("String_Node_Str");
  if (res != null && res.length() > 0) {
    try {
      resource=new Properties();
      resource.load(new FileInputStream(res));
    }
 catch (    IOException e) {
      throw new Error(e);
    }
  }
}
Program: 81061
Project: 81061
Buggy source:
public int run(String[] args) throws Exception {
  CmdLineParser parser=new CmdLineParser(this);
  try {
    parser.parseArgument(args);
  }
 catch (  CmdLineException e) {
    System.err.println(e.getMessage());
    printUsage(parser);
    return -1;
  }
  if (aptArgs.isEmpty()) {
    printUsage(parser);
    return 0;
  }
  System.setProperty("String_Node_Str",outDir.getPath());
  System.setProperty("String_Node_Str",mode.name());
  System.setProperty("String_Node_Str",resourceName);
  aptArgs.add(0,"String_Node_Str");
  ClassLoader cl=loadToolsJar();
  Class<?> apt=cl.loadClass("String_Node_Str");
  Method main=getProcessMethod(apt);
  return (Integer)main.invoke(null,new Object[]{cl.loadClass("String_Node_Str").newInstance(),aptArgs.toArray(new String[0])});
}

Fixed version (ground truth):
public int run(String[] args) throws Exception {
  CmdLineParser parser=new CmdLineParser(this);
  try {
    parser.parseArgument(args);
  }
 catch (  CmdLineException e) {
    System.err.println(e.getMessage());
    printUsage(parser);
    return -1;
  }
  if (aptArgs.isEmpty()) {
    printUsage(parser);
    return 0;
  }
  System.setProperty("String_Node_Str",outDir.getPath());
  System.setProperty("String_Node_Str",mode.name());
  if (resourceName == null)   resourceName="String_Node_Str";
  System.setProperty("String_Node_Str",resourceName);
  aptArgs.add(0,"String_Node_Str");
  ClassLoader cl=loadToolsJar();
  Class<?> apt=cl.loadClass("String_Node_Str");
  Method main=getProcessMethod(apt);
  return (Integer)main.invoke(null,new Object[]{cl.loadClass("String_Node_Str").newInstance(),aptArgs.toArray(new String[0])});
}
Program: 81062
Project: 81062
Buggy source:
public String getDefaultMetaVariable(){
  String n=enumType.getName();
  int idx=n.lastIndexOf(n,'.');
  if (idx >= 0)   n=n.substring(idx + 1);
  return n.toUpperCase();
}

Fixed version (ground truth):
public String getDefaultMetaVariable(){
  String n=enumType.getName();
  int idx=n.lastIndexOf('.');
  if (idx >= 0)   n=n.substring(idx + 1);
  return n.toUpperCase();
}
Program: 81063
Project: 81063
Buggy source:
private void startNfc(){
  createPendingIntent();
  getActivity().runOnUiThread(new Runnable(){
    public void run(){
      NfcAdapter nfcAdapter=NfcAdapter.getDefaultAdapter(getActivity());
      if (nfcAdapter != null) {
        nfcAdapter.enableForegroundDispatch(getActivity(),getPendingIntent(),getIntentFilters(),getTechLists());
        if (p2pMessage != null) {
          nfcAdapter.setNdefPushMessage(p2pMessage,getActivity());
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void startNfc(){
  createPendingIntent();
  getActivity().runOnUiThread(new Runnable(){
    public void run(){
      NfcAdapter nfcAdapter=NfcAdapter.getDefaultAdapter(getActivity());
      if (nfcAdapter != null && getActivity().isFinishing() == false) {
        nfcAdapter.enableForegroundDispatch(getActivity(),getPendingIntent(),getIntentFilters(),getTechLists());
        if (p2pMessage != null) {
          nfcAdapter.setNdefPushMessage(p2pMessage,getActivity());
        }
      }
    }
  }
);
}
Program: 81064
Project: 81064
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (mArrivalsListHeader != null && mSlidingPanel != null) {
    mArrivalsListHeader.setSlidingPanelCollapsed(isSlidingPanelCollapsed());
  }
  checkLeftHandMode();
  updateLayersFabVisibility();
  mFabMyLocation.requestLayout();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (mArrivalsListHeader != null && mSlidingPanel != null) {
    mArrivalsListHeader.setSlidingPanelCollapsed(isSlidingPanelCollapsed());
  }
  checkLeftHandMode();
  updateLayersFab();
  mFabMyLocation.requestLayout();
}
Program: 81065
Project: 81065
Buggy source:
@Override public void onRegionTaskFinished(boolean currentRegionChanged){
  boolean update=autoShowWhatsNew();
  if (currentRegionChanged || update) {
    redrawNavigationDrawerFragment();
  }
  if (currentRegionChanged && Application.getPrefs().getBoolean(getString(R.string.preference_key_auto_select_region),true) && Application.get().getCurrentRegion() != null && UIUtils.canManageDialog(this)) {
    Toast.makeText(getApplicationContext(),getString(R.string.region_region_found,Application.get().getCurrentRegion().getName()),Toast.LENGTH_LONG).show();
  }
  updateLayersFabVisibility();
}

Fixed version (ground truth):
@Override public void onRegionTaskFinished(boolean currentRegionChanged){
  boolean update=autoShowWhatsNew();
  if (currentRegionChanged || update) {
    redrawNavigationDrawerFragment();
  }
  if (currentRegionChanged && Application.getPrefs().getBoolean(getString(R.string.preference_key_auto_select_region),true) && Application.get().getCurrentRegion() != null && UIUtils.canManageDialog(this)) {
    Toast.makeText(getApplicationContext(),getString(R.string.region_region_found,Application.get().getCurrentRegion().getName()),Toast.LENGTH_LONG).show();
  }
  updateLayersFab();
}