Program: 89193
Project: 89193
Buggy source:
/** 
 * @see net.sf.acegisecurity.intercept.AbstractSecurityInterceptor#beforeInvocation(java.lang.Object)
 */
@Override protected InterceptorStatusToken beforeInvocation(Object object){
  InterceptorStatusToken result=null;
  try {
    RMMethodSecurityInterceptor.CAPABILITIES.remove();
    RMMethodSecurityInterceptor.IS_RM_SECURITY_CHECK.remove();
    RMMethodSecurityInterceptor.MESSAGES.remove();
    result=super.beforeInvocation(object);
  }
 catch (  AccessDeniedException exception) {
    if (logger.isDebugEnabled()) {
      MethodInvocation mi=(MethodInvocation)object;
      StringBuilder methodDetails=new StringBuilder("String_Node_Str");
      if (RMMethodSecurityInterceptor.IS_RM_SECURITY_CHECK.get()) {
        methodDetails.append("String_Node_Str");
      }
 else {
        methodDetails.append("String_Node_Str");
      }
      boolean first=true;
      methodDetails.append("String_Node_Str").append(mi.getMethod().getName()).append("String_Node_Str");
      for (      Object arg : mi.getArguments()) {
        if (first) {
          first=false;
        }
 else {
          methodDetails.append("String_Node_Str");
        }
        if (arg != null) {
          methodDetails.append(arg.toString());
        }
 else {
          methodDetails.append("String_Node_Str");
        }
      }
      methodDetails.append("String_Node_Str");
      List<String> messages=RMMethodSecurityInterceptor.MESSAGES.get();
      for (      String message : messages) {
        methodDetails.append(message).append("String_Node_Str");
      }
      String failureReport=getFailureReport();
      if (failureReport == null) {
        throw new AccessDeniedException(exception.getMessage() + methodDetails,exception);
      }
 else {
        throw new AccessDeniedException(exception.getMessage() + methodDetails + getFailureReport(),exception);
      }
    }
 else {
      throw exception;
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @see net.sf.acegisecurity.intercept.AbstractSecurityInterceptor#beforeInvocation(java.lang.Object)
 */
@Override protected InterceptorStatusToken beforeInvocation(Object object){
  InterceptorStatusToken result=null;
  try {
    RMMethodSecurityInterceptor.CAPABILITIES.remove();
    RMMethodSecurityInterceptor.IS_RM_SECURITY_CHECK.remove();
    RMMethodSecurityInterceptor.MESSAGES.remove();
    result=super.beforeInvocation(object);
  }
 catch (  AccessDeniedException exception) {
    if (LOGGER.isDebugEnabled()) {
      MethodInvocation mi=(MethodInvocation)object;
      StringBuilder methodDetails=new StringBuilder("String_Node_Str");
      if (RMMethodSecurityInterceptor.IS_RM_SECURITY_CHECK.get()) {
        methodDetails.append("String_Node_Str");
      }
 else {
        methodDetails.append("String_Node_Str");
      }
      boolean first=true;
      methodDetails.append("String_Node_Str").append(mi.getMethod().getName()).append("String_Node_Str");
      for (      Object arg : mi.getArguments()) {
        if (first) {
          first=false;
        }
 else {
          methodDetails.append("String_Node_Str");
        }
        if (arg != null) {
          methodDetails.append(arg.toString());
        }
 else {
          methodDetails.append("String_Node_Str");
        }
      }
      methodDetails.append("String_Node_Str");
      List<String> messages=RMMethodSecurityInterceptor.MESSAGES.get();
      for (      String message : messages) {
        methodDetails.append(message).append("String_Node_Str");
      }
      String failureReport=getFailureReport();
      if (failureReport == null) {
        throw new AccessDeniedException(exception.getMessage() + methodDetails,exception);
      }
 else {
        throw new AccessDeniedException(exception.getMessage() + methodDetails + getFailureReport(),exception);
      }
    }
 else {
      throw exception;
    }
  }
  return result;
}