nus-yam/ex-repair huggingface dataset:
Program: 102419
Project: 102419
Buggy source:
/** 
 * Creates a new thread name with the given pattern <p/>
 * @param pattern the pattern
 * @param name    the name
 * @return the thread name, which is unique
 */
public static String resolveThreadName(String pattern,String name){
  if (pattern == null) {
    pattern=DEFAULT_PATTERN;
  }
  String longName=name;
  String shortName=name;
  shortName=Matcher.quoteReplacement(shortName);
  longName=Matcher.quoteReplacement(longName);
  String answer=pattern.replaceFirst("String_Node_Str","String_Node_Str" + nextThreadCounter());
  answer=answer.replaceFirst("String_Node_Str",longName);
  answer=answer.replaceFirst("String_Node_Str",shortName);
  if (INVALID_PATTERN.matcher(answer).matches()) {
    throw new IllegalArgumentException("String_Node_Str" + pattern);
  }
  return answer;
}

Fixed version (ground truth):
/** 
 * Creates a new thread name with the given pattern <br>
 * @param pattern the pattern
 * @param name    the name
 * @return the thread name, which is unique
 */
public static String resolveThreadName(String pattern,String name){
  if (pattern == null) {
    pattern=DEFAULT_PATTERN;
  }
  String longName=name;
  String shortName=name;
  shortName=Matcher.quoteReplacement(shortName);
  longName=Matcher.quoteReplacement(longName);
  String answer=pattern.replaceFirst("String_Node_Str","String_Node_Str" + nextThreadCounter());
  answer=answer.replaceFirst("String_Node_Str",longName);
  answer=answer.replaceFirst("String_Node_Str",shortName);
  if (INVALID_PATTERN.matcher(answer).matches()) {
    throw new IllegalArgumentException("String_Node_Str" + pattern);
  }
  return answer;
}
Program: 102420
Project: 102420
Buggy source:
/** 
 * Splits tag of XML String to an arrayList
 * @param html
 * @return List<String> which each item is a token of HTML tag
 */
public static List<String> tokenize(String html){
  ArrayList<String> tokens=new ArrayList<String>();
  int pos=0;
  String token="String_Node_Str";
  int len=html.length();
  while (pos < len) {
    char c=html.charAt(pos);
    String ahead=html.substring(pos,pos > len - 4 ? len : pos + 4);
    if ("String_Node_Str".equals(ahead)) {
      if (token.length() > 0) {
        tokens.add(token);
      }
      token="String_Node_Str";
      int end=moveToMarkerEnd(pos,"String_Node_Str",html);
      tokens.add(html.substring(pos,end));
      pos=end;
    }
 else     if ('<' == c) {
      if (token.length() > 0) {
        tokens.add(token);
      }
      token="String_Node_Str";
      int end=moveToMarkerEnd(pos,"String_Node_Str",html);
      tokens.add(html.substring(pos,end));
      pos=end;
    }
 else {
      token=token + c;
      pos++;
    }
  }
  if (token.length() > 0) {
    tokens.add(token);
  }
  return tokens;
}

Fixed version (ground truth):
/** 
 * Splits tag of XML String to an arrayList
 * @param html
 * @return list of HTML tags
 */
public static List<String> tokenize(String html){
  ArrayList<String> tokens=new ArrayList<String>();
  int pos=0;
  String token="String_Node_Str";
  int len=html.length();
  while (pos < len) {
    char c=html.charAt(pos);
    String ahead=html.substring(pos,pos > len - 4 ? len : pos + 4);
    if ("String_Node_Str".equals(ahead)) {
      if (token.length() > 0) {
        tokens.add(token);
      }
      token="String_Node_Str";
      int end=moveToMarkerEnd(pos,"String_Node_Str",html);
      tokens.add(html.substring(pos,end));
      pos=end;
    }
 else     if ('<' == c) {
      if (token.length() > 0) {
        tokens.add(token);
      }
      token="String_Node_Str";
      int end=moveToMarkerEnd(pos,"String_Node_Str",html);
      tokens.add(html.substring(pos,end));
      pos=end;
    }
 else {
      token=token + c;
      pos++;
    }
  }
  if (token.length() > 0) {
    tokens.add(token);
  }
  return tokens;
}
Program: 102421
Project: 102421
Buggy source:
/** 
 * Constructor with InitParams from container, if url.length > UrlMaxLength then the url display will be shorten.
 * @param urlMaxLength
 */
public URLConverterFilterPlugin(InitParams params){
  try {
    urlMaxLength=Integer.valueOf(params.getValueParam("String_Node_Str").getValue());
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + getClass());
  }
}

Fixed version (ground truth):
/** 
 * Constructor with InitParams from container, if   {@literal url.length > UrlMaxLength} then the url display will be shorten.
 * @param params
 */
public URLConverterFilterPlugin(InitParams params){
  try {
    urlMaxLength=Integer.valueOf(params.getValueParam("String_Node_Str").getValue());
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + getClass());
  }
}
Program: 102422
Project: 102422
Buggy source:
/** 
 * Sets max length of URL, if url.length > urlMaxLength and urlMaxLength >= 3 then the url display will be shorten.
 * @param urlMaxLength
 */
public void setUrlMaxLength(int urlMaxLength){
  this.urlMaxLength=urlMaxLength;
}

Fixed version (ground truth):
/** 
 * Sets max length of URL, if   {@literal url.length > urlMaxLength and urlMaxLength >= 3} then the url display will be shorten.
 * @param urlMaxLength
 */
public void setUrlMaxLength(int urlMaxLength){
  this.urlMaxLength=urlMaxLength;
}
Program: 102423
Project: 102423
Buggy source:
/** 
 * Gets max length of URL, if url.length > urlMaxLength and urlMaxLength >= 3 then the url display will be shorten
 * @return
 */
public int getUrlMaxLength(){
  return urlMaxLength;
}

Fixed version (ground truth):
/** 
 * Gets max length of URL, if   {@literal url.length > urlMaxLength and urlMaxLength >= 3} then the url display will be shorten
 * @return
 */
public int getUrlMaxLength(){
  return urlMaxLength;
}
Program: 102424
Project: 102424
Buggy source:
/** 
 * Gets the KeySet iterator of attributes
 * @return Iterator<String>
 */
public Iterator<String> getKeyIterator(){
  return attributes.keySet().iterator();
}

Fixed version (ground truth):
/** 
 * Gets the KeySet iterator of attributes
 * @return iterator of keys
 */
public Iterator<String> getKeyIterator(){
  return attributes.keySet().iterator();
}
Program: 102425
Project: 102425
Buggy source:
/** 
 * Constructor with offset and limit
 * @param offset
 * @param limit
 * @param totalSize total size of nodes matched filter.
 */
public ActivityCounter(){
  ids=new String[0];
  gotList=new ArrayList<ExoSocialActivity>();
}

Fixed version (ground truth):
/** 
 * Constructor with offset and limit
 */
public ActivityCounter(){
  ids=new String[0];
  gotList=new ArrayList<ExoSocialActivity>();
}
Program: 102426
Project: 102426
Buggy source:
/** 
 * Gets the link to the UI endpoint of the stream in portal. <p/> A string specifying the stream's URL
 * @return the permanent link for this activity stream
 */
String getPermaLink();

Fixed version (ground truth):
/** 
 * Gets the link to the UI endpoint of the stream in portal. <br> A string specifying the stream's URL
 * @return the permanent link for this activity stream
 */
String getPermaLink();
Program: 102427
Project: 102427
Buggy source:
/** 
 * Sets the link to the UI endpoint of the stream in portal. <p/> A string specifying the stream's URL
 * @param permaLink the permanent link for this activity stream
 */
void setPermaLink(String permaLink);

Fixed version (ground truth):
/** 
 * Sets the link to the UI endpoint of the stream in portal. <br> A string specifying the stream's URL
 * @param permaLink the permanent link for this activity stream
 */
void setPermaLink(String permaLink);
Program: 102428
Project: 102428
Buggy source:
protected String getLoadActivityUrl() throws Exception {
  return event("String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str" + OBJECTID + "String_Node_Str");
}

Fixed version (ground truth):
protected String getLoadActivityUrl() throws Exception {
  return event("String_Node_Str").replace("String_Node_Str",StringUtils.EMPTY).replace("String_Node_Str","String_Node_Str" + OBJECTID + "String_Node_Str");
}
Program: 102429
Project: 102429
Buggy source:
/** 
 * Initializes ui component child
 * @throws Exception
 */
private void init() throws Exception {
  while (getChild(UIActivityLoader.class) != null) {
    removeChild(UIActivityLoader.class);
  }
  if (activityIdList == null) {
    return;
  }
  ActivityManager activityManager=getApplicationComponent(ActivityManager.class);
  for (  String activityId : activityIdList) {
    UIActivityLoader uiActivityLoader=addChild(UIActivityLoader.class,null,"String_Node_Str" + activityId);
    if (isRenderFull()) {
      UIActivityFactory factory=CommonsUtils.getService(UIActivityFactory.class);
      factory.addChild(activityManager.getActivity(activityId),uiActivityLoader);
    }
  }
}

Fixed version (ground truth):
/** 
 * Initializes ui component child
 * @throws Exception
 */
private void init() throws Exception {
  while (getChild(UIActivityLoader.class) != null) {
    removeChild(UIActivityLoader.class);
  }
  if (activityIdList == null) {
    return;
  }
  ActivityManager activityManager=getApplicationComponent(ActivityManager.class);
  for (  String activityId : activityIdList) {
    UIActivityLoader uiActivityLoader=addChild(UIActivityLoader.class,null,UIActivityLoader.buildComponentId(activityId));
    if (isRenderFull()) {
      UIActivityFactory factory=CommonsUtils.getService(UIActivityFactory.class);
      factory.addChild(activityManager.getActivity(activityId),uiActivityLoader);
    }
  }
}
Program: 102430
Project: 102430
Buggy source:
@Override public void execute(Event<UIActivitiesContainer> event) throws Exception {
  UIActivitiesContainer uiActivitiesContainer=event.getSource();
  String uiActivityId=event.getRequestContext().getRequestParameter(OBJECTID);
  if (uiActivityId == null || uiActivityId.isEmpty()) {
    ((PortalRequestContext)event.getRequestContext().getParentAppRequestContext()).ignoreAJAXUpdateOnPortlets(true);
  }
  String activityId=uiActivityId.replace("String_Node_Str","String_Node_Str");
  ExoSocialActivity activity=CommonsUtils.getService(ActivityManager.class).getActivity(activityId);
  UIActivityLoader uiActivityLoader=uiActivitiesContainer.getChildById(uiActivityId);
  if (activity != null) {
    if (uiActivityLoader == null) {
      uiActivityLoader=uiActivitiesContainer.addChild(UIActivityLoader.class,null,"String_Node_Str" + activityId);
    }
 else     if (uiActivityLoader.getChildren().size() > 0) {
      uiActivityLoader.removeChild(BaseUIActivity.class);
    }
    UIActivityFactory factory=CommonsUtils.getService(UIActivityFactory.class);
    factory.addChild(activity,uiActivityLoader);
    event.getRequestContext().addUIComponentToUpdateByAjax(uiActivityLoader);
  }
 else {
    if (uiActivityLoader != null) {
      uiActivitiesContainer.removeChildById(uiActivityLoader.getId());
      activity=new ExoSocialActivityImpl();
      activity.setId(activityId);
      uiActivitiesContainer.removeActivity(activity);
    }
    event.getRequestContext().addUIComponentToUpdateByAjax(uiActivitiesContainer.getParent());
  }
}

Fixed version (ground truth):
@Override public void execute(Event<UIActivitiesContainer> event) throws Exception {
  UIActivitiesContainer uiActivitiesContainer=event.getSource();
  String uiActivityId=event.getRequestContext().getRequestParameter(OBJECTID);
  if (uiActivityId == null || uiActivityId.isEmpty()) {
    ((PortalRequestContext)event.getRequestContext().getParentAppRequestContext()).ignoreAJAXUpdateOnPortlets(true);
  }
  String activityId=uiActivityId.replace(UIActivityLoader.COMPONENT_ID,StringUtils.EMPTY);
  ExoSocialActivity activity=CommonsUtils.getService(ActivityManager.class).getActivity(activityId);
  UIActivityLoader uiActivityLoader=uiActivitiesContainer.getChildById(uiActivityId);
  if (uiActivityLoader != null) {
    uiActivitiesContainer.removeChildById(uiActivityId);
  }
  if (activity != null) {
    uiActivityLoader=uiActivitiesContainer.addChild(UIActivityLoader.class,null,UIActivityLoader.buildComponentId(activityId));
    UIActivityFactory factory=CommonsUtils.getService(UIActivityFactory.class);
    factory.addChild(activity,uiActivityLoader);
    event.getRequestContext().addUIComponentToUpdateByAjax(uiActivityLoader);
  }
 else {
    activity=new ExoSocialActivityImpl();
    activity.setId(activityId);
    uiActivitiesContainer.removeActivity(activity);
    event.getRequestContext().addUIComponentToUpdateByAjax(uiActivitiesContainer.getParent());
  }
}
Program: 102431
Project: 102431
Buggy source:
@Override public void processRender(WebuiRequestContext context) throws Exception {
  super.processRender(context);
  if (getId().equals("String_Node_Str")) {
    getAncestorOfType(AbstractActivitiesDisplay.class).setRenderFull(false);
  }
}

Fixed version (ground truth):
@Override public void processRender(WebuiRequestContext context) throws Exception {
  super.processRender(context);
  if (getParent() instanceof AbstractActivitiesDisplay) {
    ((AbstractActivitiesDisplay)getParent()).setRenderFull(false);
  }
}
Program: 102433
Project: 102433
Buggy source:
/** 
 * {@inheritDoc}
 */
public void saveComment(ExoSocialActivity existingActivity,ExoSocialActivity newComment) throws ActivityStorageException {
  activityStorage.saveComment(existingActivity,newComment);
  activityLifeCycle.saveComment(activityStorage.getActivity(newComment.getId()));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void saveComment(ExoSocialActivity existingActivity,ExoSocialActivity newComment) throws ActivityStorageException {
  activityStorage.saveComment(existingActivity,newComment);
  activityLifeCycle.saveComment(activityStorage.getComment(newComment.getId()));
}
Program: 102436
Project: 102436
Buggy source:
/** 
 * Process to return a space by id
 * @param uriInfo
 * @return
 * @throws Exception
 */
@GET @Path("String_Node_Str") public abstract Response getSpaceActivitiesById(@Context UriInfo uriInfo,@PathParam("String_Node_Str") String id,@QueryParam("String_Node_Str") int offset,@QueryParam("String_Node_Str") int limit,@QueryParam("String_Node_Str") long before,@QueryParam("String_Node_Str") long after,@ApiParam(value="String_Node_Str",defaultValue="String_Node_Str") @QueryParam("String_Node_Str") boolean returnSize,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String expand) throws Exception ;

Fixed version (ground truth):
/** 
 * Process to return a space by id
 * @param uriInfo
 * @return
 * @throws Exception
 */
@GET @Path("String_Node_Str") public abstract Response getSpaceActivitiesById(@Context UriInfo uriInfo,@PathParam("String_Node_Str") String id,@QueryParam("String_Node_Str") int offset,@QueryParam("String_Node_Str") int limit,@QueryParam("String_Node_Str") String before,@QueryParam("String_Node_Str") String after,@ApiParam(value="String_Node_Str",defaultValue="String_Node_Str") @QueryParam("String_Node_Str") boolean returnSize,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String expand) throws Exception ;
Program: 102437
Project: 102437
Buggy source:
@GET @Path("String_Node_Str") public abstract Response getActivitiesOfUser(@Context UriInfo uriInfo,@PathParam("String_Node_Str") String id,@QueryParam("String_Node_Str") int offset,@QueryParam("String_Node_Str") int limit,@QueryParam("String_Node_Str") long before,@QueryParam("String_Node_Str") long after,@QueryParam("String_Node_Str") boolean returnSize,@QueryParam("String_Node_Str") String expand) throws Exception ;

Fixed version (ground truth):
@GET @Path("String_Node_Str") public abstract Response getActivitiesOfUser(@Context UriInfo uriInfo,@PathParam("String_Node_Str") String id,@QueryParam("String_Node_Str") int offset,@QueryParam("String_Node_Str") int limit,@QueryParam("String_Node_Str") String before,@QueryParam("String_Node_Str") String after,@QueryParam("String_Node_Str") boolean returnSize,@QueryParam("String_Node_Str") String expand) throws Exception ;
Program: 102447
Project: 102447
Buggy source:
/** 
 * {@inheritDoc}
 */
@POST @RolesAllowed("String_Node_Str") @ApiOperation(value="String_Node_Str",httpMethod="String_Node_Str",response=Response.class,notes="String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str"),@ApiResponse(code=500,message="String_Node_Str"),@ApiResponse(code=400,message="String_Node_Str")}) public Response createIdentities(@Context UriInfo uriInfo,@ApiParam(value="String_Node_Str",required=true) @QueryParam("String_Node_Str") String remoteId,@ApiParam(value="String_Node_Str",required=true) @QueryParam("String_Node_Str") String providerId,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String expand) throws Exception {
  if (!RestUtils.isMemberOfAdminGroup()) {
    throw new WebApplicationException(Response.Status.UNAUTHORIZED);
  }
  if ((!providerId.equals(SpaceIdentityProvider.NAME) && !providerId.equals(OrganizationIdentityProvider.NAME))) {
    throw new WebApplicationException(Response.Status.BAD_REQUEST);
  }
  IdentityManager identityManager=CommonsUtils.getService(IdentityManager.class);
  Identity identity=identityManager.getOrCreateIdentity(providerId,remoteId,true);
  if (identity.isDeleted()) {
    throw new WebApplicationException(Response.Status.FORBIDDEN);
  }
  IdentityEntity identityInfo=EntityBuilder.buildEntityIdentity(identity,uriInfo.getPath(),expand);
  return EntityBuilder.getResponse(identityInfo,uriInfo,RestUtils.getJsonMediaType(),Response.Status.OK);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@POST @RolesAllowed("String_Node_Str") @ApiOperation(value="String_Node_Str",httpMethod="String_Node_Str",response=Response.class,notes="String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str"),@ApiResponse(code=500,message="String_Node_Str"),@ApiResponse(code=400,message="String_Node_Str")}) public Response createIdentities(@Context UriInfo uriInfo,@ApiParam(value="String_Node_Str",required=true) @QueryParam("String_Node_Str") String remoteId,@ApiParam(value="String_Node_Str",required=true) @QueryParam("String_Node_Str") String providerId,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String expand) throws Exception {
  if (!RestUtils.isMemberOfAdminGroup()) {
    throw new WebApplicationException(Response.Status.UNAUTHORIZED);
  }
  if ((!providerId.equals(SpaceIdentityProvider.NAME) && !providerId.equals(OrganizationIdentityProvider.NAME))) {
    throw new WebApplicationException(Response.Status.BAD_REQUEST);
  }
  IdentityManager identityManager=CommonsUtils.getService(IdentityManager.class);
  Identity identity=identityManager.getOrCreateIdentity(providerId,remoteId,true);
  if (identity == null) {
    identity=new Identity(providerId,remoteId);
    identityManager.saveIdentity(identity);
  }
 else   if (identity.isDeleted()) {
    throw new WebApplicationException(Response.Status.FORBIDDEN);
  }
  IdentityEntity identityInfo=EntityBuilder.buildEntityIdentity(identity,uriInfo.getPath(),expand);
  return EntityBuilder.getResponse(identityInfo,uriInfo,RestUtils.getJsonMediaType(),Response.Status.OK);
}
Program: 102448
Project: 102448
Buggy source:
@DELETE @Path("String_Node_Str") @RolesAllowed("String_Node_Str") @ApiOperation(value="String_Node_Str",httpMethod="String_Node_Str",response=Response.class,notes="String_Node_Str") public Response deleteUserById(@Context UriInfo uriInfo,@ApiParam(value="String_Node_Str",required=true) @PathParam("String_Node_Str") String id,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String expand) throws Exception {
  if (!RestUtils.isMemberOfAdminGroup()) {
    throw new WebApplicationException(Response.Status.FORBIDDEN);
  }
  IdentityManager identityManager=CommonsUtils.getService(IdentityManager.class);
  Identity identity=identityManager.getOrCreateIdentity(OrganizationIdentityProvider.NAME,id,true);
  if (identity == null) {
    throw new WebApplicationException(Response.Status.BAD_REQUEST);
  }
  identityManager.hardDeleteIdentity(identity);
  identity.setDeleted(true);
  return EntityBuilder.getResponse(EntityBuilder.buildEntityProfile(identity.getProfile(),uriInfo.getPath(),expand),uriInfo,RestUtils.getJsonMediaType(),Response.Status.OK);
}

Fixed version (ground truth):
@DELETE @Path("String_Node_Str") @RolesAllowed("String_Node_Str") @ApiOperation(value="String_Node_Str",httpMethod="String_Node_Str",response=Response.class,notes="String_Node_Str") public Response deleteUserById(@Context UriInfo uriInfo,@ApiParam(value="String_Node_Str",required=true) @PathParam("String_Node_Str") String id,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String expand) throws Exception {
  if (!RestUtils.isMemberOfAdminGroup()) {
    throw new WebApplicationException(Response.Status.FORBIDDEN);
  }
  IdentityManager identityManager=CommonsUtils.getService(IdentityManager.class);
  Identity identity=identityManager.getOrCreateIdentity(OrganizationIdentityProvider.NAME,id,true);
  if (identity == null) {
    throw new WebApplicationException(Response.Status.BAD_REQUEST);
  }
  identityManager.hardDeleteIdentity(identity);
  identity.setDeleted(true);
  UserHandler userHandler=CommonsUtils.getService(OrganizationService.class).getUserHandler();
  userHandler.removeUser(id,false);
  return EntityBuilder.getResponse(EntityBuilder.buildEntityProfile(identity.getProfile(),uriInfo.getPath(),expand),uriInfo,RestUtils.getJsonMediaType(),Response.Status.OK);
}
Program: 102452
Project: 102452
Buggy source:
protected void initProfilePopup() throws Exception {
  JSONObject object=new JSONObject();
  WebuiRequestContext context=WebuiRequestContext.getCurrentInstance();
  object.put("String_Node_Str",UserProfileHelper.getLabel(context,"String_Node_Str"));
  String[] keys=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < keys.length; i++) {
    object.put(keys[i],UserProfileHelper.getLabel(context,"String_Node_Str" + keys[i]));
  }
  context.getJavascriptManager().getRequireJS().require("String_Node_Str","String_Node_Str").addScripts("String_Node_Str" + getId() + "String_Node_Str"+ object.toString()+ "String_Node_Str");
}

Fixed version (ground truth):
protected void initProfilePopup() throws Exception {
  JSONObject object=new JSONObject();
  WebuiRequestContext context=WebuiRequestContext.getCurrentInstance();
  object.put("String_Node_Str",UserProfileHelper.getLabel(context,"String_Node_Str"));
  String[] keys=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < keys.length; i++) {
    object.put(keys[i],UserProfileHelper.getLabel(context,"String_Node_Str" + keys[i]));
  }
  context.getJavascriptManager().getRequireJS().require("String_Node_Str","String_Node_Str" + getId()).addScripts("String_Node_Str" + getId() + "String_Node_Str"+ getId()+ "String_Node_Str"+ object.toString()+ "String_Node_Str");
}
Program: 102454
Project: 102454
Buggy source:
private List<ActionData> createExperienceActions(String experienId,boolean hasAdd){
  List<ActionData> actions=new ArrayList<UIInputSection.ActionData>();
  if (experiens.size() > 1) {
    ActionData removeAction=new ActionData();
    removeAction.setAction("String_Node_Str").setIcon("String_Node_Str").setTooltip("String_Node_Str").setObjectId(experienId);
    actions.add(removeAction);
  }
  if (hasAdd) {
    ActionData addAction=new ActionData();
    addAction.setAction("String_Node_Str").setIcon("String_Node_Str").setTooltip("String_Node_Str").setObjectId(experienId);
    actions.add(addAction);
  }
  return actions;
}

Fixed version (ground truth):
private List<ActionData> createExperienceActions(String experienId,boolean hasAdd){
  List<ActionData> actions=new ArrayList<UIInputSection.ActionData>();
  ActionData removeAction=new ActionData();
  removeAction.setAction("String_Node_Str").setIcon("String_Node_Str").setTooltip(UserProfileHelper.getLabel(null,"String_Node_Str")).setObjectId(experienId);
  actions.add(removeAction);
  if (hasAdd) {
    ActionData addAction=new ActionData();
    addAction.setAction("String_Node_Str").setIcon("String_Node_Str").setTooltip(UserProfileHelper.getLabel(null,"String_Node_Str")).setObjectId(experienId);
    actions.add(addAction);
  }
  return actions;
}
Program: 102457
Project: 102457
Buggy source:
@Override public void execute(Event<UIEditUserProfileForm> event) throws Exception {
  UIEditUserProfileForm editUserProfile=event.getSource();
  String objectId=event.getRequestContext().getRequestParameter(OBJECTID);
  editUserProfile.removeChildById(objectId);
  editUserProfile.experiens.remove(objectId);
  editUserProfile.getExperienceSections().get(0).setTitle("String_Node_Str");
  editUserProfile.resetActionFileds();
  event.getRequestContext().addUIComponentToUpdateByAjax(editUserProfile);
}

Fixed version (ground truth):
@Override public void execute(Event<UIEditUserProfileForm> event) throws Exception {
  UIEditUserProfileForm editUserProfile=event.getSource();
  String objectId=event.getRequestContext().getRequestParameter(OBJECTID);
  editUserProfile.removeChildById(objectId);
  editUserProfile.experiens.remove(objectId);
  List<UIInputSection> experienceSections=editUserProfile.getExperienceSections();
  if (experienceSections.size() > 0) {
    experienceSections.get(0).setTitle("String_Node_Str");
  }
 else {
    editUserProfile.addEmpryExperienceSection();
  }
  editUserProfile.resetActionFileds();
  event.getRequestContext().addUIComponentToUpdateByAjax(editUserProfile);
}
Program: 102458
Project: 102458
Buggy source:
/** 
 */
private void resetActionFileds(){
  List<UIInputSection> experienceSections=getExperienceSections();
  int i=0;
  for (  UIInputSection uiInputSection : experienceSections) {
    boolean hasAdd=(i == experienceSections.size() - 1);
    String experienId=uiInputSection.getName();
    uiInputSection.setActionField(Profile.EXPERIENCES_COMPANY + experienId,createExperienceActions(uiInputSection.getName(),hasAdd));
    ++i;
  }
}

Fixed version (ground truth):
/** 
 * Reset actions on experience
 */
private void resetActionFileds(){
  List<UIInputSection> experienceSections=getExperienceSections();
  int i=1;
  int experienceSize=experienceSections.size();
  for (  UIInputSection uiInputSection : experienceSections) {
    boolean hasAdd=(i == experienceSize);
    String experienId=uiInputSection.getName();
    uiInputSection.setActionField(Profile.EXPERIENCES_COMPANY + experienId,createExperienceActions(uiInputSection.getName(),hasAdd));
    ++i;
  }
}
Program: 102459
Project: 102459
Buggy source:
/** 
 * @throws Exception
 */
private void initPlaceholder() throws Exception {
  getUIInputSection(FIELD_ABOUT_SECTION).getUIFormTextAreaInput(Profile.ABOUT_ME).setHTMLAttribute(PLACEHOLDER_KEY,"String_Node_Str");
  UIInputSection baseSection=getUIInputSection(FIELD_BASE_SECTION);
  UIFormMultiValueInputSet urlMulti=baseSection.getChildById(Profile.CONTACT_URLS);
  List<UIComponent> children=urlMulti.getChildren();
  for (  UIComponent uiComponent : children) {
    if (uiComponent instanceof UIFormInputBase) {
      ((UIFormInputBase<?>)uiComponent).setHTMLAttribute(PLACEHOLDER_KEY,"String_Node_Str");
    }
  }
  List<UIInputSection> experienceSections=getExperienceSections();
  for (  UIInputSection uiInputSection : experienceSections) {
    List<UIFormDateTimeInput> dateInputs=new ArrayList<UIFormDateTimeInput>();
    uiInputSection.findComponentOfType(dateInputs,UIFormDateTimeInput.class);
    for (    UIFormDateTimeInput uiFormDateTimeInput : dateInputs) {
      uiFormDateTimeInput.setHTMLAttribute(PLACEHOLDER_KEY,DATE_FORMAT_MMDDYYYY);
    }
  }
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
private void initPlaceholder() throws Exception {
  getUIInputSection(FIELD_ABOUT_SECTION).getUIFormTextAreaInput(Profile.ABOUT_ME).setHTMLAttribute(PLACEHOLDER_KEY,"String_Node_Str");
  UIInputSection baseSection=getUIInputSection(FIELD_BASE_SECTION);
  UIFormMultiValueInputSet urlMulti=baseSection.getChildById(Profile.CONTACT_URLS);
  List<UIComponent> children=urlMulti.getChildren();
  for (  UIComponent uiComponent : children) {
    if (uiComponent instanceof UIFormInputBase) {
      ((UIFormInputBase<?>)uiComponent).setHTMLAttribute(PLACEHOLDER_KEY,getLabel("String_Node_Str"));
    }
  }
  List<UIInputSection> experienceSections=getExperienceSections();
  for (  UIInputSection uiInputSection : experienceSections) {
    List<UIFormDateTimeInput> dateInputs=new ArrayList<UIFormDateTimeInput>();
    uiInputSection.findComponentOfType(dateInputs,UIFormDateTimeInput.class);
    for (    UIFormDateTimeInput uiFormDateTimeInput : dateInputs) {
      uiFormDateTimeInput.setHTMLAttribute(PLACEHOLDER_KEY,DATE_FORMAT_MMDDYYYY);
    }
  }
}
Program: 102460
Project: 102460
Buggy source:
private void addInput(int indexId,String selected,String value){
  int index=indexId;
  if (indexs.contains(Integer.valueOf(indexId))) {
    index=indexs.indexOf(indexId) + 1;
    indexId=index * 10;
  }
  ((LinkedList<Integer>)indexs).add(index,indexId);
  addUIFormInput(new UIFormSelectBox(getSelectId(indexId),getSelectId(indexId),getOptions()).setValue(selected));
  UIFormStringInput stringInput=new UIFormStringInput(getInputId(indexId),getInputId(indexId),value);
  stringInput.setHTMLAttribute("String_Node_Str","String_Node_Str");
  addUIFormInput(stringInput);
}

Fixed version (ground truth):
private void addInput(int indexId,String selected,String value) throws Exception {
  int index=indexId;
  if (indexs.contains(Integer.valueOf(indexId))) {
    index=indexs.indexOf(indexId) + 1;
    indexId=index * 10;
  }
  ((LinkedList<Integer>)indexs).add(index,indexId);
  addUIFormInput(new UIFormSelectBox(getSelectId(indexId),getSelectId(indexId),getOptions()).setValue(selected));
  UIFormStringInput stringInput=new UIFormStringInput(getInputId(indexId),getInputId(indexId),value);
  stringInput.setHTMLAttribute("String_Node_Str","String_Node_Str");
  if (validators != null && !validators.isEmpty()) {
    stringInput.addValidator(SpecialCharacterValidator.class);
    List<Validator> validators_=stringInput.getValidators();
    validators_.clear();
    validators_.addAll(validators);
  }
  addUIFormInput(stringInput);
}
Program: 102461
Project: 102461
Buggy source:
protected List<String> getNotifications() throws Exception {
  WebNotificationFilter filter=new WebNotificationFilter(currentUser);
  List<String> notificationContents=webNotifService.get(filter,offset * currentPage,ITEMS_LOADED_NUM);
  if (notificationContents.size() > ITEMS_PER_PAGE) {
    notificationContents=notificationContents.subList(0,ITEMS_PER_PAGE);
    hasMore=true;
  }
  return notificationContents;
}

Fixed version (ground truth):
protected List<String> getNotifications() throws Exception {
  WebNotificationFilter filter=new WebNotificationFilter(currentUser);
  if (hasMore) {
    offset=ITEMS_PER_PAGE;
  }
 else {
    offset=0;
    currentPage=0;
  }
  List<String> notificationContents=webNotifService.get(filter,offset * currentPage,ITEMS_LOADED_NUM);
  if (notificationContents.size() > ITEMS_PER_PAGE) {
    hasMore=true;
    return notificationContents.subList(0,ITEMS_PER_PAGE);
  }
 else {
    hasMore=false;
  }
  return notificationContents;
}
Program: 102462
Project: 102462
Buggy source:
@Override public void processRender(WebuiApplication app,WebuiRequestContext context) throws Exception {
  this.currentUser=context.getRemoteUser();
  this.currentPage=1;
  super.processRender(app,context);
}

Fixed version (ground truth):
@Override public void processRender(WebuiApplication app,WebuiRequestContext context) throws Exception {
  this.currentUser=context.getRemoteUser();
  super.processRender(app,context);
}
Program: 102464
Project: 102464
Buggy source:
private String getChannelContainer(UserSetting setting,String pluginId){
  List<String> channels=getChannels();
  Map<String,Object> parameters=new HashMap<String,Object>();
  Context context=new Context(bundle);
  parameters.put("String_Node_Str",context);
  Map<String,String> options=buildOptions(context);
  Map<String,Boolean> channelStatus=new HashMap<String,Boolean>();
  Map<String,CheckBoxInput> channelCheckBoxList=new HashMap<String,CheckBoxInput>();
  parameters.put("String_Node_Str",null);
  for (  String channelId : channels) {
    boolean isChannelActive=setting.isChannelActive(channelId);
    channelStatus.put(channelId,isChannelActive);
    channelCheckBoxList.put(channelId,new CheckBoxInput(channelId,pluginId,setting.isActive(channelId,pluginId),isChannelActive));
    if (UserSetting.EMAIL_CHANNEL.equals(channelId)) {
      parameters.put("String_Node_Str",new SelectBoxInput(channelId + pluginId,options,getValue(setting,pluginId),isChannelActive));
    }
  }
  parameters.put("String_Node_Str",channels);
  parameters.put("String_Node_Str",channelCheckBoxList);
  parameters.put("String_Node_Str",channelStatus);
  parameters.put("String_Node_Str",UserSetting.EMAIL_CHANNEL);
  parameters.put("String_Node_Str",pluginId);
  StringBuilder buffer=new StringBuilder();
  channelContainer.renderTo(new AppendableStream(Tools.UTF_8,buffer),parameters);
  return buffer.toString();
}

Fixed version (ground truth):
private String getChannelContainer(UserSetting setting,String pluginId){
  List<String> channels=getChannels();
  Map<String,Object> parameters=new HashMap<String,Object>();
  Context context=new Context(bundle);
  parameters.put("String_Node_Str",context);
  Map<String,String> options=buildOptions(context);
  Map<String,Boolean> channelStatus=new HashMap<String,Boolean>();
  Map<String,CheckBoxInput> channelCheckBoxList=new HashMap<String,CheckBoxInput>();
  parameters.put("String_Node_Str",null);
  for (  String channelId : channels) {
    if (pluginSettingService.isActive(channelId,pluginId)) {
      boolean isChannelActive=setting.isChannelActive(channelId);
      channelStatus.put(channelId,isChannelActive);
      channelCheckBoxList.put(channelId,new CheckBoxInput(channelId,pluginId,setting.isActive(channelId,pluginId),isChannelActive));
      if (UserSetting.EMAIL_CHANNEL.equals(channelId)) {
        parameters.put("String_Node_Str",new SelectBoxInput(channelId + pluginId,options,getValue(setting,pluginId),isChannelActive));
      }
    }
  }
  parameters.put("String_Node_Str",channels);
  parameters.put("String_Node_Str",channelCheckBoxList);
  parameters.put("String_Node_Str",channelStatus);
  parameters.put("String_Node_Str",UserSetting.EMAIL_CHANNEL);
  parameters.put("String_Node_Str",pluginId);
  StringBuilder buffer=new StringBuilder();
  channelContainer.renderTo(new AppendableStream(Tools.UTF_8,buffer),parameters);
  return buffer.toString();
}
Program: 102466
Project: 102466
Buggy source:
@Override public MessageInfo makeMessage(NotificationContext ctx){
  MessageInfo messageInfo=new MessageInfo();
  NotificationInfo notification=ctx.getNotificationInfo();
  String language=getLanguage(notification);
  String activityId=notification.getValueOwnerParameter(SocialNotificationUtils.ACTIVITY_ID.getKey());
  ExoSocialActivity activity=Utils.getActivityManager().getActivity(activityId);
  ExoSocialActivity parentActivity=Utils.getActivityManager().getParentActivity(activity);
  Identity identity=Utils.getIdentityManager().getIdentity(activity.getPosterId(),true);
  TemplateContext templateContext=new TemplateContext(notification.getKey().getId(),language);
  templateContext.put("String_Node_Str",identity.getProfile().getFullName());
  String subject=TemplateUtils.processSubject(templateContext);
  SocialNotificationUtils.addFooterAndFirstName(notification.getTo(),templateContext);
  templateContext.put("String_Node_Str",LinkProviderUtils.getRedirectUrl("String_Node_Str",identity.getRemoteId()));
  templateContext.put("String_Node_Str",activity.getTitle());
  templateContext.put("String_Node_Str",LinkProviderUtils.getRedirectUrl("String_Node_Str",parentActivity.getId() + "String_Node_Str" + activity.getId()));
  templateContext.put("String_Node_Str",LinkProviderUtils.getRedirectUrl("String_Node_Str",parentActivity.getId() + "String_Node_Str" + activity.getId()));
  String body=SocialNotificationUtils.getBody(ctx,templateContext,parentActivity);
  return messageInfo.subject(subject).body(body).end();
}

Fixed version (ground truth):
@Override public MessageInfo makeMessage(NotificationContext ctx){
  MessageInfo messageInfo=new MessageInfo();
  NotificationInfo notification=ctx.getNotificationInfo();
  String language=getLanguage(notification);
  String activityId=notification.getValueOwnerParameter(SocialNotificationUtils.ACTIVITY_ID.getKey());
  ExoSocialActivity activity=Utils.getActivityManager().getActivity(activityId);
  ExoSocialActivity parentActivity=Utils.getActivityManager().getParentActivity(activity);
  Identity identity=Utils.getIdentityManager().getIdentity(activity.getPosterId(),true);
  TemplateContext templateContext=new TemplateContext(notification.getKey().getId(),language);
  templateContext.put("String_Node_Str",identity.getProfile().getFullName());
  String subject=TemplateUtils.processSubject(templateContext);
  SocialNotificationUtils.addFooterAndFirstName(notification.getTo(),templateContext);
  templateContext.put("String_Node_Str",LinkProviderUtils.getRedirectUrl("String_Node_Str",identity.getRemoteId()));
  templateContext.put("String_Node_Str",NotificationUtils.processLinkTitle(activity.getTitle()));
  templateContext.put("String_Node_Str",LinkProviderUtils.getRedirectUrl("String_Node_Str",parentActivity.getId() + "String_Node_Str" + activity.getId()));
  templateContext.put("String_Node_Str",LinkProviderUtils.getRedirectUrl("String_Node_Str",parentActivity.getId() + "String_Node_Str" + activity.getId()));
  String body=SocialNotificationUtils.getBody(ctx,templateContext,parentActivity);
  return messageInfo.subject(subject).body(body).end();
}
Program: 102468
Project: 102468
Buggy source:
@Override public String makeContent(NotificationContext ctx){
  NotificationInfo notification=ctx.getNotificationInfo();
  String language=getLanguage(notification);
  TemplateContext templateContext=new TemplateContext(ID,language);
  String activityId=notification.getValueOwnerParameter(SocialNotificationUtils.ACTIVITY_ID.getKey());
  ExoSocialActivity activity=Utils.getActivityManager().getActivity(activityId);
  templateContext.put("String_Node_Str",activity.getTitle());
  String content=TemplateUtils.processGroovy(templateContext);
  return content;
}

Fixed version (ground truth):
@Override public String makeContent(NotificationContext ctx){
  NotificationInfo notification=ctx.getNotificationInfo();
  String language=getLanguage(notification);
  TemplateContext templateContext=new TemplateContext(ID,language);
  String activityId=notification.getValueOwnerParameter(SocialNotificationUtils.ACTIVITY_ID.getKey());
  ExoSocialActivity activity=Utils.getActivityManager().getActivity(activityId);
  if (activity.isComment()) {
    activity=Utils.getActivityManager().getParentActivity(activity);
  }
  templateContext.put("String_Node_Str",NotificationUtils.processLinkTitle(activity.getTitle()));
  String content=TemplateUtils.processGroovy(templateContext);
  return content;
}
Program: 102469
Project: 102469
Buggy source:
@Override public String makeContent(NotificationContext ctx){
  try {
    ActivityManager activityM=CommonsUtils.getService(ActivityManager.class);
    NotificationInfo notification=ctx.getNotificationInfo();
    String language=getLanguage(notification);
    String activityId=notification.getValueOwnerParameter(ACTIVITY_ID.getKey());
    activity=activityM.getActivity(activityId);
    if (activity.isComment()) {
      activity=activityM.getParentActivity(activity);
    }
    TemplateContext templateContext=new TemplateContext(ID,language);
    String url=activity.getTemplateParams().get(LINK_PARAM);
    templateContext.put("String_Node_Str",activity.getTemplateParams().get(COMMENT_PARAM));
    templateContext.put("String_Node_Str",activity.getTemplateParams().get(TITLE_PARAM));
    templateContext.put("String_Node_Str",url);
    templateContext.put("String_Node_Str",getImageUrl(url));
    templateContext.put("String_Node_Str",isEmbedLink());
    templateContext.put("String_Node_Str",Utils.formatContent(activity.getTemplateParams().get(DESCRIPTION_PARAM)));
    templateContext.put("String_Node_Str",LinkProviderUtils.getRedirectUrl(VIEW_FULL_ACTIVITY,activity.getId()));
    String content=TemplateUtils.processGroovy(templateContext);
    return content;
  }
 catch (  Exception e) {
    return (activity != null) ? activity.getTitle() : "String_Node_Str";
  }
}

Fixed version (ground truth):
@Override public String makeContent(NotificationContext ctx){
  try {
    ActivityManager activityM=CommonsUtils.getService(ActivityManager.class);
    NotificationInfo notification=ctx.getNotificationInfo();
    String language=getLanguage(notification);
    String activityId=notification.getValueOwnerParameter(ACTIVITY_ID.getKey());
    activity=activityM.getActivity(activityId);
    if (activity.isComment()) {
      activity=activityM.getParentActivity(activity);
    }
    TemplateContext templateContext=new TemplateContext(ID,language);
    String url=activity.getTemplateParams().get(LINK_PARAM);
    templateContext.put("String_Node_Str",NotificationUtils.processLinkTitle(activity.getTemplateParams().get(COMMENT_PARAM)));
    templateContext.put("String_Node_Str",NotificationUtils.processLinkTitle(activity.getTemplateParams().get(TITLE_PARAM)));
    templateContext.put("String_Node_Str",url);
    templateContext.put("String_Node_Str",getImageUrl(url));
    templateContext.put("String_Node_Str",isEmbedLink());
    templateContext.put("String_Node_Str",Utils.formatContent(activity.getTemplateParams().get(DESCRIPTION_PARAM)));
    templateContext.put("String_Node_Str",LinkProviderUtils.getRedirectUrl(VIEW_FULL_ACTIVITY,activity.getId()));
    String content=TemplateUtils.processGroovy(templateContext);
    return content;
  }
 catch (  Exception e) {
    return (activity != null) ? activity.getTitle() : "String_Node_Str";
  }
}
Program: 102470
Project: 102470
Buggy source:
private boolean severIsStarting(JobDataMap dataMap){
  rampup=(Integer)dataMap.get("String_Node_Str");
  if (rampup == null) {
    rampup=2;
  }
  if (rampup > 1) {
    dataMap.put("String_Node_Str",--rampup);
    LOG.debug("String_Node_Str" + rampup);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean severIsStarting(JobDataMap dataMap){
  if (rampup > 1) {
    --rampup;
    LOG.debug("String_Node_Str" + rampup);
    return true;
  }
  return false;
}
Program: 102471
Project: 102471
Buggy source:
public Object invokeNext() throws InvocationException {
  try {
    filterChain.doFilter(request,response);
  }
 catch (  Throwable t) {
    throw new InvocationException(t.getCause());
  }
  return null;
}

Fixed version (ground truth):
public Object invokeNext() throws InvocationException {
  try {
    filterChain.doFilter(request,response);
  }
 catch (  Exception e) {
    throw new InvocationException(e.getCause());
  }
  return null;
}
Program: 102473
Project: 102473
Buggy source:
/** 
 * Updates profile in Position section
 * @throws Exception
 */
private void updatePosition() throws Exception {
  String position=(String)updatedProfile.getProperty(Profile.POSITION);
  UserProfile foundUserProfile=organizationService.getUserProfileHandler().findUserProfileByName(userName);
  if (foundUserProfile == null) {
    return;
  }
  String uPosition=foundUserProfile.getAttribute(UserProfile.PERSONAL_INFO_KEYS[7]);
  if (position != null && uPosition != position) {
    foundUserProfile.setAttribute(UserProfile.PERSONAL_INFO_KEYS[7],position);
    organizationService.getUserProfileHandler().saveUserProfile(foundUserProfile,false);
  }
}

Fixed version (ground truth):
/** 
 * Updates profile in Position section
 * @throws Exception
 */
private void updatePosition() throws Exception {
  String position=(String)updatedProfile.getProperty(Profile.POSITION);
  UserProfile foundUserProfile=organizationService.getUserProfileHandler().findUserProfileByName(userName);
  if (foundUserProfile == null) {
    return;
  }
  String uPosition=foundUserProfile.getAttribute(UserProfile.PERSONAL_INFO_KEYS[7]);
  if (position != null && !position.equals(uPosition)) {
    foundUserProfile.setAttribute(UserProfile.PERSONAL_INFO_KEYS[7],position);
    organizationService.getUserProfileHandler().saveUserProfile(foundUserProfile,false);
  }
}
Program: 102474
Project: 102474
Buggy source:
/** 
 * Updates profile in Contact section
 * @throws Exception
 */
private void updateContact() throws Exception {
  String gender=(String)updatedProfile.getProperty(Profile.GENDER);
  UserProfile foundUserProfile=organizationService.getUserProfileHandler().findUserProfileByName(userName);
  if (foundUserProfile == null) {
    return;
  }
  String uGender=foundUserProfile.getAttribute(UserProfile.PERSONAL_INFO_KEYS[4]);
  if (gender != null && uGender != gender) {
    foundUserProfile.setAttribute(UserProfile.PERSONAL_INFO_KEYS[4],gender);
    organizationService.getUserProfileHandler().saveUserProfile(foundUserProfile,false);
  }
}

Fixed version (ground truth):
/** 
 * Updates profile in Contact section
 * @throws Exception
 */
private void updateContact() throws Exception {
  String gender=(String)updatedProfile.getProperty(Profile.GENDER);
  UserProfile foundUserProfile=organizationService.getUserProfileHandler().findUserProfileByName(userName);
  if (foundUserProfile == null) {
    return;
  }
  String uGender=foundUserProfile.getAttribute(UserProfile.PERSONAL_INFO_KEYS[4]);
  if (gender != null && !gender.equals(uGender)) {
    foundUserProfile.setAttribute(UserProfile.PERSONAL_INFO_KEYS[4],gender);
    organizationService.getUserProfileHandler().saveUserProfile(foundUserProfile,false);
  }
}
Program: 102475
Project: 102475
Buggy source:
@Override public void preDelete(final User user) throws Exception {
  RequestLifeCycle.begin(PortalContainer.getInstance());
  ExoContainer container=ExoContainerContext.getCurrentContainer();
  IdentityManager idm=(IdentityManager)container.getComponentInstanceOfType(IdentityManager.class);
  Identity identity=idm.getOrCreateIdentity(OrganizationIdentityProvider.NAME,user.getUserName(),true);
  try {
    idm.hardDeleteIdentity(identity);
  }
 catch (  Exception e) {
  }
  StorageUtils.clearUsersPlatformGroup();
  RequestLifeCycle.end();
}

Fixed version (ground truth):
@Override public void preDelete(final User user) throws Exception {
  RequestLifeCycle.begin(PortalContainer.getInstance());
  ExoContainer container=ExoContainerContext.getCurrentContainer();
  IdentityManager idm=(IdentityManager)container.getComponentInstanceOfType(IdentityManager.class);
  Identity identity=idm.getOrCreateIdentity(OrganizationIdentityProvider.NAME,user.getUserName(),true);
  try {
    idm.hardDeleteIdentity(identity);
  }
 catch (  Exception e) {
    LOG.debug("String_Node_Str");
  }
  StorageUtils.clearUsersPlatformGroup();
  RequestLifeCycle.end();
}
Program: 102476
Project: 102476
Buggy source:
/** 
 * Gets the type.
 * @param fieldName the field name
 * @param propertyName the property name
 * @return the type
 */
public String getType(String fieldName,String propertyName){
  if (this.storage == null) {
    ExoContainer container=ExoContainerContext.getCurrentContainer();
    IdentityManager im=(IdentityManager)container.getComponentInstanceOfType(IdentityManager.class);
    this.storage=im.getIdentityStorage();
  }
  try {
    String type=storage.getType(fieldName,propertyName);
    if (type != null)     return type;
  }
 catch (  Exception e) {
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Gets the type.
 * @param fieldName the field name
 * @param propertyName the property name
 * @return the type
 */
public String getType(String fieldName,String propertyName){
  if (this.storage == null) {
    ExoContainer container=ExoContainerContext.getCurrentContainer();
    IdentityManager im=(IdentityManager)container.getComponentInstanceOfType(IdentityManager.class);
    this.storage=im.getIdentityStorage();
  }
  try {
    String type=storage.getType(fieldName,propertyName);
    if (type != null)     return type;
  }
 catch (  Exception e) {
    LOG.debug("String_Node_Str");
  }
  return "String_Node_Str";
}