nus-yam/ex-repair huggingface dataset:
Program: 89320
Project: 89320
Buggy source:
/** 
 * Helper method to check whether all the mandatory properties of the node have been set
 * @param nodeRef node reference
 * @return boolean true if all mandatory properties are set, false otherwise
 */
private boolean mandatoryPropertiesSet(NodeRef nodeRef,List<String> missingProperties){
  boolean result=true;
  Map<QName,Serializable> nodeRefProps=this.nodeService.getProperties(nodeRef);
  QName nodeRefType=this.nodeService.getType(nodeRef);
  TypeDefinition typeDef=this.dictionaryService.getType(nodeRefType);
  for (  PropertyDefinition propDef : typeDef.getProperties().values()) {
    if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null) {
      logMissingProperty(propDef,missingProperties);
      result=false;
      break;
    }
  }
  if (result != false) {
    Set<QName> aspects=this.nodeService.getAspects(nodeRef);
    for (    QName aspect : aspects) {
      AspectDefinition aspectDef=this.dictionaryService.getAspect(aspect);
      for (      PropertyDefinition propDef : aspectDef.getProperties().values()) {
        if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null) {
          logMissingProperty(propDef,missingProperties);
          result=false;
          break;
        }
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Helper method to check whether all the mandatory properties of the node have been set
 * @param nodeRef node reference
 * @return boolean true if all mandatory properties are set, false otherwise
 */
private boolean mandatoryPropertiesSet(NodeRef nodeRef,List<String> missingProperties){
  boolean result=true;
  Map<QName,Serializable> nodeRefProps=this.nodeService.getProperties(nodeRef);
  QName nodeRefType=this.nodeService.getType(nodeRef);
  TypeDefinition typeDef=this.dictionaryService.getType(nodeRefType);
  for (  PropertyDefinition propDef : typeDef.getProperties().values()) {
    if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null) {
      logMissingProperty(propDef,missingProperties);
      result=false;
      break;
    }
  }
  if (result) {
    Set<QName> aspects=this.nodeService.getAspects(nodeRef);
    for (    QName aspect : aspects) {
      AspectDefinition aspectDef=this.dictionaryService.getAspect(aspect);
      for (      PropertyDefinition propDef : aspectDef.getProperties().values()) {
        if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null) {
          logMissingProperty(propDef,missingProperties);
          result=false;
          break;
        }
      }
    }
  }
  return result;
}
Program: 89322
Project: 89322
Buggy source:
public Object doWork(){
  RetryingTransactionCallback<Void> callback=new RetryingTransactionCallback<Void>(){
    public Void execute() throws Throwable {
      nodeService.setProperty(OLD_BEHAVIOR_SCRIPTS_FOLDER,ContentModel.PROP_DESCRIPTION,"String_Node_Str");
      List<FileInfo> oldBehaviorScripts=fileFolderService.listFiles(OLD_BEHAVIOR_SCRIPTS_FOLDER);
      if (oldBehaviorScripts != null && oldBehaviorScripts.isEmpty() != true) {
        if (logger.isDebugEnabled()) {
          logger.debug("String_Node_Str");
        }
        for (        FileInfo script : oldBehaviorScripts) {
          fileFolderService.moveFrom(script.getNodeRef(),OLD_BEHAVIOR_SCRIPTS_FOLDER,RMv21BehaviorScriptsPatch.newBehaviorScriptsFolder,script.getName());
          if (logger.isDebugEnabled()) {
            logger.debug("String_Node_Str" + script.getName());
          }
        }
      }
      return null;
    }
  }
;
  retryingTransactionHelper.doInTransaction(callback);
  return null;
}

Fixed version (ground truth):
public Object doWork(){
  RetryingTransactionCallback<Void> callback=new RetryingTransactionCallback<Void>(){
    public Void execute() throws Throwable {
      nodeService.setProperty(OLD_BEHAVIOR_SCRIPTS_FOLDER,ContentModel.PROP_DESCRIPTION,"String_Node_Str");
      List<FileInfo> oldBehaviorScripts=fileFolderService.listFiles(OLD_BEHAVIOR_SCRIPTS_FOLDER);
      if (oldBehaviorScripts != null && !oldBehaviorScripts.isEmpty()) {
        if (logger.isDebugEnabled()) {
          logger.debug("String_Node_Str");
        }
        for (        FileInfo script : oldBehaviorScripts) {
          fileFolderService.moveFrom(script.getNodeRef(),OLD_BEHAVIOR_SCRIPTS_FOLDER,RMv21BehaviorScriptsPatch.newBehaviorScriptsFolder,script.getName());
          if (logger.isDebugEnabled()) {
            logger.debug("String_Node_Str" + script.getName());
          }
        }
      }
      return null;
    }
  }
;
  retryingTransactionHelper.doInTransaction(callback);
  return null;
}
Program: 89323
Project: 89323
Buggy source:
public Void execute() throws Throwable {
  nodeService.setProperty(OLD_BEHAVIOR_SCRIPTS_FOLDER,ContentModel.PROP_DESCRIPTION,"String_Node_Str");
  List<FileInfo> oldBehaviorScripts=fileFolderService.listFiles(OLD_BEHAVIOR_SCRIPTS_FOLDER);
  if (oldBehaviorScripts != null && oldBehaviorScripts.isEmpty() != true) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    for (    FileInfo script : oldBehaviorScripts) {
      fileFolderService.moveFrom(script.getNodeRef(),OLD_BEHAVIOR_SCRIPTS_FOLDER,RMv21BehaviorScriptsPatch.newBehaviorScriptsFolder,script.getName());
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str" + script.getName());
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public Void execute() throws Throwable {
  nodeService.setProperty(OLD_BEHAVIOR_SCRIPTS_FOLDER,ContentModel.PROP_DESCRIPTION,"String_Node_Str");
  List<FileInfo> oldBehaviorScripts=fileFolderService.listFiles(OLD_BEHAVIOR_SCRIPTS_FOLDER);
  if (oldBehaviorScripts != null && !oldBehaviorScripts.isEmpty()) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    for (    FileInfo script : oldBehaviorScripts) {
      fileFolderService.moveFrom(script.getNodeRef(),OLD_BEHAVIOR_SCRIPTS_FOLDER,RMv21BehaviorScriptsPatch.newBehaviorScriptsFolder,script.getName());
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str" + script.getName());
      }
    }
  }
  return null;
}
Program: 89324
Project: 89324
Buggy source:
@Override public boolean evaluate(JSONObject jsonObject){
  if (type == null) {
    return false;
  }
  if (isDocLibRecord(jsonObject) == true) {
    return false;
  }
  try {
    JSONObject rmNode=getRMNode(jsonObject);
    if (rmNode == null) {
      return false;
    }
 else {
      String uiType=(String)rmNode.get("String_Node_Str");
      if (uiType.equalsIgnoreCase(type)) {
        return true;
      }
    }
  }
 catch (  Exception err) {
    throw new AlfrescoRuntimeException("String_Node_Str" + err);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean evaluate(JSONObject jsonObject){
  if (type == null) {
    return false;
  }
  if (isDocLibRecord(jsonObject)) {
    return false;
  }
  try {
    JSONObject rmNode=getRMNode(jsonObject);
    if (rmNode == null) {
      return false;
    }
 else {
      String uiType=(String)rmNode.get("String_Node_Str");
      if (uiType.equalsIgnoreCase(type)) {
        return true;
      }
    }
  }
 catch (  Exception err) {
    throw new AlfrescoRuntimeException("String_Node_Str" + err);
  }
  return false;
}
Program: 89325
Project: 89325
Buggy source:
/** 
 * @see org.alfresco.web.scripts.forms.FormUIGet#getVisibleFieldsInSet(org.alfresco.web.scripts.forms.FormUIGet.ModelContext,org.alfresco.web.config.forms.FormSet)
 */
@Override protected List<String> getVisibleFieldsInSet(ModelContext context,FormSet setConfig){
  List<String> result=null;
  String id=setConfig.getSetId();
  if (SET_RM_CUSTOM.equals(id) == true || id.startsWith(SET_RM_METADATA) == true) {
    Map<String,List<String>> setMembership=discoverSetMembership(context);
    result=setMembership.get(id);
  }
 else {
    result=super.getVisibleFieldsInSet(context,setConfig);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.web.scripts.forms.FormUIGet#getVisibleFieldsInSet(org.alfresco.web.scripts.forms.FormUIGet.ModelContext,org.alfresco.web.config.forms.FormSet)
 */
@Override protected List<String> getVisibleFieldsInSet(ModelContext context,FormSet setConfig){
  List<String> result=null;
  String id=setConfig.getSetId();
  if (SET_RM_CUSTOM.equals(id) || id.startsWith(SET_RM_METADATA)) {
    Map<String,List<String>> setMembership=discoverSetMembership(context);
    result=setMembership.get(id);
  }
 else {
    result=super.getVisibleFieldsInSet(context,setConfig);
  }
  return result;
}
Program: 89326
Project: 89326
Buggy source:
/** 
 * Gets all the record meta-data sets present in the form data.
 * @param context
 * @return
 */
protected Collection<FormSet> getRecordMetaDataSetConfig(ModelContext context){
  Map<String,FormSet> result=new HashMap<String,FormSet>(13);
  try {
    JSONObject data=context.getFormDefinition().getJSONObject(MODEL_DATA);
    JSONObject definition=data.getJSONObject(MODEL_DEFINITION);
    JSONArray fieldsFromServer=definition.getJSONArray(MODEL_FIELDS);
    for (int x=0; x < fieldsFromServer.length(); x++) {
      JSONObject fieldDefinition=fieldsFromServer.getJSONObject(x);
      if (fieldDefinition.has(MODEL_GROUP)) {
        String set=fieldDefinition.getString(MODEL_GROUP);
        if (!result.containsKey(set) && set.startsWith(SET_RM_METADATA) == true) {
          FormSet formSet=new FormSet(set,null,"String_Node_Str",null,LABEL_ID_PREFIX + set);
          result.put(set,formSet);
        }
      }
    }
  }
 catch (  JSONException je) {
  }
  return result.values();
}

Fixed version (ground truth):
/** 
 * Gets all the record meta-data sets present in the form data.
 * @param context
 * @return
 */
protected Collection<FormSet> getRecordMetaDataSetConfig(ModelContext context){
  Map<String,FormSet> result=new HashMap<String,FormSet>(13);
  try {
    JSONObject data=context.getFormDefinition().getJSONObject(MODEL_DATA);
    JSONObject definition=data.getJSONObject(MODEL_DEFINITION);
    JSONArray fieldsFromServer=definition.getJSONArray(MODEL_FIELDS);
    for (int x=0; x < fieldsFromServer.length(); x++) {
      JSONObject fieldDefinition=fieldsFromServer.getJSONObject(x);
      if (fieldDefinition.has(MODEL_GROUP)) {
        String set=fieldDefinition.getString(MODEL_GROUP);
        if (!result.containsKey(set) && set.startsWith(SET_RM_METADATA)) {
          FormSet formSet=new FormSet(set,null,"String_Node_Str",null,LABEL_ID_PREFIX + set);
          result.put(set,formSet);
        }
      }
    }
  }
 catch (  JSONException je) {
  }
  return result.values();
}
Program: 89328
Project: 89328
Buggy source:
/** 
 * Extend the default resolution code to account for records.
 * @see org.alfresco.web.resolver.doclib.DefaultDoclistActionGroupResolver#resolve(org.json.simple.JSONObject,java.lang.String)
 */
@Override public String resolve(JSONObject jsonObject,String view){
  String result=null;
  JSONObject node=(org.json.simple.JSONObject)jsonObject.get("String_Node_Str");
  Boolean isRMNode=(Boolean)node.get("String_Node_Str");
  if (isRMNode != null && isRMNode.booleanValue() == true) {
    result=filePlanDoclistActionGroupResolver.resolve(jsonObject,view,true);
  }
 else {
    result=super.resolve(jsonObject,view);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Extend the default resolution code to account for records.
 * @see org.alfresco.web.resolver.doclib.DefaultDoclistActionGroupResolver#resolve(org.json.simple.JSONObject,java.lang.String)
 */
@Override public String resolve(JSONObject jsonObject,String view){
  String result=null;
  JSONObject node=(org.json.simple.JSONObject)jsonObject.get("String_Node_Str");
  Boolean isRMNode=(Boolean)node.get("String_Node_Str");
  if (isRMNode != null && isRMNode.booleanValue()) {
    result=filePlanDoclistActionGroupResolver.resolve(jsonObject,view,true);
  }
 else {
    result=super.resolve(jsonObject,view);
  }
  return result;
}
Program: 89329
Project: 89329
Buggy source:
/** 
 * @param jsonObject
 * @param view
 * @param isDocLib
 * @return
 */
public String resolve(JSONObject jsonObject,String view,boolean isDocLib){
  String actionGroupId="String_Node_Str";
  if (isDocLib == true) {
    actionGroupId+="String_Node_Str";
  }
  JSONObject node=(org.json.simple.JSONObject)jsonObject.get("String_Node_Str");
  boolean isLink=(Boolean)node.get("String_Node_Str");
  if (isLink) {
    actionGroupId+="String_Node_Str";
  }
 else {
    JSONObject rmNode=(JSONObject)node.get("String_Node_Str");
    actionGroupId+=(String)rmNode.get("String_Node_Str") + "String_Node_Str";
  }
  if (view.equals("String_Node_Str")) {
    actionGroupId+="String_Node_Str";
  }
 else {
    actionGroupId+="String_Node_Str";
  }
  return actionGroupId;
}

Fixed version (ground truth):
/** 
 * @param jsonObject
 * @param view
 * @param isDocLib
 * @return
 */
public String resolve(JSONObject jsonObject,String view,boolean isDocLib){
  String actionGroupId="String_Node_Str";
  if (isDocLib) {
    actionGroupId+="String_Node_Str";
  }
  JSONObject node=(org.json.simple.JSONObject)jsonObject.get("String_Node_Str");
  boolean isLink=(Boolean)node.get("String_Node_Str");
  if (isLink) {
    actionGroupId+="String_Node_Str";
  }
 else {
    JSONObject rmNode=(JSONObject)node.get("String_Node_Str");
    actionGroupId+=(String)rmNode.get("String_Node_Str") + "String_Node_Str";
  }
  if (view.equals("String_Node_Str")) {
    actionGroupId+="String_Node_Str";
  }
 else {
    actionGroupId+="String_Node_Str";
  }
  return actionGroupId;
}
Program: 89330
Project: 89330
Buggy source:
/** 
 * Gets the hold name
 * @return The name of the hold
 */
public String getName(){
  return this.Name;
}

Fixed version (ground truth):
/** 
 * Gets the hold name
 * @return The name of the hold
 */
public String getName(){
  return this.name;
}
Program: 89331
Project: 89331
Buggy source:
/** 
 * Constructor
 * @param name The name of the hold
 * @param nodeRef The {@link NodeRef} of the hold
 */
public Hold(String name,NodeRef nodeRef){
  this.Name=name;
  this.nodeRef=nodeRef;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param name The name of the hold
 * @param nodeRef The {@link NodeRef} of the hold
 */
public Hold(String name,NodeRef nodeRef){
  this.name=name;
  this.nodeRef=nodeRef;
}
Program: 89332
Project: 89332
Buggy source:
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#init()
 */
@Override public void init(){
  if (this instanceof RecordsManagementAction == false) {
    super.init();
  }
  if (auditable) {
    getAuditService().registerAuditEvent(this.getActionDefinition().getName(),this.getActionDefinition().getTitle());
  }
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#init()
 */
@Override public void init(){
  if (!(this instanceof RecordsManagementAction)) {
    super.init();
  }
  if (auditable) {
    getAuditService().registerAuditEvent(this.getActionDefinition().getName(),this.getActionDefinition().getTitle());
  }
}
Program: 89333
Project: 89333
Buggy source:
/** 
 * Calculates and updates the <code>rma:dispositionEventsEligible</code> property for the given next disposition action.
 * @param nextAction The next disposition action
 * @return The result of calculation
 */
protected boolean updateEventEligible(DispositionAction nextAction){
  List<EventCompletionDetails> events=nextAction.getEventCompletionDetails();
  boolean eligible=false;
  if (nextAction.getDispositionActionDefinition().eligibleOnFirstCompleteEvent() == false) {
    eligible=true;
    for (    EventCompletionDetails event : events) {
      if (event.isEventComplete() == false) {
        eligible=false;
        break;
      }
    }
  }
 else {
    for (    EventCompletionDetails event : events) {
      if (event.isEventComplete()) {
        eligible=true;
        break;
      }
    }
  }
  this.nodeService.setProperty(nextAction.getNodeRef(),PROP_DISPOSITION_EVENTS_ELIGIBLE,eligible);
  return eligible;
}

Fixed version (ground truth):
/** 
 * Calculates and updates the <code>rma:dispositionEventsEligible</code> property for the given next disposition action.
 * @param nextAction The next disposition action
 * @return The result of calculation
 */
protected boolean updateEventEligible(DispositionAction nextAction){
  List<EventCompletionDetails> events=nextAction.getEventCompletionDetails();
  boolean eligible=false;
  if (!nextAction.getDispositionActionDefinition().eligibleOnFirstCompleteEvent()) {
    eligible=true;
    for (    EventCompletionDetails event : events) {
      if (!event.isEventComplete()) {
        eligible=false;
        break;
      }
    }
  }
 else {
    for (    EventCompletionDetails event : events) {
      if (event.isEventComplete()) {
        eligible=true;
        break;
      }
    }
  }
  this.nodeService.setProperty(nextAction.getNodeRef(),PROP_DISPOSITION_EVENTS_ELIGIBLE,eligible);
  return eligible;
}
Program: 89335
Project: 89335
Buggy source:
/** 
 * @param nodeRef
 * @return
 */
protected DispositionSchedule checkDispositionActionExecutionValidity(NodeRef nodeRef,NodeRef nextDispositionActionNodeRef,boolean throwError){
  DispositionSchedule di=dispositionService.getDispositionSchedule(nodeRef);
  if (di == null) {
    if (throwError) {
      throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NO_DISPOITION_INSTRUCTIONS,getName(),nodeRef.toString()));
    }
 else {
      return null;
    }
  }
  if (nodeService.hasAspect(nodeRef,ASPECT_DISPOSITION_LIFECYCLE) == false) {
    if (throwError) {
      throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NO_DIS_LIFECYCLE_SET,getName(),nodeRef.toString()));
    }
 else {
      return null;
    }
  }
  if (checkNextDispositionAction(nodeRef)) {
    NodeRef nextDispositionAction=nextDispositionActionNodeRef;
    if (nextDispositionAction == null) {
      if (throwError) {
        throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NEXT_DISP_NOT_SET,getName(),nodeRef.toString()));
      }
 else {
        return null;
      }
    }
    String actionName=(String)nodeService.getProperty(nextDispositionAction,PROP_DISPOSITION_ACTION);
    if (actionName == null || actionName.equals(getName()) == false) {
      if (throwError) {
        throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NOT_NEXT_DISP,getName(),nodeRef.toString()));
      }
 else {
        return null;
      }
    }
  }
  return di;
}

Fixed version (ground truth):
/** 
 * @param nodeRef
 * @return
 */
protected DispositionSchedule checkDispositionActionExecutionValidity(NodeRef nodeRef,NodeRef nextDispositionActionNodeRef,boolean throwError){
  DispositionSchedule di=dispositionService.getDispositionSchedule(nodeRef);
  if (di == null) {
    if (throwError) {
      throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NO_DISPOITION_INSTRUCTIONS,getName(),nodeRef.toString()));
    }
 else {
      return null;
    }
  }
  if (!nodeService.hasAspect(nodeRef,ASPECT_DISPOSITION_LIFECYCLE)) {
    if (throwError) {
      throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NO_DIS_LIFECYCLE_SET,getName(),nodeRef.toString()));
    }
 else {
      return null;
    }
  }
  if (checkNextDispositionAction(nodeRef)) {
    NodeRef nextDispositionAction=nextDispositionActionNodeRef;
    if (nextDispositionAction == null) {
      if (throwError) {
        throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NEXT_DISP_NOT_SET,getName(),nodeRef.toString()));
      }
 else {
        return null;
      }
    }
    String actionName=(String)nodeService.getProperty(nextDispositionAction,PROP_DISPOSITION_ACTION);
    if (actionName == null || !actionName.equals(getName())) {
      if (throwError) {
        throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NOT_NEXT_DISP,getName(),nodeRef.toString()));
      }
 else {
        return null;
      }
    }
  }
  return di;
}
Program: 89336
Project: 89336
Buggy source:
public void register(RecordsManagementActionCondition rmCondition){
  if (rmConditions.containsKey(rmCondition.getName()) == false) {
    rmConditions.put(rmCondition.getName(),rmCondition);
  }
}

Fixed version (ground truth):
public void register(RecordsManagementActionCondition rmCondition){
  if (!rmConditions.containsKey(rmCondition.getName())) {
    rmConditions.put(rmCondition.getName(),rmCondition);
  }
}
Program: 89338
Project: 89338
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){
  if (nodeService.hasAspect(actionedUponNodeRef,ASPECT_RECORD) == false) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + actionedUponNodeRef.toString() + "String_Node_Str");
    }
  }
 else {
    recordService.hideRecord(actionedUponNodeRef);
  }
}

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){
  if (!nodeService.hasAspect(actionedUponNodeRef,ASPECT_RECORD)) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + actionedUponNodeRef.toString() + "String_Node_Str");
    }
  }
 else {
    recordService.hideRecord(actionedUponNodeRef);
  }
}
Program: 89339
Project: 89339
Buggy source:
/** 
 * Helper method to check the actioned upon node reference to decide to execute the action The preconditions are: - The node must exist - The node must not be frozen - The node must be record - The node must not be declared
 * @param actionedUponNodeRef node reference
 * @return Return true if the node reference passes all the preconditions for executing the action, false otherwise
 */
private boolean eligibleForAction(NodeRef actionedUponNodeRef){
  boolean result=false;
  if (nodeService.exists(actionedUponNodeRef) && freezeService.isFrozen(actionedUponNodeRef) == false && recordService.isRecord(actionedUponNodeRef) && recordService.isDeclared(actionedUponNodeRef) == false) {
    result=true;
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Helper method to check the actioned upon node reference to decide to execute the action The preconditions are: - The node must exist - The node must not be frozen - The node must be record - The node must not be declared
 * @param actionedUponNodeRef node reference
 * @return Return true if the node reference passes all the preconditions for executing the action, false otherwise
 */
private boolean eligibleForAction(NodeRef actionedUponNodeRef){
  boolean result=false;
  if (nodeService.exists(actionedUponNodeRef) && !freezeService.isFrozen(actionedUponNodeRef) && recordService.isRecord(actionedUponNodeRef)&& !recordService.isDeclared(actionedUponNodeRef)) {
    result=true;
  }
  return result;
}
Program: 89341
Project: 89341
Buggy source:
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@SuppressWarnings("String_Node_Str") @Override protected void executeImpl(Action action,NodeRef actionedUponNodeRef){
  if (RecordsManagementModel.TYPE_DISPOSITION_ACTION_DEFINITION.equals(nodeService.getType(actionedUponNodeRef)) == false) {
    return;
  }
  List<QName> changedProps=(List<QName>)action.getParameterValue(CHANGED_PROPERTIES);
  NodeRef dispositionScheduleNode=nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef();
  NodeRef rmContainer=nodeService.getPrimaryParent(dispositionScheduleNode).getParentRef();
  DispositionSchedule dispositionSchedule=dispositionService.getAssociatedDispositionSchedule(rmContainer);
  behaviourFilter.disableBehaviour();
  try {
    List<NodeRef> disposableItems=dispositionService.getDisposableItems(dispositionSchedule);
    for (    NodeRef disposableItem : disposableItems) {
      updateDisposableItem(dispositionSchedule,disposableItem,actionedUponNodeRef,changedProps);
    }
  }
  finally {
    behaviourFilter.enableBehaviour();
  }
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@SuppressWarnings("String_Node_Str") @Override protected void executeImpl(Action action,NodeRef actionedUponNodeRef){
  if (!RecordsManagementModel.TYPE_DISPOSITION_ACTION_DEFINITION.equals(nodeService.getType(actionedUponNodeRef))) {
    return;
  }
  List<QName> changedProps=(List<QName>)action.getParameterValue(CHANGED_PROPERTIES);
  NodeRef dispositionScheduleNode=nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef();
  NodeRef rmContainer=nodeService.getPrimaryParent(dispositionScheduleNode).getParentRef();
  DispositionSchedule dispositionSchedule=dispositionService.getAssociatedDispositionSchedule(rmContainer);
  behaviourFilter.disableBehaviour();
  try {
    List<NodeRef> disposableItems=dispositionService.getDisposableItems(dispositionSchedule);
    for (    NodeRef disposableItem : disposableItems) {
      updateDisposableItem(dispositionSchedule,disposableItem,actionedUponNodeRef,changedProps);
    }
  }
  finally {
    behaviourFilter.enableBehaviour();
  }
}
Program: 89342
Project: 89342
Buggy source:
/** 
 * Helper method to check the actioned upon node reference to decide to execute the action The preconditions are: - The node must exist - The node must not be frozen
 * @param actionedUponNodeRef node reference
 * @return Return true if the node reference passes all the preconditions for executing the action, false otherwise
 */
private boolean eligibleForAction(NodeRef actionedUponNodeRef){
  boolean result=false;
  if (nodeService.exists(actionedUponNodeRef) && freezeService.isFrozen(actionedUponNodeRef) == false) {
    result=true;
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Helper method to check the actioned upon node reference to decide to execute the action The preconditions are: - The node must exist - The node must not be frozen
 * @param actionedUponNodeRef node reference
 * @return Return true if the node reference passes all the preconditions for executing the action, false otherwise
 */
private boolean eligibleForAction(NodeRef actionedUponNodeRef){
  boolean result=false;
  if (nodeService.exists(actionedUponNodeRef) && !freezeService.isFrozen(actionedUponNodeRef)) {
    result=true;
  }
  return result;
}
Program: 89345
Project: 89345
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){
  if (nodeService.exists(actionedUponNodeRef) && (checkFrozen == false || freezeService.isFrozen(actionedUponNodeRef) == false)) {
    if (allowParameterSubstitutions) {
      parameterProcessorComponent.process(action,delegateActionExecuter.getActionDefinition(),actionedUponNodeRef);
    }
    delegateActionExecuter.execute(action,actionedUponNodeRef);
  }
}

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){
  if (nodeService.exists(actionedUponNodeRef) && (!checkFrozen || !freezeService.isFrozen(actionedUponNodeRef))) {
    if (allowParameterSubstitutions) {
      parameterProcessorComponent.process(action,delegateActionExecuter.getActionDefinition(),actionedUponNodeRef);
    }
    delegateActionExecuter.execute(action,actionedUponNodeRef);
  }
}
Program: 89346
Project: 89346
Buggy source:
/** 
 * @param action
 * @param actionedUponNodeRef
 * @return
 */
private NodeRef createOrResolveRecordFolder(Action action,NodeRef actionedUponNodeRef){
  NodeRef context=filePlanService.getFilePlan(actionedUponNodeRef);
  if (context == null) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
 else   if (nodeService.exists(context) == false) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
  String path=(String)action.getParameterValue(PARAM_PATH);
  String[] pathValues=ArrayUtils.EMPTY_STRING_ARRAY;
  if (path != null && path.isEmpty() == false) {
    pathValues=StringUtils.tokenizeToStringArray(path,"String_Node_Str",false,true);
  }
  boolean create=false;
  Boolean createValue=(Boolean)action.getParameterValue(PARAM_CREATE_RECORD_PATH);
  if (createValue != null) {
    create=createValue.booleanValue();
  }
  NodeRef recordFolder=resolvePath(context,pathValues);
  if (recordFolder == null) {
    if (create) {
      NodeRef parent=resolveParent(context,pathValues,create);
      if (parent == null) {
        throw new AlfrescoRuntimeException("String_Node_Str");
      }
      if (filePlanService.isRecordCategory(parent) == false) {
        throw new AlfrescoRuntimeException("String_Node_Str");
      }
      String recordFolderName=pathValues[pathValues.length - 1];
      recordFolder=recordFolderService.createRecordFolder(parent,recordFolderName);
    }
 else {
      throw new AlfrescoRuntimeException("String_Node_Str");
    }
  }
  return recordFolder;
}

Fixed version (ground truth):
/** 
 * @param action
 * @param actionedUponNodeRef
 * @return
 */
private NodeRef createOrResolveRecordFolder(Action action,NodeRef actionedUponNodeRef){
  NodeRef context=filePlanService.getFilePlan(actionedUponNodeRef);
  if (context == null) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
 else   if (!nodeService.exists(context)) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
  String path=(String)action.getParameterValue(PARAM_PATH);
  String[] pathValues=ArrayUtils.EMPTY_STRING_ARRAY;
  if (path != null && !path.isEmpty()) {
    pathValues=StringUtils.tokenizeToStringArray(path,"String_Node_Str",false,true);
  }
  boolean create=false;
  Boolean createValue=(Boolean)action.getParameterValue(PARAM_CREATE_RECORD_PATH);
  if (createValue != null) {
    create=createValue.booleanValue();
  }
  NodeRef recordFolder=resolvePath(context,pathValues);
  if (recordFolder == null) {
    if (create) {
      NodeRef parent=resolveParent(context,pathValues,create);
      if (parent == null) {
        throw new AlfrescoRuntimeException("String_Node_Str");
      }
      if (!filePlanService.isRecordCategory(parent)) {
        throw new AlfrescoRuntimeException("String_Node_Str");
      }
      String recordFolderName=pathValues[pathValues.length - 1];
      recordFolder=recordFolderService.createRecordFolder(parent,recordFolderName);
    }
 else {
      throw new AlfrescoRuntimeException("String_Node_Str");
    }
  }
  return recordFolder;
}
Program: 89347
Project: 89347
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(final Action action,final NodeRef actionedUponNodeRef){
  if (nodeService.exists(actionedUponNodeRef) && freezeService.isFrozen(actionedUponNodeRef) == false && recordService.isFiled(actionedUponNodeRef) == false) {
    NodeRef recordFolder=(NodeRef)action.getParameterValue(PARAM_DESTINATION_RECORD_FOLDER);
    if (recordFolder == null) {
      recordFolder=createOrResolveRecordFolder(action,actionedUponNodeRef);
    }
    if (recordFolder == null) {
      throw new AlfrescoRuntimeException("String_Node_Str");
    }
    if (recordFolderService.isRecordFolder(recordFolder)) {
      final NodeRef finalRecordFolder=recordFolder;
      AuthenticationUtil.runAsSystem(new RunAsWork<Void>(){
        @Override public Void doWork() throws Exception {
          try {
            fileFolderService.move(actionedUponNodeRef,finalRecordFolder,null);
          }
 catch (          FileNotFoundException fileNotFound) {
            throw new AlfrescoRuntimeException("String_Node_Str",fileNotFound);
          }
          return null;
        }
      }
);
    }
 else {
      throw new AlfrescoRuntimeException("String_Node_Str");
    }
  }
}

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(final Action action,final NodeRef actionedUponNodeRef){
  if (nodeService.exists(actionedUponNodeRef) && !freezeService.isFrozen(actionedUponNodeRef) && !recordService.isFiled(actionedUponNodeRef)) {
    NodeRef recordFolder=(NodeRef)action.getParameterValue(PARAM_DESTINATION_RECORD_FOLDER);
    if (recordFolder == null) {
      recordFolder=createOrResolveRecordFolder(action,actionedUponNodeRef);
    }
    if (recordFolder == null) {
      throw new AlfrescoRuntimeException("String_Node_Str");
    }
    if (recordFolderService.isRecordFolder(recordFolder)) {
      final NodeRef finalRecordFolder=recordFolder;
      AuthenticationUtil.runAsSystem(new RunAsWork<Void>(){
        @Override public Void doWork() throws Exception {
          try {
            fileFolderService.move(actionedUponNodeRef,finalRecordFolder,null);
          }
 catch (          FileNotFoundException fileNotFound) {
            throw new AlfrescoRuntimeException("String_Node_Str",fileNotFound);
          }
          return null;
        }
      }
);
    }
 else {
      throw new AlfrescoRuntimeException("String_Node_Str");
    }
  }
}
Program: 89348
Project: 89348
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){
  if (nodeService.exists(actionedUponNodeRef) && nodeService.hasAspect(actionedUponNodeRef,ContentModel.ASPECT_PENDING_DELETE) == false && (recordService.isRecord(actionedUponNodeRef) || recordFolderService.isRecordFolder(actionedUponNodeRef)) && freezeService.isFrozen(actionedUponNodeRef) == false) {
    freezeService.freeze((String)action.getParameterValue(PARAM_REASON),actionedUponNodeRef);
  }
}

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){
  if (nodeService.exists(actionedUponNodeRef) && !nodeService.hasAspect(actionedUponNodeRef,ContentModel.ASPECT_PENDING_DELETE) && (recordService.isRecord(actionedUponNodeRef) || recordFolderService.isRecordFolder(actionedUponNodeRef))&& !freezeService.isFrozen(actionedUponNodeRef)) {
    freezeService.freeze((String)action.getParameterValue(PARAM_REASON),actionedUponNodeRef);
  }
}
Program: 89349
Project: 89349
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){
  if (nodeService.exists(actionedUponNodeRef) && freezeService.isFrozen(actionedUponNodeRef) == false) {
    if (recordService.isRecord(actionedUponNodeRef)) {
      ChildAssociationRef assocRef=nodeService.getPrimaryParent(actionedUponNodeRef);
      if (assocRef != null) {
        actionedUponNodeRef=assocRef.getParentRef();
      }
    }
    if (recordFolderService.isRecordFolder(actionedUponNodeRef)) {
      Boolean isClosed=(Boolean)nodeService.getProperty(actionedUponNodeRef,PROP_IS_CLOSED);
      if (Boolean.TRUE.equals(isClosed)) {
        nodeService.setProperty(actionedUponNodeRef,PROP_IS_CLOSED,false);
      }
    }
 else {
      if (logger.isWarnEnabled()) {
        logger.warn(I18NUtil.getMessage(MSG_NO_OPEN_RECORD_FOLDER,actionedUponNodeRef.toString()));
      }
    }
  }
}

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){
  if (nodeService.exists(actionedUponNodeRef) && !freezeService.isFrozen(actionedUponNodeRef)) {
    if (recordService.isRecord(actionedUponNodeRef)) {
      ChildAssociationRef assocRef=nodeService.getPrimaryParent(actionedUponNodeRef);
      if (assocRef != null) {
        actionedUponNodeRef=assocRef.getParentRef();
      }
    }
    if (recordFolderService.isRecordFolder(actionedUponNodeRef)) {
      Boolean isClosed=(Boolean)nodeService.getProperty(actionedUponNodeRef,PROP_IS_CLOSED);
      if (Boolean.TRUE.equals(isClosed)) {
        nodeService.setProperty(actionedUponNodeRef,PROP_IS_CLOSED,false);
      }
    }
 else {
      if (logger.isWarnEnabled()) {
        logger.warn(I18NUtil.getMessage(MSG_NO_OPEN_RECORD_FOLDER,actionedUponNodeRef.toString()));
      }
    }
  }
}
Program: 89350
Project: 89350
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){
  if (nodeService.exists(actionedUponNodeRef) && freezeService.isFrozen(actionedUponNodeRef) == false && nodeService.getProperty(actionedUponNodeRef,PROP_RECORD_ORIGINATING_LOCATION) != null) {
    recordService.rejectRecord(actionedUponNodeRef,(String)action.getParameterValue(PARAM_REASON));
  }
}

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){
  if (nodeService.exists(actionedUponNodeRef) && !freezeService.isFrozen(actionedUponNodeRef) && nodeService.getProperty(actionedUponNodeRef,PROP_RECORD_ORIGINATING_LOCATION) != null) {
    recordService.rejectRecord(actionedUponNodeRef,(String)action.getParameterValue(PARAM_REASON));
  }
}
Program: 89351
Project: 89351
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){
  if (nodeService.exists(actionedUponNodeRef) && nodeService.hasAspect(actionedUponNodeRef,ContentModel.ASPECT_PENDING_DELETE) == false && recordService.isRecord(actionedUponNodeRef) && recordService.isDeclared(actionedUponNodeRef) == false) {
    String workflowDefinitionId=workflowService.getDefinitionByName(REQUEST_INFO_WORKFLOW_DEFINITION_NAME).getId();
    Map<QName,Serializable> parameters=new HashMap<QName,Serializable>();
    parameters.put(WorkflowModel.ASSOC_PACKAGE,getWorkflowPackage(action,actionedUponNodeRef));
    parameters.put(RMWorkflowModel.RM_MIXED_ASSIGNEES,getAssignees(action));
    parameters.put(RMWorkflowModel.RM_REQUESTED_INFORMATION,getRequestedInformation(action));
    parameters.put(RMWorkflowModel.RM_RULE_CREATOR,getRuleCreator(action));
    workflowService.startWorkflow(workflowDefinitionId,parameters);
  }
 else {
    logger.info("String_Node_Str" + actionedUponNodeRef.toString() + "String_Node_Str");
  }
}

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){
  if (nodeService.exists(actionedUponNodeRef) && !nodeService.hasAspect(actionedUponNodeRef,ContentModel.ASPECT_PENDING_DELETE) && recordService.isRecord(actionedUponNodeRef)&& !recordService.isDeclared(actionedUponNodeRef)) {
    String workflowDefinitionId=workflowService.getDefinitionByName(REQUEST_INFO_WORKFLOW_DEFINITION_NAME).getId();
    Map<QName,Serializable> parameters=new HashMap<QName,Serializable>();
    parameters.put(WorkflowModel.ASSOC_PACKAGE,getWorkflowPackage(action,actionedUponNodeRef));
    parameters.put(RMWorkflowModel.RM_MIXED_ASSIGNEES,getAssignees(action));
    parameters.put(RMWorkflowModel.RM_REQUESTED_INFORMATION,getRequestedInformation(action));
    parameters.put(RMWorkflowModel.RM_RULE_CREATOR,getRuleCreator(action));
    workflowService.startWorkflow(workflowDefinitionId,parameters);
  }
 else {
    logger.info("String_Node_Str" + actionedUponNodeRef.toString() + "String_Node_Str");
  }
}
Program: 89353
Project: 89353
Buggy source:
/** 
 * Checks if the actioned upon node reference is a sub class of transfer
 * @param actionedUponNodeRef actioned upon node reference
 */
private void checkTransferSubClass(NodeRef actionedUponNodeRef){
  QName type=nodeService.getType(actionedUponNodeRef);
  if (dictionaryService.isSubClass(type,TYPE_TRANSFER) == false) {
    throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NODE_NOT_TRANSFER));
  }
}

Fixed version (ground truth):
/** 
 * Checks if the actioned upon node reference is a sub class of transfer
 * @param actionedUponNodeRef actioned upon node reference
 */
private void checkTransferSubClass(NodeRef actionedUponNodeRef){
  QName type=nodeService.getType(actionedUponNodeRef);
  if (!dictionaryService.isSubClass(type,TYPE_TRANSFER)) {
    throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NODE_NOT_TRANSFER));
  }
}
Program: 89355
Project: 89355
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){
  if (nodeService.exists(actionedUponNodeRef)) {
    if (recordService.isRecord(actionedUponNodeRef)) {
      if (recordService.isDeclared(actionedUponNodeRef) && freezeService.isFrozen(actionedUponNodeRef) == false) {
        this.nodeService.removeAspect(actionedUponNodeRef,ASPECT_DECLARED_RECORD);
      }
    }
 else {
      if (logger.isWarnEnabled()) {
        logger.warn(I18NUtil.getMessage(MSG_RECORDS_ONLY_UNDECLARED));
      }
    }
  }
}

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){
  if (nodeService.exists(actionedUponNodeRef)) {
    if (recordService.isRecord(actionedUponNodeRef)) {
      if (recordService.isDeclared(actionedUponNodeRef) && !freezeService.isFrozen(actionedUponNodeRef)) {
        this.nodeService.removeAspect(actionedUponNodeRef,ASPECT_DECLARED_RECORD);
      }
    }
 else {
      if (logger.isWarnEnabled()) {
        logger.warn(I18NUtil.getMessage(MSG_RECORDS_ONLY_UNDECLARED));
      }
    }
  }
}
Program: 89356
Project: 89356
Buggy source:
/** 
 * @param da
 * @param nodeRef
 */
private void updateEventEigible(DispositionAction da){
  List<EventCompletionDetails> events=da.getEventCompletionDetails();
  boolean eligible=false;
  if (da.getDispositionActionDefinition().eligibleOnFirstCompleteEvent() == false) {
    eligible=true;
    for (    EventCompletionDetails event : events) {
      if (event.isEventComplete() == false) {
        eligible=false;
        break;
      }
    }
  }
 else {
    for (    EventCompletionDetails event : events) {
      if (event.isEventComplete()) {
        eligible=true;
        break;
      }
    }
  }
  this.nodeService.setProperty(da.getNodeRef(),PROP_DISPOSITION_EVENTS_ELIGIBLE,eligible);
}

Fixed version (ground truth):
/** 
 * @param da
 * @param nodeRef
 */
private void updateEventEigible(DispositionAction da){
  List<EventCompletionDetails> events=da.getEventCompletionDetails();
  boolean eligible=false;
  if (!da.getDispositionActionDefinition().eligibleOnFirstCompleteEvent()) {
    eligible=true;
    for (    EventCompletionDetails event : events) {
      if (!event.isEventComplete()) {
        eligible=false;
        break;
      }
    }
  }
 else {
    for (    EventCompletionDetails event : events) {
      if (event.isEventComplete()) {
        eligible=true;
        break;
      }
    }
  }
  this.nodeService.setProperty(da.getNodeRef(),PROP_DISPOSITION_EVENTS_ELIGIBLE,eligible);
}
Program: 89358
Project: 89358
Buggy source:
private M2Model readCustomContentModel(NodeRef modelNodeRef){
  ContentReader reader=this.contentService.getReader(modelNodeRef,ContentModel.TYPE_CONTENT);
  if (reader.exists() == false) {
    throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CUSTOM_MODEL_NO_CONTENT,modelNodeRef.toString()));
  }
  InputStream contentIn=null;
  M2Model deserializedModel=null;
  try {
    contentIn=reader.getContentInputStream();
    deserializedModel=M2Model.createModel(contentIn);
  }
  finally {
    try {
      if (contentIn != null) {
        contentIn.close();
      }
    }
 catch (    IOException ignored) {
    }
  }
  return deserializedModel;
}

Fixed version (ground truth):
private M2Model readCustomContentModel(NodeRef modelNodeRef){
  ContentReader reader=this.contentService.getReader(modelNodeRef,ContentModel.TYPE_CONTENT);
  if (!reader.exists()) {
    throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CUSTOM_MODEL_NO_CONTENT,modelNodeRef.toString()));
  }
  InputStream contentIn=null;
  M2Model deserializedModel=null;
  try {
    contentIn=reader.getContentInputStream();
    deserializedModel=M2Model.createModel(contentIn);
  }
  finally {
    try {
      if (contentIn != null) {
        contentIn.close();
      }
    }
 catch (    IOException ignored) {
    }
  }
  return deserializedModel;
}
Program: 89359
Project: 89359
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService#getCustomisable(org.alfresco.service.cmr.repository.NodeRef)
 */
@Override public Set<QName> getCustomisable(NodeRef nodeRef){
  Set<QName> result=new HashSet<QName>(5);
  QName type=nodeService.getType(nodeRef);
  while (type != null && ContentModel.TYPE_CMOBJECT.equals(type) == false) {
    if (isCustomisable(type)) {
      result.add(type);
    }
    TypeDefinition def=dictionaryService.getType(type);
    if (def != null) {
      type=def.getParentName();
    }
 else {
      type=null;
    }
  }
  Set<QName> aspects=nodeService.getAspects(nodeRef);
  for (  QName aspect : aspects) {
    QName tempAspect=QName.createQName(aspect.toString());
    while (tempAspect != null) {
      if (isCustomisable(tempAspect)) {
        result.add(tempAspect);
      }
      AspectDefinition aspectDef=dictionaryService.getAspect(tempAspect);
      if (aspectDef != null) {
        tempAspect=aspectDef.getParentName();
      }
 else {
        tempAspect=null;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService#getCustomisable(org.alfresco.service.cmr.repository.NodeRef)
 */
@Override public Set<QName> getCustomisable(NodeRef nodeRef){
  Set<QName> result=new HashSet<QName>(5);
  QName type=nodeService.getType(nodeRef);
  while (type != null && !ContentModel.TYPE_CMOBJECT.equals(type)) {
    if (isCustomisable(type)) {
      result.add(type);
    }
    TypeDefinition def=dictionaryService.getType(type);
    if (def != null) {
      type=def.getParentName();
    }
 else {
      type=null;
    }
  }
  Set<QName> aspects=nodeService.getAspects(nodeRef);
  for (  QName aspect : aspects) {
    QName tempAspect=QName.createQName(aspect.toString());
    while (tempAspect != null) {
      if (isCustomisable(tempAspect)) {
        result.add(tempAspect);
      }
      AspectDefinition aspectDef=dictionaryService.getAspect(tempAspect);
      if (aspectDef != null) {
        tempAspect=aspectDef.getParentName();
      }
 else {
        tempAspect=null;
      }
    }
  }
  return result;
}