Program: 174773
Project: 174773
Buggy source:
@Override protected Map<String,Object> executeImpl(WebScriptRequest req,Status status,Cache cache){
  Map<String,String> templateVars=req.getServiceMatch().getTemplateVars();
  Map<String,String[]> params=new TreeMap<String,String[]>();
  Map<String,String[]> headers=new TreeMap<String,String[]>();
  for (  String paramName : req.getParameterNames()) {
    params.put(paramName,req.getParameterValues(paramName));
  }
  for (  String header : req.getHeaderNames()) {
    headers.put(header,req.getHeaderValues(header));
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + templateVars);
    log.debug("String_Node_Str" + params);
    log.debug("String_Node_Str" + headers);
  }
  String channelNodeUuid=templateVars.get("String_Node_Str");
  String channelNodeStoreProtocol=templateVars.get("String_Node_Str");
  String channelNodeStoreId=templateVars.get("String_Node_Str");
  NodeRef channelNodeRef=new NodeRef(channelNodeStoreProtocol,channelNodeStoreId,channelNodeUuid);
  Channel channel=channelService.getChannelById(channelNodeRef.toString());
  ChannelType.AuthStatus authStatus=channel.getChannelType().acceptAuthorisationCallback(channel,headers,params);
  if (ChannelType.AuthStatus.RETRY.equals(authStatus)) {
    String authoriseUrl=channel.getChannelType().getAuthorisationUrls(channel,channelAuthHelper.getAuthoriseCallbackUrl(channelNodeRef));
    if (authoriseUrl == null) {
      authoriseUrl=channelAuthHelper.getDefaultAuthoriseUrl(channelNodeRef);
    }
    status.setCode(HttpServletResponse.SC_MOVED_TEMPORARILY);
    status.setLocation(authoriseUrl);
  }
  Map<String,Object> model=new TreeMap<String,Object>();
  model.put("String_Node_Str",authStatus.name());
  return model;
}

Fixed version (ground truth):
@Override protected Map<String,Object> executeImpl(WebScriptRequest req,Status status,Cache cache){
  Map<String,String> templateVars=req.getServiceMatch().getTemplateVars();
  Map<String,String[]> params=new TreeMap<String,String[]>();
  Map<String,String[]> headers=new TreeMap<String,String[]>();
  for (  String paramName : req.getParameterNames()) {
    params.put(paramName,req.getParameterValues(paramName));
  }
  for (  String header : req.getHeaderNames()) {
    headers.put(header,req.getHeaderValues(header));
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + templateVars);
    log.debug("String_Node_Str" + params);
    log.debug("String_Node_Str" + headers);
  }
  String channelNodeUuid=templateVars.get("String_Node_Str");
  String channelNodeStoreProtocol=templateVars.get("String_Node_Str");
  String channelNodeStoreId=templateVars.get("String_Node_Str");
  NodeRef channelNodeRef=new NodeRef(channelNodeStoreProtocol,channelNodeStoreId,channelNodeUuid);
  Channel channel=channelService.getChannelById(channelNodeRef.toString());
  ChannelType.AuthStatus authStatus=channel.getChannelType().acceptAuthorisationCallback(channel,headers,params);
  if (ChannelType.AuthStatus.RETRY.equals(authStatus)) {
    AuthUrlPair authoriseUrls=channel.getChannelType().getAuthorisationUrls(channel,channelAuthHelper.getAuthoriseCallbackUrl(channelNodeRef));
    String authRequestUrl=authoriseUrls.authorisationRequestUrl;
    if (authRequestUrl == null) {
      authRequestUrl=channelAuthHelper.getDefaultAuthoriseUrl(channelNodeRef);
    }
    status.setCode(HttpServletResponse.SC_MOVED_TEMPORARILY);
    status.setLocation(authRequestUrl);
  }
  Map<String,Object> model=new TreeMap<String,Object>();
  model.put("String_Node_Str",authStatus.name());
  return model;
}