nus-yam/ex-repair huggingface dataset:
Program: 89185
Project: 89185
Buggy source:
/** 
 * Adds a new capability to the specified roles.
 * @param filePlan          file plan
 * @param capabilityName    capability name
 * @param roles             roles
 */
protected void addCapability(NodeRef filePlan,String capabilityName,String... roles){
  Capability capability=capabilityService.getCapability(capabilityName);
  if (capability == null) {
    throw new AlfrescoRuntimeException("String_Node_Str" + capabilityName + "String_Node_Str");
  }
  for (  String roleName : roles) {
    Role role=filePlanRoleService.getRole(filePlan,roleName);
    if (role != null) {
      Set<Capability> capabilities=role.getCapabilities();
      if (!capabilities.contains(capability)) {
        if (logger.isDebugEnabled()) {
          logger.debug("String_Node_Str" + capabilityName + "String_Node_Str"+ role.getName());
        }
        capabilities.add(capability);
        filePlanRoleService.updateRole(filePlan,role.getName(),role.getDisplayLabel(),capabilities);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds a new capability to the specified roles.
 * @param filePlan          file plan
 * @param capabilityName    capability name
 * @param roles             roles
 */
protected void addCapability(NodeRef filePlan,String capabilityName,String... roles){
  Capability capability=capabilityService.getCapability(capabilityName);
  if (capability == null) {
    throw new AlfrescoRuntimeException("String_Node_Str" + capabilityName + "String_Node_Str");
  }
  for (  String roleName : roles) {
    Role role=filePlanRoleService.getRole(filePlan,roleName);
    if (role != null) {
      Set<Capability> capabilities=role.getCapabilities();
      if (!capabilities.contains(capability)) {
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("String_Node_Str" + capabilityName + "String_Node_Str"+ role.getName());
        }
        capabilities.add(capability);
        filePlanRoleService.updateRole(filePlan,role.getName(),role.getDisplayLabel(),capabilities);
      }
    }
  }
}
Program: 89186
Project: 89186
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.patch.AbstractModulePatch#applyInternal()
 */
@Override public void applyInternal(){
  Long maxNodeId=patchDAO.getMaxAdmNodeID();
  for (  QName qname : qnames) {
    QName origional=QName.createQName(RecordsManagementModel.RM_URI,qname.getLocalName());
    if (qnameDAO.getQName(origional) != null) {
      qnameDAO.updateQName(origional,qname);
    }
  }
  long recordCount=patchDAO.getCountNodesWithAspects(Collections.singleton(ASPECT_RECORD));
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + recordCount + "String_Node_Str");
  }
  int completed=0;
  Pair<Long,QName> recordAspect=qnameDAO.getQName(ASPECT_RECORD);
  if (recordAspect != null) {
    for (Long i=0L; i < maxNodeId; i+=BATCH_SIZE) {
      List<Long> nodeIds=patchDAO.getNodesByAspectQNameId(recordAspect.getFirst(),i,i + BATCH_SIZE);
      for (      Long nodeId : nodeIds) {
        nodeDAO.addNodeAspects(nodeId,Collections.singleton(DOD5015Model.ASPECT_DOD_5015_RECORD));
      }
      completed+=completed + nodeIds.size();
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str" + completed + "String_Node_Str"+ recordCount);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.patch.AbstractModulePatch#applyInternal()
 */
@Override public void applyInternal(){
  Long maxNodeId=patchDAO.getMaxAdmNodeID();
  for (  QName qname : qnames) {
    QName origional=QName.createQName(RecordsManagementModel.RM_URI,qname.getLocalName());
    if (qnameDAO.getQName(origional) != null) {
      qnameDAO.updateQName(origional,qname);
    }
  }
  long recordCount=patchDAO.getCountNodesWithAspects(Collections.singleton(ASPECT_RECORD));
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + recordCount + "String_Node_Str");
  }
  int completed=0;
  Pair<Long,QName> recordAspect=qnameDAO.getQName(ASPECT_RECORD);
  if (recordAspect != null) {
    for (Long i=0L; i < maxNodeId; i+=BATCH_SIZE) {
      List<Long> nodeIds=patchDAO.getNodesByAspectQNameId(recordAspect.getFirst(),i,i + BATCH_SIZE);
      for (      Long nodeId : nodeIds) {
        nodeDAO.addNodeAspects(nodeId,Collections.singleton(DOD5015Model.ASPECT_DOD_5015_RECORD));
      }
      completed+=completed + nodeIds.size();
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("String_Node_Str" + completed + "String_Node_Str"+ recordCount);
      }
    }
  }
}
Program: 89187
Project: 89187
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService#setPermission(org.alfresco.service.cmr.repository.NodeRef,java.lang.String,java.lang.String,boolean)
 */
public void setPermission(final NodeRef nodeRef,final String authority,final String permission){
  ParameterCheck.mandatory("String_Node_Str",nodeRef);
  ParameterCheck.mandatory("String_Node_Str",authority);
  ParameterCheck.mandatory("String_Node_Str",permission);
  runAsSystem(new AuthenticationUtil.RunAsWork<Object>(){
    public Void doWork(){
      if (isFilePlan(nodeRef)) {
        setPermissionDown(nodeRef,authority,permission);
      }
 else       if (isFilePlanContainer(nodeRef) || isRecordFolder(nodeRef) || isRecord(nodeRef)|| isHold(nodeRef)) {
        setReadPermissionUp(nodeRef,authority);
        setPermissionDown(nodeRef,authority,permission);
      }
 else {
        if (logger.isWarnEnabled()) {
          logger.warn("String_Node_Str" + nodeRef + "String_Node_Str"+ authority+ "String_Node_Str"+ permission+ "String_Node_Str");
        }
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService#setPermission(org.alfresco.service.cmr.repository.NodeRef,java.lang.String,java.lang.String,boolean)
 */
public void setPermission(final NodeRef nodeRef,final String authority,final String permission){
  ParameterCheck.mandatory("String_Node_Str",nodeRef);
  ParameterCheck.mandatory("String_Node_Str",authority);
  ParameterCheck.mandatory("String_Node_Str",permission);
  runAsSystem(new AuthenticationUtil.RunAsWork<Object>(){
    public Void doWork(){
      if (isFilePlan(nodeRef)) {
        setPermissionDown(nodeRef,authority,permission);
      }
 else       if (isFilePlanContainer(nodeRef) || isRecordFolder(nodeRef) || isRecord(nodeRef)|| isHold(nodeRef)) {
        setReadPermissionUp(nodeRef,authority);
        setPermissionDown(nodeRef,authority,permission);
      }
 else {
        if (LOGGER.isWarnEnabled()) {
          LOGGER.warn("String_Node_Str" + nodeRef + "String_Node_Str"+ authority+ "String_Node_Str"+ permission+ "String_Node_Str");
        }
      }
      return null;
    }
  }
);
}
Program: 89188
Project: 89188
Buggy source:
/** 
 * Indicates whether this is a RM security check or not
 * @param newValue  true if RM security check, false otherwise
 */
public static void isRMSecurityChecked(boolean newValue){
  if (logger.isDebugEnabled()) {
    RMMethodSecurityInterceptor.IS_RM_SECURITY_CHECK.set(newValue);
  }
}

Fixed version (ground truth):
/** 
 * Indicates whether this is a RM security check or not
 * @param newValue  true if RM security check, false otherwise
 */
public static void isRMSecurityChecked(boolean newValue){
  if (LOGGER.isDebugEnabled()) {
    RMMethodSecurityInterceptor.IS_RM_SECURITY_CHECK.set(newValue);
  }
}
Program: 89189
Project: 89189
Buggy source:
/** 
 * Report capability status.
 * @param name      capability name
 * @param status    capability status
 */
public static void reportCapabilityStatus(String name,int status){
  if (logger.isDebugEnabled()) {
    CapabilityReport capability=getCapabilityReport(name);
    capability.status=translate(status);
  }
}

Fixed version (ground truth):
/** 
 * Report capability status.
 * @param name      capability name
 * @param status    capability status
 */
public static void reportCapabilityStatus(String name,int status){
  if (LOGGER.isDebugEnabled()) {
    CapabilityReport capability=getCapabilityReport(name);
    capability.status=translate(status);
  }
}
Program: 89190
Project: 89190
Buggy source:
/** 
 * Gets the failure report for the currently recorded capabilities.
 * @return  {@link String}  capability error report
 */
public String getFailureReport(){
  String result=null;
  if (logger.isDebugEnabled()) {
    Collection<CapabilityReport> capabilities=RMMethodSecurityInterceptor.CAPABILITIES.get().values();
    if (!capabilities.isEmpty()) {
      StringBuffer buffer=new StringBuffer("String_Node_Str");
      for (      CapabilityReport capability : capabilities) {
        buffer.append("String_Node_Str").append(capability.name).append("String_Node_Str").append(capability.status).append("String_Node_Str");
        if (!capability.conditions.isEmpty()) {
          for (          Map.Entry<String,Boolean> entry : capability.conditions.entrySet()) {
            buffer.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
            if (entry.getValue()) {
              buffer.append("String_Node_Str");
            }
 else {
              buffer.append("String_Node_Str");
            }
            buffer.append("String_Node_Str");
          }
        }
      }
      result=buffer.toString();
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Gets the failure report for the currently recorded capabilities.
 * @return  {@link String}  capability error report
 */
public String getFailureReport(){
  String result=null;
  if (LOGGER.isDebugEnabled()) {
    Collection<CapabilityReport> capabilities=RMMethodSecurityInterceptor.CAPABILITIES.get().values();
    if (!capabilities.isEmpty()) {
      StringBuffer buffer=new StringBuffer("String_Node_Str");
      for (      CapabilityReport capability : capabilities) {
        buffer.append("String_Node_Str").append(capability.name).append("String_Node_Str").append(capability.status).append("String_Node_Str");
        if (!capability.conditions.isEmpty()) {
          for (          Map.Entry<String,Boolean> entry : capability.conditions.entrySet()) {
            buffer.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
            if (entry.getValue()) {
              buffer.append("String_Node_Str");
            }
 else {
              buffer.append("String_Node_Str");
            }
            buffer.append("String_Node_Str");
          }
        }
      }
      result=buffer.toString();
    }
  }
  return result;
}
Program: 89191
Project: 89191
Buggy source:
/** 
 * Report capability condition.
 * @param name              capability name
 * @param conditionName     capability condition name
 * @param expected          expected value
 * @param actual            actual value
 */
public static void reportCapabilityCondition(String name,String conditionName,boolean expected,boolean actual){
  if (logger.isDebugEnabled()) {
    CapabilityReport capability=getCapabilityReport(name);
    if (!expected) {
      conditionName="String_Node_Str" + conditionName;
    }
    capability.conditions.put(conditionName,(expected == actual));
  }
}

Fixed version (ground truth):
/** 
 * Report capability condition.
 * @param name              capability name
 * @param conditionName     capability condition name
 * @param expected          expected value
 * @param actual            actual value
 */
public static void reportCapabilityCondition(String name,String conditionName,boolean expected,boolean actual){
  if (LOGGER.isDebugEnabled()) {
    CapabilityReport capability=getCapabilityReport(name);
    if (!expected) {
      conditionName="String_Node_Str" + conditionName;
    }
    capability.conditions.put(conditionName,(expected == actual));
  }
}
Program: 89192
Project: 89192
Buggy source:
public static void addMessage(String message,Object... params){
  if (logger.isDebugEnabled()) {
    addMessage(MessageFormat.format(message,params));
  }
}

Fixed version (ground truth):
public static void addMessage(String message,Object... params){
  if (LOGGER.isDebugEnabled()) {
    addMessage(MessageFormat.format(message,params));
  }
}
Program: 89194
Project: 89194
Buggy source:
public void setAllowedValues(String[] values){
  this.allowedValues=values;
}

Fixed version (ground truth):
public void setAllowedValues(String[] values){
  this.allowedValues=values.clone();
}
Program: 89195
Project: 89195
Buggy source:
/** 
 * @param name
 * @param displayLabel
 * @param actions
 */
protected ScriptCapability(String name,String displayLabel,String[] actions){
  this.name=name;
  this.displayLabel=displayLabel;
  this.actions=actions;
}

Fixed version (ground truth):
/** 
 * @param name
 * @param displayLabel
 * @param actions
 */
protected ScriptCapability(String name,String displayLabel,String[] actions){
  this.name=name;
  this.displayLabel=displayLabel;
  this.actions=actions.clone();
}
Program: 89196
Project: 89196
Buggy source:
public Group(String id,String label,Property[] properties){
  this.id=id;
  this.label=label;
  this.properties=properties;
}

Fixed version (ground truth):
public Group(String id,String label,Property[] properties){
  this.id=id;
  this.label=label;
  this.properties=properties.clone();
}
Program: 89197
Project: 89197
Buggy source:
/** 
 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
 */
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  this.applicationContext=applicationContext;
}

Fixed version (ground truth):
/** 
 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
 */
@Override public void setApplicationContext(ApplicationContext applicationContext){
  this.applicationContext=applicationContext;
}
Program: 89198
Project: 89198
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private Map decide(Authentication authentication,Object object,ConfigAttributeDefinition config,Map returnedObject) throws AccessDeniedException {
  try {
    if (returnedObject.containsKey(RecordsManagementModel.PROP_HOLD_REASON)) {
      HashMap filtered=new HashMap();
      filtered.putAll(returnedObject);
      String protocol=DefaultTypeConverter.INSTANCE.convert(String.class,filtered.get(ContentModel.PROP_STORE_PROTOCOL));
      String identifier=DefaultTypeConverter.INSTANCE.convert(String.class,filtered.get(ContentModel.PROP_STORE_IDENTIFIER));
      String uuid=DefaultTypeConverter.INSTANCE.convert(String.class,filtered.get(ContentModel.PROP_NODE_UUID));
      StoreRef storeRef=new StoreRef(protocol,identifier);
      NodeRef nodeRef=new NodeRef(storeRef,uuid);
      if ((nodeRef == null) || (permissionService.hasPermission(getFilePlanService().getFilePlan(nodeRef),RMPermissionModel.VIEW_UPDATE_REASONS_FOR_FREEZE) != AccessStatus.ALLOWED)) {
        filtered.remove(RecordsManagementModel.PROP_HOLD_REASON);
      }
      return filtered;
    }
 else {
      return returnedObject;
    }
  }
 catch (  ClassCastException ex) {
    return returnedObject;
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private Map decide(Authentication authentication,Object object,ConfigAttributeDefinition config,Map returnedObject){
  try {
    if (returnedObject.containsKey(RecordsManagementModel.PROP_HOLD_REASON)) {
      HashMap filtered=new HashMap();
      filtered.putAll(returnedObject);
      String protocol=DefaultTypeConverter.INSTANCE.convert(String.class,filtered.get(ContentModel.PROP_STORE_PROTOCOL));
      String identifier=DefaultTypeConverter.INSTANCE.convert(String.class,filtered.get(ContentModel.PROP_STORE_IDENTIFIER));
      String uuid=DefaultTypeConverter.INSTANCE.convert(String.class,filtered.get(ContentModel.PROP_NODE_UUID));
      StoreRef storeRef=new StoreRef(protocol,identifier);
      NodeRef nodeRef=new NodeRef(storeRef,uuid);
      if ((nodeRef == null) || (permissionService.hasPermission(getFilePlanService().getFilePlan(nodeRef),RMPermissionModel.VIEW_UPDATE_REASONS_FOR_FREEZE) != AccessStatus.ALLOWED)) {
        filtered.remove(RecordsManagementModel.PROP_HOLD_REASON);
      }
      return filtered;
    }
 else {
      return returnedObject;
    }
  }
 catch (  ClassCastException ex) {
    return returnedObject;
  }
}
Program: 89199
Project: 89199
Buggy source:
/** 
 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
 */
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  this.applicationContext=applicationContext;
}

Fixed version (ground truth):
/** 
 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
 */
@Override public void setApplicationContext(ApplicationContext applicationContext){
  this.applicationContext=applicationContext;
}
Program: 89200
Project: 89200
Buggy source:
/** 
 * @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
 */
@Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
  if (beanFactory.containsBean(BEAN_SITESERVICE_BOOTSTRAP) && beanFactory.containsBean(BEAN_RM_DICTIONARY_BOOTSTRAP)) {
    BeanDefinition beanDef=beanFactory.getBeanDefinition(BEAN_RM_DICTIONARY_BOOTSTRAP);
    beanDef.setDependsOn(new String[]{BEAN_SITESERVICE_BOOTSTRAP});
  }
}

Fixed version (ground truth):
/** 
 * @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
 */
@Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory){
  if (beanFactory.containsBean(BEAN_SITESERVICE_BOOTSTRAP) && beanFactory.containsBean(BEAN_RM_DICTIONARY_BOOTSTRAP)) {
    BeanDefinition beanDef=beanFactory.getBeanDefinition(BEAN_RM_DICTIONARY_BOOTSTRAP);
    beanDef.setDependsOn(new String[]{BEAN_SITESERVICE_BOOTSTRAP});
  }
}
Program: 89201
Project: 89201
Buggy source:
/** 
 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
 */
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  this.applicationContext=applicationContext;
}

Fixed version (ground truth):
/** 
 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
 */
@Override public void setApplicationContext(ApplicationContext applicationContext){
  this.applicationContext=applicationContext;
}
Program: 89202
Project: 89202
Buggy source:
/** 
 * Checks whether the report generator is applicable given the reported upon node reference. <p> Throws AlfrescoRuntimeException if applicability fails, with reason.
 * @param reportedUponNodeRef          reported upon node reference
 * @throws AlfrescoRuntimeException     if applicability check fails
 */
protected abstract void checkReportApplicability(NodeRef reportedUponNodeRef) throws AlfrescoRuntimeException ;

Fixed version (ground truth):
/** 
 * Checks whether the report generator is applicable given the reported upon node reference. <p> Throws AlfrescoRuntimeException if applicability fails, with reason.
 * @param reportedUponNodeRef          reported upon node reference
 */
protected abstract void checkReportApplicability(NodeRef reportedUponNodeRef);
Program: 89203
Project: 89203
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.report.generator.BaseReportGenerator#checkReportApplicability(org.alfresco.service.cmr.repository.NodeRef)
 */
@Override protected void checkReportApplicability(NodeRef reportedUponNodeRef) throws AlfrescoRuntimeException {
  if (applicableTypes != null && applicableTypes.size() != 0) {
    boolean isTypeApplicable=false;
    QName type=nodeService.getType(reportedUponNodeRef);
    for (    QName applicableType : applicableTypes) {
      if (dictionaryService.isSubClass(type,applicableType)) {
        isTypeApplicable=true;
        break;
      }
    }
    if (!isTypeApplicable) {
      throw new AlfrescoRuntimeException("String_Node_Str" + type.toString() + "String_Node_Str"+ reportType.toString()+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.report.generator.BaseReportGenerator#checkReportApplicability(org.alfresco.service.cmr.repository.NodeRef)
 */
@Override protected void checkReportApplicability(NodeRef reportedUponNodeRef){
  if (applicableTypes != null && applicableTypes.size() != 0) {
    boolean isTypeApplicable=false;
    QName type=nodeService.getType(reportedUponNodeRef);
    for (    QName applicableType : applicableTypes) {
      if (dictionaryService.isSubClass(type,applicableType)) {
        isTypeApplicable=true;
        break;
      }
    }
    if (!isTypeApplicable) {
      throw new AlfrescoRuntimeException("String_Node_Str" + type.toString() + "String_Node_Str"+ reportType.toString()+ "String_Node_Str");
    }
  }
}
Program: 89204
Project: 89204
Buggy source:
/** 
 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
 */
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  this.applicationContext=applicationContext;
}

Fixed version (ground truth):
/** 
 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
 */
@Override public void setApplicationContext(ApplicationContext applicationContext){
  this.applicationContext=applicationContext;
}
Program: 89205
Project: 89205
Buggy source:
/** 
 * @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
 */
@Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
  for (  String bean : getSecurityBeanNames(beanFactory)) {
    if (beanFactory.containsBeanDefinition(bean)) {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str" + bean);
      }
      BeanDefinition beanDef=beanFactory.getBeanDefinition(bean);
      PropertyValue beanValue=beanDef.getPropertyValues().getPropertyValue(PROP_OBJECT_DEFINITION_SOURCE);
      if (beanValue != null) {
        String beanStringValue=(String)((TypedStringValue)beanValue.getValue()).getValue();
        String mergedStringValue=merge(beanStringValue);
        beanDef.getPropertyValues().addPropertyValue(PROP_OBJECT_DEFINITION_SOURCE,new TypedStringValue(mergedStringValue));
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
 */
@Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory){
  for (  String bean : getSecurityBeanNames(beanFactory)) {
    if (beanFactory.containsBeanDefinition(bean)) {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str" + bean);
      }
      BeanDefinition beanDef=beanFactory.getBeanDefinition(bean);
      PropertyValue beanValue=beanDef.getPropertyValues().getPropertyValue(PROP_OBJECT_DEFINITION_SOURCE);
      if (beanValue != null) {
        String beanStringValue=(String)((TypedStringValue)beanValue.getValue()).getValue();
        String mergedStringValue=merge(beanStringValue);
        beanDef.getPropertyValues().addPropertyValue(PROP_OBJECT_DEFINITION_SOURCE,new TypedStringValue(mergedStringValue));
      }
    }
  }
}
Program: 89206
Project: 89206
Buggy source:
/** 
 * Gets the failure report for the currently recorded capabilities.
 * @return  {@link String}  capability error report
 */
public String getFailureReport(){
  String result=null;
  if (logger.isDebugEnabled()) {
    Collection<CapabilityReport> capabilities=RMMethodSecurityInterceptor.capabilities.get().values();
    if (!capabilities.isEmpty()) {
      StringBuffer buffer=new StringBuffer("String_Node_Str");
      for (      CapabilityReport capability : capabilities) {
        buffer.append("String_Node_Str").append(capability.name).append("String_Node_Str").append(capability.status).append("String_Node_Str");
        if (!capability.conditions.isEmpty()) {
          for (          Map.Entry<String,Boolean> entry : capability.conditions.entrySet()) {
            buffer.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
            if (entry.getValue() == true) {
              buffer.append("String_Node_Str");
            }
 else {
              buffer.append("String_Node_Str");
            }
            buffer.append("String_Node_Str");
          }
        }
      }
      result=buffer.toString();
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Gets the failure report for the currently recorded capabilities.
 * @return  {@link String}  capability error report
 */
public String getFailureReport(){
  String result=null;
  if (logger.isDebugEnabled()) {
    Collection<CapabilityReport> capabilities=RMMethodSecurityInterceptor.CAPABILITIES.get().values();
    if (!capabilities.isEmpty()) {
      StringBuffer buffer=new StringBuffer("String_Node_Str");
      for (      CapabilityReport capability : capabilities) {
        buffer.append("String_Node_Str").append(capability.name).append("String_Node_Str").append(capability.status).append("String_Node_Str");
        if (!capability.conditions.isEmpty()) {
          for (          Map.Entry<String,Boolean> entry : capability.conditions.entrySet()) {
            buffer.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
            if (entry.getValue() == true) {
              buffer.append("String_Node_Str");
            }
 else {
              buffer.append("String_Node_Str");
            }
            buffer.append("String_Node_Str");
          }
        }
      }
      result=buffer.toString();
    }
  }
  return result;
}
Program: 89207
Project: 89207
Buggy source:
/** 
 * Get capability report object from the thread local, creating one for the given capability name if one does not already exist.
 * @param name  capability name
 * @return {@link CapabilityReport} object containing information about the capability
 */
private static final CapabilityReport getCapabilityReport(String name){
  Map<String,CapabilityReport> map=RMMethodSecurityInterceptor.capabilities.get();
  CapabilityReport capability=map.get(name);
  if (capability == null) {
    capability=new CapabilityReport();
    capability.name=name;
    map.put(name,capability);
  }
  return capability;
}

Fixed version (ground truth):
/** 
 * Get capability report object from the thread local, creating one for the given capability name if one does not already exist.
 * @param name  capability name
 * @return {@link CapabilityReport} object containing information about the capability
 */
private static final CapabilityReport getCapabilityReport(String name){
  Map<String,CapabilityReport> map=RMMethodSecurityInterceptor.CAPABILITIES.get();
  CapabilityReport capability=map.get(name);
  if (capability == null) {
    capability=new CapabilityReport();
    capability.name=name;
    map.put(name,capability);
  }
  return capability;
}
Program: 89208
Project: 89208
Buggy source:
/** 
 * @see net.sf.acegisecurity.intercept.AbstractSecurityInterceptor#beforeInvocation(java.lang.Object)
 */
@Override protected InterceptorStatusToken beforeInvocation(Object object){
  InterceptorStatusToken result=null;
  try {
    RMMethodSecurityInterceptor.capabilities.remove();
    result=super.beforeInvocation(object);
  }
 catch (  AccessDeniedException exception) {
    String failureReport=getFailureReport();
    if (failureReport == null) {
      throw exception;
    }
 else {
      throw new AccessDeniedException(exception.getMessage() + getFailureReport(),exception);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @see net.sf.acegisecurity.intercept.AbstractSecurityInterceptor#beforeInvocation(java.lang.Object)
 */
@Override protected InterceptorStatusToken beforeInvocation(Object object){
  InterceptorStatusToken result=null;
  try {
    RMMethodSecurityInterceptor.CAPABILITIES.remove();
    result=super.beforeInvocation(object);
  }
 catch (  AccessDeniedException exception) {
    String failureReport=getFailureReport();
    if (failureReport == null) {
      throw exception;
    }
 else {
      throw new AccessDeniedException(exception.getMessage() + getFailureReport(),exception);
    }
  }
  return result;
}
Program: 89209
Project: 89209
Buggy source:
@SuppressWarnings("String_Node_Str") public Map<String,String> doWork() throws Exception {
  Map<String,String> result=Collections.EMPTY_MAP;
  NodeRef filePlan=filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
  if (filePlan != null) {
    Set<QName> recordTypes=recordService.getRecordMetadataAspects(filePlan);
    result=new HashMap<String,String>(recordTypes.size());
    for (    QName recordType : recordTypes) {
      AspectDefinition aspectDefinition=dictionaryService.getAspect(recordType);
      if (aspectDefinition != null) {
        result.put(aspectDefinition.getName().getLocalName(),aspectDefinition.getTitle(new StaticMessageLookup()));
      }
    }
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Map<String,String> doWork(){
  Map<String,String> result=Collections.EMPTY_MAP;
  NodeRef filePlan=filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
  if (filePlan != null) {
    Set<QName> recordTypes=recordService.getRecordMetadataAspects(filePlan);
    result=new HashMap<String,String>(recordTypes.size());
    for (    QName recordType : recordTypes) {
      AspectDefinition aspectDefinition=dictionaryService.getAspect(recordType);
      if (aspectDefinition != null) {
        result.put(aspectDefinition.getName().getLocalName(),aspectDefinition.getTitle(new StaticMessageLookup()));
      }
    }
  }
  return result;
}
Program: 89210
Project: 89210
Buggy source:
/** 
 * @see org.alfresco.service.cmr.action.ParameterConstraint#getAllowableValues()
 */
protected Map<String,String> getAllowableValuesImpl(){
  return AuthenticationUtil.runAsSystem(new RunAsWork<Map<String,String>>(){
    @SuppressWarnings("String_Node_Str") public Map<String,String> doWork() throws Exception {
      Map<String,String> result=Collections.EMPTY_MAP;
      NodeRef filePlan=filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
      if (filePlan != null) {
        Set<QName> recordTypes=recordService.getRecordMetadataAspects(filePlan);
        result=new HashMap<String,String>(recordTypes.size());
        for (        QName recordType : recordTypes) {
          AspectDefinition aspectDefinition=dictionaryService.getAspect(recordType);
          if (aspectDefinition != null) {
            result.put(aspectDefinition.getName().getLocalName(),aspectDefinition.getTitle(new StaticMessageLookup()));
          }
        }
      }
      return result;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.service.cmr.action.ParameterConstraint#getAllowableValues()
 */
protected Map<String,String> getAllowableValuesImpl(){
  return AuthenticationUtil.runAsSystem(new RunAsWork<Map<String,String>>(){
    @SuppressWarnings("String_Node_Str") public Map<String,String> doWork(){
      Map<String,String> result=Collections.EMPTY_MAP;
      NodeRef filePlan=filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
      if (filePlan != null) {
        Set<QName> recordTypes=recordService.getRecordMetadataAspects(filePlan);
        result=new HashMap<String,String>(recordTypes.size());
        for (        QName recordType : recordTypes) {
          AspectDefinition aspectDefinition=dictionaryService.getAspect(recordType);
          if (aspectDefinition != null) {
            result.put(aspectDefinition.getName().getLocalName(),aspectDefinition.getTitle(new StaticMessageLookup()));
          }
        }
      }
      return result;
    }
  }
);
}
Program: 89211
Project: 89211
Buggy source:
@Override public NodeRef doWork() throws Exception {
  return filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
}

Fixed version (ground truth):
@Override public NodeRef doWork(){
  return filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
}
Program: 89213
Project: 89213
Buggy source:
@Override public Void doWork() throws Exception {
  recordFolderService.closeRecordFolder(actionedUponNodeRef);
  return null;
}

Fixed version (ground truth):
@Override public Void doWork(){
  recordFolderService.closeRecordFolder(actionedUponNodeRef);
  return null;
}
Program: 89214
Project: 89214
Buggy source:
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override protected void executeImpl(Action action,final NodeRef actionedUponNodeRef){
  if (eligibleForAction(actionedUponNodeRef)) {
    AuthenticationUtil.runAsSystem(new RunAsWork<Void>(){
      @Override public Void doWork() throws Exception {
        recordFolderService.closeRecordFolder(actionedUponNodeRef);
        return null;
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override protected void executeImpl(Action action,final NodeRef actionedUponNodeRef){
  if (eligibleForAction(actionedUponNodeRef)) {
    AuthenticationUtil.runAsSystem(new RunAsWork<Void>(){
      @Override public Void doWork(){
        recordFolderService.closeRecordFolder(actionedUponNodeRef);
        return null;
      }
    }
);
  }
}
Program: 89215
Project: 89215
Buggy source:
/** 
 * Create the specified child of the specified parent
 * @param action  Action to use for reporting if anything goes wrong
 * @param parent  Parent of the child to be created
 * @param childName  The name of the child to be created
 * @param targetisUnfiledRecords  true if the child is being created in the unfiled directory (determines type as unfiled container child)
 * @param lastAsFolder  true if this is the last element of the pathe being created and it should be created as a folder. ignored if targetIsUnfiledRecords is true
 * @return
 */
private NodeRef createChild(final Action action,final NodeRef parent,final String childName,final boolean targetisUnfiledRecords,final boolean lastAsFolder){
  return AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>(){
    public NodeRef doWork() throws Exception {
      NodeRef child=null;
      if (targetisUnfiledRecords) {
        child=fileFolderService.create(parent,childName,RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER).getNodeRef();
      }
 else       if (lastAsFolder) {
        child=recordFolderService.createRecordFolder(parent,childName);
      }
 else {
        if (RecordsManagementModel.TYPE_RECORD_FOLDER.equals(nodeService.getType(parent))) {
          throw new AlfrescoRuntimeException("String_Node_Str" + action.getActionDefinitionName() + "String_Node_Str");
        }
        child=filePlanService.createRecordCategory(parent,childName);
      }
      return child;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Create the specified child of the specified parent
 * @param action  Action to use for reporting if anything goes wrong
 * @param parent  Parent of the child to be created
 * @param childName  The name of the child to be created
 * @param targetisUnfiledRecords  true if the child is being created in the unfiled directory (determines type as unfiled container child)
 * @param lastAsFolder  true if this is the last element of the pathe being created and it should be created as a folder. ignored if targetIsUnfiledRecords is true
 * @return
 */
private NodeRef createChild(final Action action,final NodeRef parent,final String childName,final boolean targetisUnfiledRecords,final boolean lastAsFolder){
  return AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>(){
    @Override public NodeRef doWork(){
      NodeRef child=null;
      if (targetisUnfiledRecords) {
        child=fileFolderService.create(parent,childName,RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER).getNodeRef();
      }
 else       if (lastAsFolder) {
        child=recordFolderService.createRecordFolder(parent,childName);
      }
 else {
        if (RecordsManagementModel.TYPE_RECORD_FOLDER.equals(nodeService.getType(parent))) {
          throw new AlfrescoRuntimeException("String_Node_Str" + action.getActionDefinitionName() + "String_Node_Str");
        }
        child=filePlanService.createRecordCategory(parent,childName);
      }
      return child;
    }
  }
);
}
Program: 89216
Project: 89216
Buggy source:
public NodeRef doWork() throws Exception {
  NodeRef child=null;
  if (targetisUnfiledRecords) {
    child=fileFolderService.create(parent,childName,RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER).getNodeRef();
  }
 else   if (lastAsFolder) {
    child=recordFolderService.createRecordFolder(parent,childName);
  }
 else {
    if (RecordsManagementModel.TYPE_RECORD_FOLDER.equals(nodeService.getType(parent))) {
      throw new AlfrescoRuntimeException("String_Node_Str" + action.getActionDefinitionName() + "String_Node_Str");
    }
    child=filePlanService.createRecordCategory(parent,childName);
  }
  return child;
}

Fixed version (ground truth):
@Override public NodeRef doWork(){
  NodeRef child=null;
  if (targetisUnfiledRecords) {
    child=fileFolderService.create(parent,childName,RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER).getNodeRef();
  }
 else   if (lastAsFolder) {
    child=recordFolderService.createRecordFolder(parent,childName);
  }
 else {
    if (RecordsManagementModel.TYPE_RECORD_FOLDER.equals(nodeService.getType(parent))) {
      throw new AlfrescoRuntimeException("String_Node_Str" + action.getActionDefinitionName() + "String_Node_Str");
    }
    child=filePlanService.createRecordCategory(parent,childName);
  }
  return child;
}
Program: 89218
Project: 89218
Buggy source:
@Override public Void doWork() throws Exception {
  ownableService.setOwner(actionedUponNodeRef,OwnableService.NO_OWNER);
  return null;
}

Fixed version (ground truth):
@Override public Void doWork(){
  ownableService.setOwner(actionedUponNodeRef,OwnableService.NO_OWNER);
  return null;
}
Program: 89220
Project: 89220
Buggy source:
@Override public NodeRef doWork() throws Exception {
  return reportService.fileReport(destination,report);
}

Fixed version (ground truth):
@Override public NodeRef doWork(){
  return reportService.fileReport(destination,report);
}
Program: 89221
Project: 89221
Buggy source:
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override protected void executeImpl(Action action,NodeRef actionedUponNodeRef){
  String mimetype=(String)action.getParameterValue(MIMETYPE);
  if (mimetype == null || mimetype.isEmpty()) {
    mimetype=MimetypeMap.MIMETYPE_HTML;
  }
  QName reportType=getReportType(action);
  final NodeRef destination=getDestination(action);
  final Report report=reportService.generateReport(reportType,actionedUponNodeRef,mimetype);
  NodeRef filedReport=AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>(){
    @Override public NodeRef doWork() throws Exception {
      return reportService.fileReport(destination,report);
    }
  }
);
  String filedReportName=(String)nodeService.getProperty(filedReport,ContentModel.PROP_NAME);
  action.setParameterValue(ActionExecuterAbstractBase.PARAM_RESULT,filedReportName);
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override protected void executeImpl(Action action,NodeRef actionedUponNodeRef){
  String mimetype=(String)action.getParameterValue(MIMETYPE);
  if (mimetype == null || mimetype.isEmpty()) {
    mimetype=MimetypeMap.MIMETYPE_HTML;
  }
  QName reportType=getReportType(action);
  final NodeRef destination=getDestination(action);
  final Report report=reportService.generateReport(reportType,actionedUponNodeRef,mimetype);
  NodeRef filedReport=AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>(){
    @Override public NodeRef doWork(){
      return reportService.fileReport(destination,report);
    }
  }
);
  String filedReportName=(String)nodeService.getProperty(filedReport,ContentModel.PROP_NAME);
  action.setParameterValue(ActionExecuterAbstractBase.PARAM_RESULT,filedReportName);
}
Program: 89222
Project: 89222
Buggy source:
@Override public Void doWork() throws Exception {
  recordsManagementAdminService.addCustomReference(parentRef,childRef,relationshipQName);
  nodeService.createAssociation(parentRef,childRef,ImapModel.ASSOC_IMAP_ATTACHMENT);
  return null;
}

Fixed version (ground truth):
@Override public Void doWork(){
  recordsManagementAdminService.addCustomReference(parentRef,childRef,relationshipQName);
  nodeService.createAssociation(parentRef,childRef,ImapModel.ASSOC_IMAP_ATTACHMENT);
  return null;
}
Program: 89223
Project: 89223
Buggy source:
/** 
 * Create a link from the message to the attachment
 */
private void createRMReference(final NodeRef parentRef,final NodeRef childRef){
  AuthenticationUtil.runAsSystem(new RunAsWork<Void>(){
    @Override public Void doWork() throws Exception {
      recordsManagementAdminService.addCustomReference(parentRef,childRef,relationshipQName);
      nodeService.createAssociation(parentRef,childRef,ImapModel.ASSOC_IMAP_ATTACHMENT);
      return null;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Create a link from the message to the attachment
 */
private void createRMReference(final NodeRef parentRef,final NodeRef childRef){
  AuthenticationUtil.runAsSystem(new RunAsWork<Void>(){
    @Override public Void doWork(){
      recordsManagementAdminService.addCustomReference(parentRef,childRef,relationshipQName);
      nodeService.createAssociation(parentRef,childRef,ImapModel.ASSOC_IMAP_ATTACHMENT);
      return null;
    }
  }
);
}
Program: 89224
Project: 89224
Buggy source:
/** 
 * @see org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy#onAddAspect(org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.namespace.QName)
 */
@Override @Behaviour(kind=BehaviourKind.CLASS,isService=true,notificationFrequency=NotificationFrequency.FIRST_EVENT) public void onAddAspect(final NodeRef nodeRef,final QName aspectTypeQName){
  AuthenticationUtil.runAs(new RunAsWork<Void>(){
    @Override public Void doWork() throws Exception {
      if (nodeService.exists(nodeRef) && dictionaryService.getAllModels().contains(RM_CUSTOM_MODEL) && isCustomisable(aspectTypeQName)) {
        QName customPropertyAspect=getCustomAspect(aspectTypeQName);
        nodeService.addAspect(nodeRef,customPropertyAspect,null);
      }
      return null;
    }
  }
,AuthenticationUtil.getSystemUserName());
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy#onAddAspect(org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.namespace.QName)
 */
@Override @Behaviour(kind=BehaviourKind.CLASS,isService=true,notificationFrequency=NotificationFrequency.FIRST_EVENT) public void onAddAspect(final NodeRef nodeRef,final QName aspectTypeQName){
  AuthenticationUtil.runAs(new RunAsWork<Void>(){
    @Override public Void doWork(){
      if (nodeService.exists(nodeRef) && dictionaryService.getAllModels().contains(RM_CUSTOM_MODEL) && isCustomisable(aspectTypeQName)) {
        QName customPropertyAspect=getCustomAspect(aspectTypeQName);
        nodeService.addAspect(nodeRef,customPropertyAspect,null);
      }
      return null;
    }
  }
,AuthenticationUtil.getSystemUserName());
}
Program: 89225
Project: 89225
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#removeCustomReference(org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.namespace.QName)
 */
public void removeCustomReference(final NodeRef fromNode,final NodeRef toNode,final QName assocId){
  Map<QName,AssociationDefinition> availableAssocs=this.getCustomReferenceDefinitions();
  AssociationDefinition assocDef=availableAssocs.get(assocId);
  if (assocDef == null) {
    throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_EXIST,assocId));
  }
  invokeBeforeRemoveReference(fromNode,toNode,assocId);
  if (assocDef.isChild()) {
    AuthenticationUtil.runAsSystem(new RunAsWork<Void>(){
      @Override public Void doWork() throws Exception {
        List<ChildAssociationRef> children=nodeService.getChildAssocs(fromNode);
        for (        ChildAssociationRef chRef : children) {
          if (assocId.equals(chRef.getTypeQName()) && chRef.getChildRef().equals(toNode)) {
            nodeService.removeChildAssociation(chRef);
          }
        }
        return null;
      }
    }
);
  }
 else {
    nodeService.removeAssociation(fromNode,toNode,assocId);
  }
  invokeOnRemoveReference(fromNode,toNode,assocId);
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#removeCustomReference(org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.namespace.QName)
 */
public void removeCustomReference(final NodeRef fromNode,final NodeRef toNode,final QName assocId){
  Map<QName,AssociationDefinition> availableAssocs=this.getCustomReferenceDefinitions();
  AssociationDefinition assocDef=availableAssocs.get(assocId);
  if (assocDef == null) {
    throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_EXIST,assocId));
  }
  invokeBeforeRemoveReference(fromNode,toNode,assocId);
  if (assocDef.isChild()) {
    AuthenticationUtil.runAsSystem(new RunAsWork<Void>(){
      @Override public Void doWork(){
        List<ChildAssociationRef> children=nodeService.getChildAssocs(fromNode);
        for (        ChildAssociationRef chRef : children) {
          if (assocId.equals(chRef.getTypeQName()) && chRef.getChildRef().equals(toNode)) {
            nodeService.removeChildAssociation(chRef);
          }
        }
        return null;
      }
    }
);
  }
 else {
    nodeService.removeAssociation(fromNode,toNode,assocId);
  }
  invokeOnRemoveReference(fromNode,toNode,assocId);
}
Program: 89226
Project: 89226
Buggy source:
@Override public Void doWork() throws Exception {
  List<ChildAssociationRef> children=nodeService.getChildAssocs(fromNode);
  for (  ChildAssociationRef chRef : children) {
    if (assocId.equals(chRef.getTypeQName()) && chRef.getChildRef().equals(toNode)) {
      nodeService.removeChildAssociation(chRef);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doWork(){
  List<ChildAssociationRef> children=nodeService.getChildAssocs(fromNode);
  for (  ChildAssociationRef chRef : children) {
    if (assocId.equals(chRef.getTypeQName()) && chRef.getChildRef().equals(toNode)) {
      nodeService.removeChildAssociation(chRef);
    }
  }
  return null;
}