Program: 44627
Project: 44627
Buggy source:
@Path("String_Node_Str") public ResourceLocator connectToAstroboaRepository(@HeaderParam("String_Node_Str") String authorization,@PathParam("String_Node_Str") String repositoryId,@Context ServletContext servletContext){
  if (StringUtils.isBlank(repositoryId)) {
    throw new WebApplicationException(HttpURLConnection.HTTP_NOT_FOUND);
  }
  try {
    AstroboaClient astroboaClient=null;
    long start=System.currentTimeMillis();
    if (authorization != null) {
      astroboaClient=AstroboaClientCache.Instance.get(authorization);
      if (astroboaClient == null) {
        String encodedUsernamePass=authorization.substring(5);
        String usernamePass=Base64.base64Decode(encodedUsernamePass);
        String[] usernamePassSplitted=usernamePass.split("String_Node_Str");
        if (usernamePassSplitted.length == 2) {
          astroboaClient=new AstroboaClient(AstroboaClient.INTERNAL_CONNECTION);
          AstroboaCredentials credentials=new AstroboaCredentials(usernamePassSplitted[0],usernamePassSplitted[1]);
          astroboaClient.login(repositoryId,credentials);
          astroboaClient=AstroboaClientCache.Instance.cache(astroboaClient,authorization);
        }
 else {
          logger.error("String_Node_Str" + authorization);
          throw new WebApplicationException(HttpURLConnection.HTTP_UNAUTHORIZED);
        }
      }
    }
 else {
      final String anonymousCacheKey=repositoryId + IdentityPrincipal.ANONYMOUS;
      astroboaClient=AstroboaClientCache.Instance.get(anonymousCacheKey);
      if (astroboaClient == null) {
        astroboaClient=new AstroboaClient(AstroboaClient.INTERNAL_CONNECTION);
        String permanentKey=retrievePermanentKeyForAnonymousUser(repositoryId,servletContext);
        astroboaClient.loginAsAnonymous(repositoryId,permanentKey);
        astroboaClient=AstroboaClientCache.Instance.cache(astroboaClient,anonymousCacheKey);
      }
    }
    logger.debug("String_Node_Str",System.identityHashCode(astroboaClient),DurationFormatUtils.formatDurationHMS(System.currentTimeMillis() - start));
    return new ResourceLocator(astroboaClient);
  }
 catch (  CmsInvalidPasswordException e) {
    logger.error("String_Node_Str");
    throw new WebApplicationException(HttpURLConnection.HTTP_UNAUTHORIZED);
  }
catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw new WebApplicationException(HttpURLConnection.HTTP_NOT_FOUND);
  }
}

Fixed version (ground truth):
@Path("String_Node_Str") public ResourceLocator connectToAstroboaRepository(@HeaderParam("String_Node_Str") String authorization,@PathParam("String_Node_Str") String repositoryId,@Context ServletContext servletContext){
  if (StringUtils.isBlank(repositoryId)) {
    throw new WebApplicationException(HttpURLConnection.HTTP_NOT_FOUND);
  }
  try {
    AstroboaClient astroboaClient=null;
    long start=System.currentTimeMillis();
    if (authorization != null) {
      String cacheKey=authorization + repositoryId;
      astroboaClient=AstroboaClientCache.Instance.get(cacheKey);
      if (astroboaClient == null) {
        String encodedUsernamePass=authorization.substring(5);
        String usernamePass=Base64.base64Decode(encodedUsernamePass);
        String[] usernamePassSplitted=usernamePass.split("String_Node_Str");
        if (usernamePassSplitted.length == 2) {
          astroboaClient=new AstroboaClient(AstroboaClient.INTERNAL_CONNECTION);
          AstroboaCredentials credentials=new AstroboaCredentials(usernamePassSplitted[0],usernamePassSplitted[1]);
          astroboaClient.login(repositoryId,credentials);
          astroboaClient=AstroboaClientCache.Instance.cache(astroboaClient,cacheKey);
        }
 else {
          logger.error("String_Node_Str" + authorization);
          throw new WebApplicationException(HttpURLConnection.HTTP_UNAUTHORIZED);
        }
      }
    }
 else {
      final String anonymousCacheKey=repositoryId + IdentityPrincipal.ANONYMOUS;
      astroboaClient=AstroboaClientCache.Instance.get(anonymousCacheKey);
      if (astroboaClient == null) {
        astroboaClient=new AstroboaClient(AstroboaClient.INTERNAL_CONNECTION);
        String permanentKey=retrievePermanentKeyForAnonymousUser(repositoryId,servletContext);
        astroboaClient.loginAsAnonymous(repositoryId,permanentKey);
        astroboaClient=AstroboaClientCache.Instance.cache(astroboaClient,anonymousCacheKey);
      }
    }
    logger.debug("String_Node_Str",System.identityHashCode(astroboaClient),DurationFormatUtils.formatDurationHMS(System.currentTimeMillis() - start));
    return new ResourceLocator(astroboaClient);
  }
 catch (  CmsInvalidPasswordException e) {
    logger.error("String_Node_Str");
    throw new WebApplicationException(HttpURLConnection.HTTP_UNAUTHORIZED);
  }
catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw new WebApplicationException(HttpURLConnection.HTTP_NOT_FOUND);
  }
}