Program: 31375
Project: 31375
Buggy source:
public Action check(HttpServletRequest request,InterceptingHTTPServletResponse response,HttpServletResponse httpResponse){
  if (url != null && !url.matcher(request.getRequestURL().toString()).matches()) {
    return new DoNothingAction();
  }
  String inboundContentType;
  String charEnc;
  if (response != null) {
    if (response.getContentType() == null) {
      response.setContentType(AppGuardianConfiguration.DEFAULT_CONTENT_TYPE);
    }
    inboundContentType=response.getContentType();
    charEnc=response.getCharacterEncoding();
  }
 else {
    if (httpResponse.getContentType() == null) {
      httpResponse.setContentType(AppGuardianConfiguration.DEFAULT_CONTENT_TYPE);
    }
    inboundContentType=httpResponse.getContentType();
    charEnc=httpResponse.getCharacterEncoding();
  }
  if (contentType.matcher(inboundContentType).matches()) {
    try {
      byte[] bytes=null;
      try {
        bytes=response.getInterceptingServletOutputStream().getResponseBytes();
      }
 catch (      IOException ioe) {
        log(request,"String_Node_Str" + pattern.pattern() + "String_Node_Str"+ ioe.getMessage()+ "String_Node_Str"+ request.getRequestURL()+ "String_Node_Str");
        return new DoNothingAction();
      }
      String s=new String(bytes,charEnc);
      if (pattern.matcher(s).matches()) {
        log(request,"String_Node_Str" + pattern.pattern() + "String_Node_Str"+ request.getRequestURL()+ "String_Node_Str");
        return new DefaultAction();
      }
    }
 catch (    UnsupportedEncodingException uee) {
      log(request,"String_Node_Str" + pattern.pattern() + "String_Node_Str"+ uee.getMessage());
    }
  }
  return new DoNothingAction();
}

Fixed version (ground truth):
public Action check(HttpServletRequest request,InterceptingHTTPServletResponse response,HttpServletResponse httpResponse){
  if (uri != null && !uri.matcher(request.getRequestURI()).matches()) {
    return new DoNothingAction();
  }
  String inboundContentType;
  String charEnc;
  if (response != null) {
    if (response.getContentType() == null) {
      response.setContentType(AppGuardianConfiguration.DEFAULT_CONTENT_TYPE);
    }
    inboundContentType=response.getContentType();
    charEnc=response.getCharacterEncoding();
  }
 else {
    if (httpResponse.getContentType() == null) {
      httpResponse.setContentType(AppGuardianConfiguration.DEFAULT_CONTENT_TYPE);
    }
    inboundContentType=httpResponse.getContentType();
    charEnc=httpResponse.getCharacterEncoding();
  }
  if (contentType.matcher(inboundContentType).matches()) {
    try {
      byte[] bytes=null;
      try {
        bytes=response.getInterceptingServletOutputStream().getResponseBytes();
      }
 catch (      IOException ioe) {
        log(request,"String_Node_Str" + pattern.pattern() + "String_Node_Str"+ ioe.getMessage()+ "String_Node_Str"+ request.getRequestURL()+ "String_Node_Str");
        return new DoNothingAction();
      }
      String s=new String(bytes,charEnc);
      if (pattern.matcher(s).matches()) {
        log(request,"String_Node_Str" + pattern.pattern() + "String_Node_Str"+ request.getRequestURL()+ "String_Node_Str");
        return new DefaultAction();
      }
    }
 catch (    UnsupportedEncodingException uee) {
      log(request,"String_Node_Str" + pattern.pattern() + "String_Node_Str"+ uee.getMessage());
    }
  }
  return new DoNothingAction();
}