nus-yam/ex-repair huggingface dataset:
Program: 89274
Project: 89274
Buggy source:
/** 
 * Action click on edit rule button
 * @return {@link RmCreateRulePage}
 */
public RmCreateRulePage clickEditButton(){
  click(EDIT_BUTTON);
  HtmlPage page=drone.getCurrentPage();
  Assert.assertEquals(RmCreateRulePage.class.getSimpleName(),page.getClass().getSimpleName());
  return page.render();
}

Fixed version (ground truth):
/** 
 * Action click on edit rule button
 * @return {@link RmCreateRulePage}
 */
public RmCreateRulePage clickEditButton(){
  click(EDIT_BUTTON);
  HtmlPage page=drone.getCurrentPage();
  return page.render();
}
Program: 89277
Project: 89277
Buggy source:
/** 
 * Verify if item is a record. Part of Records management module, when a document is a record a small banner info is displayed indicating that it is a record.
 * @return <code>true</code> if record banner is visible <code>false</code> otherwise
 */
public boolean isRecord(){
  try {
    return find(BANNER).isDisplayed();
  }
 catch (  NoSuchElementException e) {
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Verify if item is a record. Part of Records management module, when a document is a record a small banner info is displayed indicating that it is a record.
 * @return <code>true</code> if record banner is visible <code>false</code> otherwise
 */
public boolean isRecord(){
  try {
    return drone.find(BANNER).isDisplayed();
  }
 catch (  NoSuchElementException e) {
  }
  return false;
}
Program: 89278
Project: 89278
Buggy source:
/** 
 * Action of selecting the declare records button that appear in the action drop down.
 * @return {@link HtmlPage}
 */
public HtmlPage declareRecord(){
  selectMoreAction().click();
  try {
    WebElement createRecord=drone.find(CREATE_RECORD);
    createRecord.click();
  }
 catch (  NoSuchElementException nse) {
    throw new PageOperationException("String_Node_Str",nse);
  }
  canResume();
  return FactorySharePage.resolvePage(drone);
}

Fixed version (ground truth):
/** 
 * Action of selecting the declare records button that appear in the action drop down.
 * @return {@link HtmlPage}
 */
public HtmlPage declareRecord(){
  selectMoreAction().click();
  try {
    WebElement createRecord=drone.find(CREATE_RECORD);
    createRecord.click();
  }
 catch (  NoSuchElementException nse) {
    throw new PageOperationException("String_Node_Str",nse);
  }
  return FactorySharePage.resolvePage(drone);
}
Program: 89279
Project: 89279
Buggy source:
/** 
 * Checks if File plan link is displayed.
 * @return <code>true</code> if displayed <code>false</code> otherwise
 */
public boolean isFilePlanDisplayed(){
  try {
    WebElement filePlanButton=find(FILE_PLAN);
    String label=filePlanButton.getText();
    String filePlan="String_Node_Str";
    if (StringUtils.isNotBlank(label) && filePlan.equalsIgnoreCase(label.trim())) {
      return true;
    }
  }
 catch (  NoSuchElementException e) {
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if File plan link is displayed.
 * @return <code>true</code> if displayed <code>false</code> otherwise
 */
public boolean isFilePlanDisplayed(){
  try {
    WebElement filePlanButton=drone.find(FILE_PLAN);
    String label=filePlanButton.getText();
    String filePlan="String_Node_Str";
    if (StringUtils.isNotBlank(label) && filePlan.equalsIgnoreCase(label.trim())) {
      return true;
    }
  }
 catch (  NoSuchElementException e) {
  }
  return false;
}
Program: 89280
Project: 89280
Buggy source:
/** 
 * Constructor
 * @param drone                 web drone
 * @param fileDirectoryInfo     file directory information 
 */
public RecordInfo(WebDrone drone,FileDirectoryInfo fileDirectoryInfo){
  this.drone=drone;
  this.fileDirectoryInfo=fileDirectoryInfo;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param drone                 web drone
 * @param fileDirectoryInfo     file directory information
 */
public RecordInfo(WebDrone drone,FileDirectoryInfo fileDirectoryInfo){
  this.drone=drone;
  this.fileDirectoryInfo=fileDirectoryInfo;
}
Program: 89281
Project: 89281
Buggy source:
/** 
 * Helper method to indicate whether an action is visible or not.
 * @param action    action selector
 * @return boolean  true if visible, false otherwise
 */
private boolean isVisibleAction(By action){
  fileDirectoryInfo.selectMoreAction().click();
  try {
    WebElement link=((FileDirectoryInfoImpl)fileDirectoryInfo).find(action);
    return link.isDisplayed();
  }
 catch (  NoSuchElementException e) {
    return false;
  }
catch (  TimeoutException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Helper method to indicate whether an action is visible or not.
 * @param action    action selector
 * @return boolean  true if visible, false otherwise
 */
private boolean isVisibleAction(By action){
  fileDirectoryInfo.selectMoreAction().click();
  try {
    WebElement link=drone.find(action);
    return link.isDisplayed();
  }
 catch (  NoSuchElementException e) {
    return false;
  }
catch (  TimeoutException e) {
    return false;
  }
}
Program: 89282
Project: 89282
Buggy source:
/** 
 * Action renders to RM site
 */
public FilePlanPage openRmSite(){
  drone.navigateTo(shareUrl + "String_Node_Str");
  FilePlanPage filePlanPage=(FilePlanPage)rmSiteDashBoard.selectFilePlan();
  return new FilePlanPage(drone).render();
}

Fixed version (ground truth):
/** 
 * Action renders to RM site
 */
public FilePlanPage openRmSite(){
  drone.navigateTo(shareUrl + "String_Node_Str");
  return (FilePlanPage)rmSiteDashBoard.selectFilePlan();
}
Program: 89283
Project: 89283
Buggy source:
/** 
 * Helper method to convert a stream to a string.
 * @param is    input stream
 * @return {@link String}   string
 * @throws IOException
 */
public String convertStreamToString(InputStream is) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  StringBuilder sb=new StringBuilder();
  String line=null;
  try {
    while ((line=reader.readLine()) != null) {
      sb.append(line + "String_Node_Str");
    }
  }
  finally {
    try {
      is.close();
    }
 catch (    IOException e) {
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Helper method to convert a stream to a string.
 * @param is    input stream
 * @return {@link String}   string
 * @throws IOException
 */
public String convertStreamToString(InputStream is) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(is,Charset.forName("String_Node_Str")));
  StringBuilder sb=new StringBuilder();
  String line=null;
  try {
    while ((line=reader.readLine()) != null) {
      sb.append(line + "String_Node_Str");
    }
  }
  finally {
    try {
      is.close();
    }
 catch (    IOException e) {
    }
  }
  return sb.toString();
}
Program: 89286
Project: 89286
Buggy source:
/** 
 * Indicates whether the given node reference is a hold or not. <p> Exposed publicly in the   {@link HoldService}
 * @param nodeRef   node reference
 * @return boolean  true if rma:hold or sub-type, false otherwise
 */
public boolean isHold(NodeRef nodeRef){
  ParameterCheck.mandatory("String_Node_Str",nodeRef);
  if (nodeService.exists(nodeRef) && instanceOf(nodeRef,TYPE_HOLD)) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Indicates whether the given node reference is a hold or not. <p> Exposed publicly in the   {@link HoldService}
 * @param nodeRef   node reference
 * @return boolean  true if rma:hold or sub-type, false otherwise
 */
public boolean isHold(NodeRef nodeRef){
  ParameterCheck.mandatory("String_Node_Str",nodeRef);
  boolean isHold=false;
  if (nodeService.exists(nodeRef) && instanceOf(nodeRef,TYPE_HOLD)) {
    isHold=true;
  }
  return isHold;
}
Program: 89287
Project: 89287
Buggy source:
/** 
 * This method converts a Map of String, Serializable to a Map of QName, Serializable. To do this, it assumes that each parameter name is a String representing a qname of the form prefix:localName.
 */
private Map<QName,Serializable> getPropertyValues(Action action){
  Map<String,Serializable> paramValues=action.getParameterValues();
  Map<QName,Serializable> result=new HashMap<QName,Serializable>(paramValues.size());
  for (  String paramName : paramValues.keySet()) {
    QName propQName=QName.createQName(paramName,this.namespaceService);
    result.put(propQName,paramValues.get(paramName));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * This method converts a Map of String, Serializable to a Map of QName, Serializable. To do this, it assumes that each parameter name is a String representing a qname of the form prefix:localName.
 */
private Map<QName,Serializable> getPropertyValues(Action action){
  Map<String,Serializable> paramValues=action.getParameterValues();
  Map<QName,Serializable> result=new HashMap<QName,Serializable>(paramValues.size());
  for (  Map.Entry<String,Serializable> entry : paramValues.entrySet()) {
    QName propQName=QName.createQName(entry.getKey(),this.namespaceService);
    result.put(propQName,entry.getValue());
  }
  return result;
}
Program: 89288
Project: 89288
Buggy source:
@Override protected synchronized List<ParameterDefinition> getParameterDefintions(){
  if (this.parameterDefinitions == null) {
    AspectDefinition aspectDefinition=dictionaryService.getAspect(customTypeAspect);
    if (aspectDefinition == null) {
      throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CUSTOM_ASPECT_NOT_RECOGNISED,customTypeAspect));
    }
    Map<QName,PropertyDefinition> props=aspectDefinition.getProperties();
    this.parameterDefinitions=new ArrayList<ParameterDefinition>(props.size());
    for (    QName qn : props.keySet()) {
      String paramName=qn.toPrefixString(namespaceService);
      QName paramType=props.get(qn).getDataType().getName();
      boolean paramIsMandatory=props.get(qn).isMandatory();
      parameterDefinitions.add(new ParameterDefinitionImpl(paramName,paramType,paramIsMandatory,null));
    }
  }
  return parameterDefinitions;
}

Fixed version (ground truth):
@Override protected synchronized List<ParameterDefinition> getParameterDefintions(){
  if (this.parameterDefinitions == null) {
    AspectDefinition aspectDefinition=dictionaryService.getAspect(customTypeAspect);
    if (aspectDefinition == null) {
      throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CUSTOM_ASPECT_NOT_RECOGNISED,customTypeAspect));
    }
    Map<QName,PropertyDefinition> props=aspectDefinition.getProperties();
    this.parameterDefinitions=new ArrayList<ParameterDefinition>(props.size());
    for (    Map.Entry<QName,PropertyDefinition> entry : props.entrySet()) {
      String paramName=entry.getKey().toPrefixString(namespaceService);
      PropertyDefinition value=entry.getValue();
      QName paramType=value.getDataType().getName();
      boolean paramIsMandatory=value.isMandatory();
      parameterDefinitions.add(new ParameterDefinitionImpl(paramName,paramType,paramIsMandatory,null));
    }
  }
  return parameterDefinitions;
}
Program: 89289
Project: 89289
Buggy source:
static Map<String,List<String>> getPivot(Map<String,List<String>> source){
  Map<String,List<String>> pivot=new HashMap<String,List<String>>();
  for (  String authority : source.keySet()) {
    List<String> values=source.get(authority);
    for (    String value : values) {
      if (pivot.containsKey(value)) {
        List<String> list=pivot.get(value);
        list.add(authority);
      }
 else {
        List<String> list=new ArrayList<String>();
        list.add(authority);
        pivot.put(value,list);
      }
    }
  }
  return pivot;
}

Fixed version (ground truth):
static Map<String,List<String>> getPivot(Map<String,List<String>> source){
  Map<String,List<String>> pivot=new HashMap<String,List<String>>();
  for (  Map.Entry<String,List<String>> entry : source.entrySet()) {
    List<String> values=entry.getValue();
    for (    String value : values) {
      String authority=entry.getKey();
      if (pivot.containsKey(value)) {
        List<String> list=pivot.get(value);
        list.add(authority);
      }
 else {
        List<String> list=new ArrayList<String>();
        list.add(authority);
        pivot.put(value,list);
      }
    }
  }
  return pivot;
}
Program: 89290
Project: 89290
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.email.CustomEmailMappingService#getCustomMappings()
 */
public Set<CustomMapping> getCustomMappings(){
  if (customMappings == null) {
    if (nodeService.exists(CONFIG_NODE_REF)) {
      customMappings=loadConfig();
    }
 else {
      customMappings=new HashSet<CustomMapping>();
      Map<String,Set<QName>> currentMapping=extracter.getCurrentMapping();
      for (      String key : currentMapping.keySet()) {
        Set<QName> set=currentMapping.get(key);
        for (        QName qname : set) {
          CustomMapping value=new CustomMapping();
          value.setFrom(key);
          QName resolvedQname=qname.getPrefixedQName(nspr);
          value.setTo(resolvedQname.toPrefixString());
          customMappings.add(value);
        }
      }
      NodeRef oldConfigNode=getOldConfigNode();
      if (oldConfigNode != null) {
        Set<CustomMapping> oldMappings=readOldConfig(oldConfigNode);
        customMappings.addAll(oldMappings);
      }
      for (      CustomMapping mapping : DEFAULT_MAPPINGS) {
        customMappings.add(mapping);
      }
      saveConfig(customMappings);
    }
  }
  return customMappings;
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.email.CustomEmailMappingService#getCustomMappings()
 */
public Set<CustomMapping> getCustomMappings(){
  if (customMappings == null) {
    if (nodeService.exists(CONFIG_NODE_REF)) {
      customMappings=loadConfig();
    }
 else {
      customMappings=new HashSet<CustomMapping>();
      Map<String,Set<QName>> currentMapping=extracter.getCurrentMapping();
      for (      Map.Entry<String,Set<QName>> entry : currentMapping.entrySet()) {
        Set<QName> set=entry.getValue();
        for (        QName qname : set) {
          CustomMapping value=new CustomMapping();
          value.setFrom(entry.getKey());
          QName resolvedQname=qname.getPrefixedQName(nspr);
          value.setTo(resolvedQname.toPrefixString());
          customMappings.add(value);
        }
      }
      NodeRef oldConfigNode=getOldConfigNode();
      if (oldConfigNode != null) {
        Set<CustomMapping> oldMappings=readOldConfig(oldConfigNode);
        customMappings.addAll(oldMappings);
      }
      for (      CustomMapping mapping : DEFAULT_MAPPINGS) {
        customMappings.add(mapping);
      }
      saveConfig(customMappings);
    }
  }
  return customMappings;
}
Program: 89291
Project: 89291
Buggy source:
/** 
 * This method compares the oldProps map against the newProps map and returns a set of QNames of the properties that have changed. Changed here means one of <ul> <li>the property has been removed</li> <li>the property has had its value changed</li> <li>the property has been added</li> </ul>
 */
private Set<QName> determineChangedProps(Map<QName,Serializable> oldProps,Map<QName,Serializable> newProps){
  Set<QName> result=new HashSet<QName>();
  for (  QName qn : oldProps.keySet()) {
    if (newProps.get(qn) == null || !newProps.get(qn).equals(oldProps.get(qn))) {
      result.add(qn);
    }
  }
  for (  QName qn : newProps.keySet()) {
    if (oldProps.get(qn) == null) {
      result.add(qn);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * This method compares the oldProps map against the newProps map and returns a set of QNames of the properties that have changed. Changed here means one of <ul> <li>the property has been removed</li> <li>the property has had its value changed</li> <li>the property has been added</li> </ul>
 */
private Set<QName> determineChangedProps(Map<QName,Serializable> oldProps,Map<QName,Serializable> newProps){
  Set<QName> result=new HashSet<QName>();
  for (  Map.Entry<QName,Serializable> entry : oldProps.entrySet()) {
    QName qn=entry.getKey();
    if (newProps.get(qn) == null || !newProps.get(qn).equals(entry.getValue())) {
      result.add(qn);
    }
  }
  for (  QName qn : newProps.keySet()) {
    if (oldProps.get(qn) == null) {
      result.add(qn);
    }
  }
  return result;
}
Program: 89292
Project: 89292
Buggy source:
/** 
 * @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)
 */
@Override @Behaviour(kind=BehaviourKind.CLASS,isService=true,name="String_Node_Str") public void onUpdateProperties(NodeRef nodeRef,Map<QName,Serializable> before,Map<QName,Serializable> after){
  if (enabled && AuthenticationUtil.getFullyAuthenticatedUser() != null && !AuthenticationUtil.isRunAsUserTheSystemUser() && nodeService.exists(nodeRef)) {
    for (    QName property : after.keySet()) {
      if (isProtectedProperty(property)) {
        if (before == null || before.isEmpty() || before.get(property) == null) {
          return;
        }
        if (!EqualsHelper.nullSafeEquals(before.get(property),after.get(property)) && !canEditProtectedProperty(nodeRef,property)) {
          throw new ModelAccessDeniedException("String_Node_Str" + AuthenticationUtil.getFullyAuthenticatedUser() + "String_Node_Str"+ property.toPrefixString(namespaceService)+ "String_Node_Str"+ nodeRef.toString());
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)
 */
@Override @Behaviour(kind=BehaviourKind.CLASS,isService=true,name="String_Node_Str") public void onUpdateProperties(NodeRef nodeRef,Map<QName,Serializable> before,Map<QName,Serializable> after){
  if (enabled && AuthenticationUtil.getFullyAuthenticatedUser() != null && !AuthenticationUtil.isRunAsUserTheSystemUser() && nodeService.exists(nodeRef)) {
    for (    Map.Entry<QName,Serializable> entry : after.entrySet()) {
      QName property=entry.getKey();
      if (isProtectedProperty(property)) {
        if (before == null || before.isEmpty() || before.get(property) == null) {
          return;
        }
        if (!EqualsHelper.nullSafeEquals(before.get(property),entry.getValue()) && !canEditProtectedProperty(nodeRef,property)) {
          throw new ModelAccessDeniedException("String_Node_Str" + AuthenticationUtil.getFullyAuthenticatedUser() + "String_Node_Str"+ property.toPrefixString(namespaceService)+ "String_Node_Str"+ nodeRef.toString());
        }
      }
    }
  }
}
Program: 89293
Project: 89293
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() && 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 && !isPropertyEditable(nodeRef,property)) {
        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() && nodeService.exists(nodeRef) && isRecord(nodeRef)) {
    for (    Map.Entry<QName,Serializable> entry : after.entrySet()) {
      Serializable beforeValue=null;
      QName property=entry.getKey();
      if (before != null) {
        beforeValue=before.get(property);
      }
      Serializable afterValue=entry.getValue();
      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 && !isPropertyEditable(nodeRef,property)) {
        throw new ModelAccessDeniedException("String_Node_Str" + AuthenticationUtil.getFullyAuthenticatedUser() + "String_Node_Str"+ property.toString()+ "String_Node_Str"+ nodeRef.toString());
      }
    }
  }
}
Program: 89295
Project: 89295
Buggy source:
/** 
 * Process the supplied map of property definitions and add the ones that match the supplied fragment to the list of suggestions.
 * @param definition  Definition (aspect or type) to get properties of and the call this method for associated aspects
 * @param substitutionFragment  Substitution fragment to search for
 * @param suggestions  The current list of suggestions to which we will add newly found suggestions
 */
private boolean processPropertyDefinitions(Map<QName,PropertyDefinition> properties,String substitutionFragment,Set<String> suggestions){
  boolean gotMaximumSuggestions=false;
  if (properties != null) {
    for (    QName key : properties.keySet()) {
      PropertyDefinition propertyDefinition=properties.get(key);
      QName type=propertyDefinition.getDataType().getName();
      if (ArrayUtils.contains(supportedDataTypes,type)) {
        String suggestion=getName() + "String_Node_Str" + key.getPrefixString();
        if (suggestion.toLowerCase().contains(substitutionFragment)) {
          if (suggestions.size() < this.maximumNumberSuggestions) {
            suggestions.add(suggestion);
          }
 else {
            gotMaximumSuggestions=true;
            break;
          }
        }
      }
    }
  }
  return gotMaximumSuggestions;
}

Fixed version (ground truth):
/** 
 * Process the supplied map of property definitions and add the ones that match the supplied fragment to the list of suggestions.
 * @param definition  Definition (aspect or type) to get properties of and the call this method for associated aspects
 * @param substitutionFragment  Substitution fragment to search for
 * @param suggestions  The current list of suggestions to which we will add newly found suggestions
 */
private boolean processPropertyDefinitions(Map<QName,PropertyDefinition> properties,String substitutionFragment,Set<String> suggestions){
  boolean gotMaximumSuggestions=false;
  if (properties != null) {
    for (    Map.Entry<QName,PropertyDefinition> entry : properties.entrySet()) {
      PropertyDefinition propertyDefinition=entry.getValue();
      QName type=propertyDefinition.getDataType().getName();
      if (ArrayUtils.contains(supportedDataTypes,type)) {
        String suggestion=getName() + "String_Node_Str" + entry.getKey().getPrefixString();
        if (suggestion.toLowerCase().contains(substitutionFragment)) {
          if (suggestions.size() < this.maximumNumberSuggestions) {
            suggestions.add(suggestion);
          }
 else {
            gotMaximumSuggestions=true;
            break;
          }
        }
      }
    }
  }
  return gotMaximumSuggestions;
}
Program: 89296
Project: 89296
Buggy source:
/** 
 * Helper method to remove system properties from maps
 * @param properties
 */
private void removeAuditProperties(List<String> ignoredAuditProperties,Map<QName,Serializable> before,Map<QName,Serializable> after){
  if (before != null) {
    before.keySet().removeAll(this.propertiesToBeRemoved);
  }
  if (after != null) {
    after.keySet().removeAll(this.propertiesToBeRemoved);
  }
}

Fixed version (ground truth):
/** 
 * Helper method to remove system properties from maps
 * @param properties
 */
private void removeAuditProperties(Map<QName,Serializable> before,Map<QName,Serializable> after){
  if (before != null) {
    before.keySet().removeAll(this.propertiesToBeRemoved);
  }
  if (after != null) {
    after.keySet().removeAll(this.propertiesToBeRemoved);
  }
}
Program: 89297
Project: 89297
Buggy source:
/** 
 * Helper method to build audit map
 * @param nodeRef
 * @param eventName
 * @return
 * @since 2.0.3
 */
private Map<String,Serializable> buildAuditMap(NodeRef nodeRef,String eventName,Map<QName,Serializable> propertiesBefore,Map<QName,Serializable> propertiesAfter,boolean removeOnNoPropertyChange){
  Map<String,Serializable> auditMap=new HashMap<String,Serializable>(13);
  auditMap.put(AuditApplication.buildPath(RM_AUDIT_SNIPPET_EVENT,RM_AUDIT_SNIPPET_NAME),eventName);
  if (nodeRef != null) {
    auditMap.put(AuditApplication.buildPath(RM_AUDIT_SNIPPET_EVENT,RM_AUDIT_SNIPPET_NODE),nodeRef);
  }
  if (!ignoredAuditProperties.isEmpty()) {
    removeAuditProperties(ignoredAuditProperties,propertiesBefore,propertiesAfter);
  }
  Pair<Map<QName,Serializable>,Map<QName,Serializable>> deltaPair=PropertyMap.getBeforeAndAfterMapsForChanges(propertiesBefore,propertiesAfter);
  if (deltaPair.getFirst().isEmpty() && deltaPair.getSecond().isEmpty() && removeOnNoPropertyChange) {
    auditMap.clear();
  }
 else {
    auditMap.put(AuditApplication.buildPath(RM_AUDIT_SNIPPET_EVENT,RM_AUDIT_SNIPPET_NODE,RM_AUDIT_SNIPPET_CHANGES,RM_AUDIT_SNIPPET_BEFORE),(Serializable)deltaPair.getFirst());
    auditMap.put(AuditApplication.buildPath(RM_AUDIT_SNIPPET_EVENT,RM_AUDIT_SNIPPET_NODE,RM_AUDIT_SNIPPET_CHANGES,RM_AUDIT_SNIPPET_AFTER),(Serializable)deltaPair.getSecond());
  }
  return auditMap;
}

Fixed version (ground truth):
/** 
 * Helper method to build audit map
 * @param nodeRef
 * @param eventName
 * @return
 * @since 2.0.3
 */
private Map<String,Serializable> buildAuditMap(NodeRef nodeRef,String eventName,Map<QName,Serializable> propertiesBefore,Map<QName,Serializable> propertiesAfter,boolean removeOnNoPropertyChange){
  Map<String,Serializable> auditMap=new HashMap<String,Serializable>(13);
  auditMap.put(AuditApplication.buildPath(RM_AUDIT_SNIPPET_EVENT,RM_AUDIT_SNIPPET_NAME),eventName);
  if (nodeRef != null) {
    auditMap.put(AuditApplication.buildPath(RM_AUDIT_SNIPPET_EVENT,RM_AUDIT_SNIPPET_NODE),nodeRef);
  }
  if (!ignoredAuditProperties.isEmpty()) {
    removeAuditProperties(propertiesBefore,propertiesAfter);
  }
  Pair<Map<QName,Serializable>,Map<QName,Serializable>> deltaPair=PropertyMap.getBeforeAndAfterMapsForChanges(propertiesBefore,propertiesAfter);
  if (deltaPair.getFirst().isEmpty() && deltaPair.getSecond().isEmpty() && removeOnNoPropertyChange) {
    auditMap.clear();
  }
 else {
    auditMap.put(AuditApplication.buildPath(RM_AUDIT_SNIPPET_EVENT,RM_AUDIT_SNIPPET_NODE,RM_AUDIT_SNIPPET_CHANGES,RM_AUDIT_SNIPPET_BEFORE),(Serializable)deltaPair.getFirst());
    auditMap.put(AuditApplication.buildPath(RM_AUDIT_SNIPPET_EVENT,RM_AUDIT_SNIPPET_NODE,RM_AUDIT_SNIPPET_CHANGES,RM_AUDIT_SNIPPET_AFTER),(Serializable)deltaPair.getSecond());
  }
  return auditMap;
}
Program: 89298
Project: 89298
Buggy source:
/** 
 * @see org.alfresco.repo.jscript.app.JSONConversionComponent#setRootValues(org.alfresco.service.cmr.model.FileInfo,org.json.simple.JSONObject,boolean)
 */
@SuppressWarnings("String_Node_Str") @Override protected void setRootValues(FileInfo nodeInfo,JSONObject rootJSONObject,boolean useShortQNames){
  super.setRootValues(nodeInfo,rootJSONObject,useShortQNames);
  NodeRef nodeRef=nodeInfo.getNodeRef();
  if (AccessStatus.ALLOWED.equals(capabilityService.getCapabilityAccessState(nodeRef,RMPermissionModel.VIEW_RECORDS))) {
    boolean isFilePlanComponent=filePlanService.isFilePlanComponent(nodeInfo.getNodeRef());
    rootJSONObject.put("String_Node_Str",isFilePlanComponent);
    if (isFilePlanComponent) {
      rootJSONObject.put("String_Node_Str",setRmNodeValues(nodeRef,rootJSONObject,useShortQNames));
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.repo.jscript.app.JSONConversionComponent#setRootValues(org.alfresco.service.cmr.model.FileInfo,org.json.simple.JSONObject,boolean)
 */
@SuppressWarnings("String_Node_Str") @Override protected void setRootValues(FileInfo nodeInfo,JSONObject rootJSONObject,boolean useShortQNames){
  super.setRootValues(nodeInfo,rootJSONObject,useShortQNames);
  NodeRef nodeRef=nodeInfo.getNodeRef();
  if (AccessStatus.ALLOWED.equals(capabilityService.getCapabilityAccessState(nodeRef,RMPermissionModel.VIEW_RECORDS))) {
    boolean isFilePlanComponent=filePlanService.isFilePlanComponent(nodeInfo.getNodeRef());
    rootJSONObject.put("String_Node_Str",isFilePlanComponent);
    if (isFilePlanComponent) {
      rootJSONObject.put("String_Node_Str",setRmNodeValues(nodeRef,useShortQNames));
    }
  }
}
Program: 89299
Project: 89299
Buggy source:
/** 
 * @param nodeRef
 * @param rootJSONObject
 * @param useShortQName
 * @return
 */
@SuppressWarnings("String_Node_Str") private JSONObject setRmNodeValues(NodeRef nodeRef,JSONObject rootJSONObject,boolean useShortQName){
  JSONObject rmNodeValues=new JSONObject();
  rmNodeValues.put("String_Node_Str",getUIType(nodeRef));
  FilePlanComponentKind kind=filePlanService.getFilePlanComponentKind(nodeRef);
  rmNodeValues.put("String_Node_Str",kind.toString());
  NodeRef filePlan=filePlanService.getFilePlan(nodeRef);
  rmNodeValues.put("String_Node_Str",filePlan.toString());
  NodeRef unfiledRecordContainer=filePlanService.getUnfiledContainer(filePlan);
  if (unfiledRecordContainer != null) {
    rmNodeValues.put("String_Node_Str",unfiledRecordContainer.toString());
    rmNodeValues.put("String_Node_Str",propertiesToJSON(unfiledRecordContainer,nodeService.getProperties(unfiledRecordContainer),useShortQName));
    QName type=fileFolderService.getFileInfo(unfiledRecordContainer).getType();
    rmNodeValues.put("String_Node_Str",useShortQName ? type.toPrefixString(namespaceService) : type.toString());
  }
  setIndicators(rmNodeValues,nodeRef);
  setActions(rmNodeValues,nodeRef);
  return rmNodeValues;
}

Fixed version (ground truth):
/** 
 * @param nodeRef
 * @param useShortQName
 * @return
 */
@SuppressWarnings("String_Node_Str") private JSONObject setRmNodeValues(NodeRef nodeRef,boolean useShortQName){
  JSONObject rmNodeValues=new JSONObject();
  rmNodeValues.put("String_Node_Str",getUIType(nodeRef));
  FilePlanComponentKind kind=filePlanService.getFilePlanComponentKind(nodeRef);
  rmNodeValues.put("String_Node_Str",kind.toString());
  NodeRef filePlan=filePlanService.getFilePlan(nodeRef);
  rmNodeValues.put("String_Node_Str",filePlan.toString());
  NodeRef unfiledRecordContainer=filePlanService.getUnfiledContainer(filePlan);
  if (unfiledRecordContainer != null) {
    rmNodeValues.put("String_Node_Str",unfiledRecordContainer.toString());
    rmNodeValues.put("String_Node_Str",propertiesToJSON(unfiledRecordContainer,nodeService.getProperties(unfiledRecordContainer),useShortQName));
    QName type=fileFolderService.getFileInfo(unfiledRecordContainer).getType();
    rmNodeValues.put("String_Node_Str",useShortQName ? type.toPrefixString(namespaceService) : type.toString());
  }
  setIndicators(rmNodeValues,nodeRef);
  setActions(rmNodeValues,nodeRef);
  return rmNodeValues;
}
Program: 89300
Project: 89300
Buggy source:
@Override protected void executePatch() throws Throwable {
  if (nodeService.exists(RM_CONFIG_FOLDER) && !nodeService.exists(TEMPLATE_ROOT)) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    NodeRef templateRoot=createNode(ContentModel.TYPE_FOLDER,RM_CONFIG_FOLDER,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    NodeRef destructionTemplate=createNode(ContentModel.TYPE_CONTENT,templateRoot,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    nodeService.addAspect(destructionTemplate,ContentModel.ASPECT_TITLED,null);
    nodeService.addAspect(destructionTemplate,ContentModel.ASPECT_AUTHOR,null);
    ContentWriter writer=contentService.getWriter(destructionTemplate,ContentModel.PROP_CONTENT,true);
    InputStream is=getClass().getClassLoader().getResourceAsStream(PATH_DESTRUCTION_TEMPLATE);
    writer.setEncoding("String_Node_Str");
    writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
    writer.putContent(is);
  }
}

Fixed version (ground truth):
@Override protected void executePatch() throws Throwable {
  if (nodeService.exists(RM_CONFIG_FOLDER) && !nodeService.exists(TEMPLATE_ROOT)) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    NodeRef destructionTemplate=createNode(ContentModel.TYPE_CONTENT,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    nodeService.addAspect(destructionTemplate,ContentModel.ASPECT_TITLED,null);
    nodeService.addAspect(destructionTemplate,ContentModel.ASPECT_AUTHOR,null);
    ContentWriter writer=contentService.getWriter(destructionTemplate,ContentModel.PROP_CONTENT,true);
    InputStream is=getClass().getClassLoader().getResourceAsStream(PATH_DESTRUCTION_TEMPLATE);
    writer.setEncoding("String_Node_Str");
    writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
    writer.putContent(is);
  }
}
Program: 89301
Project: 89301
Buggy source:
private NodeRef createNode(QName type,NodeRef parent,String id,String name,String assocName,String title,String description){
  Map<QName,Serializable> props=new HashMap<QName,Serializable>(4);
  props.put(ContentModel.PROP_DESCRIPTION,description);
  props.put(ContentModel.PROP_TITLE,title);
  props.put(ContentModel.PROP_NAME,name);
  props.put(ContentModel.PROP_NODE_UUID,id);
  QName assocQName=QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,QName.createValidLocalName(assocName));
  return nodeService.createNode(RM_CONFIG_FOLDER,ContentModel.ASSOC_CONTAINS,assocQName,type,props).getChildRef();
}

Fixed version (ground truth):
private NodeRef createNode(QName type,String id,String name,String assocName,String title,String description){
  Map<QName,Serializable> props=new HashMap<QName,Serializable>(4);
  props.put(ContentModel.PROP_DESCRIPTION,description);
  props.put(ContentModel.PROP_TITLE,title);
  props.put(ContentModel.PROP_NAME,name);
  props.put(ContentModel.PROP_NODE_UUID,id);
  QName assocQName=QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,QName.createValidLocalName(assocName));
  return nodeService.createNode(RM_CONFIG_FOLDER,ContentModel.ASSOC_CONTAINS,assocQName,type,props).getChildRef();
}
Program: 89302
Project: 89302
Buggy source:
private boolean isAuthorityNameMatching(Set<String> authorities,String authorityName,AuthorityType type){
  boolean isMatching=false;
  if (type == null || AuthorityType.getAuthorityType(authorityName).equals(type) && !getAuthorityZones(authorityName).contains("String_Node_Str")) {
    isMatching=true;
  }
  return isMatching;
}

Fixed version (ground truth):
private boolean isAuthorityNameMatching(String authorityName,AuthorityType type){
  boolean isMatching=false;
  if (type == null || AuthorityType.getAuthorityType(authorityName).equals(type) && !getAuthorityZones(authorityName).contains("String_Node_Str")) {
    isMatching=true;
  }
  return isMatching;
}
Program: 89303
Project: 89303
Buggy source:
protected void addAuthorityNameIfMatches(Set<String> authorities,String authorityName,AuthorityType type,Pattern pattern){
  if (isAuthorityNameMatching(authorities,authorityName,type)) {
    if (pattern == null) {
      authorities.add(authorityName);
    }
 else {
      if (pattern.matcher(getShortName(authorityName)).matches()) {
        authorities.add(authorityName);
      }
 else {
        String displayName=getAuthorityDisplayName(authorityName);
        if (displayName != null && pattern.matcher(displayName).matches()) {
          authorities.add(authorityName);
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void addAuthorityNameIfMatches(Set<String> authorities,String authorityName,AuthorityType type,Pattern pattern){
  if (isAuthorityNameMatching(authorityName,type)) {
    if (pattern == null) {
      authorities.add(authorityName);
    }
 else {
      if (pattern.matcher(getShortName(authorityName)).matches()) {
        authorities.add(authorityName);
      }
 else {
        String displayName=getAuthorityDisplayName(authorityName);
        if (displayName != null && pattern.matcher(displayName).matches()) {
          authorities.add(authorityName);
        }
      }
    }
  }
}
Program: 89306
Project: 89306
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#getCustomReferencesTo(org.alfresco.service.cmr.repository.NodeRef)
 */
public List<AssociationRef> getCustomReferencesTo(NodeRef node){
  List<AssociationRef> retrievedAssocs=nodeService.getSourceAssocs(node,RegexQNamePattern.MATCH_ALL);
  return retrievedAssocs;
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#getCustomReferencesTo(org.alfresco.service.cmr.repository.NodeRef)
 */
public List<AssociationRef> getCustomReferencesTo(NodeRef node){
  return nodeService.getSourceAssocs(node,RegexQNamePattern.MATCH_ALL);
}
Program: 89307
Project: 89307
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#getCustomParentReferences(org.alfresco.service.cmr.repository.NodeRef)
 */
public List<ChildAssociationRef> getCustomParentReferences(NodeRef node){
  List<ChildAssociationRef> result=nodeService.getParentAssocs(node);
  return result;
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#getCustomParentReferences(org.alfresco.service.cmr.repository.NodeRef)
 */
public List<ChildAssociationRef> getCustomParentReferences(NodeRef node){
  return nodeService.getParentAssocs(node);
}
Program: 89308
Project: 89308
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#getCustomChildReferences(org.alfresco.service.cmr.repository.NodeRef)
 */
public List<ChildAssociationRef> getCustomChildReferences(NodeRef node){
  List<ChildAssociationRef> childAssocs=nodeService.getChildAssocs(node);
  return childAssocs;
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#getCustomChildReferences(org.alfresco.service.cmr.repository.NodeRef)
 */
public List<ChildAssociationRef> getCustomChildReferences(NodeRef node){
  return nodeService.getChildAssocs(node);
}
Program: 89309
Project: 89309
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#getCustomReferencesFrom(org.alfresco.service.cmr.repository.NodeRef)
 */
public List<AssociationRef> getCustomReferencesFrom(NodeRef node){
  List<AssociationRef> retrievedAssocs=nodeService.getTargetAssocs(node,RegexQNamePattern.MATCH_ALL);
  return retrievedAssocs;
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#getCustomReferencesFrom(org.alfresco.service.cmr.repository.NodeRef)
 */
public List<AssociationRef> getCustomReferencesFrom(NodeRef node){
  return nodeService.getTargetAssocs(node,RegexQNamePattern.MATCH_ALL);
}
Program: 89310
Project: 89310
Buggy source:
/** 
 * @param invocation
 * @param params
 * @param position
 * @return
 */
@SuppressWarnings("String_Node_Str") protected Serializable getProperty(MethodInvocation invocation,Class[] params,int position){
  if (invocation.getArguments()[position] == null) {
    return null;
  }
  if (Serializable.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null) {
    Serializable property=(Serializable)invocation.getArguments()[position];
    return property;
  }
  throw new ACLEntryVoterException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param invocation
 * @param params
 * @param position
 * @return
 */
@SuppressWarnings("String_Node_Str") protected Serializable getProperty(MethodInvocation invocation,Class[] params,int position){
  if (invocation.getArguments()[position] == null) {
    return null;
  }
  if (Serializable.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null) {
    return (Serializable)invocation.getArguments()[position];
  }
  throw new ACLEntryVoterException("String_Node_Str");
}
Program: 89311
Project: 89311
Buggy source:
/** 
 * @param invocation
 * @param params
 * @param position
 * @param parent
 * @return
 */
@SuppressWarnings("String_Node_Str") protected QName getType(MethodInvocation invocation,Class[] params,int position,boolean parent){
  if (QName.class.isAssignableFrom(params[position])) {
    if (invocation.getArguments()[position] != null) {
      QName qname=(QName)invocation.getArguments()[position];
      return qname;
    }
  }
 else   if (NodeRef.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null) {
    NodeRef nodeRef=(NodeRef)invocation.getArguments()[position];
    return nodeService.getType(nodeRef);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param invocation
 * @param params
 * @param position
 * @param parent
 * @return
 */
@SuppressWarnings("String_Node_Str") protected QName getType(MethodInvocation invocation,Class[] params,int position,boolean parent){
  if (QName.class.isAssignableFrom(params[position])) {
    if (invocation.getArguments()[position] != null) {
      return (QName)invocation.getArguments()[position];
    }
  }
 else   if (NodeRef.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null) {
    NodeRef nodeRef=(NodeRef)invocation.getArguments()[position];
    return nodeService.getType(nodeRef);
  }
  return null;
}
Program: 89312
Project: 89312
Buggy source:
/** 
 * @param invocation
 * @param params
 * @param position
 * @return
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected Map<QName,Serializable> getProperties(MethodInvocation invocation,Class[] params,int position){
  if (invocation.getArguments()[position] == null) {
    return null;
  }
  if (Map.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null) {
    Map<QName,Serializable> properties=(Map<QName,Serializable>)invocation.getArguments()[position];
    return properties;
  }
  throw new ACLEntryVoterException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param invocation
 * @param params
 * @param position
 * @return
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected Map<QName,Serializable> getProperties(MethodInvocation invocation,Class[] params,int position){
  if (invocation.getArguments()[position] == null) {
    return null;
  }
  if (Map.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null) {
    return (Map<QName,Serializable>)invocation.getArguments()[position];
  }
  throw new ACLEntryVoterException("String_Node_Str");
}
Program: 89313
Project: 89313
Buggy source:
/** 
 * @param invocation
 * @param params
 * @param position
 * @return
 */
@SuppressWarnings("String_Node_Str") protected QName getQName(MethodInvocation invocation,Class[] params,int position){
  if (QName.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null) {
    QName qname=(QName)invocation.getArguments()[position];
    return qname;
  }
  throw new ACLEntryVoterException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param invocation
 * @param params
 * @param position
 * @return
 */
@SuppressWarnings("String_Node_Str") protected QName getQName(MethodInvocation invocation,Class[] params,int position){
  if (QName.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null) {
    return (QName)invocation.getArguments()[position];
  }
  throw new ACLEntryVoterException("String_Node_Str");
}
Program: 89314
Project: 89314
Buggy source:
public String getName(){
  String xxx=info.getName().replace("String_Node_Str","String_Node_Str");
  return xxx;
}

Fixed version (ground truth):
public String getName(){
  return info.getName().replace("String_Node_Str","String_Node_Str");
}
Program: 89316
Project: 89316
Buggy source:
public ScriptConstraint createConstraint(String listName,String title,String[] allowedValues){
  if (listName != null) {
    listName=listName.replace("String_Node_Str","String_Node_Str");
  }
  RMConstraintInfo info=caveatConfigService.addRMConstraint(listName,title,allowedValues);
  ScriptConstraint c=new ScriptConstraint(info,caveatConfigService,getAuthorityService());
  return c;
}

Fixed version (ground truth):
public ScriptConstraint createConstraint(String listName,String title,String[] allowedValues){
  if (listName != null) {
    listName=listName.replace("String_Node_Str","String_Node_Str");
  }
  RMConstraintInfo info=caveatConfigService.addRMConstraint(listName,title,allowedValues);
  return new ScriptConstraint(info,caveatConfigService,getAuthorityService());
}
Program: 89317
Project: 89317
Buggy source:
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierGenerator#generateId(java.util.Map)
 */
@Override public String generateId(Map<String,Serializable> context){
  NodeRef nodeRef=(NodeRef)context.get(IdentifierService.CONTEXT_NODEREF);
  Long dbId=0l;
  if (nodeRef != null) {
    dbId=(Long)nodeService.getProperty(nodeRef,ContentModel.PROP_NODE_DBID);
  }
 else {
    dbId=System.currentTimeMillis();
  }
  Calendar fileCalendar=Calendar.getInstance();
  String year=Integer.toString(fileCalendar.get(Calendar.YEAR));
  String identifier=year + "String_Node_Str" + padString(dbId.toString(),10);
  return identifier;
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierGenerator#generateId(java.util.Map)
 */
@Override public String generateId(Map<String,Serializable> context){
  NodeRef nodeRef=(NodeRef)context.get(IdentifierService.CONTEXT_NODEREF);
  Long dbId=0l;
  if (nodeRef != null) {
    dbId=(Long)nodeService.getProperty(nodeRef,ContentModel.PROP_NODE_DBID);
  }
 else {
    dbId=System.currentTimeMillis();
  }
  Calendar fileCalendar=Calendar.getInstance();
  String year=Integer.toString(fileCalendar.get(Calendar.YEAR));
  return year + "String_Node_Str" + padString(dbId.toString(),10);
}
Program: 89318
Project: 89318
Buggy source:
@Override public boolean evaluate(JSONObject jsonObject){
  boolean result=super.evaluate(jsonObject);
  return !result;
}

Fixed version (ground truth):
@Override public boolean evaluate(JSONObject jsonObject){
  return !super.evaluate(jsonObject);
}