Program: 39598
Project: 39598
Buggy source:
protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  response.setContentType("String_Node_Str");
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setDateHeader("String_Node_Str",0);
  Twitter twitter=new TwitterFactory().getInstance();
  twitter.setOAuthConsumer(configMgr.getConsumerKey(),configMgr.getConsumerSecret());
  RequestToken requestToken=configMgr.getRequestToken();
  String verifier=request.getParameter(OAUTH_VERIFIER);
  try {
    AccessToken accessToken=twitter.getOAuthAccessToken(requestToken,verifier);
    long userId=accessToken.getUserId();
    String screenName=accessToken.getScreenName();
    String oauthToken=accessToken.getToken();
    String oauthTokenSecret=accessToken.getTokenSecret();
    User user=null;
    user=userMgr.getUserById(userId);
    twitter4j.User twUser=twitter.showUser(userId);
    if (user == null) {
      user=new User();
      user.setId(userId);
      user.setUserName(screenName);
      user.setFirstLogin(Calendar.getInstance().getTime());
      user.setLastIp(request.getRemoteAddr());
      user.setLastLogin(Calendar.getInstance().getTime());
      user.setOauthToken(oauthToken);
      user.setOauthTokenSecret(oauthTokenSecret);
      user.setCash(configMgr.getInitialMoney());
      user.setPictureUrl(twUser.getProfileImageURL().toExternalForm());
      userMgr.saveUser(user);
      request.setAttribute(User.USER,user);
    }
 else {
      user=new User();
      user.setId(userId);
      user.setLastLogin(Calendar.getInstance().getTime());
      user.setUserName(screenName);
      user.setLastIp(request.getRemoteHost());
      user.setOauthToken(oauthToken);
      user.setOauthTokenSecret(oauthTokenSecret);
      user.setPictureUrl(twUser.getProfileImageURL().toExternalForm());
      userMgr.updateUser(user);
      request.setAttribute(User.USER,user);
    }
    request.getSession().removeAttribute(REQUEST_TOKEN);
    Cookie cookies[]=createCookie(userId,oauthToken);
    writeCookies(response,cookies);
  }
 catch (  TwitterException e) {
    throw new ServletException(e);
  }
  response.sendRedirect(request.getContextPath() + "String_Node_Str");
}

Fixed version (ground truth):
protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setDateHeader("String_Node_Str",0);
  Twitter twitter=new TwitterFactory().getInstance();
  twitter.setOAuthConsumer(configMgr.getConsumerKey(),configMgr.getConsumerSecret());
  RequestToken requestToken=(RequestToken)request.getSession().getAttribute(REQUEST_TOKEN);
  String verifier=request.getParameter(OAUTH_VERIFIER);
  try {
    AccessToken accessToken=twitter.getOAuthAccessToken(requestToken,verifier);
    long userId=accessToken.getUserId();
    String screenName=accessToken.getScreenName();
    String oauthToken=accessToken.getToken();
    String oauthTokenSecret=accessToken.getTokenSecret();
    User user=null;
    user=userMgr.getUserById(userId);
    twitter4j.User twUser=twitter.showUser(userId);
    if (user == null) {
      user=new User();
      user.setId(userId);
      user.setUserName(screenName);
      user.setFirstLogin(Calendar.getInstance().getTime());
      user.setLastIp(request.getRemoteAddr());
      user.setLastLogin(Calendar.getInstance().getTime());
      user.setOauthToken(oauthToken);
      user.setOauthTokenSecret(oauthTokenSecret);
      user.setCash(configMgr.getInitialMoney());
      user.setPictureUrl(twUser.getProfileImageURL().toExternalForm());
      userMgr.saveUser(user);
    }
 else {
      user=new User();
      user.setId(userId);
      user.setLastLogin(Calendar.getInstance().getTime());
      user.setUserName(screenName);
      user.setLastIp(request.getRemoteHost());
      user.setOauthToken(oauthToken);
      user.setOauthTokenSecret(oauthTokenSecret);
      user.setPictureUrl(twUser.getProfileImageURL().toExternalForm());
      userMgr.updateUser(user);
    }
    Cookie cookies[]=createCookie(userId,oauthToken);
    writeCookies(response,cookies);
  }
 catch (  TwitterException e) {
    throw new ServletException(e);
  }
  response.sendRedirect(request.getContextPath() + "String_Node_Str");
}