nus-yam/ex-repair huggingface dataset:
Program: 172215
Project: 172215
Buggy source:
/** 
 * Create CMISRendition by thumbnailNode and documentNode.
 * @param thumbnailNode thumbnail node reference
 * @param documentNode document node reference
 * @return CMISRendition
 */
private CMISRendition getRendition(NodeRef thumbnailNode,NodeRef documentNode){
  CMISRenditionImpl rendition=null;
  String thumbnailName=(String)nodeService.getProperty(thumbnailNode,ContentModel.PROP_THUMBNAIL_NAME);
  CMISRenditionKind kind=thumbnailNamesToKind.get(thumbnailName);
  if (thumbnailName != null && kind != null) {
    rendition=new CMISRenditionImpl();
    ContentData contentData=(ContentData)nodeService.getProperty(thumbnailNode,ContentModel.PROP_CONTENT);
    rendition.setNodeRef(thumbnailNode);
    rendition.setStreamId(thumbnailNode.toString());
    rendition.setRenditionDocumentId(documentNode.toString());
    rendition.setTitle(thumbnailName);
    rendition.setKind(kind);
    rendition.setMimeType(contentData.getMimetype());
    rendition.setLength((int)contentData.getSize());
    ImageResizeOptions imageAttributes=getImageAttributes(thumbnailName);
    if (imageAttributes != null) {
      rendition.setWidth(imageAttributes.getWidth());
      rendition.setHeight(imageAttributes.getHeight());
    }
  }
  return rendition;
}

Fixed version (ground truth):
/** 
 * Create CMISRendition by thumbnailNode and documentNode.
 * @param thumbnailNode thumbnail node reference
 * @param documentNode document node reference
 * @return CMISRendition
 */
private CMISRendition getRendition(NodeRef thumbnailNode,NodeRef documentNode){
  CMISRenditionImpl rendition=null;
  String thumbnailName=getThumbnailName(thumbnailNode);
  CMISRenditionKind kind=thumbnailNamesToKind.get(thumbnailName);
  if (thumbnailName != null && kind != null) {
    rendition=new CMISRenditionImpl();
    ContentData contentData=(ContentData)nodeService.getProperty(thumbnailNode,ContentModel.PROP_CONTENT);
    rendition.setNodeRef(thumbnailNode);
    rendition.setStreamId(thumbnailNode.toString());
    rendition.setRenditionDocumentId(documentNode.toString());
    rendition.setTitle(thumbnailName);
    rendition.setKind(kind);
    rendition.setMimeType(contentData.getMimetype());
    rendition.setLength((int)contentData.getSize());
    ImageResizeOptions imageAttributes=getImageAttributes(thumbnailName);
    if (imageAttributes != null) {
      rendition.setWidth(imageAttributes.getWidth());
      rendition.setHeight(imageAttributes.getHeight());
    }
  }
  return rendition;
}
Program: 172216
Project: 172216
Buggy source:
/** 
 * Set rendition kind mapping.
 * @param RenditionKind to Thumbnail Definition mapping
 */
public void setRenditionKindMapping(Map<String,List<String>> renditionKinds){
  this.kindToThumbnailNames=renditionKinds;
  for (  Entry<String,List<String>> entry : renditionKinds.entrySet()) {
    CMISRenditionKind kind=null;
    for (    CMISRenditionKind renditionKind : CMISRenditionKind.values()) {
      if (renditionKind.getLabel().equals(entry.getKey())) {
        kind=renditionKind;
      }
    }
    for (    String thumbnailName : entry.getValue()) {
      thumbnailNamesToKind.put(thumbnailName,kind);
    }
  }
}

Fixed version (ground truth):
/** 
 * Set rendition kind mapping.
 * @param RenditionKind to Thumbnail Definition mapping
 */
public void setRenditionKindMapping(Map<String,List<String>> renditionKinds){
  this.kindToThumbnailNames=renditionKinds;
  for (  Entry<String,List<String>> entry : renditionKinds.entrySet()) {
    CMISRenditionKind kind=CMISRenditionKind.valueOfLabel(entry.getKey());
    for (    String thumbnailName : entry.getValue()) {
      thumbnailNamesToKind.put(thumbnailName,kind);
    }
  }
}
Program: 172217
Project: 172217
Buggy source:
/** 
 * @see #initCacheManager()
 */
public void stop(){
synchronized (getClass()) {
    if (logger.isDebugEnabled()) {
      String[] caches=InternalEhCacheManagerFactoryBean.getInstance().getCacheNames();
      for (      String regionName : caches) {
        logger.debug("String_Node_Str" + regionName);
      }
    }
    InternalEhCacheManagerFactoryBean.getInstance().shutdown();
    initialized=false;
  }
}

Fixed version (ground truth):
/** 
 * @see #initCacheManager()
 */
public void stop(){
  if (Thread.currentThread().getName().contains("String_Node_Str")) {
    return;
  }
synchronized (getClass()) {
    if (logger.isDebugEnabled()) {
      String[] caches=InternalEhCacheManagerFactoryBean.getInstance().getCacheNames();
      for (      String regionName : caches) {
        logger.debug("String_Node_Str" + regionName);
      }
    }
    if (initialized) {
      InternalEhCacheManagerFactoryBean.getInstance().shutdown();
      initialized=false;
    }
  }
}
Program: 172218
Project: 172218
Buggy source:
/** 
 * This test method uses the RenditionService to render a test document (of type PDF) into a different format (of type application/x-shockwave-flash).
 */
public void testRenderPdfDocumentToFlash() throws Exception {
  this.setComplete();
  this.endTransaction();
  this.renditionNode=transactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>(){
    public NodeRef execute() throws Throwable {
      assertFalse("String_Node_Str",nodeService.hasAspect(nodeWithDocContent,RenditionModel.ASPECT_RENDITIONED));
      validateRenderingActionDefinition(ReformatRenderingEngine.NAME);
      RenditionDefinition action=makeReformatAction(null,MimetypeMap.MIMETYPE_FLASH);
      action.setParameterValue(ReformatRenderingEngine.PARAM_FLASH_VERSION,"String_Node_Str");
      ChildAssociationRef renditionAssoc=renditionService.render(nodeWithDocContent,action);
      assertEquals("String_Node_Str",nodeWithDocContent,renditionAssoc.getParentRef());
      validateRenditionAssociation(renditionAssoc,REFORMAT_RENDER_DEFN_NAME);
      assertEquals("String_Node_Str",1,nodeService.getParentAssocs(renditionNode).size());
      assertTrue("String_Node_Str",nodeService.hasAspect(nodeWithDocContent,RenditionModel.ASPECT_RENDITIONED));
      return renditionNode;
    }
  }
);
  assertNotNull("String_Node_Str",renditionNode);
}

Fixed version (ground truth):
/** 
 * This test method uses the RenditionService to render a test document (of type PDF) into a different format (of type application/x-shockwave-flash).
 */
public void testRenderPdfDocumentToFlash() throws Exception {
  this.setComplete();
  this.endTransaction();
  this.renditionNode=transactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>(){
    public NodeRef execute() throws Throwable {
      assertFalse("String_Node_Str",nodeService.hasAspect(nodeWithDocContent,RenditionModel.ASPECT_RENDITIONED));
      validateRenderingActionDefinition(ReformatRenderingEngine.NAME);
      RenditionDefinition action=makeReformatAction(null,MimetypeMap.MIMETYPE_FLASH);
      action.setParameterValue(ReformatRenderingEngine.PARAM_FLASH_VERSION,"String_Node_Str");
      ChildAssociationRef renditionAssoc=renditionService.render(nodeWithDocContent,action);
      assertEquals("String_Node_Str",nodeWithDocContent,renditionAssoc.getParentRef());
      validateRenditionAssociation(renditionAssoc,REFORMAT_RENDER_DEFN_NAME);
      assertEquals("String_Node_Str",1,nodeService.getParentAssocs(renditionAssoc.getChildRef()).size());
      assertTrue("String_Node_Str",nodeService.hasAspect(nodeWithDocContent,RenditionModel.ASPECT_RENDITIONED));
      return renditionAssoc.getChildRef();
    }
  }
);
  assertNotNull("String_Node_Str",renditionNode);
}
Program: 172219
Project: 172219
Buggy source:
/** 
 * Called during the transaction setup
 */
protected void onSetUpInTransaction() throws Exception {
  super.onSetUpInTransaction();
  this.transferService=(TransferService)this.applicationContext.getBean("String_Node_Str");
  this.contentService=(ContentService)this.applicationContext.getBean("String_Node_Str");
  this.searchService=(SearchService)this.applicationContext.getBean("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Called during the transaction setup
 */
protected void onSetUpInTransaction() throws Exception {
  super.onSetUpInTransaction();
  this.transferService=(TransferService)this.applicationContext.getBean("String_Node_Str");
  this.contentService=(ContentService)this.applicationContext.getBean("String_Node_Str");
}
Program: 172224
Project: 172224
Buggy source:
/** 
 * Ensures that all properties have been set
 */
public void afterPropertiesSet() throws Exception {
  Assert.notNull(name,"String_Node_Str");
  Assert.notNull(cacheManager,"String_Node_Str");
  resourceKeyTxnData=RESOURCE_KEY_TXN_DATA + "String_Node_Str" + name;
  logger=LogFactory.getLog(TransactionalCache.class + "String_Node_Str" + name);
  isDebugEnabled=logger.isDebugEnabled();
}

Fixed version (ground truth):
/** 
 * Ensures that all properties have been set
 */
public void afterPropertiesSet() throws Exception {
  Assert.notNull(name,"String_Node_Str");
  Assert.notNull(cacheManager,"String_Node_Str");
  resourceKeyTxnData=RESOURCE_KEY_TXN_DATA + "String_Node_Str" + name;
  logger=LogFactory.getLog(TransactionalCache.class.getName() + "String_Node_Str" + name);
  isDebugEnabled=logger.isDebugEnabled();
}
Program: 172225
Project: 172225
Buggy source:
@Override public void afterCommit(){
  try {
    transactionalCache.get(key);
  }
 catch (  Throwable e) {
    this.e=e;
    return;
  }
}

Fixed version (ground truth):
@Override public void afterCommit(){
  try {
    transactionalCache.put(key,value);
    transactionalCache.remove(key);
    transactionalCache.clear();
  }
 catch (  Throwable e) {
    this.e=e;
    return;
  }
}
Program: 172227
Project: 172227
Buggy source:
/** 
 * Goes direct to the shared cache in the absence of a transaction. <p> Where a transaction is present, a cache of updated items is lazily added to the thread and the <tt>Object</tt> put onto that. 
 */
public void put(K key,V value){
  if (AlfrescoTransactionSupport.getTransactionId() == null) {
    sharedCache.put(key,value);
    if (isDebugEnabled) {
      logger.debug("String_Node_Str" + "String_Node_Str" + this + "String_Node_Str"+ "String_Node_Str"+ key+ "String_Node_Str"+ "String_Node_Str"+ value);
    }
  }
 else {
    TransactionData txnData=getTransactionData();
    if (txnData.isClosed) {
      throw new AlfrescoRuntimeException("String_Node_Str");
    }
    if (txnData.updatedItemsCache.getMemoryStoreSize() >= maxCacheSize) {
      txnData.isClearOn=true;
    }
    CacheBucket<V> bucket=null;
    if (sharedCache.contains(key)) {
      V existingValue=sharedCache.get(key);
      bucket=new UpdateCacheBucket<V>(existingValue,value);
    }
 else {
      bucket=new NewCacheBucket<V>(value);
    }
    Element element=new Element(key,bucket);
    txnData.updatedItemsCache.put(element);
    txnData.removedItemsCache.remove(key);
    if (isDebugEnabled) {
      logger.debug("String_Node_Str" + "String_Node_Str" + this + "String_Node_Str"+ "String_Node_Str"+ key+ "String_Node_Str"+ "String_Node_Str"+ value);
    }
  }
}

Fixed version (ground truth):
/** 
 * Goes direct to the shared cache in the absence of a transaction. <p> Where a transaction is present, a cache of updated items is lazily added to the thread and the <tt>Object</tt> put onto that. 
 */
public void put(K key,V value){
  if (AlfrescoTransactionSupport.getTransactionId() == null) {
    sharedCache.put(key,value);
    if (isDebugEnabled) {
      logger.debug("String_Node_Str" + "String_Node_Str" + this + "String_Node_Str"+ "String_Node_Str"+ key+ "String_Node_Str"+ "String_Node_Str"+ value);
    }
  }
 else {
    TransactionData txnData=getTransactionData();
    if (txnData.isClosed) {
      if (isDebugEnabled) {
        logger.debug("String_Node_Str" + "String_Node_Str" + this + "String_Node_Str"+ "String_Node_Str"+ key+ "String_Node_Str"+ "String_Node_Str"+ value);
      }
    }
 else {
      if (txnData.updatedItemsCache.getMemoryStoreSize() >= maxCacheSize) {
        txnData.isClearOn=true;
      }
      CacheBucket<V> bucket=null;
      if (sharedCache.contains(key)) {
        V existingValue=sharedCache.get(key);
        bucket=new UpdateCacheBucket<V>(existingValue,value);
      }
 else {
        bucket=new NewCacheBucket<V>(value);
      }
      Element element=new Element(key,bucket);
      txnData.updatedItemsCache.put(element);
      txnData.removedItemsCache.remove(key);
      if (isDebugEnabled) {
        logger.debug("String_Node_Str" + "String_Node_Str" + this + "String_Node_Str"+ "String_Node_Str"+ key+ "String_Node_Str"+ "String_Node_Str"+ value);
      }
    }
  }
}
Program: 172229
Project: 172229
Buggy source:
/** 
 * Clears out all the caches.
 */
public void clear(){
  if (AlfrescoTransactionSupport.getTransactionId() != null) {
    if (isDebugEnabled) {
      logger.debug("String_Node_Str" + "String_Node_Str" + this + "String_Node_Str"+ "String_Node_Str"+ AlfrescoTransactionSupport.getTransactionId());
    }
    TransactionData txnData=getTransactionData();
    if (txnData.isClosed) {
      throw new AlfrescoRuntimeException("String_Node_Str");
    }
    txnData.isClearOn=true;
    txnData.updatedItemsCache.removeAll();
    txnData.removedItemsCache.removeAll();
  }
 else {
    if (isDebugEnabled) {
      logger.debug("String_Node_Str");
    }
    sharedCache.clear();
  }
}

Fixed version (ground truth):
/** 
 * Clears out all the caches.
 */
public void clear(){
  if (AlfrescoTransactionSupport.getTransactionId() != null) {
    if (isDebugEnabled) {
      logger.debug("String_Node_Str" + "String_Node_Str" + this + "String_Node_Str"+ "String_Node_Str"+ AlfrescoTransactionSupport.getTransactionId());
    }
    TransactionData txnData=getTransactionData();
    if (txnData.isClosed) {
      if (isDebugEnabled) {
        logger.debug("String_Node_Str" + "String_Node_Str" + this);
      }
    }
 else {
      txnData.isClearOn=true;
      txnData.updatedItemsCache.removeAll();
      txnData.removedItemsCache.removeAll();
    }
  }
 else {
    if (isDebugEnabled) {
      logger.debug("String_Node_Str");
    }
    sharedCache.clear();
  }
}
Program: 172230
Project: 172230
Buggy source:
public boolean equals(Object obj){
  if (obj == this) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof TransactionalCache)) {
    return false;
  }
  @SuppressWarnings("String_Node_Str") TransactionalCache that=(TransactionalCache)obj;
  return EqualsHelper.nullSafeEquals(this.name,that.name);
}

Fixed version (ground truth):
public boolean equals(Object obj){
  if (obj == this) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof TransactionalCache<?,?>)) {
    return false;
  }
  @SuppressWarnings("String_Node_Str") TransactionalCache that=(TransactionalCache)obj;
  return EqualsHelper.nullSafeEquals(this.name,that.name);
}
Program: 172231
Project: 172231
Buggy source:
/** 
 * NO-OP
 */
@SuppressWarnings("String_Node_Str") public void beforeCommit(boolean readOnly){
}

Fixed version (ground truth):
/** 
 * NO-OP
 */
public void beforeCommit(boolean readOnly){
}
Program: 172235
Project: 172235
Buggy source:
public ResultSet query(StoreRef store,String language,String query,QueryParameterDefinition[] queryParameterDefintions){
  return query(store,language,query,queryParameterDefintions);
}

Fixed version (ground truth):
public ResultSet query(StoreRef store,String language,String query){
  return query(store,language,query,null);
}
Program: 172237
Project: 172237
Buggy source:
public boolean hasExpired(){
  return System.currentTimeMillis() > expiryTime;
}

Fixed version (ground truth):
public boolean hasExpired(){
  return System.currentTimeMillis() >= expiryTime;
}
Program: 172239
Project: 172239
Buggy source:
/** 
 * Persists the given FormData on the given NodeRef
 * @param nodeRef The NodeRef to persist the form data on
 * @param data The FormData to persist
 */
protected void persistNode(NodeRef nodeRef,FormData data){
  QName type=this.nodeService.getType(nodeRef);
  TypeDefinition typeDef=this.dictionaryService.getAnonymousType(type,this.nodeService.getAspects(nodeRef));
  Map<QName,PropertyDefinition> propDefs=typeDef.getProperties();
  Map<QName,Serializable> propsToPersist=new HashMap<QName,Serializable>(data.getData().size());
  for (  String dataKey : data.getData().keySet()) {
    FieldData fieldData=data.getData().get(dataKey);
    if (fieldData.isFile() == false) {
      String fieldName=fieldData.getName();
      if (fieldName.startsWith(PROP_PREFIX)) {
        processPropertyPersist(nodeRef,propDefs,fieldData,propsToPersist);
      }
 else       if (fieldName.startsWith(ASSOC_PREFIX)) {
      }
 else       if (logger.isWarnEnabled()) {
        logger.warn("String_Node_Str" + fieldName + "String_Node_Str");
      }
    }
  }
  this.nodeService.addProperties(nodeRef,propsToPersist);
}

Fixed version (ground truth):
/** 
 * Persists the given FormData on the given NodeRef
 * @param nodeRef The NodeRef to persist the form data on
 * @param data The FormData to persist
 */
protected void persistNode(NodeRef nodeRef,FormData data){
  QName type=this.nodeService.getType(nodeRef);
  Collection<QName> aspects=this.getAspectsToInclude(nodeRef);
  TypeDefinition typeDef=this.dictionaryService.getAnonymousType(type,aspects);
  Map<QName,PropertyDefinition> propDefs=typeDef.getProperties();
  Map<QName,Serializable> propsToPersist=new HashMap<QName,Serializable>(data.getData().size());
  for (  String dataKey : data.getData().keySet()) {
    FieldData fieldData=data.getData().get(dataKey);
    if (fieldData.isFile() == false) {
      String fieldName=fieldData.getName();
      if (fieldName.startsWith(PROP_PREFIX)) {
        processPropertyPersist(nodeRef,propDefs,fieldData,propsToPersist);
      }
 else       if (fieldName.startsWith(ASSOC_PREFIX)) {
      }
 else       if (logger.isWarnEnabled()) {
        logger.warn("String_Node_Str" + fieldName + "String_Node_Str");
      }
    }
  }
  this.nodeService.addProperties(nodeRef,propsToPersist);
}
Program: 172243
Project: 172243
Buggy source:
/** 
 * Before delete node event
 * @param nodeRef NodeRef
 */
public void beforeDeleteNode(NodeRef nodeRef){
  if (nodeRef.getStoreRef().equals(m_storeRef) == false)   return;
  QName nodeType=m_nodeService.getType(nodeRef);
  FileFolderServiceType fType=m_fileFolderService.getType(nodeType);
  if (fType != FileFolderServiceType.INVALID) {
    Path nodePath=m_nodeService.getPath(nodeRef);
    String fName=(String)m_nodeService.getProperty(nodeRef,ContentModel.PROP_NAME);
    StringBuilder pathStr=new StringBuilder();
    pathStr.append(nodePath.toDisplayPath(m_nodeService,m_permissionService));
    if (pathStr.charAt(pathStr.length() - 1) != '/' && pathStr.charAt(pathStr.length() - 1) != '\\')     pathStr.append("String_Node_Str");
    pathStr.append(fName);
    String relPath=pathStr.toString();
    if (relPath.startsWith(m_rootPath)) {
      NodeEvent nodeEvent=new DeleteNodeEvent(fType,nodeRef,relPath);
      AlfrescoTransactionSupport.bindListener(this);
      AlfrescoTransactionSupport.bindResource(FileSysNodeEvent,nodeEvent);
      if (logger.isDebugEnabled())       logger.debug("String_Node_Str" + nodeRef + "String_Node_Str"+ relPath);
    }
  }
}

Fixed version (ground truth):
/** 
 * Before delete node event
 * @param nodeRef NodeRef
 */
public void beforeDeleteNode(NodeRef nodeRef){
  if (nodeRef.getStoreRef().equals(m_storeRef) == false)   return;
  QName nodeType=m_nodeService.getType(nodeRef);
  FileFolderServiceType fType=m_fileFolderService.getType(nodeType);
  if (fType != FileFolderServiceType.INVALID) {
    Path nodePath=m_nodeService.getPath(nodeRef);
    String fName=(String)m_nodeService.getProperty(nodeRef,ContentModel.PROP_NAME);
    StringBuilder pathStr=new StringBuilder();
    pathStr.append(nodePath.toDisplayPath(m_nodeService,m_permissionService));
    if (pathStr.length() == 0 || (pathStr.charAt(pathStr.length() - 1) != '/' && pathStr.charAt(pathStr.length() - 1) != '\\'))     pathStr.append("String_Node_Str");
    pathStr.append(fName);
    String relPath=pathStr.toString();
    if (relPath.startsWith(m_rootPath)) {
      NodeEvent nodeEvent=new DeleteNodeEvent(fType,nodeRef,relPath);
      AlfrescoTransactionSupport.bindListener(this);
      AlfrescoTransactionSupport.bindResource(FileSysNodeEvent,nodeEvent);
      if (logger.isDebugEnabled())       logger.debug("String_Node_Str" + nodeRef + "String_Node_Str"+ relPath);
    }
  }
}
Program: 172244
Project: 172244
Buggy source:
public List<AclChange> enableInheritance(Long id,Long parent){
  List<AclChange> changes=new ArrayList<AclChange>();
  DbAccessControlList acl=(DbAccessControlList)getHibernateTemplate().get(DbAccessControlListImpl.class,id);
switch (acl.getAclType()) {
case FIXED:
case GLOBAL:
    throw new IllegalArgumentException("String_Node_Str");
case OLD:
  acl.setInherits(Boolean.TRUE);
aclCache.remove(id);
changes.add(new AclChangeImpl(id,id,acl.getAclType(),acl.getAclType()));
return changes;
case SHARED:
throw new IllegalArgumentException("String_Node_Str");
case DEFINING:
case LAYERED:
default :
if (!acl.getInherits()) {
getWritable(id,null,null,null,null,false,changes,WriteMode.COPY_ONLY);
acl=(DbAccessControlList)getHibernateTemplate().get(DbAccessControlListImpl.class,changes.get(0).getAfter());
acl.setInherits(Boolean.TRUE);
}
 else {
getWritable(id,null,null,null,null,false,changes,WriteMode.COPY_ONLY);
}
return mergeInheritedAccessControlList(parent,changes.get(0).getAfter());
}
}

Fixed version (ground truth):
public List<AclChange> enableInheritance(Long id,Long parent){
  List<AclChange> changes=new ArrayList<AclChange>();
  DbAccessControlList acl=(DbAccessControlList)getHibernateTemplate().get(DbAccessControlListImpl.class,id);
switch (acl.getAclType()) {
case FIXED:
case GLOBAL:
    throw new IllegalArgumentException("String_Node_Str");
case OLD:
  acl.setInherits(Boolean.TRUE);
aclCache.remove(id);
changes.add(new AclChangeImpl(id,id,acl.getAclType(),acl.getAclType()));
return changes;
case SHARED:
throw new IllegalArgumentException("String_Node_Str");
case DEFINING:
case LAYERED:
default :
if (!acl.getInherits()) {
getWritable(id,null,null,null,null,false,changes,WriteMode.COPY_ONLY);
acl=(DbAccessControlList)getHibernateTemplate().get(DbAccessControlListImpl.class,changes.get(0).getAfter());
acl.setInherits(Boolean.TRUE);
}
 else {
getWritable(id,null,null,null,null,false,changes,WriteMode.COPY_ONLY);
}
List<AclChange> merged=mergeInheritedAccessControlList(parent,changes.get(0).getAfter());
changes.addAll(merged);
return changes;
}
}
Program: 172245
Project: 172245
Buggy source:
/** 
 * Purge store call back handler
 * @param storeName String
 */
public void storePurged(String storeName){
  FileStateTable fsTable=getStateTable();
  if (fsTable == null)   return;
  FileState rootState=fsTable.findFileState(FileName.DOS_SEPERATOR_STR);
  if (rootState != null && rootState.hasPseudoFiles()) {
    rootState.getPseudoFileList().removeFile(storeName,false);
    StringBuilder pathStr=new StringBuilder();
    pathStr.append(FileName.DOS_SEPERATOR);
    pathStr.append(storeName);
    String storePath=pathStr.toString();
    fsTable.removeFileState(storePath);
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + storeName);
    rootState.setLastUpdated(System.currentTimeMillis());
    if (hasChangeHandler()) {
      getChangeHandler().notifyDirectoryChanged(NotifyChange.ActionRemoved,storePath);
    }
  }
}

Fixed version (ground truth):
/** 
 * Purge store call back handler
 * @param storeName String
 */
public void storePurged(String storeName){
  FileStateTable fsTable=getStateTable();
  if (fsTable == null)   return;
  FileState rootState=fsTable.findFileState(FileName.DOS_SEPERATOR_STR);
  if (rootState != null && rootState.hasPseudoFiles()) {
    rootState.getPseudoFileList().removeFile(storeName,false);
    StringBuilder pathStr=new StringBuilder();
    pathStr.append(FileName.DOS_SEPERATOR);
    pathStr.append(storeName);
    String storePath=pathStr.toString();
    fsTable.removeFileState(storePath);
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + storeName);
    rootState.updateModifyDateTime();
    if (hasChangeHandler()) {
      getChangeHandler().notifyDirectoryChanged(NotifyChange.ActionRemoved,storePath);
    }
  }
}
Program: 172246
Project: 172246
Buggy source:
/** 
 * Rename a node
 * @param nodeToRenameRef Node to be renamed
 * @param newName New name for the node
 * @throws FileExistsException
 */
public void rename(NodeRef nodeToRenameRef,String newName) throws FileExistsException {
  try {
    if (newName.endsWith("String_Node_Str") || newName.endsWith("String_Node_Str"))     nodeService.addAspect(nodeToRenameRef,ContentModel.ASPECT_TEMPORARY,null);
    fileFolderService.rename(nodeToRenameRef,newName);
  }
 catch (  org.alfresco.service.cmr.model.FileExistsException e) {
    throw new FileExistsException(newName);
  }
catch (  Throwable e) {
    throw new AlfrescoRuntimeException("String_Node_Str" + "String_Node_Str" + nodeToRenameRef + "String_Node_Str"+ "String_Node_Str"+ newName,e);
  }
}

Fixed version (ground truth):
/** 
 * Rename a node
 * @param nodeToRenameRef Node to be renamed
 * @param newName New name for the node
 * @throws FileExistsException
 */
public void rename(NodeRef nodeToRenameRef,String newName) throws FileExistsException {
  try {
    fileFolderService.rename(nodeToRenameRef,newName);
  }
 catch (  org.alfresco.service.cmr.model.FileExistsException e) {
    throw new FileExistsException(newName);
  }
catch (  Throwable e) {
    throw new AlfrescoRuntimeException("String_Node_Str" + "String_Node_Str" + nodeToRenameRef + "String_Node_Str"+ "String_Node_Str"+ newName,e);
  }
}
Program: 172247
Project: 172247
Buggy source:
/** 
 * Creates a new site container
 * @param componentId   component id
 * @param folderType    folder type to create
 * @return ScriptNode   the created container
 */
public ScriptNode createContainer(String componentId,String folderType,Object permissions){
  ScriptNode container=null;
  try {
    QName folderQName=(folderType == null) ? null : QName.createQName(folderType,serviceRegistry.getNamespaceService());
    final NodeRef containerNodeRef=this.siteService.createContainer(getShortName(),componentId,folderQName,null);
    if (permissions != null && permissions instanceof ScriptableObject) {
      ScriptableObject scriptable=(ScriptableObject)permissions;
      Object[] propIds=scriptable.getIds();
      for (int i=0; i < propIds.length; i++) {
        Object propId=propIds[i];
        if (propId instanceof String) {
          final String key=(String)propId;
          final Object value=scriptable.get(key,scriptable);
          if (value instanceof String) {
            AuthenticationUtil.runAs(new RunAsWork<Object>(){
              public Object doWork() throws Exception {
                Site.this.serviceRegistry.getPermissionService().setPermission(containerNodeRef,key,(String)value,true);
                return null;
              }
            }
,AuthenticationUtil.SYSTEM_USER_NAME);
          }
        }
      }
    }
    container=new ScriptNode(containerNodeRef,this.serviceRegistry,this.scope);
  }
 catch (  AlfrescoRuntimeException e) {
  }
  return container;
}

Fixed version (ground truth):
/** 
 * Creates a new site container
 * @param componentId   component id
 * @param folderType    folder type to create
 * @return ScriptNode   the created container
 */
public ScriptNode createContainer(final String componentId,final String folderType,final Object permissions){
  ScriptNode container=null;
  try {
    NodeRef containerNodeRef=AuthenticationUtil.runAs(new RunAsWork<NodeRef>(){
      public NodeRef doWork() throws Exception {
        QName folderQName=(folderType == null) ? null : QName.createQName(folderType,serviceRegistry.getNamespaceService());
        NodeRef containerNodeRef=Site.this.siteService.createContainer(getShortName(),componentId,folderQName,null);
        if (permissions != null && permissions instanceof ScriptableObject) {
          ScriptableObject scriptable=(ScriptableObject)permissions;
          Object[] propIds=scriptable.getIds();
          for (int i=0; i < propIds.length; i++) {
            Object propId=propIds[i];
            if (propId instanceof String) {
              final String key=(String)propId;
              final Object value=scriptable.get(key,scriptable);
              if (value instanceof String) {
                Site.this.serviceRegistry.getPermissionService().setPermission(containerNodeRef,key,(String)value,true);
              }
            }
          }
        }
        return containerNodeRef;
      }
    }
,AuthenticationUtil.SYSTEM_USER_NAME);
    container=new ScriptNode(containerNodeRef,this.serviceRegistry,this.scope);
  }
 catch (  AlfrescoRuntimeException e) {
  }
  return container;
}
Program: 172248
Project: 172248
Buggy source:
public Object doWork() throws Exception {
  Site.this.serviceRegistry.getPermissionService().setPermission(containerNodeRef,key,(String)value,true);
  return null;
}

Fixed version (ground truth):
public NodeRef doWork() throws Exception {
  QName folderQName=(folderType == null) ? null : QName.createQName(folderType,serviceRegistry.getNamespaceService());
  NodeRef containerNodeRef=Site.this.siteService.createContainer(getShortName(),componentId,folderQName,null);
  if (permissions != null && permissions instanceof ScriptableObject) {
    ScriptableObject scriptable=(ScriptableObject)permissions;
    Object[] propIds=scriptable.getIds();
    for (int i=0; i < propIds.length; i++) {
      Object propId=propIds[i];
      if (propId instanceof String) {
        final String key=(String)propId;
        final Object value=scriptable.get(key,scriptable);
        if (value instanceof String) {
          Site.this.serviceRegistry.getPermissionService().setPermission(containerNodeRef,key,(String)value,true);
        }
      }
    }
  }
  return containerNodeRef;
}
Program: 172249
Project: 172249
Buggy source:
/** 
 * Adds a tag to the node
 * @param tag   tag name
 */
public void addTag(String tag){
  this.services.getTaggingService().addTag(this.nodeRef,tag);
}

Fixed version (ground truth):
/** 
 * Adds a tag to the node
 * @param tag   tag name
 */
public void addTag(String tag){
  this.services.getTaggingService().addTag(this.nodeRef,tag);
  updateTagProperty();
}
Program: 172250
Project: 172250
Buggy source:
/** 
 * Removes a tag from the node
 * @param tag   tag name
 */
public void removeTag(String tag){
  this.services.getTaggingService().removeTag(this.nodeRef,tag);
}

Fixed version (ground truth):
/** 
 * Removes a tag from the node
 * @param tag   tag name
 */
public void removeTag(String tag){
  this.services.getTaggingService().removeTag(this.nodeRef,tag);
  updateTagProperty();
}
Program: 172251
Project: 172251
Buggy source:
/** 
 * Clear the node's tags
 */
public void clearTags(){
  this.services.getTaggingService().clearTags(this.nodeRef);
}

Fixed version (ground truth):
/** 
 * Clear the node's tags
 */
public void clearTags(){
  this.services.getTaggingService().clearTags(this.nodeRef);
  updateTagProperty();
}
Program: 172252
Project: 172252
Buggy source:
/** 
 * Removes all the tags from the node
 * @param tags  array of tag names
 */
public void removeTags(String[] tags){
  this.services.getTaggingService().removeTags(this.nodeRef,Arrays.asList(tags));
}

Fixed version (ground truth):
/** 
 * Removes all the tags from the node
 * @param tags  array of tag names
 */
public void removeTags(String[] tags){
  this.services.getTaggingService().removeTags(this.nodeRef,Arrays.asList(tags));
  updateTagProperty();
}
Program: 172253
Project: 172253
Buggy source:
/** 
 * Set the tags applied to this node.  This overwirtes the list of tags currently applied to the  node.
 * @param tags  array of tags
 */
public void setTags(String[] tags){
  this.services.getTaggingService().setTags(this.nodeRef,Arrays.asList(tags));
}

Fixed version (ground truth):
/** 
 * Set the tags applied to this node.  This overwirtes the list of tags currently applied to the  node.
 * @param tags  array of tags
 */
public void setTags(String[] tags){
  this.services.getTaggingService().setTags(this.nodeRef,Arrays.asList(tags));
  updateTagProperty();
}
Program: 172254
Project: 172254
Buggy source:
/** 
 * Adds all the tags to the node
 * @param tags  array of tag names
 */
public void addTags(String[] tags){
  this.services.getTaggingService().addTags(this.nodeRef,Arrays.asList(tags));
}

Fixed version (ground truth):
/** 
 * Adds all the tags to the node
 * @param tags  array of tag names
 */
public void addTags(String[] tags){
  this.services.getTaggingService().addTags(this.nodeRef,Arrays.asList(tags));
  updateTagProperty();
}
Program: 172255
Project: 172255
Buggy source:
public boolean isTransformable(String sourceMimetype,String targetMimetype,TransformationOptions options){
  if (sourceMimetype.startsWith(StringExtractingContentTransformer.PREFIX_TEXT)) {
    return false;
  }
 else   if (!sourceMimetype.equals(targetMimetype)) {
    return false;
  }
 else {
    if (BinaryPassThroughContentTransformer.class == options.getClass()) {
      return true;
    }
 else {
      return false;
    }
  }
}

Fixed version (ground truth):
public boolean isTransformable(String sourceMimetype,String targetMimetype,TransformationOptions options){
  if (sourceMimetype.startsWith(StringExtractingContentTransformer.PREFIX_TEXT)) {
    return false;
  }
 else   if (!sourceMimetype.equals(targetMimetype)) {
    return false;
  }
 else {
    if (BinaryPassThroughContentTransformer.class.equals(options.getClass()) == true) {
      return true;
    }
 else {
      return false;
    }
  }
}
Program: 172256
Project: 172256
Buggy source:
public void onCreateNode(ChildAssociationRef childAssocRef){
  NodeRef nodeRef=childAssocRef.getChildRef();
  Boolean value=(Boolean)nodeService.getProperty(nodeRef,ContentModel.PROP_MODEL_ACTIVE);
  if ((value != null) && (value == true)) {
    queueModel(nodeRef);
  }
}

Fixed version (ground truth):
public void onCreateNode(ChildAssociationRef childAssocRef){
  NodeRef nodeRef=childAssocRef.getChildRef();
  if (nodeService.getType(nodeRef).equals(ContentModel.TYPE_DICTIONARY_MODEL)) {
    Boolean value=(Boolean)nodeService.getProperty(nodeRef,ContentModel.PROP_MODEL_ACTIVE);
    if ((value != null) && (value == true)) {
      queueModel(nodeRef);
    }
  }
}
Program: 172257
Project: 172257
Buggy source:
/** 
 * Get message resource bundle from the repository note: also used by Web Client (ResourceBundleWrapper)
 * @param storeRef  store ref
 * @param path      repository path (XPath)
 * @param locale    locale
 * @return          input stream
 */
public InputStream getRepoResourceBundle(StoreRef storeRef,String path,Locale locale);

Fixed version (ground truth):
/** 
 * Get message resource bundle from the repository note: also used by Web Client (ResourceBundleWrapper)
 * @param storeRef  store ref
 * @param path      repository path (XPath)
 * @param locale    locale
 * @return          input stream
 */
public ResourceBundle getRepoResourceBundle(StoreRef storeRef,String path,Locale locale) throws IOException ;
Program: 172258
Project: 172258
Buggy source:
public InputStream getRepoResourceBundle(StoreRef storeRef,String path,Locale locale){
  InputStream resBundleStream=null;
  SearchService searchService=serviceRegistry.getSearchService();
  NamespaceService resolver=serviceRegistry.getNamespaceService();
  NodeRef rootNode=serviceRegistry.getNodeService().getRootNode(storeRef);
  List<NodeRef> nodeRefs=searchService.selectNodes(rootNode,path + "String_Node_Str" + locale+ "String_Node_Str",null,resolver,false);
  if ((nodeRefs == null) || (nodeRefs.size() == 0)) {
    nodeRefs=searchService.selectNodes(rootNode,path + "String_Node_Str",null,resolver,false);
    if ((nodeRefs == null) || (nodeRefs.size() == 0)) {
      logger.debug("String_Node_Str" + storeRef + "String_Node_Str"+ path);
      return null;
    }
  }
  if (nodeRefs.size() > 1) {
    throw new RuntimeException("String_Node_Str" + storeRef + path);
  }
 else {
    NodeRef messageResourceNodeRef=nodeRefs.get(0);
    ContentReader cr=serviceRegistry.getContentService().getReader(messageResourceNodeRef,ContentModel.PROP_CONTENT);
    resBundleStream=cr.getContentInputStream();
  }
  return resBundleStream;
}

Fixed version (ground truth):
public ResourceBundle getRepoResourceBundle(StoreRef storeRef,String path,Locale locale) throws IOException {
  ResourceBundle resBundle=null;
  SearchService searchService=serviceRegistry.getSearchService();
  NamespaceService resolver=serviceRegistry.getNamespaceService();
  NodeRef rootNode=serviceRegistry.getNodeService().getRootNode(storeRef);
  List<NodeRef> nodeRefs=searchService.selectNodes(rootNode,path + "String_Node_Str" + locale+ "String_Node_Str",null,resolver,false);
  if ((nodeRefs == null) || (nodeRefs.size() == 0)) {
    nodeRefs=searchService.selectNodes(rootNode,path + "String_Node_Str",null,resolver,false);
    if ((nodeRefs == null) || (nodeRefs.size() == 0)) {
      logger.debug("String_Node_Str" + storeRef + "String_Node_Str"+ path);
      return null;
    }
  }
  if (nodeRefs.size() > 1) {
    throw new RuntimeException("String_Node_Str" + storeRef + path);
  }
 else {
    NodeRef messageResourceNodeRef=nodeRefs.get(0);
    ContentReader cr=serviceRegistry.getContentService().getReader(messageResourceNodeRef,ContentModel.PROP_CONTENT);
    resBundle=new MessagePropertyResourceBundle(new InputStreamReader(cr.getContentInputStream(),cr.getEncoding()));
  }
  return resBundle;
}
Program: 172261
Project: 172261
Buggy source:
/** 
 * Create a new File (cm:content) node as a child of this node. <p> Once created the file should have content set using the <code>content</code> property.
 * @param name Name of the file to create
 * @return Newly created Node or null if failed to create.
 */
public ScriptNode createFile(String name){
  ParameterCheck.mandatoryString("String_Node_Str",name);
  FileInfo fileInfo=this.services.getFileFolderService().create(this.nodeRef,name,ContentModel.TYPE_CONTENT);
  reset();
  return newInstance(fileInfo.getNodeRef(),this.services,this.scope);
}

Fixed version (ground truth):
/** 
 * Create a new File (cm:content) node as a child of this node. <p> Once created the file should have content set using the <code>content</code> property.
 * @param name Name of the file to create
 * @return Newly created Node or null if failed to create.
 */
public ScriptNode createFile(String name){
  ParameterCheck.mandatoryString("String_Node_Str",name);
  FileInfo fileInfo=this.services.getFileFolderService().create(this.nodeRef,name,ContentModel.TYPE_CONTENT);
  reset();
  ScriptNode file=newInstance(fileInfo.getNodeRef(),this.services,this.scope);
  file.setMimetype(this.services.getMimetypeService().guessMimetype(name));
  return file;
}
Program: 172262
Project: 172262
Buggy source:
/** 
 * Convert values for JBPM Context
 * @param value
 * @param services
 * @return
 */
private static Object convertForJBPM(Object value,ServiceRegistry services){
  if (value == null) {
    return null;
  }
 else   if (value instanceof NodeRef) {
    value=new JBPMNode(((NodeRef)value),services);
  }
 else   if (value instanceof Collection) {
    Collection<Object> collection=(Collection<Object>)value;
    Collection<Object> converted=new ArrayList<Object>();
    for (    Object obj : collection) {
      converted.add(convertForJBPM(obj,services));
    }
    value=converted;
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Convert values for JBPM Context
 * @param value
 * @param services
 * @return
 */
private static Object convertForJBPM(Object value,ServiceRegistry services){
  if (value == null) {
    return null;
  }
 else   if (value instanceof NodeRef) {
    value=new JBPMNode(((NodeRef)value),services);
  }
 else   if (value instanceof Collection) {
    Collection<Object> collection=(Collection<Object>)value;
    boolean isNodeCollection=false;
    for (    Object obj : collection) {
      if (obj instanceof NodeRef) {
        isNodeCollection=true;
        break;
      }
    }
    if (isNodeCollection) {
      JBPMNodeList converted=new JBPMNodeList();
      for (      Object obj : collection) {
        if (!(obj instanceof NodeRef)) {
          throw new WorkflowException("String_Node_Str");
        }
        converted.add((JBPMNode)convertForJBPM(obj,services));
      }
      value=converted;
    }
 else {
      Collection<Object> converted=new ArrayList<Object>();
      for (      Object obj : collection) {
        converted.add(convertForJBPM(obj,services));
      }
      value=converted;
    }
  }
  return value;
}
Program: 172263
Project: 172263
Buggy source:
public Set<PermissionReference> getSettablePermissionReferences(NodeRef nodeRef){
  return modelDAO.getExposedPermissions(nodeRef);
}

Fixed version (ground truth):
public Set<PermissionReference> getSettablePermissionReferences(NodeRef nodeRef){
  return modelDAO.getExposedPermissions(tenantService.getName(nodeRef));
}
Program: 172264
Project: 172264
Buggy source:
public boolean hasSinglePermission(Set<String> authorisations,NodeRef nodeRef,Set<Pair<String,PermissionReference>> denied){
  denied.addAll(getDenied(nodeRef));
  Serializable key=null;
  if (denied.size() == 0) {
    key=generateKey(authorisations,nodeRef,this.required,CacheType.SINGLE_PERMISSION);
  }
  if (key != null) {
    AccessStatus status=accessCache.get(key);
    if (status != null) {
      return status == AccessStatus.ALLOWED;
    }
  }
  if (checkRequired(authorisations,nodeRef,denied)) {
    if (key != null) {
      accessCache.put(key,AccessStatus.ALLOWED);
    }
    return true;
  }
  ChildAssociationRef car=nodeService.getPrimaryParent(nodeRef);
  if (car.getParentRef() != null) {
    NodePermissionEntry nodePermissions=permissionsDaoComponent.getPermissions(nodeRef);
    if ((nodePermissions == null) || (nodePermissions.inheritPermissions())) {
      if (hasSinglePermission(authorisations,car.getParentRef(),denied)) {
        if (key != null) {
          accessCache.put(key,AccessStatus.ALLOWED);
        }
        return true;
      }
 else {
        if (key != null) {
          accessCache.put(key,AccessStatus.DENIED);
        }
        return false;
      }
    }
 else {
      if (key != null) {
        accessCache.put(key,AccessStatus.DENIED);
      }
      return false;
    }
  }
 else {
    if (key != null) {
      accessCache.put(key,AccessStatus.DENIED);
    }
    return false;
  }
}

Fixed version (ground truth):
public boolean hasSinglePermission(Set<String> authorisations,NodeRef nodeRef,Set<Pair<String,PermissionReference>> denied){
  nodeRef=tenantService.getName(nodeRef);
  denied.addAll(getDenied(nodeRef));
  Serializable key=null;
  if (denied.size() == 0) {
    key=generateKey(authorisations,nodeRef,this.required,CacheType.SINGLE_PERMISSION);
  }
  if (key != null) {
    AccessStatus status=accessCache.get(key);
    if (status != null) {
      return status == AccessStatus.ALLOWED;
    }
  }
  if (checkRequired(authorisations,nodeRef,denied)) {
    if (key != null) {
      accessCache.put(key,AccessStatus.ALLOWED);
    }
    return true;
  }
  ChildAssociationRef car=nodeService.getPrimaryParent(nodeRef);
  if (car.getParentRef() != null) {
    NodePermissionEntry nodePermissions=permissionsDaoComponent.getPermissions(nodeRef);
    if ((nodePermissions == null) || (nodePermissions.inheritPermissions())) {
      if (hasSinglePermission(authorisations,car.getParentRef(),denied)) {
        if (key != null) {
          accessCache.put(key,AccessStatus.ALLOWED);
        }
        return true;
      }
 else {
        if (key != null) {
          accessCache.put(key,AccessStatus.DENIED);
        }
        return false;
      }
    }
 else {
      if (key != null) {
        accessCache.put(key,AccessStatus.DENIED);
      }
      return false;
    }
  }
 else {
    if (key != null) {
      accessCache.put(key,AccessStatus.DENIED);
    }
    return false;
  }
}
Program: 172265
Project: 172265
Buggy source:
public void onEnableTenant(){
  init();
}

Fixed version (ground truth):
public void onEnableTenant(){
  initConfig();
}
Program: 172266
Project: 172266
Buggy source:
@Override protected void onBootstrap(ApplicationEvent event){
  AuthenticationUtil.runAs(new RunAsWork<Object>(){
    public Object doWork(){
      init();
      return null;
    }
  }
,AuthenticationUtil.getSystemUserName());
  if (tenantService.isEnabled() && (tenantDeployerService != null)) {
    tenantDeployerService.deployTenants(this,logger);
    tenantDeployerService.register(this);
  }
}

Fixed version (ground truth):
@Override protected void onBootstrap(ApplicationEvent event){
  AuthenticationUtil.runAs(new RunAsWork<Object>(){
    public Object doWork(){
      initConfig();
      return null;
    }
  }
,AuthenticationUtil.getSystemUserName());
  if (tenantService.isEnabled() && (tenantDeployerService != null)) {
    tenantDeployerService.deployTenants(this,logger);
    tenantDeployerService.register(this);
  }
}
Program: 172268
Project: 172268
Buggy source:
/** 
 * NTLM2 encryption of the MD4 hashed password
 * @param md4Hash byte[]
 * @param userName String
 * @param domain String
 * @return byte[]
 * @exception NoSuchAlgorithmException
 */
public final byte[] doNTLM2Encryption(byte[] md4Hash,String userName,String domain) throws NoSuchAlgorithmException, InvalidKeyException {
  Mac hmacMd5=Mac.getInstance("String_Node_Str");
  SecretKeySpec key=new SecretKeySpec(md4Hash,0,md4Hash.length,"String_Node_Str");
  hmacMd5.init(key);
  StringBuilder str=new StringBuilder();
  str.append(userName.toUpperCase());
  str.append(domain.toUpperCase());
  String dataStr=str.toString();
  byte[] dataByts=null;
  try {
    dataByts=dataStr.getBytes("String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
  }
  return hmacMd5.doFinal(dataByts);
}

Fixed version (ground truth):
/** 
 * NTLM2 encryption of the MD4 hashed password
 * @param md4Hash byte[]
 * @param userName String
 * @param domain String
 * @return byte[]
 * @exception NoSuchAlgorithmException
 */
public final byte[] doNTLM2Encryption(byte[] md4Hash,String userName,String domain) throws NoSuchAlgorithmException, InvalidKeyException {
  Mac hmacMd5=Mac.getInstance("String_Node_Str");
  SecretKeySpec key=new SecretKeySpec(md4Hash,0,md4Hash.length,"String_Node_Str");
  hmacMd5.init(key);
  StringBuilder str=new StringBuilder();
  str.append(userName.toUpperCase());
  str.append(domain);
  String dataStr=str.toString();
  byte[] dataByts=null;
  try {
    dataByts=dataStr.getBytes("String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
  }
  return hmacMd5.doFinal(dataByts);
}
Program: 172270
Project: 172270
Buggy source:
/** 
 * Set the file folder server
 * @param fileService FileFolderService
 */
public void setFileFolderService(FileFolderService fileService){
  fileFolderService=fileService;
}

Fixed version (ground truth):
/** 
 * Set the file folder service
 * @param fileService FileFolderService
 */
public void setFileFolderService(FileFolderService fileService){
  fileFolderService=fileService;
}