nus-yam/ex-repair huggingface dataset:
Program: 172315
Project: 172315
Buggy source:
public void processString(String template,Object model,Writer out){
  if (template == null || template.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (model == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (out == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + template + "String_Node_Str"+ model);
    Template t=getStringConfig(PATH,template).getTemplate(PATH);
    if (t != null) {
      try {
        t.process(model,out);
      }
 catch (      Throwable err) {
        throw new TemplateException(MSG_ERROR_TEMPLATE_FAIL,new Object[]{err.getMessage()},err);
      }
    }
 else {
      throw new TemplateException(MSG_ERROR_NO_TEMPLATE,new Object[]{template});
    }
  }
 catch (  IOException ioerr) {
    throw new TemplateException(MSG_ERROR_TEMPLATE_IO,new Object[]{template},ioerr);
  }
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.service.cmr.repository.TemplateProcessor#processString(java.lang.String,java.lang.Object,java.io.Writer)
 */
public void processString(String template,Object model,Writer out){
  if (template == null || template.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (model == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (out == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    long startTime=0;
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + template);
      startTime=System.currentTimeMillis();
    }
    Template t=getStringConfig(PATH,template).getTemplate(PATH);
    if (t != null) {
      try {
        t.process(model,out);
        if (logger.isDebugEnabled()) {
          long endTime=System.currentTimeMillis();
          logger.debug("String_Node_Str" + (endTime - startTime) + "String_Node_Str");
        }
      }
 catch (      Throwable err) {
        throw new TemplateException(MSG_ERROR_TEMPLATE_FAIL,new Object[]{err.getMessage()},err);
      }
    }
 else {
      throw new TemplateException(MSG_ERROR_NO_TEMPLATE,new Object[]{template});
    }
  }
 catch (  IOException ioerr) {
    throw new TemplateException(MSG_ERROR_TEMPLATE_IO,new Object[]{template},ioerr);
  }
}
Program: 172316
Project: 172316
Buggy source:
/** 
 * @return The FreeMarker config instance for this processor
 */
private Configuration getConfig(){
  if (this.config == null) {
    Configuration config=new Configuration();
    config.setCacheStorage(new MruCacheStorage(20,0));
    config.setTemplateLoader(new ClassPathRepoTemplateLoader(nodeService,contentService));
    config.setObjectWrapper(new QNameAwareObjectWrapper());
    config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    this.config=config;
  }
  return this.config;
}

Fixed version (ground truth):
/** 
 * Get the FreeMarker configuration for this instance
 * @return FreeMarker configuration
 */
private Configuration getConfig(){
  if (this.config == null) {
    Configuration config=new Configuration();
    config.setCacheStorage(new MruCacheStorage(20,0));
    config.setTemplateLoader(new ClassPathRepoTemplateLoader(nodeService,contentService));
    config.setObjectWrapper(new QNameAwareObjectWrapper());
    config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    this.config=config;
  }
  return this.config;
}
Program: 172317
Project: 172317
Buggy source:
/** 
 * Return the TemplateProcessor implementation for the named template engine
 * @param name      Template Engine name
 * @return TemplateProcessor
 */
private TemplateProcessor getTemplateProcessorImpl(String name){
  Map<String,TemplateProcessor> procMap=processors.get();
  if (procMap == null) {
    procMap=new HashMap<String,TemplateProcessor>(7,1.0f);
    processors.set(procMap);
  }
  if (name == null) {
    name=defaultTemplateEngine;
  }
  TemplateProcessor processor=procMap.get(name);
  if (processor == null) {
    String className=templateEngines.get(name);
    if (className == null) {
      throw new AlfrescoRuntimeException("String_Node_Str" + name);
    }
    try {
      Object obj;
      try {
        obj=this.applicationContext.getBean(className);
      }
 catch (      BeansException err) {
        obj=Class.forName(className).newInstance();
      }
      if (obj instanceof TemplateProcessor) {
        processor=(TemplateProcessor)obj;
      }
 else {
        throw new AlfrescoRuntimeException("String_Node_Str" + className);
      }
    }
 catch (    ClassNotFoundException err1) {
      throw new AlfrescoRuntimeException("String_Node_Str" + className,err1);
    }
catch (    IllegalAccessException err2) {
      throw new AlfrescoRuntimeException("String_Node_Str" + className,err2);
    }
catch (    InstantiationException err3) {
      throw new AlfrescoRuntimeException("String_Node_Str" + className,err3);
    }
    procMap.put(name,processor);
  }
  return processor;
}

Fixed version (ground truth):
/** 
 * Return the TemplateProcessor implementation for the named template engine
 * @param name      Template Engine name
 * @return TemplateProcessor
 */
private TemplateProcessor getTemplateProcessorImpl(String name){
  Map<String,TemplateProcessor> procMap=processors.get();
  if (procMap == null) {
    procMap=new HashMap<String,TemplateProcessor>(2,1.0f);
    processors.set(procMap);
  }
  if (name == null) {
    name=defaultTemplateEngine;
  }
  TemplateProcessor processor=procMap.get(name);
  if (processor == null) {
    String className=templateEngines.get(name);
    if (className == null) {
      throw new AlfrescoRuntimeException("String_Node_Str" + name);
    }
    try {
      Object obj;
      try {
        obj=this.applicationContext.getBean(className);
      }
 catch (      BeansException err) {
        obj=Class.forName(className).newInstance();
      }
      if (obj instanceof TemplateProcessor) {
        processor=(TemplateProcessor)obj;
      }
 else {
        throw new AlfrescoRuntimeException("String_Node_Str" + className);
      }
    }
 catch (    ClassNotFoundException err1) {
      throw new AlfrescoRuntimeException("String_Node_Str" + className,err1);
    }
catch (    IllegalAccessException err2) {
      throw new AlfrescoRuntimeException("String_Node_Str" + className,err2);
    }
catch (    InstantiationException err3) {
      throw new AlfrescoRuntimeException("String_Node_Str" + className,err3);
    }
    procMap.put(name,processor);
  }
  return processor;
}
Program: 172318
Project: 172318
Buggy source:
public String processTemplateString(String engine,String template,Object model) throws TemplateException {
  Writer out=new StringWriter(1024);
  processTemplateString(engine,template,model,out);
  return out.toString();
}

Fixed version (ground truth):
/** 
 * @see org.alfresco.service.cmr.repository.TemplateService#processTemplateString(java.lang.String,java.lang.String,java.lang.Object)
 */
public String processTemplateString(String engine,String template,Object model) throws TemplateException {
  Writer out=new StringWriter(1024);
  processTemplateString(engine,template,model,out);
  return out.toString();
}
Program: 172319
Project: 172319
Buggy source:
public Token next() throws IOException {
  Token candidate;
  while ((candidate=baseTokeniser.next()) != null) {
    Double d=Double.valueOf(candidate.termText());
    String valueString=NumericEncoder.encode(d.doubleValue());
    Token doubleToken=new Token(valueString,candidate.startOffset(),candidate.startOffset(),candidate.type());
    return doubleToken;
  }
  return null;
}

Fixed version (ground truth):
public Token next() throws IOException {
  Token candidate;
  while ((candidate=baseTokeniser.next()) != null) {
    try {
      Double d=Double.valueOf(candidate.termText());
      String valueString=NumericEncoder.encode(d.doubleValue());
      Token doubleToken=new Token(valueString,candidate.startOffset(),candidate.startOffset(),candidate.type());
      return doubleToken;
    }
 catch (    NumberFormatException e) {
    }
  }
  return null;
}
Program: 172320
Project: 172320
Buggy source:
public Token next() throws IOException {
  Token candidate;
  while ((candidate=baseTokeniser.next()) != null) {
    Float floatValue=Float.valueOf(candidate.termText());
    String valueString=NumericEncoder.encode(floatValue.floatValue());
    Token floatToken=new Token(valueString,candidate.startOffset(),candidate.startOffset(),candidate.type());
    return floatToken;
  }
  return null;
}

Fixed version (ground truth):
public Token next() throws IOException {
  Token candidate;
  while ((candidate=baseTokeniser.next()) != null) {
    try {
      Float floatValue=Float.valueOf(candidate.termText());
      String valueString=NumericEncoder.encode(floatValue.floatValue());
      Token floatToken=new Token(valueString,candidate.startOffset(),candidate.startOffset(),candidate.type());
      return floatToken;
    }
 catch (    NumberFormatException e) {
    }
  }
  return null;
}
Program: 172321
Project: 172321
Buggy source:
public Token next() throws IOException {
  Token candidate;
  while ((candidate=baseTokeniser.next()) != null) {
    Integer integer=Integer.valueOf(candidate.termText());
    String valueString=NumericEncoder.encode(integer.intValue());
    Token integerToken=new Token(valueString,candidate.startOffset(),candidate.startOffset(),candidate.type());
    return integerToken;
  }
  return null;
}

Fixed version (ground truth):
public Token next() throws IOException {
  Token candidate;
  while ((candidate=baseTokeniser.next()) != null) {
    try {
      Integer integer=Integer.valueOf(candidate.termText());
      String valueString=NumericEncoder.encode(integer.intValue());
      Token integerToken=new Token(valueString,candidate.startOffset(),candidate.startOffset(),candidate.type());
      return integerToken;
    }
 catch (    NumberFormatException e) {
    }
  }
  return null;
}
Program: 172322
Project: 172322
Buggy source:
public Token next() throws IOException {
  Token candidate;
  while ((candidate=baseTokeniser.next()) != null) {
    Long longValue=Long.valueOf(candidate.termText());
    String valueString=NumericEncoder.encode(longValue.longValue());
    Token longToken=new Token(valueString,candidate.startOffset(),candidate.startOffset(),candidate.type());
    return longToken;
  }
  return null;
}

Fixed version (ground truth):
public Token next() throws IOException {
  Token candidate;
  while ((candidate=baseTokeniser.next()) != null) {
    try {
      Long longValue=Long.valueOf(candidate.termText());
      String valueString=NumericEncoder.encode(longValue.longValue());
      Token longToken=new Token(valueString,candidate.startOffset(),candidate.startOffset(),candidate.type());
      return longToken;
    }
 catch (    NumberFormatException e) {
    }
  }
  return null;
}
Program: 172323
Project: 172323
Buggy source:
/** 
 * Copy like constructor.
 * @param other The other directory.
 * @param repos The Repository Object that will own us.
 */
@SuppressWarnings("String_Node_Str") public PlainDirectoryNodeImpl(PlainDirectoryNode other,Repository repos){
  super(repos.getSuperRepository().issueID(),repos);
  Session sess=repos.getSuperRepository().getSession();
  sess.save(this);
  for (  ChildEntry child : other.getChildren()) {
    ChildEntry newChild=new ChildEntryImpl(child.getName(),this,child.getChild());
    sess.save(newChild);
  }
}

Fixed version (ground truth):
/** 
 * Copy like constructor.
 * @param other The other directory.
 * @param repos The Repository Object that will own us.
 */
@SuppressWarnings("String_Node_Str") public PlainDirectoryNodeImpl(PlainDirectoryNode other,Repository repos){
  super(repos.getSuperRepository().issueID(),repos);
  Session sess=repos.getSuperRepository().getSession();
  sess.save(this);
  sess.flush();
  for (  ChildEntry child : other.getChildren()) {
    ChildEntry newChild=new ChildEntryImpl(child.getName(),this,child.getChild());
    sess.save(newChild);
    sess.flush();
  }
}
Program: 172324
Project: 172324
Buggy source:
/** 
 * Put a new child node into this directory.  No copy.
 * @param name The name of the child.
 * @param node The node to add.
 */
public void putChild(String name,AVMNode node){
  Session sess=SuperRepository.GetInstance().getSession();
  sess.flush();
  ChildEntry entry=new ChildEntryImpl(name,this,node);
  ChildEntry existing=(ChildEntry)sess.get(ChildEntryImpl.class,(Serializable)entry);
  if (existing != null) {
    existing.setChild(node);
  }
 else {
    sess.save(entry);
  }
}

Fixed version (ground truth):
/** 
 * Put a new child node into this directory.  No copy.
 * @param name The name of the child.
 * @param node The node to add.
 */
public void putChild(String name,AVMNode node){
  Session sess=SuperRepository.GetInstance().getSession();
  ChildEntry entry=new ChildEntryImpl(name,this,node);
  ChildEntry existing=(ChildEntry)sess.get(ChildEntryImpl.class,(Serializable)entry);
  if (existing != null) {
    existing.setChild(node);
  }
 else {
    sess.save(entry);
  }
}
Program: 172326
Project: 172326
Buggy source:
public NodePermissionEntry getPermissions(NodeRef nodeRef){
  NodePermissionEntry npe=null;
  DbAccessControlList acl=null;
  Node node=getNode(nodeRef,false);
  if (node != null) {
    acl=getAccessControlList(node,false);
  }
  if (acl == null) {
    SimpleNodePermissionEntry snpe=new SimpleNodePermissionEntry(nodeRef,true,Collections.<SimplePermissionEntry>emptySet());
    npe=snpe;
  }
 else {
    npe=createSimpleNodePermissionEntry(node);
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + nodeRef);
  }
  return npe;
}

Fixed version (ground truth):
public NodePermissionEntry getPermissions(NodeRef nodeRef){
  NodePermissionEntry npe=null;
  DbAccessControlList acl=null;
  Node node=getNode(nodeRef,false);
  if (node != null) {
    acl=getAccessControlList(node,false);
  }
  if (acl == null) {
    SimpleNodePermissionEntry snpe=new SimpleNodePermissionEntry(nodeRef,true,Collections.<SimplePermissionEntry>emptySet());
    npe=snpe;
  }
 else {
    npe=createSimpleNodePermissionEntry(node);
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + "String_Node_Str" + nodeRef + "String_Node_Str"+ "String_Node_Str"+ npe);
  }
  return npe;
}
Program: 172328
Project: 172328
Buggy source:
public Node newNode(Store store,String uuid,QName nodeTypeQName) throws InvalidTypeException {
  NodeKey key=new NodeKey(store.getKey(),uuid);
  Node node=new NodeImpl();
  node.setStore(store);
  node.setUuid(uuid);
  node.setTypeQName(nodeTypeQName);
  getHibernateTemplate().save(node);
  NodeStatus status=(NodeStatus)getHibernateTemplate().get(NodeStatusImpl.class,key);
  if (status == null) {
    status=new NodeStatusImpl();
    status.setKey(key);
  }
  status.setNode(node);
  status.setChangeTxnId(AlfrescoTransactionSupport.getTransactionId());
  getHibernateTemplate().save(status);
  return node;
}

Fixed version (ground truth):
public Node newNode(Store store,String uuid,QName nodeTypeQName) throws InvalidTypeException {
  NodeKey key=new NodeKey(store.getKey(),uuid);
  NodeStatus status=(NodeStatus)getHibernateTemplate().get(NodeStatusImpl.class,key);
  if (status == null) {
    status=new NodeStatusImpl();
    status.setKey(key);
  }
 else {
    if (status.getChangeTxnId().equals(AlfrescoTransactionSupport.getTransactionId())) {
      getHibernateTemplate().flush();
    }
  }
  Node node=new NodeImpl();
  node.setStore(store);
  node.setUuid(uuid);
  node.setTypeQName(nodeTypeQName);
  getHibernateTemplate().save(node);
  status.setNode(node);
  status.setChangeTxnId(AlfrescoTransactionSupport.getTransactionId());
  getHibernateTemplate().save(status);
  return node;
}
Program: 172329
Project: 172329
Buggy source:
public void flushPending() throws LuceneIndexException {
  IndexReader mainReader=null;
  try {
    mainReader=getReader();
    Set<NodeRef> forIndex=new LinkedHashSet<NodeRef>();
    for (    Command command : commandList) {
      if (command.action == Action.INDEX) {
        forIndex.add(command.nodeRef);
      }
 else       if (command.action == Action.REINDEX) {
        Set<NodeRef> set=deleteImpl(command.nodeRef,true,false,mainReader);
        forIndex.removeAll(set);
        forIndex.addAll(set);
      }
 else       if (command.action == Action.CASCADEREINDEX) {
        Set<NodeRef> set=deleteImpl(command.nodeRef,true,true,mainReader);
        forIndex.removeAll(set);
        forIndex.addAll(set);
      }
 else       if (command.action == Action.DELETE) {
        Set<NodeRef> set=deleteImpl(command.nodeRef,false,true,mainReader);
        forIndex.removeAll(set);
      }
    }
    commandList.clear();
    indexImpl(forIndex,false);
  }
  finally {
    if (mainReader != null) {
      try {
        mainReader.close();
      }
 catch (      IOException e) {
        throw new LuceneIndexException("String_Node_Str",e);
      }
    }
    closeDeltaWriter();
  }
}

Fixed version (ground truth):
public void flushPending() throws LuceneIndexException {
  IndexReader mainReader=null;
  try {
    mainReader=getReader();
    Set<NodeRef> forIndex=new LinkedHashSet<NodeRef>();
    for (    Command command : commandList) {
      if (command.action == Action.INDEX) {
        forIndex.add(command.nodeRef);
      }
 else       if (command.action == Action.REINDEX) {
        Set<NodeRef> set=deleteImpl(command.nodeRef,true,false,mainReader);
        forIndex.removeAll(set);
        forIndex.addAll(set);
      }
 else       if (command.action == Action.CASCADEREINDEX) {
        Set<NodeRef> set=deleteImpl(command.nodeRef,true,true,mainReader);
        forIndex.removeAll(set);
        forIndex.addAll(set);
      }
 else       if (command.action == Action.DELETE) {
        Set<NodeRef> set=deleteImpl(command.nodeRef,false,true,mainReader);
        forIndex.removeAll(set);
      }
    }
    commandList.clear();
    indexImpl(forIndex,false);
  }
  finally {
    if (mainReader != null) {
      try {
        mainReader.close();
      }
 catch (      IOException e) {
        throw new LuceneIndexException("String_Node_Str",e);
      }
    }
    closeDeltaReader();
    closeDeltaWriter();
  }
}
Program: 172331
Project: 172331
Buggy source:
public void setUp() throws Exception {
  DictionaryDAO dictionaryDao=(DictionaryDAO)ctx.getBean("String_Node_Str");
  ClassLoader cl=BaseNodeServiceTest.class.getClassLoader();
  InputStream modelStream=cl.getResourceAsStream("String_Node_Str");
  assertNotNull(modelStream);
  M2Model model=M2Model.createModel(modelStream);
  dictionaryDao.putModel(model);
  tagger=(IncompleteNodeTagger)ctx.getBean("String_Node_Str");
  serviceRegistry=(ServiceRegistry)ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
  nodeService=serviceRegistry.getNodeService();
  this.authenticationComponent=(AuthenticationComponent)ctx.getBean("String_Node_Str");
  this.authenticationComponent.setSystemUserAsCurrentUser();
  TransactionService transactionService=serviceRegistry.getTransactionService();
  txn=transactionService.getUserTransaction();
  txn.begin();
  StoreRef storeRef=new StoreRef(StoreRef.PROTOCOL_WORKSPACE,getName());
  if (!nodeService.exists(storeRef)) {
    nodeService.createStore(storeRef.getProtocol(),storeRef.getIdentifier());
  }
  rootNodeRef=nodeService.getRootNode(storeRef);
  properties=new PropertyMap();
  properties.put(IntegrityTest.TEST_PROP_TEXT_C,"String_Node_Str");
}

Fixed version (ground truth):
public void setUp() throws Exception {
  DictionaryDAO dictionaryDao=(DictionaryDAO)IntegrityTest.ctx.getBean("String_Node_Str");
  ClassLoader cl=BaseNodeServiceTest.class.getClassLoader();
  InputStream modelStream=cl.getResourceAsStream("String_Node_Str");
  assertNotNull(modelStream);
  M2Model model=M2Model.createModel(modelStream);
  dictionaryDao.putModel(model);
  tagger=(IncompleteNodeTagger)IntegrityTest.ctx.getBean("String_Node_Str");
  serviceRegistry=(ServiceRegistry)IntegrityTest.ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
  nodeService=serviceRegistry.getNodeService();
  this.authenticationComponent=(AuthenticationComponent)IntegrityTest.ctx.getBean("String_Node_Str");
  this.authenticationComponent.setSystemUserAsCurrentUser();
  TransactionService transactionService=serviceRegistry.getTransactionService();
  txn=transactionService.getUserTransaction();
  txn.begin();
  StoreRef storeRef=new StoreRef(StoreRef.PROTOCOL_WORKSPACE,getName());
  if (!nodeService.exists(storeRef)) {
    nodeService.createStore(storeRef.getProtocol(),storeRef.getIdentifier());
  }
  rootNodeRef=nodeService.getRootNode(storeRef);
  properties=new PropertyMap();
  properties.put(IntegrityTest.TEST_PROP_TEXT_C,"String_Node_Str");
}
Program: 172332
Project: 172332
Buggy source:
public NodeRef getPersonOrNull(String caseSensitiveUserName){
  String userName=userNamesAreCaseSensitive ? caseSensitiveUserName : caseSensitiveUserName.toLowerCase();
  SearchParameters sp=new SearchParameters();
  sp.setLanguage(SearchService.LANGUAGE_LUCENE);
  sp.setQuery("String_Node_Str" + userName);
  sp.addStore(storeRef);
  sp.excludeDataInTheCurrentTransaction(false);
  ResultSet rs=null;
  try {
    rs=searchService.query(sp);
    for (    ResultSetRow row : rs) {
      NodeRef nodeRef=row.getNodeRef();
      if (nodeService.exists(nodeRef)) {
        String realUserName=DefaultTypeConverter.INSTANCE.convert(String.class,nodeService.getProperty(nodeRef,ContentModel.PROP_USERNAME));
        realUserName=userNamesAreCaseSensitive ? realUserName : realUserName.toLowerCase();
        if (realUserName.equals(userName)) {
          return nodeRef;
        }
      }
    }
  }
  finally {
    if (rs != null) {
      rs.close();
    }
  }
  return null;
}

Fixed version (ground truth):
public NodeRef getPersonOrNull(String caseSensitiveUserName){
  String userName=userNamesAreCaseSensitive ? caseSensitiveUserName : caseSensitiveUserName.toLowerCase();
  SearchParameters sp=new SearchParameters();
  sp.setLanguage(SearchService.LANGUAGE_LUCENE);
  sp.setQuery("String_Node_Str" + userName + "String_Node_Str");
  sp.addStore(storeRef);
  sp.excludeDataInTheCurrentTransaction(false);
  ResultSet rs=null;
  try {
    rs=searchService.query(sp);
    for (    ResultSetRow row : rs) {
      NodeRef nodeRef=row.getNodeRef();
      if (nodeService.exists(nodeRef)) {
        String realUserName=DefaultTypeConverter.INSTANCE.convert(String.class,nodeService.getProperty(nodeRef,ContentModel.PROP_USERNAME));
        realUserName=userNamesAreCaseSensitive ? realUserName : realUserName.toLowerCase();
        if (realUserName.equals(userName)) {
          return nodeRef;
        }
      }
    }
  }
  finally {
    if (rs != null) {
      rs.close();
    }
  }
  return null;
}
Program: 172334
Project: 172334
Buggy source:
/** 
 * Adds an Access Control Entry
 * @param accessStatus
 * @param authority
 * @param permission
 */
public void addAccessControlEntry(AccessStatus accessStatus,String authority,String permission){
  ACE ace=new ACE();
  ace.accessStatus=accessStatus;
  ace.authority=authority;
  ace.permission=permission;
  accessControlEntries.add(ace);
}

Fixed version (ground truth):
/** 
 * Adds an Access Control Entry
 * @param accessStatus
 * @param authority
 * @param permission
 */
public void addAccessControlEntry(AccessStatus accessStatus,String authority,String permission){
  if (permission.equalsIgnoreCase("String_Node_Str")) {
    permission=PermissionService.CONSUMER;
  }
  ACE ace=new ACE();
  ace.accessStatus=accessStatus;
  ace.authority=authority;
  ace.permission=permission;
  accessControlEntries.add(ace);
}
Program: 172338
Project: 172338
Buggy source:
@Override public void beforeCompletion(){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + this);
  }
  for (  TransactionListener listener : listeners) {
    listener.beforeCompletion();
  }
}

Fixed version (ground truth):
@Override public void beforeCompletion(){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + this);
  }
  for (  TransactionListener listener : getListenersIterable()) {
    listener.beforeCompletion();
  }
}
Program: 172339
Project: 172339
Buggy source:
@Override public void afterCompletion(int status){
  String statusStr="String_Node_Str";
switch (status) {
case TransactionSynchronization.STATUS_COMMITTED:
    statusStr="String_Node_Str";
  break;
case TransactionSynchronization.STATUS_ROLLED_BACK:
statusStr="String_Node_Str";
break;
default :
}
if (logger.isDebugEnabled()) {
logger.debug("String_Node_Str" + statusStr + "String_Node_Str"+ this);
}
for (LuceneIndexerAndSearcherFactory lucene : lucenes) {
try {
if (status == TransactionSynchronization.STATUS_COMMITTED) {
lucene.commit();
}
 else {
lucene.rollback();
}
}
 catch (RuntimeException e) {
logger.error("String_Node_Str" + statusStr + "String_Node_Str",e);
}
}
if (status == TransactionSynchronization.STATUS_COMMITTED) {
for (TransactionListener listener : listeners) {
try {
listener.afterCommit();
}
 catch (RuntimeException e) {
logger.error("String_Node_Str" + statusStr + "String_Node_Str"+ "String_Node_Str"+ listener,e);
}
}
}
 else {
for (TransactionListener listener : listeners) {
try {
listener.afterRollback();
}
 catch (RuntimeException e) {
logger.error("String_Node_Str" + statusStr + "String_Node_Str"+ "String_Node_Str"+ listener,e);
}
}
}
AlfrescoTransactionSupport.clearSynchronization();
}

Fixed version (ground truth):
@Override public void afterCompletion(int status){
  String statusStr="String_Node_Str";
switch (status) {
case TransactionSynchronization.STATUS_COMMITTED:
    statusStr="String_Node_Str";
  break;
case TransactionSynchronization.STATUS_ROLLED_BACK:
statusStr="String_Node_Str";
break;
default :
}
if (logger.isDebugEnabled()) {
logger.debug("String_Node_Str" + statusStr + "String_Node_Str"+ this);
}
for (LuceneIndexerAndSearcherFactory lucene : lucenes) {
try {
if (status == TransactionSynchronization.STATUS_COMMITTED) {
lucene.commit();
}
 else {
lucene.rollback();
}
}
 catch (RuntimeException e) {
logger.error("String_Node_Str" + statusStr + "String_Node_Str",e);
}
}
List<TransactionListener> iterableListeners=getListenersIterable();
if (status == TransactionSynchronization.STATUS_COMMITTED) {
for (TransactionListener listener : iterableListeners) {
try {
listener.afterCommit();
}
 catch (RuntimeException e) {
logger.error("String_Node_Str" + statusStr + "String_Node_Str"+ "String_Node_Str"+ listener,e);
}
}
}
 else {
for (TransactionListener listener : iterableListeners) {
try {
listener.afterRollback();
}
 catch (RuntimeException e) {
logger.error("String_Node_Str" + statusStr + "String_Node_Str"+ "String_Node_Str"+ listener,e);
}
}
}
AlfrescoTransactionSupport.clearSynchronization();
}
Program: 172340
Project: 172340
Buggy source:
/** 
 * Performs the in-transaction flushing.  Typically done during a transaction or before commit.
 */
public void flush(){
  for (  IntegrityChecker integrityChecker : integrityCheckers) {
    integrityChecker.checkIntegrity();
  }
  for (  TransactionListener listener : listeners) {
    listener.flush();
  }
}

Fixed version (ground truth):
/** 
 * Performs the in-transaction flushing.  Typically done during a transaction or before commit.
 */
public void flush(){
  for (  IntegrityChecker integrityChecker : integrityCheckers) {
    integrityChecker.checkIntegrity();
  }
  for (  TransactionListener listener : getListenersIterable()) {
    listener.flush();
  }
}
Program: 172341
Project: 172341
Buggy source:
/** 
 * Pre-commit cleanup. <p> Ensures that the session resources are   {@link #flush() flushed}. The Lucene indexes are then prepared.
 */
@Override public void beforeCommit(boolean readOnly){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + (readOnly ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ this);
  }
  TransactionSynchronizationImpl synch=(TransactionSynchronizationImpl)TransactionSynchronizationManager.getResource(RESOURCE_KEY_TXN_SYNCH);
  if (synch == null) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
  for (  TransactionListener listener : listeners) {
    listener.beforeCommit(readOnly);
  }
  flush();
  for (  LuceneIndexerAndSearcherFactory lucene : lucenes) {
    lucene.prepare();
  }
}

Fixed version (ground truth):
/** 
 * Pre-commit cleanup. <p> Ensures that the session resources are   {@link #flush() flushed}. The Lucene indexes are then prepared.
 */
@Override public void beforeCommit(boolean readOnly){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + (readOnly ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ this);
  }
  TransactionSynchronizationImpl synch=(TransactionSynchronizationImpl)TransactionSynchronizationManager.getResource(RESOURCE_KEY_TXN_SYNCH);
  if (synch == null) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
  for (  TransactionListener listener : getListenersIterable()) {
    listener.beforeCommit(readOnly);
  }
  flush();
  for (  LuceneIndexerAndSearcherFactory lucene : lucenes) {
    lucene.prepare();
  }
}
Program: 172342
Project: 172342
Buggy source:
public void testListener() throws Exception {
  final List<String> strings=new ArrayList<String>(1);
  TransactionListener listener=new TransactionListener(){
    public void flush(){
      strings.add("String_Node_Str");
    }
    public void beforeCommit(    boolean readOnly){
      strings.add("String_Node_Str");
    }
    public void beforeCompletion(){
      strings.add("String_Node_Str");
    }
    public void afterCommit(){
      strings.add("String_Node_Str");
    }
    public void afterRollback(){
      strings.add("String_Node_Str");
    }
  }
;
  TransactionService transactionService=serviceRegistry.getTransactionService();
  UserTransaction txn=transactionService.getUserTransaction();
  txn.begin();
  AlfrescoTransactionSupport.bindListener(listener);
  AlfrescoTransactionSupport.flush();
  assertTrue("String_Node_Str",strings.contains("String_Node_Str"));
  txn.commit();
  assertTrue("String_Node_Str",strings.contains("String_Node_Str"));
  assertTrue("String_Node_Str",strings.contains("String_Node_Str"));
  assertTrue("String_Node_Str",strings.contains("String_Node_Str"));
}

Fixed version (ground truth):
public void testListener() throws Exception {
  final List<String> strings=new ArrayList<String>(1);
  TransactionListener listener=new TransactionListener(){
    public void flush(){
      strings.add("String_Node_Str");
    }
    public void beforeCommit(    boolean readOnly){
      strings.add("String_Node_Str");
    }
    public void beforeCompletion(){
      strings.add("String_Node_Str");
    }
    public void afterCommit(){
      strings.add("String_Node_Str");
    }
    public void afterRollback(){
      strings.add("String_Node_Str");
    }
  }
;
  UserTransaction txn=transactionService.getUserTransaction();
  txn.begin();
  AlfrescoTransactionSupport.bindListener(listener);
  AlfrescoTransactionSupport.flush();
  assertTrue("String_Node_Str",strings.contains("String_Node_Str"));
  txn.commit();
  assertTrue("String_Node_Str",strings.contains("String_Node_Str"));
  assertTrue("String_Node_Str",strings.contains("String_Node_Str"));
  assertTrue("String_Node_Str",strings.contains("String_Node_Str"));
}
Program: 172343
Project: 172343
Buggy source:
public void setUp() throws Exception {
  serviceRegistry=(ServiceRegistry)ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
}

Fixed version (ground truth):
public void setUp() throws Exception {
  serviceRegistry=(ServiceRegistry)ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
  transactionService=serviceRegistry.getTransactionService();
}
Program: 172344
Project: 172344
Buggy source:
public void testTransactionId() throws Exception {
  TransactionService transactionService=serviceRegistry.getTransactionService();
  UserTransaction txn=transactionService.getUserTransaction();
  assertNull("String_Node_Str",AlfrescoTransactionSupport.getTransactionId());
  txn.begin();
  String txnId=AlfrescoTransactionSupport.getTransactionId();
  assertNotNull("String_Node_Str",txnId);
  Thread thread=new Thread(new Runnable(){
    public void run(){
      String txnId=AlfrescoTransactionSupport.getTransactionId();
      assertNull("String_Node_Str");
    }
  }
);
  String txnIdCheck=AlfrescoTransactionSupport.getTransactionId();
  assertEquals("String_Node_Str",txnId,txnIdCheck);
{
    UserTransaction txnInner=transactionService.getNonPropagatingUserTransaction();
    String txnIdInner=AlfrescoTransactionSupport.getTransactionId();
    assertEquals("String_Node_Str",txnId,txnIdInner);
    txnInner.begin();
    txnIdInner=AlfrescoTransactionSupport.getTransactionId();
    assertNotSame("String_Node_Str",txnIdInner,txnId);
    txnInner.rollback();
    txnIdCheck=AlfrescoTransactionSupport.getTransactionId();
    assertEquals("String_Node_Str",txnId,txnIdCheck);
  }
  txn.rollback();
  assertNull("String_Node_Str",AlfrescoTransactionSupport.getTransactionId());
  txn=transactionService.getUserTransaction();
  txn.begin();
  txnIdCheck=AlfrescoTransactionSupport.getTransactionId();
  assertNotSame("String_Node_Str",txnId,txnIdCheck);
  txn.rollback();
  assertNull("String_Node_Str",AlfrescoTransactionSupport.getTransactionId());
}

Fixed version (ground truth):
public void testTransactionId() throws Exception {
  TransactionService transactionService=serviceRegistry.getTransactionService();
  UserTransaction txn=transactionService.getUserTransaction();
  assertNull("String_Node_Str",AlfrescoTransactionSupport.getTransactionId());
  txn.begin();
  String txnId=AlfrescoTransactionSupport.getTransactionId();
  assertNotNull("String_Node_Str",txnId);
  String txnIdCheck=AlfrescoTransactionSupport.getTransactionId();
  assertEquals("String_Node_Str",txnId,txnIdCheck);
{
    UserTransaction txnInner=transactionService.getNonPropagatingUserTransaction();
    String txnIdInner=AlfrescoTransactionSupport.getTransactionId();
    assertEquals("String_Node_Str",txnId,txnIdInner);
    txnInner.begin();
    txnIdInner=AlfrescoTransactionSupport.getTransactionId();
    assertNotSame("String_Node_Str",txnIdInner,txnId);
    txnInner.rollback();
    txnIdCheck=AlfrescoTransactionSupport.getTransactionId();
    assertEquals("String_Node_Str",txnId,txnIdCheck);
  }
  txn.rollback();
  assertNull("String_Node_Str",AlfrescoTransactionSupport.getTransactionId());
  txn=transactionService.getUserTransaction();
  txn.begin();
  txnIdCheck=AlfrescoTransactionSupport.getTransactionId();
  assertNotSame("String_Node_Str",txnId,txnIdCheck);
  txn.rollback();
  assertNull("String_Node_Str",AlfrescoTransactionSupport.getTransactionId());
}
Program: 172345
Project: 172345
Buggy source:
public void beforeCommit(boolean readOnly){
  strings.add("String_Node_Str");
}

Fixed version (ground truth):
@Override public void beforeCommit(boolean readOnly){
  testList.remove(beforeCommit);
  TransactionListener postCommitListener=new TransactionListenerAdapter(){
    @Override public void afterCommit(){
      testList.remove(afterCommitInner);
    }
  }
;
  AlfrescoTransactionSupport.bindListener(postCommitListener);
}
Program: 172346
Project: 172346
Buggy source:
public void afterCommit(){
  strings.add("String_Node_Str");
}

Fixed version (ground truth):
@Override public void afterCommit(){
  testList.remove(afterCommitOuter);
}
Program: 172347
Project: 172347
Buggy source:
/** 
 * Return file information for the next file in the active search. Returns false if the search is complete.
 * @param info FileInfo to return the file information.
 * @return true if the file information is valid, else false
 */
public boolean nextFileInfo(FileInfo info){
  if (!hasMoreFiles())   return false;
  index++;
  resumeId++;
  if (donePseudoFiles == false && pseudoList != null) {
    if (index < pseudoList.numberOfFiles()) {
      PseudoFile pfile=pseudoList.getFileAt(index);
      if (pfile != null) {
        FileInfo pinfo=pfile.getFileInfo();
        info.copyFrom(pinfo);
        return true;
      }
    }
 else {
      donePseudoFiles=true;
      index=0;
      if (results == null || results.size() == 0)       return false;
    }
  }
  NodeRef nextNodeRef=results.get(index);
  try {
    FileInfo nextInfo=cifsHelper.getFileInformation(nextNodeRef,"String_Node_Str");
    info.copyFrom(nextInfo);
    return true;
  }
 catch (  FileNotFoundException e) {
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Return file information for the next file in the active search. Returns false if the search is complete.
 * @param info FileInfo to return the file information.
 * @return true if the file information is valid, else false
 */
public boolean nextFileInfo(FileInfo info){
  if (!hasMoreFiles())   return false;
  index++;
  resumeId++;
  if (donePseudoFiles == false && pseudoList != null) {
    if (index < pseudoList.numberOfFiles()) {
      PseudoFile pfile=pseudoList.getFileAt(index);
      if (pfile != null) {
        FileInfo pinfo=pfile.getFileInfo();
        info.copyFrom(pinfo);
        if (index == (pseudoList.numberOfFiles() - 1)) {
          donePseudoFiles=true;
          index=-1;
        }
        return true;
      }
    }
  }
  NodeRef nextNodeRef=results.get(index);
  try {
    FileInfo nextInfo=cifsHelper.getFileInformation(nextNodeRef,"String_Node_Str");
    info.copyFrom(nextInfo);
    return true;
  }
 catch (  FileNotFoundException e) {
  }
  return false;
}
Program: 172348
Project: 172348
Buggy source:
/** 
 * Return the file name of the next file in the active search. Returns null is the search is complete.
 * @return String
 */
public String nextFileName(){
  if (!hasMoreFiles())   return null;
  index++;
  resumeId++;
  if (donePseudoFiles == false && pseudoList != null) {
    if (index < pseudoList.numberOfFiles()) {
      PseudoFile pfile=pseudoList.getFileAt(index);
      if (pfile != null) {
        FileInfo pinfo=pfile.getFileInfo();
        return pinfo.getFileName();
      }
    }
 else {
      donePseudoFiles=true;
      index=0;
      if (results == null || results.size() == 0)       return null;
    }
  }
  NodeRef nextNodeRef=results.get(index);
  try {
    FileInfo nextInfo=cifsHelper.getFileInformation(nextNodeRef,"String_Node_Str");
    return nextInfo.getFileName();
  }
 catch (  FileNotFoundException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the file name of the next file in the active search. Returns null is the search is complete.
 * @return String
 */
public String nextFileName(){
  if (!hasMoreFiles())   return null;
  index++;
  resumeId++;
  if (donePseudoFiles == false && pseudoList != null) {
    if (index < pseudoList.numberOfFiles()) {
      PseudoFile pfile=pseudoList.getFileAt(index);
      if (pfile != null) {
        FileInfo pinfo=pfile.getFileInfo();
        return pinfo.getFileName();
      }
    }
 else {
      donePseudoFiles=true;
      index=-1;
      if (results == null || results.size() == 0)       return null;
    }
  }
  NodeRef nextNodeRef=results.get(index);
  try {
    FileInfo nextInfo=cifsHelper.getFileInformation(nextNodeRef,"String_Node_Str");
    return nextInfo.getFileName();
  }
 catch (  FileNotFoundException e) {
  }
  return null;
}
Program: 172349
Project: 172349
Buggy source:
public Reader getDataStream(){
  try {
    InputStream dataStream=null;
    Enumeration entries=zipFile.entries();
    while (entries.hasMoreElements()) {
      ZipEntry entry=(ZipEntry)entries.nextElement();
      if (!entry.isDirectory()) {
        if (entry.getName().endsWith("String_Node_Str")) {
          dataStream=zipFile.getInputStream(entry);
        }
      }
    }
    if (dataStream == null) {
      throw new ImporterException("String_Node_Str");
    }
    Reader inputReader=(dataFileEncoding == null) ? new InputStreamReader(dataStream) : new InputStreamReader(dataStream,dataFileEncoding);
    return new BufferedReader(inputReader);
  }
 catch (  UnsupportedEncodingException e) {
    throw new ImporterException("String_Node_Str" + dataFileEncoding + "String_Node_Str");
  }
catch (  IOException e) {
    throw new ImporterException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
public Reader getDataStream(){
  try {
    ZipEntry xmlMetaDataEntry=null;
    Enumeration entries=zipFile.entries();
    while (entries.hasMoreElements()) {
      ZipEntry entry=(ZipEntry)entries.nextElement();
      if (!entry.isDirectory()) {
        String entryName=entry.getName();
        if (entryName.endsWith("String_Node_Str") && entryName.indexOf('/') == -1 && entryName.indexOf('\\') == -1) {
          if (xmlMetaDataEntry != null) {
            throw new ImporterException("String_Node_Str");
          }
          xmlMetaDataEntry=entry;
        }
      }
    }
    if (xmlMetaDataEntry == null) {
      throw new ImporterException("String_Node_Str");
    }
    InputStream dataStream=zipFile.getInputStream(xmlMetaDataEntry);
    Reader inputReader=(dataFileEncoding == null) ? new InputStreamReader(dataStream) : new InputStreamReader(dataStream,dataFileEncoding);
    return new BufferedReader(inputReader);
  }
 catch (  UnsupportedEncodingException e) {
    throw new ImporterException("String_Node_Str" + dataFileEncoding + "String_Node_Str");
  }
catch (  IOException e) {
    throw new ImporterException("String_Node_Str" + e.getMessage());
  }
}
Program: 172350
Project: 172350
Buggy source:
/** 
 * Import Node Content. <p> The content URL, if present, will be a local URL.  This import copies the content from the local URL to a server-assigned location.
 * @param nodeRef containing node
 * @param propertyName the name of the content-type property
 * @param contentData the identifier of the content to import
 */
private void importContent(NodeRef nodeRef,QName propertyName,String importContentData){
  DataTypeDefinition dataTypeDef=dictionaryService.getDataType(DataTypeDefinition.CONTENT);
  importContentData=bindPlaceHolder(importContentData,binding);
  ContentData contentData=(ContentData)DefaultTypeConverter.INSTANCE.convert(dataTypeDef,importContentData);
  String contentUrl=contentData.getContentUrl();
  if (contentUrl != null && contentUrl.length() > 0) {
    InputStream contentStream=streamHandler.importStream(contentUrl);
    ContentWriter writer=contentService.getWriter(nodeRef,propertyName,true);
    writer.setEncoding(contentData.getEncoding());
    writer.setMimetype(contentData.getMimetype());
    writer.putContent(contentStream);
    reportContentCreated(nodeRef,contentUrl);
  }
}

Fixed version (ground truth):
/** 
 * Import Node Content. <p> The content URL, if present, will be a local URL.  This import copies the content from the local URL to a server-assigned location.
 * @param nodeRef containing node
 * @param propertyName the name of the content-type property
 * @param contentData the identifier of the content to import
 */
private void importContent(NodeRef nodeRef,QName propertyName,String importContentData){
  DataTypeDefinition dataTypeDef=dictionaryService.getDataType(DataTypeDefinition.CONTENT);
  importContentData=bindPlaceHolder(importContentData,binding);
  if (importContentData != null && importContentData.length() > 0) {
    ContentData contentData=(ContentData)DefaultTypeConverter.INSTANCE.convert(dataTypeDef,importContentData);
    String contentUrl=contentData.getContentUrl();
    if (contentUrl != null && contentUrl.length() > 0) {
      InputStream contentStream=streamHandler.importStream(contentUrl);
      ContentWriter writer=contentService.getWriter(nodeRef,propertyName,true);
      writer.setEncoding(contentData.getEncoding());
      writer.setMimetype(contentData.getMimetype());
      writer.putContent(contentStream);
      reportContentCreated(nodeRef,contentUrl);
    }
  }
}
Program: 172352
Project: 172352
Buggy source:
/** 
 * Convert an <b>xpath</b> like function clause into a <b>regex</b> query.
 * @param xpathLikeClause
 * @return Returns a valid regular expression that is equivalent to thegiven <b>xpath</b> like clause.
 */
public static String convertXPathLikeToRegex(String xpathLikeClause){
  return convert(DEF_XPATH_LIKE,DEF_REGEX,xpathLikeClause);
}

Fixed version (ground truth):
/** 
 * Convert an <b>xpath</b> like function clause into a <b>regex</b> query.
 * @param xpathLikeClause
 * @return Returns a valid regular expression that is equivalent to thegiven <b>xpath</b> like clause.
 */
public static String convertXPathLikeToRegex(String xpathLikeClause){
  return "String_Node_Str" + convert(DEF_XPATH_LIKE,DEF_REGEX,xpathLikeClause);
}
Program: 172354
Project: 172354
Buggy source:
public HtmlMetadataExtracter(){
  super(MimetypeMap.MIMETYPE_HTML,1.0,1000);
}

Fixed version (ground truth):
public HtmlMetadataExtracter(){
  super(MIMETYPES,1.0,1000);
}
Program: 172355
Project: 172355
Buggy source:
public void handleEndTag(HTML.Tag t,int pos){
  if (HTML.Tag.HEAD.equals(t)) {
    inHead=false;
  }
 else   if (HTML.Tag.TITLE.equals(t)) {
    trimPut(ContentModel.PROP_TITLE,title.toString(),tempDestination);
    title=null;
  }
}

Fixed version (ground truth):
public void handleEndTag(HTML.Tag t,int pos){
  if (HTML.Tag.HEAD.equals(t)) {
    inHead=false;
  }
 else   if (HTML.Tag.TITLE.equals(t) && title != null) {
    trimPut(ContentModel.PROP_TITLE,title.toString(),tempDestination);
    title=null;
  }
}
Program: 172360
Project: 172360
Buggy source:
public void onLogin(int playerId){
  RankingList<FightingRankEntity> rank=rankService.getRankingList(RankService.TYPE_FIGHTING);
  FightingRankEntity rankEntity=rank.getEntity(playerId);
  if (rankEntity != null) {
    checkTitle(playerId,TitleConsts.FIGHTING,rankEntity.getFight(),ActivityConsts.UpdateType.T_VALUE,null);
  }
  int ladderLevel=ladderService.getRank(playerId);
  if (ladderLevel != 0) {
    checkTitle(playerId,TitleConsts.LADDER,ladderLevel,ActivityConsts.UpdateType.T_VALUE,null);
  }
}

Fixed version (ground truth):
public void onLogin(int playerId){
  doInit(playerId);
  RankingList<FightingRankEntity> rank=rankService.getRankingList(RankService.TYPE_FIGHTING);
  FightingRankEntity rankEntity=rank.getEntity(playerId);
  if (rankEntity != null) {
    checkTitle(playerId,TitleConsts.FIGHTING,rankEntity.getFight(),ActivityConsts.UpdateType.T_VALUE,null);
  }
  int ladderLevel=ladderService.getRank(playerId);
  if (ladderLevel != 0) {
    checkTitle(playerId,TitleConsts.LADDER,ladderLevel,ActivityConsts.UpdateType.T_VALUE,null);
  }
}
Program: 172361
Project: 172361
Buggy source:
public void doInit(int playerId){
  PlayerData data=playerService.getPlayerData(playerId);
  for (  Object obj : GameData.getConfigs(TitleConfig.class)) {
    TitleConfig cfg=(TitleConfig)obj;
    Title title=new Title();
    title.setId(cfg.id);
    title.setOpenFlag(false);
    title.setCondType(cfg.titleSubType);
    data.getTitleMap().put(cfg.id,title);
  }
}

Fixed version (ground truth):
public void doInit(int playerId){
  PlayerData data=playerService.getPlayerData(playerId);
  for (  Object obj : GameData.getConfigs(TitleConfig.class)) {
    TitleConfig cfg=(TitleConfig)obj;
    if (!data.getTitleMap().containsKey(cfg.id)) {
      Title title=new Title();
      title.setId(cfg.id);
      title.setOpenFlag(false);
      title.setCondType(cfg.titleSubType);
      data.getTitleMap().put(cfg.id,title);
    }
  }
}
Program: 172363
Project: 172363
Buggy source:
/** 
 * 获取实时伤害排名
 */
public Object getRealTimeHurtList(int playerId){
  WorldBossHurtRankVO vo=new WorldBossHurtRankVO();
  vo.rankList=new ArrayList<>();
  for (  HurtRecord hr : treeMap.values()) {
    WorldBossHurtVO vo1=new WorldBossHurtVO();
    vo1.hurt=hr.getHurt();
    vo1.nickName=hr.getName();
    vo.rankList.add(vo1);
  }
  HurtRecord hr=worldBossData.getHurtMap().get(playerId);
  if (hr != null) {
    vo.selfRank=hr.getRank();
    vo.hurt=hr.getCurHurt();
  }
  return vo;
}

Fixed version (ground truth):
/** 
 * 获取实时伤害排名
 */
public Object getRealTimeHurtList(int playerId){
  List<HurtRecord> listTmp=new ArrayList<>(treeMap.values());
  WorldBossHurtRankVO vo=toRankProto(listTmp);
  listTmp.clear();
  listTmp=null;
  HurtRecord hr=worldBossData.getHurtMap().get(playerId);
  if (hr != null) {
    vo.selfRank=hr.getRank();
    vo.hurt=hr.getCurHurt();
  }
  return vo;
}