Program: 8562
Project: 8562
Buggy source:
/** 
 * POST  /account/preferences -> update account's preferences
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST,produces="String_Node_Str") @ResponseBody public Preferences updatePreferences(@RequestBody Preferences newPreferences,HttpServletResponse response){
  if (this.log.isDebugEnabled()) {
    this.log.debug("String_Node_Str");
  }
  Preferences preferences=null;
  try {
    User currentUser=authenticationService.getCurrentUser();
    if (newPreferences.getTheme().isEmpty()) {
      throw new Exception("String_Node_Str");
    }
    currentUser.setTheme((String)newPreferences.getTheme());
    currentUser.setPreferencesMentionEmail((Boolean)newPreferences.getMentionEmail());
    currentUser.setDailyDigestSubscription((Boolean)newPreferences.getDailyDigest());
    currentUser.setWeeklyDigestSubscription((Boolean)newPreferences.getWeeklyDigest());
    String rssUid=userService.updateRssTimelinePreferences(newPreferences.getRssUidActive());
    currentUser.setRssUid(rssUid);
    preferences=new Preferences(currentUser);
    userService.updateUser(currentUser);
    userService.updateThemePreferences(newPreferences.getTheme());
    TatamiUserDetails userDetails=(TatamiUserDetails)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    userDetails.setTheme(newPreferences.getTheme());
    Authentication authentication=new UsernamePasswordAuthenticationToken(userDetails,userDetails.getPassword(),userDetails.getAuthorities());
    SecurityContextHolder.getContext().setAuthentication(authentication);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + currentUser);
    }
  }
 catch (  Exception e) {
    log.debug("String_Node_Str",e);
    response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
  }
 finally {
    String themes=env.getProperty("String_Node_Str");
    preferences.setThemesList(themes);
    return preferences;
  }
}

Fixed version (ground truth):
/** 
 * POST  /account/preferences -> update account's preferences
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST,produces="String_Node_Str") @ResponseBody public Preferences updatePreferences(@RequestBody Preferences newPreferences,HttpServletResponse response){
  if (this.log.isDebugEnabled()) {
    this.log.debug("String_Node_Str");
  }
  Preferences preferences=null;
  try {
    User currentUser=authenticationService.getCurrentUser();
    if (newPreferences.getTheme().isEmpty()) {
      throw new Exception("String_Node_Str");
    }
    currentUser.setTheme((String)newPreferences.getTheme());
    currentUser.setPreferencesMentionEmail((Boolean)newPreferences.getMentionEmail());
    currentUser.setDailyDigestSubscription((Boolean)newPreferences.getDailyDigest());
    currentUser.setWeeklyDigestSubscription((Boolean)newPreferences.getWeeklyDigest());
    String rssUid=userService.updateRssTimelinePreferences(newPreferences.getRssUidActive());
    currentUser.setRssUid(rssUid);
    preferences=new Preferences(currentUser);
    userService.updateUser(currentUser);
    userService.updateDailyDigestRegistration(newPreferences.getDailyDigest());
    userService.updateWeeklyDigestRegistration(newPreferences.getWeeklyDigest());
    userService.updateThemePreferences(newPreferences.getTheme());
    TatamiUserDetails userDetails=(TatamiUserDetails)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    userDetails.setTheme(newPreferences.getTheme());
    Authentication authentication=new UsernamePasswordAuthenticationToken(userDetails,userDetails.getPassword(),userDetails.getAuthorities());
    SecurityContextHolder.getContext().setAuthentication(authentication);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + currentUser);
    }
  }
 catch (  Exception e) {
    log.debug("String_Node_Str",e);
    response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
  }
 finally {
    String themes=env.getProperty("String_Node_Str");
    preferences.setThemesList(themes);
    return preferences;
  }
}