nus-yam/ex-repair huggingface dataset:
Program: 8546
Project: 8546
Buggy source:
protected final ResponseMessage wrapMessage(AtmosphereResponse res,String message){
  Response.Builder builder=new Response.Builder();
  builder.body(message).status(res.getStatus(),res.getStatusMessage());
  Map<String,String> headers=res.headers();
  for (  String s : headers.keySet()) {
    builder.header(new Header(s,headers.get(s)));
  }
  Request swaggerSocketRequest=(Request)res.request().getAttribute("String_Node_Str");
  builder.uuid(swaggerSocketRequest.getUuid()).method(swaggerSocketRequest.getMethod()).path(swaggerSocketRequest.getPath());
  String identity=(String)getContextValue(res.request(),IDENTITY);
  AtomicInteger expectedResponseCount=(AtomicInteger)getContextValue(res.request(),transactionIdentity.get() + RESPONSE_COUNTER);
  ResponseMessage m=null;
  if (expectedResponseCount != null && res.resource().transport() != AtmosphereResource.TRANSPORT.WEBSOCKET) {
    m=(ResponseMessage)getContextValue(res.request(),transactionIdentity.get() + ResponseMessage.class.getName());
    if (m != null) {
      m.response(builder.build());
    }
 else {
      m=new ResponseMessage(identity,builder.build());
    }
    if (expectedResponseCount.decrementAndGet() <= 0) {
      return m;
    }
 else {
      addContextValue(res.request(),transactionIdentity.get() + ResponseMessage.class.getName(),m);
      return null;
    }
  }
  if (m == null) {
    m=new ResponseMessage(identity,builder.build());
  }
  return m;
}

Fixed version (ground truth):
protected final ResponseMessage wrapMessage(AtmosphereResponse res,String message){
  Response.Builder builder=new Response.Builder();
  builder.body(message).status(res.getStatus(),res.getStatusMessage());
  Map<String,String> headers=res.headers();
  for (  String s : headers.keySet()) {
    builder.header(new Header(s,headers.get(s)));
  }
  Request swaggerSocketRequest=ssRequest.get();
  if (swaggerSocketRequest == null) {
    swaggerSocketRequest=(Request)res.request().getAttribute("String_Node_Str");
  }
  builder.uuid(swaggerSocketRequest.getUuid()).method(swaggerSocketRequest.getMethod()).path(swaggerSocketRequest.getPath());
  String identity=(String)getContextValue(res.request(),IDENTITY);
  AtomicInteger expectedResponseCount=(AtomicInteger)getContextValue(res.request(),transactionIdentity.get() + RESPONSE_COUNTER);
  ResponseMessage m=null;
  if (expectedResponseCount != null && res.resource().transport() != AtmosphereResource.TRANSPORT.WEBSOCKET) {
    m=(ResponseMessage)getContextValue(res.request(),transactionIdentity.get() + ResponseMessage.class.getName());
    if (m != null) {
      m.response(builder.build());
    }
 else {
      m=new ResponseMessage(identity,builder.build());
    }
    if (expectedResponseCount.decrementAndGet() <= 0) {
      return m;
    }
 else {
      addContextValue(res.request(),transactionIdentity.get() + ResponseMessage.class.getName(),m);
      return null;
    }
  }
  if (m == null) {
    m=new ResponseMessage(identity,builder.build());
  }
  return m;
}
Program: 8548
Project: 8548
Buggy source:
@Override public byte[] error(AtmosphereResponse response,int statusCode,String reasonPhrase){
  Request swaggerSocketRequest=(Request)response.request().getAttribute("String_Node_Str");
  if (swaggerSocketRequest == null) {
    logger.debug("String_Node_Str",response.getStatus(),response.getStatusMessage());
    return new byte[0];
  }
  logger.debug("String_Node_Str",response.getStatus(),response.getStatusMessage());
  StatusMessage statusMessage=new StatusMessage.Builder().status(new StatusMessage.Status(response.getStatus(),response.getStatusMessage())).identity(swaggerSocketRequest.getUuid()).build();
  try {
    return mapper.writeValueAsBytes(statusMessage);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public byte[] error(AtmosphereResponse response,int statusCode,String reasonPhrase){
  Request swaggerSocketRequest=ssRequest.get();
  if (swaggerSocketRequest == null) {
    swaggerSocketRequest=(Request)response.request().getAttribute("String_Node_Str");
  }
  if (swaggerSocketRequest == null) {
    logger.debug("String_Node_Str",response.getStatus(),response.getStatusMessage());
    return new byte[0];
  }
  logger.debug("String_Node_Str",response.getStatus(),response.getStatusMessage());
  StatusMessage statusMessage=new StatusMessage.Builder().status(new StatusMessage.Status(response.getStatus(),response.getStatusMessage())).identity(swaggerSocketRequest.getUuid()).build();
  try {
    return mapper.writeValueAsBytes(statusMessage);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 8550
Project: 8550
Buggy source:
protected final static ResponseMessage wrapMessage(AtmosphereResponse res,String message){
  Response.Builder builder=new Response.Builder();
  builder.body(message).status(res.getStatus(),res.getStatusMessage());
  Map<String,String> headers=res.headers();
  for (  String s : headers.keySet()) {
    builder.header(new Header(s,headers.get(s)));
  }
  Request swaggerSocketRequest=Request.class.cast(res.request().getAttribute(SWAGGERSOCKET_REQUEST));
  builder.uuid(swaggerSocketRequest.getUuid()).method(swaggerSocketRequest.getMethod()).path(swaggerSocketRequest.getPath());
  String identity=(String)res.request().getAttribute("String_Node_Str");
  AtomicInteger expectedResponseCount=(AtomicInteger)res.request().getAttribute("String_Node_Str");
  ResponseMessage m=null;
  if (expectedResponseCount != null) {
    m=(ResponseMessage)res.request().getAttribute(ResponseMessage.class.getName());
    if (m != null) {
      m.response(builder.build());
    }
 else {
      m=new ResponseMessage(identity,builder.build());
    }
    if (expectedResponseCount.decrementAndGet() == 0) {
      return m;
    }
 else {
      res.request().setAttribute(ResponseMessage.class.getName(),m);
      return null;
    }
  }
  if (m == null) {
    m=new ResponseMessage(identity,builder.build());
  }
  return m;
}

Fixed version (ground truth):
protected final static ResponseMessage wrapMessage(AtmosphereResponse res,String message){
  Response.Builder builder=new Response.Builder();
  builder.body(message).status(res.getStatus(),res.getStatusMessage());
  Map<String,String> headers=res.headers();
  for (  String s : headers.keySet()) {
    builder.header(new Header(s,headers.get(s)));
  }
  Request swaggerSocketRequest=Request.class.cast(res.request().getAttribute(SWAGGERSOCKET_REQUEST));
  builder.uuid(swaggerSocketRequest.getUuid()).method(swaggerSocketRequest.getMethod()).path(swaggerSocketRequest.getPath());
  String identity=(String)res.request().getAttribute("String_Node_Str");
  AtomicInteger expectedResponseCount=(AtomicInteger)res.request().getAttribute("String_Node_Str");
  ResponseMessage m=null;
  if (expectedResponseCount != null) {
    m=(ResponseMessage)res.request().getAttribute(ResponseMessage.class.getName());
    if (m != null) {
      m.response(builder.build());
    }
 else {
      m=new ResponseMessage(identity,builder.build());
    }
    if (expectedResponseCount.decrementAndGet() <= 0) {
      return m;
    }
 else {
      res.request().setAttribute(ResponseMessage.class.getName(),m);
      return null;
    }
  }
  if (m == null) {
    m=new ResponseMessage(identity,builder.build());
  }
  return m;
}
Program: 8551
Project: 8551
Buggy source:
@Override protected void doFilter(HttpServletRequest request,HttpServletResponse response,FilterChain chain) throws Exception {
  if (request.getHeader("String_Node_Str").equals("String_Node_Str")) {
    IeRefreshWrapper requestIE=new IeRefreshWrapper(request);
    chain.doFilter(requestIE,response);
  }
 else {
    chain.doFilter(request,response);
  }
}

Fixed version (ground truth):
@Override protected void doFilter(HttpServletRequest request,HttpServletResponse response,FilterChain chain) throws Exception {
  if ("String_Node_Str".equals(request.getHeader("String_Node_Str"))) {
    IeRefreshWrapper requestIE=new IeRefreshWrapper(request);
    chain.doFilter(requestIE,response);
  }
 else {
    chain.doFilter(request,response);
  }
}
Program: 8552
Project: 8552
Buggy source:
/** 
 * GET  /account/preferences -> get account's preferences
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST,produces="String_Node_Str") @ResponseBody @Timed public UserPassword setPassword(@RequestBody UserPassword userPassword,HttpServletResponse response){
  this.log.debug("String_Node_Str");
  try {
    User currentUser=authenticationService.getCurrentUser();
    StandardPasswordEncoder encoder=new StandardPasswordEncoder();
    if (!encoder.matches(userPassword.getOldPassword(),currentUser.getPassword())) {
      log.debug("String_Node_Str",userPassword.getOldPassword());
      throw new Exception("String_Node_Str");
    }
    if (!userPassword.getNewPassword().equals(userPassword.getNewPasswordConfirmation())) {
      throw new Exception("String_Node_Str");
    }
    currentUser.setPassword(userPassword.getNewPassword());
    userService.updatePassword(currentUser);
    log.debug("String_Node_Str",currentUser);
    return new UserPassword();
  }
 catch (  Exception e) {
    response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * GET  /account/preferences -> get account's preferences
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST,produces="String_Node_Str") @ResponseBody @Timed public UserPassword setPassword(@RequestBody UserPassword userPassword,HttpServletResponse response){
  log.debug("String_Node_Str");
  try {
    User currentUser=authenticationService.getCurrentUser();
    StandardPasswordEncoder encoder=new StandardPasswordEncoder();
    if (!encoder.matches(userPassword.getOldPassword(),currentUser.getPassword())) {
      log.debug("String_Node_Str",userPassword.getOldPassword());
      throw new Exception("String_Node_Str");
    }
    if (!userPassword.getNewPassword().equals(userPassword.getNewPasswordConfirmation())) {
      throw new Exception("String_Node_Str");
    }
    currentUser.setPassword(userPassword.getNewPassword());
    userService.updatePassword(currentUser);
    log.debug("String_Node_Str",currentUser);
    return new UserPassword();
  }
 catch (  Exception e) {
    response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    return null;
  }
}
Program: 8553
Project: 8553
Buggy source:
/** 
 * GET  /account/preferences -> get account's preferences
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody @Timed public Preferences getPreferences(){
  this.log.debug("String_Node_Str");
  User currentUser=authenticationService.getCurrentUser();
  User user=userService.getUserByLogin(currentUser.getLogin());
  Preferences preferences=new Preferences(user);
  return preferences;
}

Fixed version (ground truth):
/** 
 * GET  /account/preferences -> get account's preferences
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody @Timed public Preferences getPreferences(){
  log.debug("String_Node_Str");
  User currentUser=authenticationService.getCurrentUser();
  User user=userService.getUserByLogin(currentUser.getLogin());
  return new Preferences(user);
}
Program: 8555
Project: 8555
Buggy source:
/** 
 * GET  /account/profile -> get account's profile
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody @Timed public User getProfile(){
  this.log.debug("String_Node_Str");
  User currentUser=authenticationService.getCurrentUser();
  return userService.getUserByLogin(currentUser.getLogin());
}

Fixed version (ground truth):
/** 
 * GET  /account/profile -> get account's profile
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody @Timed public User getProfile(){
  log.debug("String_Node_Str");
  User currentUser=authenticationService.getCurrentUser();
  return userService.getUserByLogin(currentUser.getLogin());
}
Program: 8556
Project: 8556
Buggy source:
/** 
 * GET /account/admin -> Determines if the current account is an admin
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody @Timed public String isAdmin(){
  this.log.debug("String_Node_Str");
  org.springframework.security.core.userdetails.User securityUser=(org.springframework.security.core.userdetails.User)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
  return "String_Node_Str" + securityUser.getAuthorities().toString() + "String_Node_Str";
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody @Timed public String isAdmin(){
  log.debug("String_Node_Str");
  org.springframework.security.core.userdetails.User securityUser=(org.springframework.security.core.userdetails.User)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
  return "String_Node_Str" + securityUser.getAuthorities().toString() + "String_Node_Str";
}
Program: 8557
Project: 8557
Buggy source:
public Preferences(User user){
  this.mentionEmail=user.getPreferencesMentionEmail();
  this.weeklyDigest=user.getWeeklyDigestSubscription();
  this.dailyDigest=user.getDailyDigestSubscription();
  if (!StringUtils.isEmpty(user.getRssUid())) {
    this.rssUidActive=true;
    this.rssUid=user.getRssUid();
  }
}

Fixed version (ground truth):
public Preferences(User user){
  this.mentionEmail=user.getPreferencesMentionEmail() || false;
  this.weeklyDigest=user.getWeeklyDigestSubscription() || false;
  this.dailyDigest=user.getDailyDigestSubscription() || false;
  if (!StringUtils.isEmpty(user.getRssUid())) {
    this.rssUidActive=true;
    this.rssUid=user.getRssUid();
  }
}
Program: 8558
Project: 8558
Buggy source:
public void deleteAttachment(Attachment attachment){
  log.debug("String_Node_Str",attachment);
  User currentUser=authenticationService.getCurrentUser();
  for (  String attachmentIdTest : userAttachmentRepository.findAttachmentIds(currentUser.getLogin())) {
    if (attachmentIdTest.equals(attachment.getAttachmentId())) {
      userAttachmentRepository.removeAttachmentId(currentUser.getLogin(),attachment.getAttachmentId());
      attachmentRepository.deleteAttachment(attachment);
      long newAttachmentsSize=currentUser.getAttachmentsSize() - attachment.getSize();
      currentUser.setAttachmentsSize(newAttachmentsSize);
      userRepository.updateUser(currentUser);
      break;
    }
  }
}

Fixed version (ground truth):
public void deleteAttachment(Attachment attachment){
  log.debug("String_Node_Str",attachment);
  User currentUser=authenticationService.getCurrentUser();
  for (  String attachmentIdTest : userAttachmentRepository.findAttachmentIds(currentUser.getLogin())) {
    if (attachmentIdTest.equals(attachment.getAttachmentId())) {
      userAttachmentRepository.removeAttachmentId(currentUser.getLogin(),attachment.getAttachmentId());
      attachmentRepository.deleteAttachment(attachment);
      currentUser=authenticationService.getCurrentUser();
      long newAttachmentsSize=currentUser.getAttachmentsSize() - attachment.getSize();
      if (newAttachmentsSize < 0) {
        newAttachmentsSize=0;
      }
      currentUser.setAttachmentsSize(newAttachmentsSize);
      userRepository.updateUser(currentUser);
      break;
    }
  }
}
Program: 8559
Project: 8559
Buggy source:
public Group buildGroup(User user,Group group){
  if (group != null) {
    if (isGroupManagedByCurrentUser(group)) {
      group.setAdministrator(true);
      group.setMember(true);
    }
 else     if (group.isPublicGroup()) {
      Group result=getGroupFromUser(user,group.getGroupId());
      if (result != null) {
        group.setMember(true);
      }
    }
 else {
      Group result=getGroupFromUser(user,group.getGroupId());
      if (result == null) {
        log.info("String_Node_Str",user.getLogin(),group.getGroupId());
        return null;
      }
 else {
        group.setMember(true);
      }
    }
    long counter=0;
    for (    UserGroupDTO userGroup : getMembersForGroup(group.getGroupId(),authenticationService.getCurrentUser().getLogin())) {
      if (userGroup.isActivated()) {
        counter++;
      }
    }
    group.setCounter(counter);
  }
  return group;
}

Fixed version (ground truth):
public Group buildGroup(User user,Group group){
  if (group != null) {
    if (isGroupManagedByCurrentUser(group)) {
      group.setAdministrator(true);
      group.setMember(true);
    }
 else     if (group.isPublicGroup()) {
      Group result=getGroupFromUser(user,group.getGroupId());
      group.setAdministrator(false);
      if (result != null) {
        group.setMember(true);
      }
 else {
        group.setMember(false);
      }
    }
 else {
      Group result=getGroupFromUser(user,group.getGroupId());
      if (result == null) {
        log.info("String_Node_Str",user.getLogin(),group.getGroupId());
        group.setMember(false);
        group.setAdministrator(false);
        return null;
      }
 else {
        group.setMember(true);
      }
    }
    long counter=0;
    for (    UserGroupDTO userGroup : getMembersForGroup(group.getGroupId(),authenticationService.getCurrentUser().getLogin())) {
      if (userGroup.isActivated()) {
        counter++;
      }
    }
    group.setCounter(counter);
  }
  return group;
}
Program: 8560
Project: 8560
Buggy source:
/** 
 * GET  /search/groups" -> search groups<br>
 * @return a Collection of groups matching the query
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody @Timed public Collection<Group> searchGroups(@RequestParam("String_Node_Str") String query){
  String prefix=query.toLowerCase();
  String currentLogin=authenticationService.getCurrentUser().getLogin();
  String domain=DomainUtil.getDomainFromLogin(currentLogin);
  Collection<Group> groups;
  if (query != null && !query.equals("String_Node_Str")) {
    this.log.debug("String_Node_Str",prefix);
    groups=searchService.searchGroupByPrefix(domain,prefix,5);
  }
 else {
    groups=new ArrayList<Group>();
  }
  return groupService.buildGroupList(groups);
}

Fixed version (ground truth):
/** 
 * GET  /search/groups" -> search groups<br>
 * @return a Collection of groups matching the query
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody @Timed public Collection<Group> searchGroups(@RequestParam("String_Node_Str") String query){
  String prefix=query.toLowerCase();
  String currentLogin=authenticationService.getCurrentUser().getLogin();
  String domain=DomainUtil.getDomainFromLogin(currentLogin);
  Collection<Group> groups;
  if (query != null && !query.equals("String_Node_Str")) {
    this.log.debug("String_Node_Str",prefix);
    this.log.debug("String_Node_Str",currentLogin);
    groups=searchService.searchGroupByPrefix(domain,prefix,5);
  }
 else {
    groups=new ArrayList<Group>();
  }
  return groupService.buildGroupList(groups);
}
Program: 8561
Project: 8561
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.PATCH) @ResponseBody public StatusDTO updateStatus(@RequestBody ActionStatus action,@PathVariable("String_Node_Str") String statusId){
  try {
    StatusDTO status=timelineService.getStatus(statusId);
    if (action.isFavorite() != null && status.isFavorite() != action.isFavorite()) {
      if (action.isFavorite()) {
        timelineService.addFavoriteStatus(statusId);
      }
 else {
        timelineService.removeFavoriteStatus(statusId);
      }
      status.setFavorite(action.isFavorite());
    }
    if (action.isShared() != null && action.isShared()) {
      timelineService.shareStatus(statusId);
    }
    if (action.isAnnounced() != null && action.isAnnounced()) {
      timelineService.announceStatus(statusId);
    }
    return status;
  }
 catch (  Exception e) {
    StringWriter stack=new StringWriter();
    PrintWriter pw=new PrintWriter(stack);
    e.printStackTrace(pw);
    log.debug("String_Node_Str",stack.toString());
    return null;
  }
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.PATCH) @ResponseBody public StatusDTO updateStatus(@RequestBody ActionStatus action,@PathVariable("String_Node_Str") String statusId){
  try {
    StatusDTO status=timelineService.getStatus(statusId);
    if (action.isFavorite() != null && status.isFavorite() != action.isFavorite()) {
      if (action.isFavorite()) {
        timelineService.addFavoriteStatus(statusId);
      }
 else {
        timelineService.removeFavoriteStatus(statusId);
      }
      status.setFavorite(action.isFavorite());
    }
    if (action.isShared() != null && action.isShared()) {
      timelineService.shareStatus(statusId);
      status.setShareByMe(action.isShared());
    }
    if (action.isAnnounced() != null && action.isAnnounced()) {
      timelineService.announceStatus(statusId);
    }
    return status;
  }
 catch (  Exception e) {
    StringWriter stack=new StringWriter();
    PrintWriter pw=new PrintWriter(stack);
    e.printStackTrace(pw);
    log.debug("String_Node_Str",stack.toString());
    return null;
  }
}
Program: 8563
Project: 8563
Buggy source:
@Override public Group getGroupDetails(String groupId){
  Group group=new Group();
  group.setGroupId(groupId);
  group.setPublicGroup(false);
  ColumnSlice<String,String> result=createSliceQuery(keyspaceOperator,StringSerializer.get(),StringSerializer.get(),StringSerializer.get()).setColumnFamily(GROUP_DETAILS_CF).setKey(groupId).setRange(null,null,false,3).execute().get();
  for (  HColumn<String,String> column : result.getColumns()) {
    if (column.getName().equals(NAME)) {
      group.setName(column.getValue());
    }
 else     if (column.getName().equals(DESCRIPTION)) {
      group.setDescription(column.getValue());
    }
 else     if (column.getName().equals(PUBLIC_GROUP)) {
      if (column.getValue().equals(Boolean.TRUE.toString())) {
        group.setPublicGroup(true);
      }
    }
 else     if (column.getName().equals(ARCHIVED_GROUP)) {
      if (column.getValue().equals(Boolean.TRUE.toString())) {
        group.setArchivedGroup(true);
      }
    }
  }
  return group;
}

Fixed version (ground truth):
@Override public Group getGroupDetails(String groupId){
  Group group=new Group();
  group.setGroupId(groupId);
  group.setPublicGroup(false);
  ColumnSlice<String,String> result=createSliceQuery(keyspaceOperator,StringSerializer.get(),StringSerializer.get(),StringSerializer.get()).setColumnFamily(GROUP_DETAILS_CF).setKey(groupId).setRange(null,null,false,4).execute().get();
  for (  HColumn<String,String> column : result.getColumns()) {
    if (column.getName().equals(NAME)) {
      group.setName(column.getValue());
    }
 else     if (column.getName().equals(DESCRIPTION)) {
      group.setDescription(column.getValue());
    }
 else     if (column.getName().equals(PUBLIC_GROUP)) {
      if (column.getValue().equals(Boolean.TRUE.toString())) {
        group.setPublicGroup(true);
      }
    }
 else     if (column.getName().equals(ARCHIVED_GROUP)) {
      if (column.getValue().equals(Boolean.TRUE.toString())) {
        group.setArchivedGroup(true);
      }
    }
  }
  return group;
}
Program: 8564
Project: 8564
Buggy source:
public void replyToStatus(String content,String replyTo) throws ArchivedGroupException {
  Status originalStatus=statusRepository.findStatusById(replyTo);
  Group group=null;
  if (originalStatus.getGroupId() != null) {
    group=groupService.getGroupById(originalStatus.getDomain(),originalStatus.getGroupId());
  }
  if (group.isArchivedGroup()) {
    throw new ArchivedGroupException();
  }
  if (!originalStatus.getReplyTo().equals("String_Node_Str")) {
    Status realOriginalStatus=statusRepository.findStatusById(originalStatus.getDiscussionId());
    Status replyStatus=createStatus(content,realOriginalStatus.getStatusPrivate(),group,realOriginalStatus.getStatusId(),originalStatus.getStatusId(),originalStatus.getUsername());
    discussionRepository.addReplyToDiscussion(realOriginalStatus.getStatusId(),replyStatus.getStatusId());
  }
 else {
    Status replyStatus=createStatus(content,originalStatus.getStatusPrivate(),group,replyTo,replyTo,originalStatus.getUsername());
    discussionRepository.addReplyToDiscussion(originalStatus.getStatusId(),replyStatus.getStatusId());
  }
}

Fixed version (ground truth):
public void replyToStatus(String content,String replyTo) throws ArchivedGroupException {
  Status originalStatus=statusRepository.findStatusById(replyTo);
  Group group=null;
  if (originalStatus.getGroupId() != null) {
    group=groupService.getGroupById(originalStatus.getDomain(),originalStatus.getGroupId());
    if (group.isArchivedGroup()) {
      throw new ArchivedGroupException();
    }
  }
  if (!originalStatus.getReplyTo().equals("String_Node_Str")) {
    Status realOriginalStatus=statusRepository.findStatusById(originalStatus.getDiscussionId());
    Status replyStatus=createStatus(content,realOriginalStatus.getStatusPrivate(),group,realOriginalStatus.getStatusId(),originalStatus.getStatusId(),originalStatus.getUsername());
    discussionRepository.addReplyToDiscussion(realOriginalStatus.getStatusId(),replyStatus.getStatusId());
  }
 else {
    Status replyStatus=createStatus(content,originalStatus.getStatusPrivate(),group,replyTo,replyTo,originalStatus.getUsername());
    discussionRepository.addReplyToDiscussion(originalStatus.getStatusId(),replyStatus.getStatusId());
  }
}
Program: 8565
Project: 8565
Buggy source:
public Collection<Long> getDomainQuota(){
  User currentUser=authenticationService.getCurrentUser();
  DomainConfiguration domainConfiguration=domainConfigurationRepository.findDomainConfigurationByDomain(currentUser.getDomain());
  Long domainQuota=domainConfiguration.getStorageSizeAsLong();
  Long userQuota=currentUser.getAttachmentsSize();
  Collection<Long> globalDomainQuota=new ArrayList<Long>();
  globalDomainQuota.add(userQuota);
  globalDomainQuota.add(domainQuota);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + domainQuota);
  }
  return globalDomainQuota;
}

Fixed version (ground truth):
public Collection<Integer> getDomainQuota(){
  User currentUser=authenticationService.getCurrentUser();
  DomainConfiguration domainConfiguration=domainConfigurationRepository.findDomainConfigurationByDomain(currentUser.getDomain());
  Long domainQuota=domainConfiguration.getStorageSizeAsLong();
  Long userQuota=currentUser.getAttachmentsSize();
  int quota=Math.round((userQuota * 100) / domainQuota);
  Collection<Integer> taux=new ArrayList<Integer>();
  taux.add(quota);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + quota);
  }
  return taux;
}
Program: 8566
Project: 8566
Buggy source:
/** 
 * GET /attachment/quota -> get quota for the domain
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody public Collection<Long> getDomainQuota(){
  return attachmentService.getDomainQuota();
}

Fixed version (ground truth):
/** 
 * GET /attachment/quota -> get quota in % for the domain
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody public Collection<Integer> getDomainQuota(){
  return attachmentService.getDomainQuota();
}
Program: 8567
Project: 8567
Buggy source:
/** 
 * POST /attachment/destroy -> delete a specific attachment
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE,produces="String_Node_Str") @ResponseBody public void DeleteAttachment(@PathVariable("String_Node_Str") String attachmentId){
  Attachment attachment=attachmentService.getAttachmentById(attachmentId);
  attachmentService.deleteAttachment(attachment);
}

Fixed version (ground truth):
/** 
 * POST /attachment/{attachmentId} -> delete a specific attachment
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE,produces="String_Node_Str") @ResponseBody public void DeleteAttachment(@PathVariable("String_Node_Str") String attachmentId){
  Attachment attachment=attachmentService.getAttachmentById(attachmentId);
  attachmentService.deleteAttachment(attachment);
}
Program: 8568
Project: 8568
Buggy source:
/** 
 * GET  /users/suggestions -> suggest users to follow
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody public Collection<User> suggestions(){
  User currentUser=authenticationService.getCurrentUser();
  String currentLogin=currentUser.getLogin();
  String currentUsername=DomainUtil.getUsernameFromLogin(currentLogin);
  if (this.log.isDebugEnabled()) {
    this.log.debug("String_Node_Str" + currentUsername + "String_Node_Str");
  }
  Collection<String> exceptions=userService.getFriendIdsForUser(currentUsername);
  exceptions.add(currentLogin);
  Collection<UserStatusStat> stats=timelineService.getDayline();
  Map<String,User> users=new HashMap<String,User>();
  for (  UserStatusStat stat : stats) {
    User potentialFriend=userService.getUserProfileByUsername(stat.getUsername());
    if (exceptions.contains(potentialFriend.getLogin())) {
      continue;
    }
    users.put(potentialFriend.getUsername(),potentialFriend);
    if (users.size() == 3) {
      break;
    }
  }
  return users.values();
}

Fixed version (ground truth):
/** 
 * GET  /users/suggestions -> suggest users to follow
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces="String_Node_Str") @ResponseBody public Collection<User> suggestions(){
  User currentUser=authenticationService.getCurrentUser();
  String currentLogin=currentUser.getLogin();
  String currentUsername=DomainUtil.getUsernameFromLogin(currentLogin);
  if (this.log.isDebugEnabled()) {
    this.log.debug("String_Node_Str" + currentUsername + "String_Node_Str");
  }
  Collection<String> exceptions=userService.getFriendIdsForUser(currentLogin);
  exceptions.add(currentLogin);
  Collection<UserStatusStat> stats=timelineService.getDayline();
  Map<String,User> users=new HashMap<String,User>();
  for (  UserStatusStat stat : stats) {
    User potentialFriend=userService.getUserProfileByUsername(stat.getUsername());
    if (exceptions.contains(potentialFriend.getLogin())) {
      continue;
    }
    users.put(potentialFriend.getUsername(),potentialFriend);
    if (users.size() == 3) {
      break;
    }
  }
  return users.values();
}
Program: 8569
Project: 8569
Buggy source:
public FaunusTitanGraph(final Configuration configuration,boolean autoTx){
  super(new GraphDatabaseConfiguration(configuration));
  this.tx=(autoTx) ? newTransaction(new TransactionConfig(this.getConfiguration(),false)) : null;
}

Fixed version (ground truth):
public FaunusTitanGraph(final Configuration configuration,boolean autoTx){
  super(new GraphDatabaseConfiguration(configuration));
  this.tx=(autoTx) ? newTransaction(new StandardTransactionBuilder(this.getConfiguration(),this)) : null;
}
Program: 8570
Project: 8570
Buggy source:
public void completeSequence(){
  if (this.mapSequenceClasses.size() > 0) {
    this.getConf().setStrings(MapSequence.MAP_CLASSES,toStringMapSequenceClasses());
    final Job job;
    try {
      job=new Job(this.getConf(),this.toStringOfJob(MapSequence.class));
    }
 catch (    IOException e) {
      throw new RuntimeException(e.getMessage(),e);
    }
    job.setJarByClass(FaunusCompiler.class);
    job.setMapperClass(MapSequence.Map.class);
    if (null != this.reduceClass) {
      job.setReducerClass(this.reduceClass);
      if (null != this.combinerClass)       job.setCombinerClass(this.combinerClass);
      job.getConfiguration().setBoolean("String_Node_Str",true);
      job.getConfiguration().setClass("String_Node_Str",DefaultCodec.class,CompressionCodec.class);
    }
 else {
      job.setNumReduceTasks(0);
    }
    job.setMapOutputKeyClass(this.mapOutputKey);
    job.setMapOutputValueClass(this.mapOutputValue);
    if (null != this.comparatorClass)     job.setSortComparatorClass(this.comparatorClass);
    job.setOutputKeyClass(this.outputKey);
    job.setOutputValueClass(this.outputValue);
    this.jobs.add(job);
    this.setConf(new Configuration());
    this.addConfiguration(this.graph.getConfiguration());
    this.mapSequenceClasses.clear();
    this.combinerClass=null;
    this.reduceClass=null;
    this.comparatorClass=null;
  }
}

Fixed version (ground truth):
public void completeSequence(){
  if (this.mapSequenceClasses.size() > 0) {
    this.addConfiguration(this.graph.getConfiguration());
    this.getConf().setStrings(MapSequence.MAP_CLASSES,toStringMapSequenceClasses());
    final Job job;
    try {
      job=new Job(this.getConf(),this.toStringOfJob(MapSequence.class));
    }
 catch (    IOException e) {
      throw new RuntimeException(e.getMessage(),e);
    }
    job.setJarByClass(FaunusCompiler.class);
    job.setMapperClass(MapSequence.Map.class);
    if (null != this.reduceClass) {
      job.setReducerClass(this.reduceClass);
      if (null != this.combinerClass)       job.setCombinerClass(this.combinerClass);
      job.getConfiguration().setBoolean("String_Node_Str",true);
      job.getConfiguration().setClass("String_Node_Str",DefaultCodec.class,CompressionCodec.class);
    }
 else {
      job.setNumReduceTasks(0);
    }
    job.setMapOutputKeyClass(this.mapOutputKey);
    job.setMapOutputValueClass(this.mapOutputValue);
    if (null != this.comparatorClass)     job.setSortComparatorClass(this.comparatorClass);
    job.setOutputKeyClass(this.outputKey);
    job.setOutputValueClass(this.outputValue);
    this.jobs.add(job);
    this.setConf(new Configuration());
    this.mapSequenceClasses.clear();
    this.combinerClass=null;
    this.reduceClass=null;
    this.comparatorClass=null;
  }
}
Program: 8571
Project: 8571
Buggy source:
public FaunusCompiler(final FaunusGraph graph){
  this.graph=graph;
  this.setConf(new Configuration());
  this.addConfiguration(this.graph.getConfiguration());
}

Fixed version (ground truth):
public FaunusCompiler(final FaunusGraph graph){
  this.graph=graph;
  this.setConf(new Configuration());
}
Program: 8572
Project: 8572
Buggy source:
private FaunusPipeline done(){
  if (!this.state.isLocked()) {
    final Pair<String,Class<? extends WritableComparable>> pair=this.state.popProperty();
    if (null != pair) {
      this.compiler.addMap(PropertyMap.Map.class,LongWritable.class,pair.getB(),PropertyMap.createConfiguration(this.state.getElementType(),pair.getA(),pair.getB()));
      makeMapReduceString(PropertyMap.class,pair.getA());
    }
    this.state.lock();
  }
  this.compiler.completeSequence();
  return this;
}

Fixed version (ground truth):
private FaunusPipeline done(){
  if (!this.state.isLocked()) {
    final Pair<String,Class<? extends WritableComparable>> pair=this.state.popProperty();
    if (null != pair) {
      this.compiler.addMap(PropertyMap.Map.class,LongWritable.class,pair.getB(),PropertyMap.createConfiguration(this.state.getElementType(),pair.getA(),pair.getB()));
      makeMapReduceString(PropertyMap.class,pair.getA());
      this.state.lock();
    }
  }
  return this;
}
Program: 8573
Project: 8573
Buggy source:
/** 
 * Submit the FaunusPipeline to the Hadoop cluster and ensure that a header is emitted in the logs.
 * @param script     the Gremlin script
 * @param showHeader the Faunus header
 * @throws Exception
 */
public void submit(final String script,final Boolean showHeader) throws Exception {
  this.done();
  if (MapReduceFormat.class.isAssignableFrom(this.graph.getGraphOutputFormat())) {
    this.state.checkLocked();
    ((Class<? extends MapReduceFormat>)this.graph.getGraphOutputFormat()).getConstructor().newInstance().addMapReduceJobs(this.compiler);
  }
  ToolRunner.run(this.compiler,new String[]{script,showHeader.toString()});
}

Fixed version (ground truth):
/** 
 * Submit the FaunusPipeline to the Hadoop cluster and ensure that a header is emitted in the logs.
 * @param script     the Gremlin script
 * @param showHeader the Faunus header
 * @throws Exception
 */
public void submit(final String script,final Boolean showHeader) throws Exception {
  this.done();
  if (MapReduceFormat.class.isAssignableFrom(this.graph.getGraphOutputFormat())) {
    this.state.checkLocked();
    ((Class<? extends MapReduceFormat>)this.graph.getGraphOutputFormat()).getConstructor().newInstance().addMapReduceJobs(this.compiler);
  }
  this.compiler.completeSequence();
  ToolRunner.run(this.compiler,new String[]{script,showHeader.toString()});
}
Program: 8574
Project: 8574
Buggy source:
public static Graph generateGraph(final Configuration config,final String prefix){
  return TitanFactory.open(generateTitanConfiguration(config,prefix));
}

Fixed version (ground truth):
public synchronized static Graph generateGraph(final Configuration config,final String prefix){
  if (null == graph)   graph=TitanFactory.open(generateTitanConfiguration(config,prefix));
  return graph;
}
Program: 8575
Project: 8575
Buggy source:
@Override public void addMapReduceJobs(final FaunusCompiler compiler){
  if (compiler.getConf().getBoolean(FAUNUS_GRAPH_OUTPUT_TITAN_INFER_SCHEMA,true)) {
    compiler.addMapReduce(SchemaInferencerMapReduce.Map.class,null,SchemaInferencerMapReduce.Reduce.class,LongWritable.class,FaunusVertex.class,NullWritable.class,FaunusVertex.class,new Configuration());
  }
  compiler.addMapReduce(BlueprintsGraphOutputMapReduce.Map.class,null,BlueprintsGraphOutputMapReduce.Reduce.class,LongWritable.class,Holder.class,NullWritable.class,FaunusVertex.class,new Configuration());
}

Fixed version (ground truth):
@Override public void addMapReduceJobs(final FaunusCompiler compiler){
  if (compiler.getConf().getBoolean(FAUNUS_GRAPH_OUTPUT_TITAN_INFER_SCHEMA,true)) {
    compiler.addMapReduce(SchemaInferencerMapReduce.Map.class,null,SchemaInferencerMapReduce.Reduce.class,LongWritable.class,FaunusVertex.class,NullWritable.class,FaunusVertex.class,new Configuration());
  }
  compiler.addMapReduce(BlueprintsGraphOutputMapReduce.Map.class,null,BlueprintsGraphOutputMapReduce.Reduce.class,LongWritable.class,Holder.class,NullWritable.class,FaunusVertex.class,BlueprintsGraphOutputMapReduce.createConfiguration());
}
Program: 8576
Project: 8576
Buggy source:
public void completeSequence(){
  if (this.mapSequenceClasses.size() > 0) {
    this.getConf().setStrings(MapSequence.MAP_CLASSES,toStringMapSequenceClasses());
    final Job job;
    try {
      job=new Job(this.getConf(),this.toStringOfJob(MapSequence.class));
    }
 catch (    IOException e) {
      throw new RuntimeException(e.getMessage(),e);
    }
    for (    final Map.Entry<String,String> entry : this.graph.getConfiguration()) {
      job.getConfiguration().set(entry.getKey(),entry.getValue());
    }
    job.setJarByClass(FaunusCompiler.class);
    job.setMapperClass(MapSequence.Map.class);
    if (null != this.reduceClass) {
      job.setReducerClass(this.reduceClass);
      if (null != this.combinerClass)       job.setCombinerClass(this.combinerClass);
      job.getConfiguration().setBoolean("String_Node_Str",true);
      job.getConfiguration().setClass("String_Node_Str",DefaultCodec.class,CompressionCodec.class);
    }
 else {
      job.setNumReduceTasks(0);
    }
    if (this.mapSequenceClasses.contains(BlueprintsGraphOutputMapReduce.Map.class)) {
      job.setMapSpeculativeExecution(false);
      job.setReduceSpeculativeExecution(false);
    }
    job.setMapOutputKeyClass(this.mapOutputKey);
    job.setMapOutputValueClass(this.mapOutputValue);
    job.setOutputKeyClass(this.outputKey);
    job.setOutputValueClass(this.outputValue);
    if (null != this.comparatorClass)     job.setSortComparatorClass(this.comparatorClass);
    this.jobs.add(job);
    this.setConf(new Configuration());
    this.addConfiguration(this.graph.getConfiguration());
    this.mapSequenceClasses.clear();
    this.combinerClass=null;
    this.reduceClass=null;
    this.comparatorClass=null;
  }
}

Fixed version (ground truth):
public void completeSequence(){
  if (this.mapSequenceClasses.size() > 0) {
    this.getConf().setStrings(MapSequence.MAP_CLASSES,toStringMapSequenceClasses());
    final Job job;
    try {
      job=new Job(this.getConf(),this.toStringOfJob(MapSequence.class));
    }
 catch (    IOException e) {
      throw new RuntimeException(e.getMessage(),e);
    }
    job.setJarByClass(FaunusCompiler.class);
    job.setMapperClass(MapSequence.Map.class);
    if (null != this.reduceClass) {
      job.setReducerClass(this.reduceClass);
      if (null != this.combinerClass)       job.setCombinerClass(this.combinerClass);
      job.getConfiguration().setBoolean("String_Node_Str",true);
      job.getConfiguration().setClass("String_Node_Str",DefaultCodec.class,CompressionCodec.class);
    }
 else {
      job.setNumReduceTasks(0);
    }
    job.setMapOutputKeyClass(this.mapOutputKey);
    job.setMapOutputValueClass(this.mapOutputValue);
    job.setOutputKeyClass(this.outputKey);
    job.setOutputValueClass(this.outputValue);
    if (null != this.comparatorClass)     job.setSortComparatorClass(this.comparatorClass);
    this.jobs.add(job);
    this.setConf(new Configuration());
    this.addConfiguration(this.graph.getConfiguration());
    this.mapSequenceClasses.clear();
    this.combinerClass=null;
    this.reduceClass=null;
    this.comparatorClass=null;
  }
}
Program: 8578
Project: 8578
Buggy source:
@Override public void reduce(final LongWritable key,final Iterable<Holder> values,final Reducer<LongWritable,Holder,NullWritable,FaunusVertex>.Context context) throws IOException, InterruptedException {
  final FaunusVertex vertex=new FaunusVertex(key.get());
  for (  final Holder holder : values) {
    if (holder.getTag() == 'o') {
      vertex.addEdge(OUT,(FaunusEdge)holder.get());
      context.getCounter(Counters.OUT_EDGES_CREATED).increment(1l);
    }
 else     if (holder.getTag() == 'i') {
      vertex.addEdge(IN,(FaunusEdge)holder.get());
      context.getCounter(Counters.IN_EDGES_CREATED).increment(1l);
    }
 else {
      final FaunusVertex temp=(FaunusVertex)holder.get();
      for (      final String property : temp.getPropertyKeys()) {
        vertex.setProperty(property,temp.getProperty(property));
      }
      vertex.addEdges(BOTH,temp);
    }
  }
  context.write(NullWritable.get(),vertex);
  context.getCounter(Counters.VERTICES_CREATED).increment(1l);
}

Fixed version (ground truth):
@Override public void reduce(final LongWritable key,final Iterable<Holder> values,final Reducer<LongWritable,Holder,NullWritable,FaunusVertex>.Context context) throws IOException, InterruptedException {
  final FaunusVertex vertex=new FaunusVertex(key.get());
  for (  final Holder holder : values) {
    if (holder.getTag() == 'o') {
      vertex.addEdge(OUT,(FaunusEdge)holder.get());
      context.getCounter(Counters.OUT_EDGES_CREATED).increment(1l);
    }
 else     if (holder.getTag() == 'i') {
      vertex.addEdge(IN,(FaunusEdge)holder.get());
      context.getCounter(Counters.IN_EDGES_CREATED).increment(1l);
    }
 else {
      final FaunusVertex temp=(FaunusVertex)holder.get();
      for (      final String property : temp.getPropertyKeys()) {
        vertex.setProperty(property,temp.getProperty(property));
      }
      vertex.addEdges(BOTH,temp);
      context.getCounter(Counters.OUT_EDGES_CREATED).increment(((List)temp.getEdges(OUT)).size());
      context.getCounter(Counters.IN_EDGES_CREATED).increment(((List)temp.getEdges(IN)).size());
    }
  }
  context.write(NullWritable.get(),vertex);
  context.getCounter(Counters.VERTICES_CREATED).increment(1l);
}
Program: 8579
Project: 8579
Buggy source:
@Override public void reduce(final LongWritable key,final Iterable<FaunusVertex> values,final Reducer<LongWritable,FaunusVertex,NullWritable,FaunusVertex>.Context context) throws IOException, InterruptedException {
  this.vertex.reuse(key.get());
  for (  final FaunusVertex value : values) {
    this.vertex.addEdges(BOTH,value);
    this.vertex.getProperties().putAll(value.getProperties());
  }
  context.write(NullWritable.get(),this.vertex);
  context.getCounter(Counters.VERTICES_CREATED).increment(1l);
  context.getCounter(Counters.VERTEX_PROPERTIES_CREATED).increment(this.vertex.getProperties().size());
  context.getCounter(Counters.OUT_EDGES_CREATED).increment(((List)this.vertex.getEdges(OUT)).size());
  context.getCounter(Counters.IN_EDGES_CREATED).increment(((List)this.vertex.getEdges(IN)).size());
  context.write(NullWritable.get(),this.vertex);
}

Fixed version (ground truth):
@Override public void reduce(final LongWritable key,final Iterable<FaunusVertex> values,final Reducer<LongWritable,FaunusVertex,NullWritable,FaunusVertex>.Context context) throws IOException, InterruptedException {
  this.vertex.reuse(key.get());
  for (  final FaunusVertex value : values) {
    this.vertex.addEdges(BOTH,value);
    this.vertex.getProperties().putAll(value.getProperties());
  }
  context.getCounter(Counters.VERTICES_CREATED).increment(1l);
  context.getCounter(Counters.VERTEX_PROPERTIES_CREATED).increment(this.vertex.getProperties().size());
  context.getCounter(Counters.OUT_EDGES_CREATED).increment(((List)this.vertex.getEdges(OUT)).size());
  context.getCounter(Counters.IN_EDGES_CREATED).increment(((List)this.vertex.getEdges(IN)).size());
  context.write(NullWritable.get(),this.vertex);
}
Program: 8580
Project: 8580
Buggy source:
@Override public void map(final NullWritable key,final FaunusElement value,final Mapper<NullWritable,FaunusElement,LongWritable,FaunusVertex>.Context context) throws IOException, InterruptedException {
  if (value instanceof FaunusEdge) {
    final long outId=((FaunusEdge)value).getVertexId(OUT);
    final long inId=((FaunusEdge)value).getVertexId(IN);
    FaunusVertex vertex=this.map.get(outId);
    if (null == vertex) {
      vertex=new FaunusVertex(outId);
      this.map.put(outId,vertex);
    }
    vertex.addEdge(OUT,(FaunusEdge)value);
    vertex=this.map.get(inId);
    if (null == vertex) {
      vertex=new FaunusVertex(inId);
      this.map.put(inId,vertex);
    }
    vertex.addEdge(IN,(FaunusEdge)value);
    context.getCounter(Counters.EDGES_PROCESSED).increment(1l);
    this.counter++;
  }
 else {
    final long id=value.getIdAsLong();
    FaunusVertex vertex=this.map.get(id);
    if (null == vertex) {
      vertex=new FaunusVertex(id);
      this.map.put(id,vertex);
    }
    vertex.getProperties().putAll(value.getProperties());
    vertex.addEdges(BOTH,(FaunusVertex)value);
    this.counter++;
  }
  if (this.counter > MAX_MAP_SIZE)   this.flush(context);
}

Fixed version (ground truth):
@Override public void map(final NullWritable key,final FaunusElement value,final Mapper<NullWritable,FaunusElement,LongWritable,FaunusVertex>.Context context) throws IOException, InterruptedException {
  if (value instanceof FaunusEdge) {
    final long outId=((FaunusEdge)value).getVertexId(OUT);
    final long inId=((FaunusEdge)value).getVertexId(IN);
    FaunusVertex vertex=this.map.get(outId);
    if (null == vertex) {
      vertex=new FaunusVertex(outId);
      this.map.put(outId,vertex);
    }
    vertex.addEdge(OUT,(FaunusEdge)value);
    this.counter++;
    vertex=this.map.get(inId);
    if (null == vertex) {
      vertex=new FaunusVertex(inId);
      this.map.put(inId,vertex);
    }
    vertex.addEdge(IN,(FaunusEdge)value);
    context.getCounter(Counters.EDGES_PROCESSED).increment(1l);
    this.counter++;
  }
 else {
    final long id=value.getIdAsLong();
    FaunusVertex vertex=this.map.get(id);
    if (null == vertex) {
      vertex=new FaunusVertex(id);
      this.map.put(id,vertex);
    }
    vertex.getProperties().putAll(value.getProperties());
    vertex.addEdges(BOTH,(FaunusVertex)value);
    this.counter++;
  }
  if (this.counter > MAX_MAP_SIZE)   this.flush(context);
}