nus-yam/ex-repair huggingface dataset:
Program: 89361
Project: 89361
Buggy source:
public void changeCustomConstraintValues(QName constraintName,List<String> newAllowedValues){
  ParameterCheck.mandatory("String_Node_Str",constraintName);
  ParameterCheck.mandatory("String_Node_Str",newAllowedValues);
  NodeRef modelRef=getCustomModelRef(constraintName.getNamespaceURI());
  M2Model deserializedModel=readCustomContentModel(modelRef);
  String constraintNameAsPrefixString=constraintName.toPrefixString(namespaceService);
  M2Constraint customConstraint=deserializedModel.getConstraint(constraintNameAsPrefixString);
  if (customConstraint == null) {
    throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CANNOT_FIND_CONSTRAINT,constraintNameAsPrefixString));
  }
  String type=customConstraint.getType();
  if (type == null || (type.equals(CUSTOM_CONSTRAINT_TYPE) == false && type.equals(CAPATIBILITY_CUSTOM_CONTRAINT_TYPE) == false)) {
    throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_UNEXPECTED_TYPE_CONSTRAINT,type,constraintNameAsPrefixString,CUSTOM_CONSTRAINT_TYPE));
  }
  customConstraint.removeParameter(PARAM_ALLOWED_VALUES);
  customConstraint.createParameter(PARAM_ALLOWED_VALUES,newAllowedValues);
  writeCustomContentModel(modelRef,deserializedModel);
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + constraintNameAsPrefixString + "String_Node_Str"+ newAllowedValues.size()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public void changeCustomConstraintValues(QName constraintName,List<String> newAllowedValues){
  ParameterCheck.mandatory("String_Node_Str",constraintName);
  ParameterCheck.mandatory("String_Node_Str",newAllowedValues);
  NodeRef modelRef=getCustomModelRef(constraintName.getNamespaceURI());
  M2Model deserializedModel=readCustomContentModel(modelRef);
  String constraintNameAsPrefixString=constraintName.toPrefixString(namespaceService);
  M2Constraint customConstraint=deserializedModel.getConstraint(constraintNameAsPrefixString);
  if (customConstraint == null) {
    throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CANNOT_FIND_CONSTRAINT,constraintNameAsPrefixString));
  }
  String type=customConstraint.getType();
  if (type == null || (!type.equals(CUSTOM_CONSTRAINT_TYPE) && !type.equals(CAPATIBILITY_CUSTOM_CONTRAINT_TYPE))) {
    throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_UNEXPECTED_TYPE_CONSTRAINT,type,constraintNameAsPrefixString,CUSTOM_CONSTRAINT_TYPE));
  }
  customConstraint.removeParameter(PARAM_ALLOWED_VALUES);
  customConstraint.createParameter(PARAM_ALLOWED_VALUES,newAllowedValues);
  writeCustomContentModel(modelRef,deserializedModel);
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + constraintNameAsPrefixString + "String_Node_Str"+ newAllowedValues.size()+ "String_Node_Str");
  }
}
Program: 89362
Project: 89362
Buggy source:
/** 
 * Make sure any custom property aspects are applied to newly created nodes.
 * @see org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy#onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
 */
@Override @Behaviour(kind=BehaviourKind.CLASS,isService=true,notificationFrequency=NotificationFrequency.FIRST_EVENT) public void onCreateNode(final ChildAssociationRef childAssocRef){
  AuthenticationUtil.runAs(new RunAsWork<Void>(){
    @Override public Void doWork() throws Exception {
      if (dictionaryService.getAllModels().contains(RecordsManagementCustomModel.RM_CUSTOM_MODEL)) {
        NodeRef nodeRef=childAssocRef.getChildRef();
        QName type=nodeService.getType(nodeRef);
        while (type != null && ContentModel.TYPE_CMOBJECT.equals(type) == false) {
          if (isCustomisable(type)) {
            QName customPropertyAspect=getCustomAspect(type);
            nodeService.addAspect(nodeRef,customPropertyAspect,null);
          }
          TypeDefinition def=dictionaryService.getType(type);
          if (def != null) {
            type=def.getParentName();
          }
 else {
            type=null;
          }
        }
      }
      return null;
    }
  }
,AuthenticationUtil.getSystemUserName());
}

Fixed version (ground truth):
/** 
 * Make sure any custom property aspects are applied to newly created nodes.
 * @see org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy#onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
 */
@Override @Behaviour(kind=BehaviourKind.CLASS,isService=true,notificationFrequency=NotificationFrequency.FIRST_EVENT) public void onCreateNode(final ChildAssociationRef childAssocRef){
  AuthenticationUtil.runAs(new RunAsWork<Void>(){
    @Override public Void doWork() throws Exception {
      if (dictionaryService.getAllModels().contains(RecordsManagementCustomModel.RM_CUSTOM_MODEL)) {
        NodeRef nodeRef=childAssocRef.getChildRef();
        QName type=nodeService.getType(nodeRef);
        while (type != null && !ContentModel.TYPE_CMOBJECT.equals(type)) {
          if (isCustomisable(type)) {
            QName customPropertyAspect=getCustomAspect(type);
            nodeService.addAspect(nodeRef,customPropertyAspect,null);
          }
          TypeDefinition def=dictionaryService.getType(type);
          if (def != null) {
            type=def.getParentName();
          }
 else {
            type=null;
          }
        }
      }
      return null;
    }
  }
,AuthenticationUtil.getSystemUserName());
}
Program: 89364
Project: 89364
Buggy source:
@Override public int hashCode(){
  int var_code=(null == name ? 0 : name.hashCode());
  return 31 + var_code;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int varCode=(null == name ? 0 : name.hashCode());
  return 31 + varCode;
}
Program: 89365
Project: 89365
Buggy source:
/** 
 * This method examines the old and new property sets and for those properties which have changed, looks for script resources corresponding to those properties. Those scripts are then called via the ScriptService.
 * @param nodeWithChangedProperties the node whose properties have changed.
 * @param oldProps the old properties and their values.
 * @param newProps the new properties and their values.
 * @see #lookupScripts(Map<QName, Serializable>, Map<QName, Serializable>)
 */
private void lookupAndExecuteScripts(NodeRef nodeWithChangedProperties,Map<QName,Serializable> oldProps,Map<QName,Serializable> newProps){
  List<NodeRef> scriptRefs=lookupScripts(oldProps,newProps);
  Map<String,Object> objectModel=new HashMap<String,Object>(1);
  objectModel.put("String_Node_Str",nodeWithChangedProperties);
  objectModel.put("String_Node_Str",oldProps);
  objectModel.put("String_Node_Str",newProps);
  ;
  for (  NodeRef scriptRef : scriptRefs) {
    scriptService.executeScript(scriptRef,null,objectModel);
  }
}

Fixed version (ground truth):
/** 
 * This method examines the old and new property sets and for those properties which have changed, looks for script resources corresponding to those properties. Those scripts are then called via the ScriptService.
 * @param nodeWithChangedProperties the node whose properties have changed.
 * @param oldProps the old properties and their values.
 * @param newProps the new properties and their values.
 * @see #lookupScripts(Map<QName, Serializable>, Map<QName, Serializable>)
 */
private void lookupAndExecuteScripts(NodeRef nodeWithChangedProperties,Map<QName,Serializable> oldProps,Map<QName,Serializable> newProps){
  List<NodeRef> scriptRefs=lookupScripts(oldProps,newProps);
  Map<String,Object> objectModel=new HashMap<String,Object>(1);
  objectModel.put("String_Node_Str",nodeWithChangedProperties);
  objectModel.put("String_Node_Str",oldProps);
  objectModel.put("String_Node_Str",newProps);
  for (  NodeRef scriptRef : scriptRefs) {
    scriptService.executeScript(scriptRef,null,objectModel);
  }
}
Program: 89367
Project: 89367
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService#existsRole(java.lang.String)
 */
public boolean existsRole(final NodeRef rmRootNode,final String role){
  return AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Boolean>(){
    public Boolean doWork() throws Exception {
      String fullRoleName=authorityService.getName(AuthorityType.GROUP,getFullRoleName(role,rmRootNode));
      String zone=getZoneName(rmRootNode);
      Set<String> roles=authorityService.getAllAuthoritiesInZone(zone,AuthorityType.GROUP);
      return new Boolean(roles.contains(fullRoleName));
    }
  }
,AuthenticationUtil.getSystemUserName()).booleanValue();
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService#existsRole(java.lang.String)
 */
public boolean existsRole(final NodeRef rmRootNode,final String role){
  return AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Boolean>(){
    public Boolean doWork() throws Exception {
      String fullRoleName=authorityService.getName(AuthorityType.GROUP,getFullRoleName(role,rmRootNode));
      String zone=getZoneName(rmRootNode);
      Set<String> roles=authorityService.getAllAuthoritiesInZone(zone,AuthorityType.GROUP);
      return Boolean.valueOf(roles.contains(fullRoleName));
    }
  }
,AuthenticationUtil.getSystemUserName()).booleanValue();
}
Program: 89368
Project: 89368
Buggy source:
/** 
 * @see org.springframework.extensions.webscripts.DeclarativeWebScript#executeImpl(org.springframework.extensions.webscripts.WebScriptRequest,org.springframework.extensions.webscripts.Status,org.springframework.extensions.webscripts.Cache)
 */
@Override protected Map<String,Object> executeImpl(WebScriptRequest req,Status status,Cache cache){
  String siteName=req.getParameter(ARG_SITE_NAME);
  if (StringUtils.isBlank(siteName)) {
    siteName=RmSiteType.DEFAULT_SITE_NAME;
  }
  NodeRef filePlan=siteService.getContainer(siteName,RmSiteType.COMPONENT_DOCUMENT_LIBRARY);
  String unloadedOnlyParam=req.getParameter(ARG_UNLOADED_ONLY);
  boolean unloadedOnly=false;
  if (StringUtils.isNotBlank(unloadedOnlyParam)) {
    unloadedOnly=new Boolean(unloadedOnlyParam).booleanValue();
  }
  Map<String,DataSet> dataSets=dataSetService.getDataSets(filePlan,unloadedOnly);
  List<Map<String,String>> dataSetList=new ArrayList<Map<String,String>>(dataSets.size());
  for (  Map.Entry<String,DataSet> entry : dataSets.entrySet()) {
    Map<String,String> dataSet=new HashMap<String,String>(3);
    DataSet value=entry.getValue();
    String dataSetId=value.getId();
    String isLoaded=String.valueOf(dataSetService.isLoadedDataSet(filePlan,dataSetId));
    dataSet.put("String_Node_Str",value.getLabel());
    dataSet.put("String_Node_Str",dataSetId);
    dataSet.put("String_Node_Str",isLoaded);
    dataSetList.add(dataSet);
  }
  Map<String,Object> model=new HashMap<String,Object>(1);
  model.put("String_Node_Str",dataSetList);
  return model;
}

Fixed version (ground truth):
/** 
 * @see org.springframework.extensions.webscripts.DeclarativeWebScript#executeImpl(org.springframework.extensions.webscripts.WebScriptRequest,org.springframework.extensions.webscripts.Status,org.springframework.extensions.webscripts.Cache)
 */
@Override protected Map<String,Object> executeImpl(WebScriptRequest req,Status status,Cache cache){
  String siteName=req.getParameter(ARG_SITE_NAME);
  if (StringUtils.isBlank(siteName)) {
    siteName=RmSiteType.DEFAULT_SITE_NAME;
  }
  NodeRef filePlan=siteService.getContainer(siteName,RmSiteType.COMPONENT_DOCUMENT_LIBRARY);
  String unloadedOnlyParam=req.getParameter(ARG_UNLOADED_ONLY);
  boolean unloadedOnly=false;
  if (StringUtils.isNotBlank(unloadedOnlyParam)) {
    unloadedOnly=Boolean.valueOf(unloadedOnlyParam).booleanValue();
  }
  Map<String,DataSet> dataSets=dataSetService.getDataSets(filePlan,unloadedOnly);
  List<Map<String,String>> dataSetList=new ArrayList<Map<String,String>>(dataSets.size());
  for (  Map.Entry<String,DataSet> entry : dataSets.entrySet()) {
    Map<String,String> dataSet=new HashMap<String,String>(3);
    DataSet value=entry.getValue();
    String dataSetId=value.getId();
    String isLoaded=String.valueOf(dataSetService.isLoadedDataSet(filePlan,dataSetId));
    dataSet.put("String_Node_Str",value.getLabel());
    dataSet.put("String_Node_Str",dataSetId);
    dataSet.put("String_Node_Str",isLoaded);
    dataSetList.add(dataSet);
  }
  Map<String,Object> model=new HashMap<String,Object>(1);
  model.put("String_Node_Str",dataSetList);
  return model;
}
Program: 89369
Project: 89369
Buggy source:
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#init()
 */
@Override public void init(){
  if (this instanceof RecordsManagementAction == false) {
    super.init();
  }
  if (auditable == true) {
    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 == false) {
    super.init();
  }
  if (auditable) {
    getAuditService().registerAuditEvent(this.getActionDefinition().getName(),this.getActionDefinition().getTitle());
  }
}
Program: 89370
Project: 89370
Buggy source:
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#execute(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override public void execute(Action action,NodeRef actionedUponNodeRef){
  if (auditable == true) {
    if (auditedImmediately == true) {
      getAuditService().auditEvent(actionedUponNodeRef,this.getActionDefinition().getName(),null,null,true);
    }
 else {
      getAuditService().auditEvent(actionedUponNodeRef,this.getActionDefinition().getName());
    }
  }
  super.execute(action,actionedUponNodeRef);
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#execute(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override public void execute(Action action,NodeRef actionedUponNodeRef){
  if (auditable) {
    if (auditedImmediately) {
      getAuditService().auditEvent(actionedUponNodeRef,this.getActionDefinition().getName(),null,null,true);
    }
 else {
      getAuditService().auditEvent(actionedUponNodeRef,this.getActionDefinition().getName());
    }
  }
  super.execute(action,actionedUponNodeRef);
}
Program: 89371
Project: 89371
Buggy source:
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#execute(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override public void execute(Action action,NodeRef actionedUponNodeRef){
  if (allowParameterSubstitutions == true) {
    parameterProcessorComponent.process(action,getActionDefinition(),actionedUponNodeRef);
  }
  super.execute(action,actionedUponNodeRef);
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#execute(org.alfresco.service.cmr.action.Action,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override public void execute(Action action,NodeRef actionedUponNodeRef){
  if (allowParameterSubstitutions) {
    parameterProcessorComponent.process(action,getActionDefinition(),actionedUponNodeRef);
  }
  super.execute(action,actionedUponNodeRef);
}
Program: 89372
Project: 89372
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() == true) {
        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() == 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;
}
Program: 89374
Project: 89374
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) == true) {
    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) == 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;
}
Program: 89377
Project: 89377
Buggy source:
@Override public boolean evaluate(JSONObject jsonObject){
  if (indicator == null) {
    return false;
  }
  boolean result=false;
  try {
    JSONArray indicators=getRMIndicators(jsonObject);
    if (indicators != null) {
      if (indicators.contains(indicator)) {
        result=true;
      }
    }
  }
 catch (  Exception err) {
    throw new AlfrescoRuntimeException("String_Node_Str" + err);
  }
  return (result == expected);
}

Fixed version (ground truth):
@Override public boolean evaluate(JSONObject jsonObject){
  if (indicator == null) {
    return false;
  }
  boolean result=false;
  try {
    JSONArray indicators=getRMIndicators(jsonObject);
    if (indicators != null && indicators.contains(indicator)) {
      result=true;
    }
  }
 catch (  Exception err) {
    throw new AlfrescoRuntimeException("String_Node_Str" + err);
  }
  return (result == expected);
}
Program: 89378
Project: 89378
Buggy source:
/** 
 * Evaluate capability
 * @param nodeRef       node reference
 * @param aspectQName   aspect qname
 * @param properties    property values
 * @return 
 */
public int evaluate(NodeRef nodeRef,QName aspectQName,Map<QName,Serializable> properties){
  return evaluate(nodeRef);
}

Fixed version (ground truth):
/** 
 * Evaluate capability
 * @param nodeRef       node reference
 * @param aspectQName   aspect qname
 * @param properties    property values
 * @return
 */
public int evaluate(NodeRef nodeRef,QName aspectQName,Map<QName,Serializable> properties){
  return evaluate(nodeRef);
}
Program: 89379
Project: 89379
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#loadDataSet(java.lang.String,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override public void loadDataSet(NodeRef filePlan,String dataSetId){
  ParameterCheck.mandatory("String_Node_Str",filePlan);
  ParameterCheck.mandatoryString("String_Node_Str",dataSetId);
  DataSet dataSet=getDataSets().get(dataSetId);
  InputStream is=null;
  try {
    is=getClass().getClassLoader().getResourceAsStream(dataSet.getPath());
    if (is == null) {
      throw new AlfrescoRuntimeException("String_Node_Str" + dataSet.getLabel() + "String_Node_Str");
    }
    Reader viewReader=new InputStreamReader(is,charsetName);
    Location location=new Location(filePlan);
    importerService.importView(viewReader,location,null,null);
    patchLoadedData();
    setDataSetIdIntoFilePlan(dataSetId,filePlan);
  }
 catch (  Exception ex) {
    throw new RuntimeException("String_Node_Str",ex);
  }
 finally {
    if (is != null) {
      try {
        is.close();
        is=null;
      }
 catch (      IOException ex) {
        throw new RuntimeException("String_Node_Str",ex);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#loadDataSet(java.lang.String,org.alfresco.service.cmr.repository.NodeRef)
 */
@Override public void loadDataSet(NodeRef filePlan,String dataSetId){
  ParameterCheck.mandatory("String_Node_Str",filePlan);
  ParameterCheck.mandatoryString("String_Node_Str",dataSetId);
  DataSet dataSet=getDataSets().get(dataSetId);
  InputStream is=null;
  try {
    is=getClass().getClassLoader().getResourceAsStream(dataSet.getPath());
    if (is == null) {
      throw new AlfrescoRuntimeException("String_Node_Str" + dataSet.getLabel() + "String_Node_Str");
    }
    Reader viewReader=new InputStreamReader(is,CHARSET_NAME);
    Location location=new Location(filePlan);
    importerService.importView(viewReader,location,null,null);
    patchLoadedData();
    setDataSetIdIntoFilePlan(dataSetId,filePlan);
  }
 catch (  Exception ex) {
    throw new RuntimeException("String_Node_Str",ex);
  }
 finally {
    if (is != null) {
      try {
        is.close();
        is=null;
      }
 catch (      IOException ex) {
        throw new RuntimeException("String_Node_Str",ex);
      }
    }
  }
}
Program: 89381
Project: 89381
Buggy source:
@Override public Map<String,Object> executeImpl(WebScriptRequest req,Status status,Cache cache){
  Map<String,Object> model=new HashMap<String,Object>();
  List<AspectDefinition> customTypeAspectDefinitions=new ArrayList<AspectDefinition>(4);
  for (  QName aspectQName : customTypeAspects) {
    AspectDefinition nextAspectDef=dictionaryService.getAspect(aspectQName);
    customTypeAspectDefinitions.add(nextAspectDef);
  }
  model.put("String_Node_Str",customTypeAspectDefinitions);
  return model;
}

Fixed version (ground truth):
@Override public Map<String,Object> executeImpl(WebScriptRequest req,Status status,Cache cache){
  Map<String,Object> model=new HashMap<String,Object>();
  List<AspectDefinition> customTypeAspectDefinitions=new ArrayList<AspectDefinition>(4);
  for (  QName aspectQName : CUSTOM_TYPE_ASPECTS) {
    AspectDefinition nextAspectDef=dictionaryService.getAspect(aspectQName);
    customTypeAspectDefinitions.add(nextAspectDef);
  }
  model.put("String_Node_Str",customTypeAspectDefinitions);
  return model;
}
Program: 89382
Project: 89382
Buggy source:
@Override protected Map<String,Object> executeImpl(WebScriptRequest req,Status status,Cache cache){
  Map<String,Object> model=new HashMap<String,Object>(1);
  boolean extended=false;
  String result="String_Node_Str";
  String nodeRef=req.getParameter(PARAM_NODEREF);
  if (nodeRef == null || nodeRef.length() == 0) {
    String type=req.getParameter(PARAM_TYPE);
    if (type != null && type.length() != 0 && type.indexOf(':') != -1) {
      Matcher m=qnamePattern.matcher(type);
      if (m.matches() == true) {
        QName qname=QName.createQName(type,namespaceService);
        FilePlanComponentKind kind=filePlanService.getFilePlanComponentKindFromType(qname);
        if (kind != null) {
          result=kind.toString();
        }
      }
    }
  }
 else {
    if (nodeRef.indexOf(':') != -1) {
      Matcher m=nodeRefPattern.matcher(nodeRef);
      if (m.matches()) {
        NodeRef nodeRefObj=new NodeRef(nodeRef);
        FilePlanComponentKind kind=filePlanService.getFilePlanComponentKind(nodeRefObj);
        if (kind != null) {
          result=kind.toString();
        }
        String extendedValue=req.getParameter(PARAM_EXTENDED);
        if (extendedValue != null && extendedValue.length() != 0) {
          extended=Boolean.parseBoolean(extendedValue);
          if (extended == true) {
            model.put("String_Node_Str",getAspects(nodeRefObj));
          }
        }
      }
    }
  }
  model.put("String_Node_Str",result);
  model.put("String_Node_Str",extended);
  return model;
}

Fixed version (ground truth):
@Override protected Map<String,Object> executeImpl(WebScriptRequest req,Status status,Cache cache){
  Map<String,Object> model=new HashMap<String,Object>(1);
  boolean extended=false;
  String result="String_Node_Str";
  String nodeRef=req.getParameter(PARAM_NODEREF);
  if (nodeRef == null || nodeRef.length() == 0) {
    String type=req.getParameter(PARAM_TYPE);
    if (type != null && type.length() != 0 && type.indexOf(':') != -1) {
      Matcher m=QNAME_PATTERN.matcher(type);
      if (m.matches() == true) {
        QName qname=QName.createQName(type,namespaceService);
        FilePlanComponentKind kind=filePlanService.getFilePlanComponentKindFromType(qname);
        if (kind != null) {
          result=kind.toString();
        }
      }
    }
  }
 else {
    if (nodeRef.indexOf(':') != -1) {
      Matcher m=NODE_REF_PATTERN.matcher(nodeRef);
      if (m.matches()) {
        NodeRef nodeRefObj=new NodeRef(nodeRef);
        FilePlanComponentKind kind=filePlanService.getFilePlanComponentKind(nodeRefObj);
        if (kind != null) {
          result=kind.toString();
        }
        String extendedValue=req.getParameter(PARAM_EXTENDED);
        if (extendedValue != null && extendedValue.length() != 0) {
          extended=Boolean.parseBoolean(extendedValue);
          if (extended == true) {
            model.put("String_Node_Str",getAspects(nodeRefObj));
          }
        }
      }
    }
  }
  model.put("String_Node_Str",result);
  model.put("String_Node_Str",extended);
  return model;
}
Program: 89385
Project: 89385
Buggy source:
/** 
 * Creates a record from the given document
 * @param document the document from which a record will be created
 */
@Override public void makeRecord(NodeRef document){
  ParameterCheck.mandatory("String_Node_Str",document);
  ruleService.disableRules();
  try {
    String recordId=identifierService.generateIdentifier(ASPECT_RECORD,nodeService.getPrimaryParent(document).getParentRef());
    String name=(String)nodeService.getProperty(document,ContentModel.PROP_NAME);
    int dotIndex=name.lastIndexOf("String_Node_Str");
    String prefix=name;
    String postfix="String_Node_Str";
    if (dotIndex != -1) {
      prefix=name.substring(0,dotIndex);
      postfix=name.substring(dotIndex);
    }
    String recordName=prefix + "String_Node_Str" + recordId+ "String_Node_Str"+ postfix;
    fileFolderService.rename(document,recordName);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + name + "String_Node_Str"+ recordName);
    }
    Map<QName,Serializable> props=new HashMap<QName,Serializable>(2);
    props.put(PROP_IDENTIFIER,recordId);
    props.put(PROP_ORIGIONAL_NAME,name);
    nodeService.addAspect(document,RecordsManagementModel.ASPECT_RECORD,props);
  }
 catch (  FileNotFoundException e) {
    throw new AlfrescoRuntimeException("String_Node_Str",e);
  }
 finally {
    ruleService.enableRules();
  }
}

Fixed version (ground truth):
/** 
 * Creates a record from the given document
 * @param document the document from which a record will be created
 */
@Override public void makeRecord(NodeRef document){
  ParameterCheck.mandatory("String_Node_Str",document);
  ruleService.disableRules();
  try {
    String recordId=identifierService.generateIdentifier(ASPECT_RECORD,nodeService.getPrimaryParent(document).getParentRef());
    String name=(String)nodeService.getProperty(document,ContentModel.PROP_NAME);
    int dotIndex=name.lastIndexOf('.');
    String prefix=name;
    String postfix="String_Node_Str";
    if (dotIndex != -1) {
      prefix=name.substring(0,dotIndex);
      postfix=name.substring(dotIndex);
    }
    String recordName=prefix + "String_Node_Str" + recordId+ "String_Node_Str"+ postfix;
    fileFolderService.rename(document,recordName);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + name + "String_Node_Str"+ recordName);
    }
    Map<QName,Serializable> props=new HashMap<QName,Serializable>(2);
    props.put(PROP_IDENTIFIER,recordId);
    props.put(PROP_ORIGIONAL_NAME,name);
    nodeService.addAspect(document,RecordsManagementModel.ASPECT_RECORD,props);
  }
 catch (  FileNotFoundException e) {
    throw new AlfrescoRuntimeException("String_Node_Str",e);
  }
 finally {
    ruleService.enableRules();
  }
}
Program: 89386
Project: 89386
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() == true) {
      if (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() == true) {
          if (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 != 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;
}
Program: 89387
Project: 89387
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 == true) {
      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) == 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;
}
Program: 89388
Project: 89388
Buggy source:
/** 
 * @param context
 * @param pathValues
 * @param create      Create any missing path elements
 * @return
 */
private NodeRef resolveParent(NodeRef context,String[] pathValues,boolean create){
  NodeRef result=null;
  if (ArrayUtils.isEmpty(pathValues) == true) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
 else   if (pathValues.length == 1) {
    result=context;
  }
 else {
    pathValues=(String[])ArrayUtils.remove(pathValues,pathValues.length - 1);
    result=resolvePath(context,pathValues,create);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param context
 * @param pathValues
 * @param create      Create any missing path elements
 * @return
 */
private NodeRef resolveParent(NodeRef context,String[] pathValues,boolean create){
  NodeRef result=null;
  if (ArrayUtils.isEmpty(pathValues)) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
 else   if (pathValues.length == 1) {
    result=context;
  }
 else {
    pathValues=(String[])ArrayUtils.remove(pathValues,pathValues.length - 1);
    result=resolvePath(context,pathValues,create);
  }
  return result;
}
Program: 89389
Project: 89389
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) == true && freezeService.isFrozen(actionedUponNodeRef) == false) {
    if (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) == true) {
        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) == 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");
    }
  }
}
Program: 89390
Project: 89390
Buggy source:
/** 
 * @return              Returns <tt>true</tt> if the data is a NodeRef and it representsa fileplan component
 */
public boolean isSupported(Serializable data){
  if (data == null || !(data instanceof NodeRef)) {
    return false;
  }
  return nodeService.hasAspect((NodeRef)data,RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT);
}

Fixed version (ground truth):
/** 
 * @return              Returns <tt>true</tt> if the data is a NodeRef and it representsa fileplan component
 */
public boolean isSupported(Serializable data){
  if (!(data instanceof NodeRef)) {
    return false;
  }
  return nodeService.hasAspect((NodeRef)data,RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT);
}
Program: 89391
Project: 89391
Buggy source:
/** 
 * @return              Returns <tt>true</tt> if the data is a NodeRef and it representsa fileplan component
 */
public boolean isSupported(Serializable data){
  if (data == null || !(data instanceof NodeRef)) {
    return false;
  }
  return nodeService.hasAspect((NodeRef)data,RecordsManagementModel.ASPECT_RECORD_COMPONENT_ID);
}

Fixed version (ground truth):
/** 
 * @return              Returns <tt>true</tt> if the data is a NodeRef and it representsa fileplan component
 */
public boolean isSupported(Serializable data){
  if (!(data instanceof NodeRef)) {
    return false;
  }
  return nodeService.hasAspect((NodeRef)data,RecordsManagementModel.ASPECT_RECORD_COMPONENT_ID);
}
Program: 89392
Project: 89392
Buggy source:
/** 
 * @return              Returns <tt>true</tt> if the data is a NodeRef and it representsa fileplan component
 */
public boolean isSupported(Serializable data){
  if (data == null || !(data instanceof NodeRef)) {
    return false;
  }
  return nodeService.hasAspect((NodeRef)data,RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT);
}

Fixed version (ground truth):
/** 
 * @return              Returns <tt>true</tt> if the data is a NodeRef and it representsa fileplan component
 */
public boolean isSupported(Serializable data){
  if (!(data instanceof NodeRef)) {
    return false;
  }
  return nodeService.hasAspect((NodeRef)data,RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT);
}
Program: 89393
Project: 89393
Buggy source:
/** 
 * @return              Returns <tt>true</tt> if the data is a NodeRef and it representsa fileplan component
 */
public boolean isSupported(Serializable data){
  if (data == null || !(data instanceof NodeRef)) {
    return false;
  }
  return nodeService.hasAspect((NodeRef)data,RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT);
}

Fixed version (ground truth):
/** 
 * @return              Returns <tt>true</tt> if the data is a NodeRef and it representsa fileplan component
 */
public boolean isSupported(Serializable data){
  if (!(data instanceof NodeRef)) {
    return false;
  }
  return nodeService.hasAspect((NodeRef)data,RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT);
}
Program: 89394
Project: 89394
Buggy source:
/** 
 * Constructor 
 * @param services
 * @param dispositionActionNodeRef
 */
public DispositionActionImpl(RecordsManagementServiceRegistry services,NodeRef dispositionActionNodeRef){
  this.services=services;
  this.dispositionNodeRef=dispositionActionNodeRef;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param services
 * @param dispositionActionNodeRef
 */
public DispositionActionImpl(RecordsManagementServiceRegistry services,NodeRef dispositionActionNodeRef){
  this.services=services;
  this.dispositionNodeRef=dispositionActionNodeRef;
}
Program: 89395
Project: 89395
Buggy source:
/** 
 * Helper method to deal with boolean values
 * @param value
 * @param defaultValue
 * @return
 */
private boolean getBooleanValue(Object value,boolean defaultValue){
  boolean result=defaultValue;
  if (value != null && value instanceof Boolean) {
    result=((Boolean)value).booleanValue();
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Helper method to deal with boolean values
 * @param value
 * @param defaultValue
 * @return
 */
private boolean getBooleanValue(Object value,boolean defaultValue){
  boolean result=defaultValue;
  if (value instanceof Boolean) {
    result=((Boolean)value).booleanValue();
  }
  return result;
}
Program: 89396
Project: 89396
Buggy source:
/** 
 * Ensure that the user only updates record properties that they have permission to.
 * @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)
 */
@Override @Behaviour(name="String_Node_Str",kind=BehaviourKind.CLASS,type="String_Node_Str") public void onUpdateProperties(final NodeRef nodeRef,final Map<QName,Serializable> before,final Map<QName,Serializable> after){
  if (AuthenticationUtil.getFullyAuthenticatedUser() != null && AuthenticationUtil.isRunAsUserTheSystemUser() == false && nodeService.exists(nodeRef) && isRecord(nodeRef)) {
    for (    QName property : after.keySet()) {
      Serializable beforeValue=null;
      if (before != null) {
        beforeValue=before.get(property);
      }
      Serializable afterValue=null;
      if (after != null) {
        afterValue=after.get(property);
      }
      boolean propertyUnchanged=false;
      if (beforeValue != null && afterValue != null && beforeValue instanceof Date && afterValue instanceof Date) {
        propertyUnchanged=(((Date)beforeValue).compareTo((Date)afterValue) == 0);
      }
 else {
        propertyUnchanged=EqualsHelper.nullSafeEquals(beforeValue,afterValue);
      }
      if (propertyUnchanged == false && isPropertyEditable(nodeRef,property) == false) {
        throw new ModelAccessDeniedException("String_Node_Str" + AuthenticationUtil.getFullyAuthenticatedUser() + "String_Node_Str"+ property.toString()+ "String_Node_Str"+ nodeRef.toString());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Ensure that the user only updates record properties that they have permission to.
 * @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)
 */
@Override @Behaviour(name="String_Node_Str",kind=BehaviourKind.CLASS,type="String_Node_Str") public void onUpdateProperties(final NodeRef nodeRef,final Map<QName,Serializable> before,final Map<QName,Serializable> after){
  if (AuthenticationUtil.getFullyAuthenticatedUser() != null && AuthenticationUtil.isRunAsUserTheSystemUser() == false && nodeService.exists(nodeRef) && isRecord(nodeRef)) {
    for (    QName property : after.keySet()) {
      Serializable beforeValue=null;
      if (before != null) {
        beforeValue=before.get(property);
      }
      Serializable afterValue=null;
      if (after != null) {
        afterValue=after.get(property);
      }
      boolean propertyUnchanged=false;
      if (beforeValue instanceof Date && afterValue instanceof Date) {
        propertyUnchanged=(((Date)beforeValue).compareTo((Date)afterValue) == 0);
      }
 else {
        propertyUnchanged=EqualsHelper.nullSafeEquals(beforeValue,afterValue);
      }
      if (propertyUnchanged == false && isPropertyEditable(nodeRef,property) == false) {
        throw new ModelAccessDeniedException("String_Node_Str" + AuthenticationUtil.getFullyAuthenticatedUser() + "String_Node_Str"+ property.toString()+ "String_Node_Str"+ nodeRef.toString());
      }
    }
  }
}