nus-yam/ex-repair huggingface dataset:
Program: 80217
Project: 80217
Buggy source:
/** 
 * Provide information only for current project
 */
@NotNull public static List<ChangeInfo> getChangesForProject(@NotNull String url,@NotNull String login,@NotNull String password,@NotNull final Project project){
  List<GitRepository> repositories=GitUtil.getRepositoryManager(project).getRepositories();
  if (repositories.isEmpty()) {
    showAddGitRepositoryNotification(project);
    return Lists.newArrayList();
  }
  List<GitRemote> remotes=Lists.newArrayList();
  for (  GitRepository repository : repositories) {
    remotes.addAll(repository.getRemotes());
  }
  String host=parseUri(url).getHost();
  List<String> projectNames=Lists.newArrayList();
  for (  GitRemote remote : remotes) {
    for (    String repositoryUrl : remote.getUrls()) {
      String repositoryHost=parseUri(repositoryUrl).getHost();
      if (repositoryHost != null && repositoryHost.equals(host)) {
        projectNames.add("String_Node_Str" + getProjectName(repositoryUrl));
      }
    }
  }
  if (projectNames.isEmpty()) {
    return Collections.emptyList();
  }
  String projectQuery=Joiner.on("String_Node_Str").join(projectNames);
  return getChanges(url,login,password,"String_Node_Str" + projectQuery + ')');
}

Fixed version (ground truth):
/** 
 * Provide information only for current project
 */
@NotNull public static List<ChangeInfo> getChangesForProject(@NotNull String url,@NotNull String login,@NotNull String password,@NotNull final Project project){
  List<GitRepository> repositories=GitUtil.getRepositoryManager(project).getRepositories();
  if (repositories.isEmpty()) {
    showAddGitRepositoryNotification(project);
    return Lists.newArrayList();
  }
  List<GitRemote> remotes=Lists.newArrayList();
  for (  GitRepository repository : repositories) {
    remotes.addAll(repository.getRemotes());
  }
  String host=parseUri(url).getHost();
  List<String> projectNames=Lists.newArrayList();
  for (  GitRemote remote : remotes) {
    for (    String repositoryUrl : remote.getUrls()) {
      String repositoryHost=parseUri(repositoryUrl).getHost();
      if (repositoryHost != null && repositoryHost.equals(host)) {
        projectNames.add("String_Node_Str" + getProjectName(url,repositoryUrl));
      }
    }
  }
  if (projectNames.isEmpty()) {
    return Collections.emptyList();
  }
  String projectQuery=Joiner.on("String_Node_Str").join(projectNames);
  return getChanges(url,login,password,"String_Node_Str" + projectQuery + ')');
}
Program: 80218
Project: 80218
Buggy source:
@Nullable private static JsonElement request(@NotNull String host,@Nullable String login,@Nullable String password,@NotNull String path,@Nullable String requestBody,boolean post){
  HttpMethod method=null;
  try {
    method=doREST(host,login,password,path,requestBody,post);
    String resp=method.getResponseBodyAsString();
    if (method.getStatusCode() != 200) {
      String message=String.format("String_Node_Str",method.getStatusCode(),method.getStatusText());
      LOG.warn(message);
      throw new HttpStatusException(method.getStatusCode(),method.getStatusText(),message);
    }
    if (resp == null) {
      String message=String.format("String_Node_Str",resp);
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    return parseResponse(resp);
  }
 catch (  IOException e) {
    LOG.warn(String.format("String_Node_Str",e.getMessage()),e);
    throw Throwables.propagate(e);
  }
 finally {
    if (method != null) {
      method.releaseConnection();
    }
  }
}

Fixed version (ground truth):
@Nullable private static JsonElement request(@NotNull String host,@Nullable String login,@Nullable String password,@NotNull String path,@Nullable String requestBody,boolean post){
  HttpMethod method=null;
  try {
    method=doREST(host,login,password,path,requestBody,post);
    String resp=method.getResponseBodyAsString();
    if (method.getStatusCode() != 200) {
      String message=String.format("String_Node_Str",method.getStatusText(),method.getStatusCode());
      LOG.warn(message);
      throw new HttpStatusException(method.getStatusCode(),method.getStatusText(),message);
    }
    if (resp == null) {
      String message=String.format("String_Node_Str",resp);
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    return parseResponse(resp);
  }
 catch (  IOException e) {
    LOG.warn(String.format("String_Node_Str",e.getMessage()),e);
    throw Throwables.propagate(e);
  }
 finally {
    if (method != null) {
      method.releaseConnection();
    }
  }
}
Program: 80219
Project: 80219
Buggy source:
@Nullable private static HttpMethod handleCertificateExceptionAndRetry(@NotNull IOException e,@NotNull String host,@NotNull HttpClient client,@NotNull URI uri,@NotNull ThrowableConvertor<String,HttpMethod,IOException> methodCreator) throws IOException {
  if (!isCertificateException(e)) {
    throw e;
  }
  if (isTrusted(host)) {
    HostConfiguration hc=new HostConfiguration();
    String relativeUri=new URI(uri.getPathQuery(),false).getURI();
    HttpMethod method=methodCreator.convert(relativeUri);
    client.executeMethod(hc,method);
    return method;
  }
  throw e;
}

Fixed version (ground truth):
@Nullable private static HttpMethod handleCertificateExceptionAndRetry(@NotNull IOException e,@NotNull String host,@NotNull HttpClient client,@NotNull URI uri,@NotNull ThrowableConvertor<String,HttpMethod,IOException> methodCreator) throws IOException {
  if (!isCertificateException(e)) {
    throw e;
  }
  if (isTrusted(host)) {
    Protocol easyHttps=new Protocol("String_Node_Str",(ProtocolSocketFactory)new EasySSLProtocolSocketFactory(),443);
    HostConfiguration hc=new HostConfiguration();
    hc.setHost(host,443,easyHttps);
    String relativeUri=new URI(uri.getPathQuery(),false).getURI();
    HttpMethod method=methodCreator.convert(relativeUri);
    client.executeMethod(hc,method);
    return method;
  }
  throw e;
}
Program: 80220
Project: 80220
Buggy source:
private static void saveToTrusted(@NotNull String host){
  GerritSettings.getInstance().addTrustedHost(host);
}

Fixed version (ground truth):
private static void saveToTrusted(@NotNull String host){
  try {
    GerritSettings.getInstance().addTrustedHost(new java.net.URI(host).getHost());
  }
 catch (  URISyntaxException e) {
    throw Throwables.propagate(e);
  }
}
Program: 80221
Project: 80221
Buggy source:
@Nullable private static JsonElement request(@NotNull String host,@Nullable String login,@Nullable String password,@NotNull String path,@Nullable String requestBody,boolean post){
  HttpMethod method=null;
  try {
    method=doREST(host,login,password,path,requestBody,post);
    String resp=method.getResponseBodyAsString();
    if (method.getStatusCode() != 200) {
      String message=String.format("String_Node_Str",method.getStatusCode(),method.getStatusText());
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    if (resp == null) {
      String message=String.format("String_Node_Str",resp);
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    return parseResponse(resp);
  }
 catch (  IOException e) {
    LOG.warn(String.format("String_Node_Str",e.getMessage()),e);
    throw Throwables.propagate(e);
  }
 finally {
    if (method != null) {
      method.releaseConnection();
    }
  }
}

Fixed version (ground truth):
@Nullable private static JsonElement request(@NotNull String host,@Nullable String login,@Nullable String password,@NotNull String path,@Nullable String requestBody,boolean post){
  HttpMethod method=null;
  try {
    method=doREST(host,login,password,path,requestBody,post);
    String resp=method.getResponseBodyAsString();
    if (method.getStatusCode() != 200) {
      String message=String.format("String_Node_Str",method.getStatusCode(),method.getStatusText());
      LOG.warn(message);
      throw new HttpStatusException(method.getStatusCode(),method.getStatusText(),message);
    }
    if (resp == null) {
      String message=String.format("String_Node_Str",resp);
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    return parseResponse(resp);
  }
 catch (  IOException e) {
    LOG.warn(String.format("String_Node_Str",e.getMessage()),e);
    throw Throwables.propagate(e);
  }
 finally {
    if (method != null) {
      method.releaseConnection();
    }
  }
}
Program: 80222
Project: 80222
Buggy source:
@NotNull private static JsonElement parseResponse(@NotNull String response){
  try {
    return new JsonParser().parse(response);
  }
 catch (  JsonSyntaxException jse) {
    if (response.startsWith("String_Node_Str")) {
      throw new NotFoundException();
    }
    throw new RuntimeException(String.format("String_Node_Str",response),jse);
  }
}

Fixed version (ground truth):
@NotNull private static JsonElement parseResponse(@NotNull String response){
  try {
    return new JsonParser().parse(response);
  }
 catch (  JsonSyntaxException jse) {
    throw new RuntimeException(String.format("String_Node_Str",response),jse);
  }
}
Program: 80223
Project: 80223
Buggy source:
/** 
 * Support starting from Gerrit 2.7.
 */
@NotNull public static TreeMap<String,List<CommentInfo>> getComments(@NotNull String url,@NotNull String login,@NotNull String password,@NotNull String changeId,@NotNull String revision){
  final String request="String_Node_Str" + changeId + "String_Node_Str"+ revision+ "String_Node_Str";
  try {
    JsonElement result=GerritApiUtil.getRequest(url,login,password,request);
    if (result == null) {
      return Maps.newTreeMap();
    }
    return parseCommentInfos(result);
  }
 catch (  NotFoundException e) {
    LOG.warn("String_Node_Str");
    return Maps.newTreeMap();
  }
}

Fixed version (ground truth):
/** 
 * Support starting from Gerrit 2.7.
 */
@NotNull public static TreeMap<String,List<CommentInfo>> getComments(@NotNull String url,@NotNull String login,@NotNull String password,@NotNull String changeId,@NotNull String revision){
  final String request="String_Node_Str" + changeId + "String_Node_Str"+ revision+ "String_Node_Str";
  try {
    JsonElement result=GerritApiUtil.getRequest(url,login,password,request);
    if (result == null) {
      return Maps.newTreeMap();
    }
    return parseCommentInfos(result);
  }
 catch (  HttpStatusException e) {
    if (e.getStatusCode() == 404) {
      LOG.warn("String_Node_Str");
    }
    return Maps.newTreeMap();
  }
}
Program: 80224
Project: 80224
Buggy source:
/** 
 * Attempts to create a player account for the given player on the specified world IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
 * @return if the account creation was successful
 */
public boolean createPlayerAccount(OfflinePlayer player,String worldName);

Fixed version (ground truth):
/** 
 * Attempts to create a player account for the given player on the specified world IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
 * @param player OfflinePlayer
 * @param worldName String name of the world
 * @return if the account creation was successful
 */
public boolean createPlayerAccount(OfflinePlayer player,String worldName);
Program: 80225
Project: 80225
Buggy source:
/** 
 * Store container diagnostics if container info is available. If diagnostics information for this container already existed, it will be overwritten.
 * @param containerId id of the container
 * @param exitCode exit code reason (of type {@link ContainerExitStatus})
 * @param diagnostics any textual message
 * @param state final state of container (of type {@link StateValues})
 * @param logLink jobhistory link for a finished container or nodemanager linkfor a running one
 * @param completionTime the end time of a container (if it has completed, 0otherwise)
 */
public void storeContainerDiagnostics(String containerId,int exitCode,String diagnostics,int state,String logLink,long completionTime){
  ContainerInformation containerInfo=getApplicationDiagnostics().getContainer(containerId);
  if (containerInfo != null) {
    containerInfo.exitCode=exitCode;
    if (StringUtils.isNotBlank(diagnostics)) {
      containerInfo.diagnostics=diagnostics;
    }
 else {
      containerInfo.diagnostics=ErrorStrings.E_MISSING_DIAGNOSTICS_FROM_YARN;
    }
    containerInfo.state=state;
    if (logLink != null) {
      containerInfo.logLink=logLink;
    }
    containerInfo.completionTime=completionTime;
  }
}

Fixed version (ground truth):
/** 
 * Store container diagnostics if container info is available. If diagnostics information for this container already existed, it will be overwritten.
 * @param containerId id of the container
 * @param exitCode exit code reason (of type {@link ContainerExitStatus})
 * @param diagnostics any textual message
 * @param state final state of container (of type {@link StateValues})
 * @param logLink jobhistory link for a finished container or nodemanager linkfor a running one
 * @param completionTime the end time of a container (if it has completed, 0otherwise)
 */
public void storeContainerDiagnostics(String containerId,int exitCode,String diagnostics,int state,String logLink,long completionTime){
  ContainerInformation containerInfo=getApplicationDiagnostics().getContainer(containerId);
  if (containerInfo != null) {
    containerInfo.exitCode=exitCode;
    if (StringUtils.isNotBlank(diagnostics)) {
      containerInfo.diagnostics=diagnostics;
    }
    containerInfo.state=state;
    if (logLink != null) {
      containerInfo.logLink=logLink;
    }
    containerInfo.completionTime=completionTime;
  }
}
Program: 80226
Project: 80226
Buggy source:
@VisibleForTesting protected Metainfo getMetaInfo(String roleGroup){
  ConfTreeOperations appConf=getAmState().getAppConfSnapshot();
  String mapKey=appConf.getComponentOpt(roleGroup,ROLE_PREFIX,DEFAULT_METAINFO_MAP_KEY);
  MetainfoHolder mh=this.metaInfoMap.get(mapKey);
  if (mh == null) {
    return null;
  }
  return mh.metaInfo;
}

Fixed version (ground truth):
@VisibleForTesting protected Metainfo getMetaInfo(String roleGroup){
  String mapKey=DEFAULT_METAINFO_MAP_KEY;
  if (roleGroup != null) {
    ConfTreeOperations appConf=getAmState().getAppConfSnapshot();
    mapKey=appConf.getComponentOpt(roleGroup,ROLE_PREFIX,DEFAULT_METAINFO_MAP_KEY);
  }
  MetainfoHolder mh=this.metaInfoMap.get(mapKey);
  if (mh == null) {
    return null;
  }
  return mh.metaInfo;
}
Program: 80231
Project: 80231
Buggy source:
private void createConfigFile(SliderFileSystem fileSystem,File file,ConfigFile configFile,Map<String,String> config) throws IOException {
  ConfigFormat configFormat=ConfigFormat.resolve(configFile.getType());
  log.info("String_Node_Str",configFormat,file);
  ConfigUtils.prepConfigForTemplateOutputter(configFormat,config,fileSystem,getClusterName(),file.getName());
  PublishedConfiguration publishedConfiguration=new PublishedConfiguration(configFile.getDictionaryName(),config.entrySet());
  PublishedConfigurationOutputter configurationOutputter=PublishedConfigurationOutputter.createOutputter(configFormat,publishedConfiguration);
  configurationOutputter.save(file);
}

Fixed version (ground truth):
private synchronized void createConfigFile(SliderFileSystem fileSystem,File file,ConfigFile configFile,Map<String,String> config) throws IOException {
  ConfigFormat configFormat=ConfigFormat.resolve(configFile.getType());
  if (file.exists()) {
    log.info("String_Node_Str",configFormat,file);
    return;
  }
  log.info("String_Node_Str",configFormat,file);
  ConfigUtils.prepConfigForTemplateOutputter(configFormat,config,fileSystem,getClusterName(),file.getName());
  PublishedConfiguration publishedConfiguration=new PublishedConfiguration(configFile.getDictionaryName(),config.entrySet());
  PublishedConfigurationOutputter configurationOutputter=PublishedConfigurationOutputter.createOutputter(configFormat,publishedConfiguration);
  configurationOutputter.save(file);
}
Program: 80233
Project: 80233
Buggy source:
@Override public void execute(SliderAppMaster appMaster,QueueAccess queueService,AppState appState) throws Exception {
  if (fs != null) {
synchronized (fs) {
      try {
        long expires=remoteUser.doAs(new PrivilegedExceptionAction<Long>(){
          @Override public Long run() throws Exception {
            long expires=token.renew(fs.getConf());
            log.info("String_Node_Str",getPrintableExirationTime(expires));
            return expires;
          }
        }
);
        long calculatedInterval=tokenExpiryTime - Time.now();
        if (calculatedInterval < renewInterval) {
          log.info("String_Node_Str",calculatedInterval);
          getNewToken();
        }
 else {
          updateRenewalTime(renewInterval);
        }
      }
 catch (      IOException ie) {
        log.info("String_Node_Str",ie);
        getNewToken();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void execute(SliderAppMaster appMaster,QueueAccess queueService,AppState appState) throws Exception {
  if (fs != null) {
synchronized (fs) {
      try {
        long expires=remoteUser.doAs(new PrivilegedExceptionAction<Long>(){
          @Override public Long run() throws Exception {
            long expires=token.renew(fs.getConf());
            log.info("String_Node_Str",getPrintableExpirationTime(expires));
            return expires;
          }
        }
);
        long calculatedInterval=tokenExpiryTime - Time.now();
        if (calculatedInterval < renewInterval) {
          log.info("String_Node_Str",calculatedInterval);
          getNewToken();
        }
 else {
          updateRenewalTime(renewInterval);
        }
      }
 catch (      IOException ie) {
        log.info("String_Node_Str",ie);
        getNewToken();
      }
    }
  }
}
Program: 80234
Project: 80234
Buggy source:
RenewAction(String name,Configuration configuration) throws IOException, InterruptedException {
  super(name);
  this.configuration=configuration;
  fs=getFileSystem();
synchronized (fs) {
    this.token=remoteUser.doAs(new PrivilegedExceptionAction<Token<?>>(){
      @Override public Token<?> run() throws Exception {
        log.info("String_Node_Str",remoteUser.getShortUserName());
        Token token=fs.getDelegationToken(remoteUser.getShortUserName());
        tokenExpiryTime=getTokenExpiryTime(token);
        log.info("String_Node_Str",getPrintableExirationTime(tokenExpiryTime));
        return token;
      }
    }
);
  }
  log.info("String_Node_Str",token);
}

Fixed version (ground truth):
RenewAction(String name,Configuration configuration) throws IOException, InterruptedException {
  super(name);
  this.configuration=configuration;
  fs=getFileSystem();
synchronized (fs) {
    this.token=remoteUser.doAs(new PrivilegedExceptionAction<Token<?>>(){
      @Override public Token<?> run() throws Exception {
        log.info("String_Node_Str",remoteUser.getShortUserName());
        Token token=fs.getDelegationToken(remoteUser.getShortUserName());
        tokenExpiryTime=getTokenExpiryTime(token);
        log.info("String_Node_Str",getPrintableExpirationTime(tokenExpiryTime));
        return token;
      }
    }
);
  }
  log.info("String_Node_Str",token);
}
Program: 80235
Project: 80235
Buggy source:
private void getNewToken() throws InterruptedException, IOException {
  try {
    Text service=token.getService();
    Token<?>[] tokens=remoteUser.doAs(new PrivilegedExceptionAction<Token<?>[]>(){
      @Override public Token<?>[] run() throws Exception {
        return fs.addDelegationTokens(remoteUser.getShortUserName(),null);
      }
    }
);
    if (tokens.length == 0) {
      throw new IOException("String_Node_Str");
    }
    token=findMatchingToken(service,tokens);
    currentUser.addToken(token.getService(),token);
    tokenExpiryTime=getTokenExpiryTime(token);
    log.info("String_Node_Str" + "String_Node_Str",getPrintableExirationTime(tokenExpiryTime));
    updateRenewalTime(renewInterval);
  }
 catch (  IOException ie2) {
    throw new IOException("String_Node_Str",ie2);
  }
}

Fixed version (ground truth):
private void getNewToken() throws InterruptedException, IOException {
  try {
    Text service=token.getService();
    Token<?>[] tokens=remoteUser.doAs(new PrivilegedExceptionAction<Token<?>[]>(){
      @Override public Token<?>[] run() throws Exception {
        return fs.addDelegationTokens(remoteUser.getShortUserName(),null);
      }
    }
);
    if (tokens.length == 0) {
      throw new IOException("String_Node_Str");
    }
    token=findMatchingToken(service,tokens);
    currentUser.addToken(token.getService(),token);
    tokenExpiryTime=getTokenExpiryTime(token);
    log.info("String_Node_Str" + "String_Node_Str",getPrintableExpirationTime(tokenExpiryTime));
    updateRenewalTime(renewInterval);
  }
 catch (  IOException ie2) {
    throw new IOException("String_Node_Str",ie2);
  }
}
Program: 80236
Project: 80236
Buggy source:
private void validateKeystore(File keystoreFile) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
  Assert.assertTrue("String_Node_Str",keystoreFile.exists());
  InputStream is=null;
  try {
    is=new FileInputStream(keystoreFile);
    KeyStore keystore=KeyStore.getInstance("String_Node_Str");
    String password="String_Node_Str";
    keystore.load(is,password.toCharArray());
    Certificate certificate=keystore.getCertificate(keystore.aliases().nextElement());
    Assert.assertNotNull(certificate);
    if (certificate instanceof X509Certificate) {
      X509Certificate x509cert=(X509Certificate)certificate;
      Principal principal=x509cert.getSubjectDN();
      String subjectDn=principal.getName();
      Assert.assertEquals("String_Node_Str","String_Node_Str",subjectDn);
      principal=x509cert.getIssuerDN();
      String issuerDn=principal.getName();
      Assert.assertEquals("String_Node_Str","String_Node_Str",issuerDn);
    }
  }
  finally {
    if (null != is) {
      is.close();
    }
  }
}

Fixed version (ground truth):
private void validateKeystore(File keystoreFile) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
  Assert.assertTrue("String_Node_Str",keystoreFile.exists());
  InputStream is=null;
  try {
    is=new FileInputStream(keystoreFile);
    KeyStore keystore=KeyStore.getInstance("String_Node_Str");
    String password="String_Node_Str";
    keystore.load(is,password.toCharArray());
    Certificate certificate=keystore.getCertificate(keystore.aliases().nextElement());
    Assert.assertNotNull(certificate);
    if (certificate instanceof X509Certificate) {
      X509Certificate x509cert=(X509Certificate)certificate;
      Principal principal=x509cert.getSubjectDN();
      String subjectDn=principal.getName();
      Assert.assertEquals("String_Node_Str","String_Node_Str",subjectDn);
      principal=x509cert.getIssuerDN();
      String issuerDn=principal.getName();
      Assert.assertEquals("String_Node_Str","String_Node_Str" + InetAddress.getLocalHost().getHostName(),issuerDn);
    }
  }
  finally {
    if (null != is) {
      is.close();
    }
  }
}
Program: 80237
Project: 80237
Buggy source:
@Test public void testAMKeystoreGenerated() throws Exception {
  File keystoreFile=new File(secDir,SliderKeys.KEYSTORE_FILE_NAME);
  Assert.assertTrue("String_Node_Str" + keystoreFile,keystoreFile.exists());
  InputStream is=null;
  try {
    is=new FileInputStream(keystoreFile);
    KeyStore keystore=KeyStore.getInstance("String_Node_Str");
    String password=SecurityUtils.getKeystorePass();
    keystore.load(is,password.toCharArray());
    Certificate certificate=keystore.getCertificate(keystore.aliases().nextElement());
    Assert.assertNotNull(certificate);
    if (certificate instanceof X509Certificate) {
      X509Certificate x509cert=(X509Certificate)certificate;
      Principal principal=x509cert.getSubjectDN();
      String subjectDn=principal.getName();
      Assert.assertEquals("String_Node_Str","String_Node_Str",subjectDn);
      principal=x509cert.getIssuerDN();
      String issuerDn=principal.getName();
      Assert.assertEquals("String_Node_Str","String_Node_Str",issuerDn);
    }
  }
  finally {
    if (null != is) {
      is.close();
    }
  }
}

Fixed version (ground truth):
@Test public void testAMKeystoreGenerated() throws Exception {
  File keystoreFile=new File(secDir,SliderKeys.KEYSTORE_FILE_NAME);
  Assert.assertTrue("String_Node_Str" + keystoreFile,keystoreFile.exists());
  InputStream is=null;
  try {
    is=new FileInputStream(keystoreFile);
    KeyStore keystore=KeyStore.getInstance("String_Node_Str");
    String password=SecurityUtils.getKeystorePass();
    keystore.load(is,password.toCharArray());
    Certificate certificate=keystore.getCertificate(keystore.aliases().nextElement());
    Assert.assertNotNull(certificate);
    if (certificate instanceof X509Certificate) {
      X509Certificate x509cert=(X509Certificate)certificate;
      Principal principal=x509cert.getSubjectDN();
      String subjectDn=principal.getName();
      Assert.assertEquals("String_Node_Str","String_Node_Str",subjectDn);
      principal=x509cert.getIssuerDN();
      String issuerDn=principal.getName();
      Assert.assertEquals("String_Node_Str","String_Node_Str" + InetAddress.getLocalHost().getHostName(),issuerDn);
    }
  }
  finally {
    if (null != is) {
      is.close();
    }
  }
}
Program: 80238
Project: 80238
Buggy source:
protected void resetResponse(){
  response=createResponse();
}

Fixed version (ground truth):
protected void resetResponse(){
  CookieStore cookieStore=null;
  if (storeCookies) {
    cookieStore=getResponse().getCookieStore();
    if (cookieStore == null) {
      cookieStore=new BasicCookieStore();
    }
  }
  response=createResponse();
  if (storeCookies) {
    response.setCookieStore(cookieStore);
  }
}
Program: 80239
Project: 80239
Buggy source:
/** 
 * @param headerName name of response header.
 * @return value of header in last response.
 */
public String responseHeader(String headerName){
  return responseHeaders().get(headerName);
}

Fixed version (ground truth):
/** 
 * @param headerName name of response header.
 * @return value of header in last response (may be a list if the saame header name was sent multiple times(e.g. Set-Cookie).
 */
public Object responseHeader(String headerName){
  return responseHeaders().get(headerName);
}
Program: 80240
Project: 80240
Buggy source:
/** 
 * @return headers received with response to last request.
 */
public Map<String,String> responseHeaders(){
  return response.getResponseHeaders();
}

Fixed version (ground truth):
/** 
 * @return headers received with response to last request.
 */
public Map<String,Object> responseHeaders(){
  return response.getResponseHeaders();
}
Program: 80242
Project: 80242
Buggy source:
/** 
 * @return headers in response.
 */
public Map<String,String> getResponseHeaders(){
  return responseHeaders;
}

Fixed version (ground truth):
/** 
 * @return headers in response.
 */
public Map<String,Object> getResponseHeaders(){
  return responseHeaders;
}
Program: 80243
Project: 80243
Buggy source:
/** 
 * Takes screenshot from current page
 * @param basename filename (below screenshot base directory).
 * @return location of screenshot.
 */
public String takeScreenshot(String basename){
  String screenshotFile=createScreenshot(basename);
  if (screenshotFile == null) {
    throw new SlimFixtureException(false,"String_Node_Str");
  }
 else {
    screenshotFile=getScreenshotLink(screenshotFile);
  }
  return screenshotFile;
}

Fixed version (ground truth):
/** 
 * Takes screenshot from current page
 * @param basename filename (below screenshot base directory).
 * @return location of screenshot.
 */
public String takeScreenshot(String basename){
  try {
    String screenshotFile=createScreenshot(basename);
    if (screenshotFile == null) {
      throw new SlimFixtureException(false,"String_Node_Str");
    }
 else {
      screenshotFile=getScreenshotLink(screenshotFile);
    }
    return screenshotFile;
  }
 catch (  UnhandledAlertException e) {
    return String.format("String_Node_Str" + "String_Node_Str",StringEscapeUtils.escapeHtml4(alertText()));
  }
}
Program: 80244
Project: 80244
Buggy source:
@Test public void testBadXPath(){
  String responseString=FileUtil.loadFile("String_Node_Str");
  assertEquals("String_Node_Str",XPathHelper.getXPath(null,responseString,"String_Node_Str"));
  try {
    XPathHelper.getXPath(null,responseString,"String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  FitFailureException e) {
    assertEquals("String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testBadXPath(){
  String responseString=FileUtil.loadFile("String_Node_Str");
  assertEquals("String_Node_Str",XPathHelper.getXPath(null,responseString,"String_Node_Str"));
  try {
    XPathHelper.getXPath(null,responseString,"String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  FitFailureException e) {
    assertEquals("String_Node_Str" + "String_Node_Str",e.getMessage());
  }
}
Program: 80245
Project: 80245
Buggy source:
private KeyInfo newKeyInfo(final List<Certificate> certs,final String keyInfoId,final boolean addKeyValue,final boolean addKeyName) throws KeyException {
  final List<Certificate> certificates=EscapeHelper.getEscapedCertificates(certs);
  final KeyInfoFactory keyInfoFactory=getXMLSignatureFactory().getKeyInfoFactory();
  final List<Certificate> x509DataList=new ArrayList<Certificate>();
  if (!XmlWrappedKeyInfo.PUBLIC_KEY.equals(getXmlWrappedKeyInfo())) {
    for (    final Certificate cert : certificates) {
      x509DataList.add(cert);
    }
  }
  final List<XMLStructure> newList=new ArrayList<XMLStructure>();
  newList.add(keyInfoFactory.newX509Data(x509DataList));
  if (addKeyValue) {
    newList.add(keyInfoFactory.newKeyValue(certificates.get(0).getPublicKey()));
  }
  if (addKeyName) {
    newList.add(keyInfoFactory.newKeyName(((X509Certificate)certificates.get(0)).getSubjectX500Principal().toString()));
  }
  return keyInfoFactory.newKeyInfo(newList,keyInfoId);
}

Fixed version (ground truth):
private KeyInfo newKeyInfo(final List<Certificate> certs,final String keyInfoId,final boolean addKeyValue,final boolean addKeyName) throws KeyException {
  final List<Certificate> certificates=EscapeHelper.getEscapedCertificates(certs);
  final KeyInfoFactory keyInfoFactory=getXMLSignatureFactory().getKeyInfoFactory();
  final List<Certificate> x509DataList=new ArrayList<Certificate>();
  if (!XmlWrappedKeyInfo.PUBLIC_KEY.equals(getXmlWrappedKeyInfo())) {
    for (    final Certificate cert : certificates) {
      x509DataList.add(cert);
    }
  }
  final List<XMLStructure> newList=new ArrayList<XMLStructure>();
  newList.add(keyInfoFactory.newX509Data(x509DataList));
  if (addKeyValue) {
    newList.add(keyInfoFactory.newKeyValue(certificates.get(0).getPublicKey()));
  }
  if (addKeyName) {
    newList.add(keyInfoFactory.newKeyName(EscapeHelper.escapeLdapName(((X509Certificate)certificates.get(0)).getSubjectX500Principal().toString())));
  }
  return keyInfoFactory.newKeyInfo(newList,keyInfoId);
}
Program: 80250
Project: 80250
Buggy source:
/** 
 * Anade un destinatario del origen seleccionado en el combo
 * @param listaModel Modelo de la lista de destinatarios
 */
private void anadirActionPerformed(JComboBox comboDestinatarios,DefaultListModel listaModel,JButton eliminar){
  AOKeyStoreManager keyStoreManager=null;
  KeyStoreConfiguration kc=(KeyStoreConfiguration)comboDestinatarios.getSelectedItem();
  try {
    AOKeyStore ao=kc.getType();
    keyStoreManager=AOKeyStoreManagerFactory.getAOKeyStoreManager(ao,null,null,getPreferredPCB(ao),this);
  }
 catch (  AOCancelledOperationException e) {
    logger.severe("String_Node_Str");
    return;
  }
catch (  Exception e) {
    e.printStackTrace();
    logger.severe("String_Node_Str" + e);
    JOptionPane.showMessageDialog(this,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
    return;
  }
  CertificateDestiny certDest=new CertificateDestiny(keyStoreManager,this);
  if (certDest.getAlias() != null && !certDest.equals("String_Node_Str")) {
    boolean copiar=true;
    for (int i=0; i < listaModel.getSize(); i++) {
      CertificateDestiny c=(CertificateDestiny)listaModel.getElementAt(i);
      if (certDest.getAlias().equals(c.getAlias())) {
        copiar=false;
      }
    }
    if (copiar) {
      listaModel.addElement(certDest.getAlias());
      listaCertificados.add(certDest);
      eliminar.setEnabled(true);
    }
 else     JOptionPane.showMessageDialog(this,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.WARNING_MESSAGE);
  }
}

Fixed version (ground truth):
/** 
 * Anade un destinatario del origen seleccionado en el combo
 * @param listaModel Modelo de la lista de destinatarios
 */
private void anadirActionPerformed(JComboBox comboDestinatarios,DefaultListModel listaModel,JButton eliminar){
  AOKeyStoreManager keyStoreManager=null;
  KeyStoreConfiguration kc=(KeyStoreConfiguration)comboDestinatarios.getSelectedItem();
  try {
    AOKeyStore ao=kc.getType();
    keyStoreManager=AOKeyStoreManagerFactory.getAOKeyStoreManager(ao,null,null,getPreferredPCB(ao),this);
  }
 catch (  AOCancelledOperationException e) {
    logger.severe("String_Node_Str");
    return;
  }
catch (  Exception e) {
    e.printStackTrace();
    logger.severe("String_Node_Str" + e);
    JOptionPane.showMessageDialog(this,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
    return;
  }
  CertificateDestiny certDest=new CertificateDestiny(keyStoreManager,this);
  if (certDest.getAlias() != null && !certDest.equals("String_Node_Str")) {
    boolean copiar=true;
    for (int i=0; i < listaModel.getSize(); i++) {
      if (certDest.getAlias().equals((String)listaModel.getElementAt(i))) {
        copiar=false;
      }
    }
    if (copiar) {
      listaModel.addElement(certDest.getAlias());
      listaCertificados.add(certDest);
      eliminar.setEnabled(true);
    }
 else     JOptionPane.showMessageDialog(this,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.WARNING_MESSAGE);
  }
}
Program: 80251
Project: 80251
Buggy source:
private void loadDefaultKeyStore(){
  this.container.setCursor(new Cursor(Cursor.WAIT_CURSOR));
  try {
    new SimpleKeyStoreManagerWorker(this,null,false).execute();
  }
 catch (  final Exception e) {
    Logger.getLogger("String_Node_Str").severe("String_Node_Str" + e);
    JOptionPane.showOptionDialog(this.container,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.CLOSED_OPTION,JOptionPane.ERROR_MESSAGE,null,new Object[]{Messages.getString("String_Node_Str")},null);
    closeApplication(-2);
  }
 finally {
    this.container.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  }
}

Fixed version (ground truth):
private void loadDefaultKeyStore(){
  this.container.setCursor(new Cursor(Cursor.WAIT_CURSOR));
  try {
    new SimpleKeyStoreManagerWorker(this,null,false).execute();
  }
 catch (  final Exception e) {
    Logger.getLogger("String_Node_Str").severe("String_Node_Str" + e);
    UIUtils.showErrorMessage(this.container,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
    closeApplication(-2);
  }
 finally {
    this.container.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  }
}
Program: 80253
Project: 80253
Buggy source:
/** 
 * Carga el fichero a firmar. Este m&eacute;todo se situa aqu&iacute; para permitir su acceso desde la barra de men&uacute;
 * @param filePath Fichero a firmar, incluyendo su ruta completa 
 */
public void loadFileToSign(final String filePath){
  if (this.currentPanel instanceof SignPanel) {
    try {
      ((SignPanel)this.currentPanel).loadFile(filePath);
    }
 catch (    final Exception e) {
      JOptionPane.showOptionDialog(this.currentPanel,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.OK_OPTION,JOptionPane.ERROR_MESSAGE,null,new Object[]{Messages.getString("String_Node_Str")},null);
    }
  }
}

Fixed version (ground truth):
/** 
 * Carga el fichero a firmar. Este m&eacute;todo se situa aqu&iacute; para permitir su acceso desde la barra de men&uacute;
 * @param filePath Fichero a firmar, incluyendo su ruta completa 
 */
public void loadFileToSign(final String filePath){
  if (this.currentPanel instanceof SignPanel) {
    try {
      ((SignPanel)this.currentPanel).loadFile(filePath);
    }
 catch (    final Exception e) {
      UIUtils.showErrorMessage(this.currentPanel,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
    }
  }
}
Program: 80254
Project: 80254
Buggy source:
void startMonitoring(){
  if (this.cardTerminal == null)   return;
  Card card;
  while (true) {
    try {
      this.cardTerminal.waitForCardPresent(0);
      if (SimpleAfirma.DEBUG) {
        System.out.println("String_Node_Str" + this.cardTerminal.getName() + "String_Node_Str");
      }
      card=this.cardTerminal.connect("String_Node_Str");
    }
 catch (    final CardException e) {
      if (SimpleAfirma.DEBUG) {
        e.printStackTrace();
      }
      firePropertyChange(CARD_EXCEPTION,"String_Node_Str",this.cardTerminal.getName());
      return;
    }
    try {
      if (!itsDNIe(card.getATR().getBytes())) {
        if (SimpleAfirma.DEBUG) {
          System.out.println("String_Node_Str");
        }
        firePropertyChange(NOT_DNI_INSERTED,"String_Node_Str",this.cardTerminal.getName());
        try {
          this.cardTerminal.waitForCardAbsent(0);
        }
 catch (        final CardException e) {
          firePropertyChange(CARD_EXCEPTION,"String_Node_Str",this.cardTerminal.getName());
          return;
        }
      }
 else {
        if (SimpleAfirma.DEBUG) {
          System.out.println("String_Node_Str");
        }
        firePropertyChange(DNI_INSERTED,"String_Node_Str",this.cardTerminal.getName());
        return;
      }
    }
 catch (    final BlownDNIeException e) {
      firePropertyChange("String_Node_Str",false,true);
      return;
    }
  }
}

Fixed version (ground truth):
void startMonitoring(){
  if (this.cardTerminal == null)   return;
  Card card=null;
  boolean validCard=true;
  while (true) {
    do {
      try {
        this.cardTerminal.waitForCardPresent(0);
        if (SimpleAfirma.DEBUG) {
          System.out.println("String_Node_Str" + this.cardTerminal.getName() + "String_Node_Str");
        }
        card=this.cardTerminal.connect("String_Node_Str");
        validCard=true;
      }
 catch (      final CardException e) {
        if (SimpleAfirma.DEBUG) {
          e.printStackTrace();
        }
        validCard=false;
        firePropertyChange(CARD_EXCEPTION,"String_Node_Str",this.cardTerminal.getName());
        try {
          this.cardTerminal.waitForCardAbsent(0);
        }
 catch (        final CardException e2) {
        }
      }
    }
 while (!validCard);
    try {
      if (!itsDNIe(card.getATR().getBytes())) {
        if (SimpleAfirma.DEBUG) {
          System.out.println("String_Node_Str");
        }
        firePropertyChange(NOT_DNI_INSERTED,"String_Node_Str",this.cardTerminal.getName());
        try {
          this.cardTerminal.waitForCardAbsent(0);
        }
 catch (        final CardException e) {
          firePropertyChange(CARD_EXCEPTION,"String_Node_Str",this.cardTerminal.getName());
          return;
        }
      }
 else {
        if (SimpleAfirma.DEBUG) {
          System.out.println("String_Node_Str");
        }
        firePropertyChange(DNI_INSERTED,"String_Node_Str",this.cardTerminal.getName());
        return;
      }
    }
 catch (    final BlownDNIeException e) {
      firePropertyChange("String_Node_Str",false,true);
      return;
    }
  }
}
Program: 80255
Project: 80255
Buggy source:
/** 
 * Before inflating views
 */
private boolean beforeInflate(){
  if (mIntent == null) {
    return false;
  }
  mAction=mIntent.getAction();
  if (mAction == null) {
    Log.w(TAG,"String_Node_Str");
    return false;
  }
  if (mIntent.hasExtra(EXTRA_PREFERENCES)) {
    options=(LockPreferences)mIntent.getSerializableExtra(EXTRA_PREFERENCES);
  }
 else {
    options=new LockPreferences(this);
  }
  mPackageName=mIntent.getStringExtra(EXTRA_PACKAGENAME);
  if (ACTION_CREATE.equals(mAction) || mPackageName == getPackageName()) {
    options.showAds=false;
  }
  if (ACTION_CREATE.equals(mAction)) {
    options.patternStealth=false;
  }
  mLayoutParams=new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.TYPE_PHONE,WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_FULLSCREEN| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,PixelFormat.TRANSLUCENT);
  mLayoutParams.screenOrientation=getScreenOrientation();
  return true;
}

Fixed version (ground truth):
/** 
 * Before inflating views
 */
private boolean beforeInflate(){
  if (mIntent == null) {
    return false;
  }
  mAction=mIntent.getAction();
  if (mAction == null) {
    Log.w(TAG,"String_Node_Str");
    return false;
  }
  if (mIntent.hasExtra(EXTRA_PREFERENCES)) {
    options=(LockPreferences)mIntent.getSerializableExtra(EXTRA_PREFERENCES);
  }
 else {
    options=new LockPreferences(this);
  }
  mPackageName=mIntent.getStringExtra(EXTRA_PACKAGENAME);
  if (!getPackageName().equals(mPackageName)) {
    Intent i=new Intent(this,AppLockService.class);
    if (mServiceState == ServiceState.NOT_BOUND) {
      if (DEBUG_BIND)       Log.v(TAG,"String_Node_Str" + mServiceState + "String_Node_Str");
      mServiceState=ServiceState.BINDING;
      bindService(i,mConnection,0);
    }
 else {
      if (DEBUG_BIND)       Log.v(TAG,"String_Node_Str" + mServiceState + "String_Node_Str");
    }
  }
  if (ACTION_CREATE.equals(mAction) || mPackageName == getPackageName()) {
    options.showAds=false;
  }
  if (ACTION_CREATE.equals(mAction)) {
    options.patternStealth=false;
  }
  mLayoutParams=new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.TYPE_PHONE,WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_FULLSCREEN| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,PixelFormat.TRANSLUCENT);
  mLayoutParams.screenOrientation=getScreenOrientation();
  return true;
}
Program: 80256
Project: 80256
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  handleIntent();
  mReceiver=new ServiceStateReceiver();
  mFilter=new IntentFilter();
  mFilter.addCategory(AppLockService.CATEGORY_STATE_EVENTS);
  mFilter.addAction(AppLockService.BROADCAST_SERVICE_STARTED);
  mFilter.addAction(AppLockService.BROADCAST_SERVICE_STOPPED);
  mNavFragment=(NavigationFragment)getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
  mNavFragment.setUp(R.id.navigation_drawer,(DrawerLayout)findViewById(R.id.drawer_layout));
  mTitle=getTitle();
  mActionBar=getSupportActionBar();
  mCurrentFragment=new AppsFragment();
  getSupportFragmentManager().beginTransaction().add(R.id.container,mCurrentFragment).commit();
  mCurrentFragmentType=NavigationElement.TYPE_APPS;
  mSequencer=new DialogSequencer();
  showDialogs();
  showLockerIfNotUnlocked(false);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  handleIntent();
  mReceiver=new ServiceStateReceiver();
  mFilter=new IntentFilter();
  mFilter.addCategory(AppLockService.CATEGORY_STATE_EVENTS);
  mFilter.addAction(AppLockService.BROADCAST_SERVICE_STARTED);
  mFilter.addAction(AppLockService.BROADCAST_SERVICE_STOPPED);
  mNavFragment=(NavigationFragment)getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
  mNavFragment.setUp(R.id.navigation_drawer,(DrawerLayout)findViewById(R.id.drawer_layout));
  mTitle=getTitle();
  mActionBar=getSupportActionBar();
  mCurrentFragment=new AppsFragment();
  getSupportFragmentManager().beginTransaction().add(R.id.container,mCurrentFragment).commit();
  mCurrentFragmentType=NavigationElement.TYPE_APPS;
  mSequencer=new DialogSequencer();
  if (showDialogs()) {
  }
  showLockerIfNotUnlocked(false);
}
Program: 80257
Project: 80257
Buggy source:
private void cancelAnimations(){
  if (DEBUG_VIEW)   Log.v(TAG,"String_Node_Str" + "String_Node_Str" + mViewState + "String_Node_Str");
  if (mViewState == ViewState.HIDING) {
    mAnimHide.setAnimationListener(null);
    mAnimHide.cancel();
    mAnimHide=null;
  }
 else   if (mViewState == ViewState.SHOWING) {
    mAnimShow.setAnimationListener(null);
    mAnimShow.cancel();
    mAnimShow=null;
  }
  mWindowManager.removeView(mRootView);
}

Fixed version (ground truth):
private void cancelAnimations(){
  if (DEBUG_VIEW)   Log.v(TAG,"String_Node_Str" + "String_Node_Str" + mViewState + "String_Node_Str");
  if (mViewState == ViewState.HIDING) {
    mAnimHide.setAnimationListener(null);
    mAnimHide.cancel();
    mAnimHide=null;
  }
 else   if (mViewState == ViewState.SHOWING) {
    mAnimShow.setAnimationListener(null);
    mAnimShow.cancel();
    mAnimShow=null;
  }
 else   if (mViewState != ViewState.HIDDEN) {
    mWindowManager.removeView(mRootView);
  }
 else   if (mViewState == ViewState.HIDDEN) {
    Log.e(TAG,"String_Node_Str");
  }
}
Program: 80258
Project: 80258
Buggy source:
/** 
 * Called every time a pattern has been detected by the user and the action was   {@link #ACTION_COMPARE}
 */
private void doComparePattern(){
  final String currentPattern=mLockPatternView.getPatternString();
  if (currentPattern.equals(options.pattern)) {
    exitSuccessCompare();
    mAnalytics.increment(LockerAnalytics.PATTERN_SUCCESS);
  }
 else {
    mAnalytics.increment(LockerAnalytics.PATTERN_FAILED);
    if (options.patternErrorStealth) {
      Toast.makeText(this,R.string.locker_invalid_pattern,Toast.LENGTH_SHORT).show();
      mLockPatternView.clearPattern();
    }
 else {
      mLockPatternView.setDisplayMode(DisplayMode.Wrong);
      mLockPatternView.clearPattern(PATTERN_DELAY);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called every time a pattern has been detected by the user and the action was   {@link #ACTION_COMPARE}
 */
private void doComparePattern(){
  final String currentPattern=mLockPatternView.getPatternString();
  if (currentPattern.equals(options.pattern)) {
    mFingerDistance=mLockPatternView.getFingerDistance();
    exitSuccessCompare();
  }
 else {
    mAnalytics.increment(LockerAnalytics.UNLOCK_ERROR);
    if (options.patternErrorStealth) {
      Toast.makeText(this,R.string.locker_invalid_pattern,Toast.LENGTH_SHORT).show();
      mLockPatternView.clearPattern();
    }
 else {
      mLockPatternView.setDisplayMode(DisplayMode.Wrong);
      mLockPatternView.clearPattern(PATTERN_DELAY);
    }
  }
}
Program: 80259
Project: 80259
Buggy source:
/** 
 * Exit when an app has been unlocked successfully
 */
private void exitSuccessCompare(){
  if (mPackageName == null || mPackageName.equals(getPackageName())) {
    finish(true);
    return;
  }
  if (mServiceState == ServiceState.BOUND) {
    mAppLockService.unlockApp(mPackageName);
  }
 else {
    if (DEBUG_BIND)     Log.w(TAG,"String_Node_Str" + mServiceState + "String_Node_Str");
  }
  finish(true);
}

Fixed version (ground truth):
/** 
 * Exit when an app has been unlocked successfully
 */
private void exitSuccessCompare(){
  long current=System.nanoTime();
  long total=(current - mTimeViewShown) / 1000000;
  long interacting=(current - mTimeFirstFingerDown) / 1000000;
  Log.d(TAG,"String_Node_Str" + total);
  mAnalytics.increment(LockerAnalytics.TIME_SPENT_IN_LOCKSCREEN,total);
  mAnalytics.increment(LockerAnalytics.TIME_SPENT_INTERACTING,interacting);
  mAnalytics.increment(LockerAnalytics.UNLOCK_SUCCESS);
  Log.d(TAG,"String_Node_Str" + mFingerDistance);
  mAnalytics.incrementFloat(LockerAnalytics.FINGER_DISTANCE,mFingerDistance);
  if (mPackageName == null || mPackageName.equals(getPackageName())) {
    finish(true);
    return;
  }
  if (mServiceState == ServiceState.BOUND) {
    mAppLockService.unlockApp(mPackageName);
  }
 else {
    if (DEBUG_BIND)     Log.w(TAG,"String_Node_Str" + mServiceState + "String_Node_Str");
  }
  finish(true);
}