nus-yam/ex-repair huggingface dataset:
Program: 171997
Project: 171997
Buggy source:
private void checkStatus(){
  GossipMember local=getSelf();
  Map<GossipMember,HeartbeatState> endpoints=getEndpointMembers();
  Set<GossipMember> epKeys=endpoints.keySet();
  for (  GossipMember k : epKeys) {
    if (!k.equals(local)) {
      HeartbeatState state=endpoints.get(k);
      long now=System.currentTimeMillis();
      long duration=now - state.getHeartbeatTime();
      long convictedTime=convictedTime();
      LOGGER.info("String_Node_Str" + k.toString() + "String_Node_Str"+ state.toString()+ "String_Node_Str"+ duration+ "String_Node_Str"+ convictedTime);
      if (duration > convictedTime) {
        if (duration > (getSettings().getDeleteThreshold() * getSettings().getGossipInterval())) {
          clearMember(k);
        }
 else         if (isAlive(k) || getLiveMembers().contains(k)) {
          LOGGER.info("String_Node_Str");
          down(k);
        }
      }
      if (duration <= convictedTime && (isDiscoverable(k) || getDeadMembers().contains(k))) {
        LOGGER.info("String_Node_Str");
        up(k);
      }
    }
  }
}

Fixed version (ground truth):
private void checkStatus(){
  GossipMember local=getSelf();
  Map<GossipMember,HeartbeatState> endpoints=getEndpointMembers();
  Set<GossipMember> epKeys=endpoints.keySet();
  for (  GossipMember k : epKeys) {
    if (!k.equals(local)) {
      HeartbeatState state=endpoints.get(k);
      long now=System.currentTimeMillis();
      long duration=now - state.getHeartbeatTime();
      long convictedTime=convictedTime();
      LOGGER.info("String_Node_Str" + k.toString() + "String_Node_Str"+ state.toString()+ "String_Node_Str"+ duration+ "String_Node_Str"+ convictedTime);
      if (duration > convictedTime && (isAlive(k) || getLiveMembers().contains(k))) {
        downing(k,state);
      }
      if (duration <= convictedTime && (isDiscoverable(k) || getDeadMembers().contains(k))) {
        up(k);
      }
    }
  }
  checkCandidate();
}
Program: 171998
Project: 171998
Buggy source:
private void up(GossipMember member){
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.UP);
    if (!liveMembers.contains(member)) {
      liveMembers.add(member);
    }
    if (deadMembers.contains(member)) {
      deadMembers.remove(member);
      fireGossipEvent(member,GossipState.UP);
    }
  }
  finally {
    rwlock.writeLock().unlock();
  }
}

Fixed version (ground truth):
private void up(GossipMember member){
  LOGGER.info("String_Node_Str");
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.UP);
    if (!liveMembers.contains(member)) {
      liveMembers.add(member);
    }
    if (candidateMembers.containsKey(member)) {
      candidateMembers.remove(member);
    }
    if (deadMembers.contains(member)) {
      deadMembers.remove(member);
      fireGossipEvent(member,GossipState.UP);
    }
  }
  finally {
    rwlock.writeLock().unlock();
  }
}
Program: 171999
Project: 171999
Buggy source:
private void gossip2Seed(Buffer buffer){
  int size=settings.getSeedMembers().size();
  if (size > 0) {
    if (size == 1 && settings.getSeedMembers().contains(localGossipMember)) {
      return;
    }
    int index=(size == 1) ? 0 : random.nextInt(size);
    if (liveMembers.size() == 0) {
      sendGossip2Seed(buffer,settings.getSeedMembers(),index);
    }
 else {
      double prob=size / (liveMembers.size() + deadMembers.size());
      if (random.nextDouble() < prob) {
        sendGossip2Seed(buffer,settings.getSeedMembers(),index);
      }
    }
  }
}

Fixed version (ground truth):
private void gossip2Seed(Buffer buffer){
  int size=settings.getSeedMembers().size();
  if (size > 0) {
    if (size == 1 && settings.getSeedMembers().contains(localGossipMember)) {
      return;
    }
    int index=(size == 1) ? 0 : random.nextInt(size);
    if (liveMembers.size() == 1) {
      sendGossip2Seed(buffer,settings.getSeedMembers(),index);
    }
 else {
      double prob=size / (liveMembers.size() + deadMembers.size());
      if (random.nextDouble() < prob) {
        sendGossip2Seed(buffer,settings.getSeedMembers(),index);
      }
    }
  }
}
Program: 172000
Project: 172000
Buggy source:
private void remoteStateReplaceLocalState(GossipMember member,HeartbeatState remoteState){
  getEndpointMembers().put(member,remoteState);
  up(member);
}

Fixed version (ground truth):
private void remoteStateReplaceLocalState(GossipMember member,HeartbeatState remoteState){
  up(member);
  if (endpointMembers.containsKey(member)) {
    HeartbeatState state=endpointMembers.get(member);
    endpointMembers.remove(member);
    endpointMembers.put(member,state);
  }
}
Program: 172001
Project: 172001
Buggy source:
@Override public void run(){
  long newversion=endpointMembers.get(getSelf()).updateVersion();
  if (isDiscoverable(getSelf())) {
    up(getSelf());
  }
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("String_Node_Str");
    LOGGER.trace(String.format("String_Node_Str",newversion));
  }
  List<GossipDigest> digests=new ArrayList<>();
  try {
    randomGossipDigest(digests);
    if (digests.size() > 0) {
      Buffer syncMessageBuffer=encodeSyncMessage(digests);
      boolean b=gossip2LiveMember(syncMessageBuffer);
      gossip2UndiscoverableMember(syncMessageBuffer);
      if (!b || liveMembers.size() < settings.getSeedMembers().size()) {
        gossip2Seed(syncMessageBuffer);
      }
      checkStatus();
      if (LOGGER.isTraceEnabled()) {
        LOGGER.trace("String_Node_Str" + getLiveMembers());
        LOGGER.trace("String_Node_Str" + getDeadMembers());
        LOGGER.trace("String_Node_Str" + getEndpointMembers());
        LOGGER.trace("String_Node_Str" + convictedTime());
      }
      LOGGER.info("String_Node_Str" + getLiveMembers());
      LOGGER.info("String_Node_Str" + getDeadMembers());
      LOGGER.info("String_Node_Str" + getEndpointMembers());
      LOGGER.info("String_Node_Str" + convictedTime());
    }
  }
 catch (  UnknownHostException e) {
    LOGGER.error(e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void run(){
  long newversion=endpointMembers.get(getSelf()).updateVersion();
  if (isDiscoverable(getSelf())) {
    up(getSelf());
  }
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("String_Node_Str");
    LOGGER.trace(String.format("String_Node_Str",newversion));
  }
  List<GossipDigest> digests=new ArrayList<>();
  try {
    randomGossipDigest(digests);
    if (digests.size() > 0) {
      Buffer syncMessageBuffer=encodeSyncMessage(digests);
      boolean b=gossip2LiveMember(syncMessageBuffer);
      gossip2UndiscoverableMember(syncMessageBuffer);
      if (!b || liveMembers.size() < settings.getSeedMembers().size()) {
        gossip2Seed(syncMessageBuffer);
      }
      checkStatus();
    }
    if (LOGGER.isTraceEnabled()) {
      LOGGER.trace("String_Node_Str" + getLiveMembers());
      LOGGER.trace("String_Node_Str" + getDeadMembers());
      LOGGER.trace("String_Node_Str" + getEndpointMembers());
    }
  }
 catch (  UnknownHostException e) {
    LOGGER.error(e.getMessage());
  }
}
Program: 172002
Project: 172002
Buggy source:
public void down(GossipMember member){
  LOGGER.info("String_Node_Str");
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.DOWN);
    liveMembers.remove(member);
    if (!deadMembers.contains(member)) {
      deadMembers.add(member);
    }
    clearExecutor.schedule(() -> {
      clearMember(member);
    }
,getSettings().getDeleteThreshold() * getSettings().getGossipInterval(),TimeUnit.MILLISECONDS);
    fireGossipEvent(member,GossipState.DOWN);
  }
  finally {
    rwlock.writeLock().unlock();
  }
}

Fixed version (ground truth):
public void down(GossipMember member){
  LOGGER.info("String_Node_Str");
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.DOWN);
    liveMembers.remove(member);
    if (!deadMembers.contains(member)) {
      deadMembers.add(member);
    }
    fireGossipEvent(member,GossipState.DOWN);
  }
  finally {
    rwlock.writeLock().unlock();
  }
}
Program: 172003
Project: 172003
Buggy source:
private void up(GossipMember member){
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.UP);
    if (!liveMembers.contains(member)) {
      liveMembers.add(member);
    }
    if (candidateMembers.containsKey(member)) {
      candidateMembers.remove(member);
    }
    if (deadMembers.contains(member)) {
      deadMembers.remove(member);
    }
    if (!member.equals(getSelf())) {
      LOGGER.info("String_Node_Str");
      fireGossipEvent(member,GossipState.UP);
    }
  }
  finally {
    rwlock.writeLock().unlock();
  }
}

Fixed version (ground truth):
private void up(GossipMember member){
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.UP);
    if (!liveMembers.contains(member)) {
      liveMembers.add(member);
    }
    if (candidateMembers.containsKey(member)) {
      candidateMembers.remove(member);
    }
    if (deadMembers.contains(member)) {
      deadMembers.remove(member);
      LOGGER.info("String_Node_Str");
    }
    if (!member.equals(getSelf())) {
      fireGossipEvent(member,GossipState.UP);
    }
  }
  finally {
    rwlock.writeLock().unlock();
  }
}
Program: 172004
Project: 172004
Buggy source:
private boolean sendGossip2Seed(Buffer buffer,List<SeedMember> members,int index){
  if (buffer != null && index >= 0) {
    SeedMember target=members.get(index);
    settings.getMsgService().sendMsg(target.getIpAddress(),target.getPort(),buffer);
    return settings.getSeedMembers().contains(target);
  }
  return false;
}

Fixed version (ground truth):
private boolean sendGossip2Seed(Buffer buffer,List<SeedMember> members,int index){
  if (buffer != null && index >= 0) {
    SeedMember target=members.get(index);
    settings.getMsgService().sendMsg(target.getIpAddress(),target.getPort(),buffer);
    return true;
  }
  return false;
}
Program: 172005
Project: 172005
Buggy source:
public void down(GossipMember member){
  LOGGER.info("String_Node_Str");
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.DOWN);
    liveMembers.remove(member);
    if (!deadMembers.contains(member)) {
      deadMembers.add(member);
    }
    fireGossipEvent(member,GossipState.DOWN);
  }
  finally {
    rwlock.writeLock().unlock();
  }
}

Fixed version (ground truth):
public void down(GossipMember member){
  LOGGER.info("String_Node_Str");
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.DOWN);
    liveMembers.remove(member);
    if (!deadMembers.contains(member)) {
      deadMembers.add(member);
    }
    clearExecutor.schedule(() -> {
      if (deadMembers.contains(member)) {
        deadMembers.remove(member);
      }
    }
,getSettings().getDeleteThreshold() * getSettings().getGossipInterval(),TimeUnit.MILLISECONDS);
    fireGossipEvent(member,GossipState.DOWN);
  }
  finally {
    rwlock.writeLock().unlock();
  }
}
Program: 172006
Project: 172006
Buggy source:
protected void start(){
  LOGGER.info(String.format("String_Node_Str",localGossipMember.getCluster(),localGossipMember.getIpAddress(),localGossipMember.getPort(),localGossipMember.getId()));
  isWorking=true;
  settings.getMsgService().listen(getSelf().getIpAddress(),getSelf().getPort());
  doGossipExecotor.scheduleAtFixedRate(new GossipTask(),settings.getGossipInterval(),settings.getGossipInterval(),TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
protected void start(){
  LOGGER.info(String.format("String_Node_Str",localGossipMember.getCluster(),localGossipMember.getIpAddress(),localGossipMember.getPort(),localGossipMember.getId()));
  isWorking=true;
  settings.getMsgService().listen(getSelf().getIpAddress(),getSelf().getPort());
  doGossipExecutor.scheduleAtFixedRate(new GossipTask(),settings.getGossipInterval(),settings.getGossipInterval(),TimeUnit.MILLISECONDS);
}
Program: 172007
Project: 172007
Buggy source:
protected void shutdown(){
  getSettings().getMsgService().unListen();
  doGossipExecotor.shutdown();
  try {
    Thread.sleep(getSettings().getGossipInterval());
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
  Buffer buffer=encodeShutdownMessage();
  for (int i=0; i < getLiveMembers().size(); i++) {
    sendGossip(buffer,getLiveMembers(),i);
  }
  isWorking=false;
}

Fixed version (ground truth):
protected void shutdown(){
  getSettings().getMsgService().unListen();
  doGossipExecutor.shutdown();
  try {
    Thread.sleep(getSettings().getGossipInterval());
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
  Buffer buffer=encodeShutdownMessage();
  for (int i=0; i < getLiveMembers().size(); i++) {
    sendGossip(buffer,getLiveMembers(),i);
  }
  isWorking=false;
}
Program: 172008
Project: 172008
Buggy source:
public void init(String cluster,String ipAddress,Integer port,String id,List<SeedMember> seedMembers,GossipSettings settings,GossipListener listener){
  this.settings=settings;
  this.settings.setSeedMembers(seedMembers);
  this.cluster=cluster;
  this.localGossipMember=new GossipMember();
  this.localGossipMember.setCluster(cluster);
  this.localGossipMember.setIpAddress(ipAddress);
  this.localGossipMember.setPort(port);
  this.localGossipMember.setId(id);
  this.localGossipMember.setState(GossipState.JOIN);
  this.endpointMembers.put(localGossipMember,new HeartbeatState());
  this.listener=listener;
  fireGossipEvent(localGossipMember,GossipState.JOIN);
}

Fixed version (ground truth):
public void init(String cluster,String ipAddress,Integer port,String id,List<SeedMember> seedMembers,GossipSettings settings,GossipListener listener){
  this.cluster=cluster;
  this.localGossipMember=new GossipMember();
  this.localGossipMember.setCluster(cluster);
  this.localGossipMember.setIpAddress(ipAddress);
  this.localGossipMember.setPort(port);
  this.localGossipMember.setId(id);
  this.localGossipMember.setState(GossipState.JOIN);
  this.endpointMembers.put(localGossipMember,new HeartbeatState());
  this.listener=listener;
  this.settings=settings;
  this.settings.setSeedMembers(seedMembers);
  fireGossipEvent(localGossipMember,GossipState.JOIN);
}
Program: 172009
Project: 172009
Buggy source:
public ResultSet executeQuery(final BasicSearchParameters searchParameters,String language);

Fixed version (ground truth):
public ResultSet executeQuery(final SearchParameters searchParameters,String language);
Program: 172012
Project: 172012
Buggy source:
public SolrSQLJSONResultSet(JSONObject json,BasicSearchParameters searchParameters){
  try {
    solrResponse=((JSONObject)json).toString();
    JSONObject res=(JSONObject)json.get("String_Node_Str");
    docs=(JSONArray)res.get("String_Node_Str");
    JSONObject obj1=docs.getJSONObject(0);
    if (obj1.has(SOLR_STREAM_EXCEPTION)) {
      String error=obj1.get(SOLR_STREAM_EXCEPTION).toString();
      if (error.equalsIgnoreCase("String_Node_Str")) {
        throw new RuntimeException("String_Node_Str");
      }
      throw new RuntimeException("String_Node_Str" + error);
    }
    this.length=docs.length();
    JSONObject time=(JSONObject)docs.get(length - 1);
    this.numberFound=length - 1;
    queryTime=new Long((Integer)time.get("String_Node_Str"));
    this.resultSetMetaData=new SimpleResultSetMetaData(LimitBy.FINAL_SIZE,PermissionEvaluationMode.EAGER,(SearchParameters)searchParameters);
  }
 catch (  JSONException e) {
    logger.info(e.getMessage());
  }
}

Fixed version (ground truth):
public SolrSQLJSONResultSet(JSONObject json,SearchParameters searchParameters){
  try {
    solrResponse=((JSONObject)json).toString();
    JSONObject res=(JSONObject)json.get("String_Node_Str");
    docs=(JSONArray)res.get("String_Node_Str");
    JSONObject obj1=docs.getJSONObject(0);
    if (obj1.has(SOLR_STREAM_EXCEPTION)) {
      String error=obj1.get(SOLR_STREAM_EXCEPTION).toString();
      if (error.equalsIgnoreCase("String_Node_Str")) {
        throw new RuntimeException("String_Node_Str");
      }
      if (searchParameters.getExtraParameters().containsKey("String_Node_Str")) {
      }
 else {
        throw new RuntimeException("String_Node_Str" + error);
      }
    }
    this.length=docs.length();
    JSONObject time=(JSONObject)docs.get(length - 1);
    this.numberFound=length - 1;
    queryTime=new Long((Integer)time.get("String_Node_Str"));
    this.resultSetMetaData=new SimpleResultSetMetaData(LimitBy.FINAL_SIZE,PermissionEvaluationMode.EAGER,(SearchParameters)searchParameters);
  }
 catch (  JSONException e) {
    logger.info(e.getMessage());
  }
}
Program: 172013
Project: 172013
Buggy source:
public ResultSet executeQuery(final BasicSearchParameters searchParameters,String language);

Fixed version (ground truth):
public ResultSet executeQuery(final SearchParameters searchParameters,String language);
Program: 172016
Project: 172016
Buggy source:
public SolrSQLJSONResultSet(JSONObject json,BasicSearchParameters searchParameters){
  try {
    solrResponse=((JSONObject)json).toString();
    JSONObject res=(JSONObject)json.get("String_Node_Str");
    docs=(JSONArray)res.get("String_Node_Str");
    JSONObject obj1=docs.getJSONObject(0);
    if (obj1.has(SOLR_STREAM_EXCEPTION)) {
      String error=obj1.get(SOLR_STREAM_EXCEPTION).toString();
      if (error.equalsIgnoreCase("String_Node_Str")) {
        throw new RuntimeException("String_Node_Str");
      }
      throw new RuntimeException("String_Node_Str" + error);
    }
    this.length=docs.length();
    JSONObject time=(JSONObject)docs.get(length - 1);
    this.numberFound=length - 1;
    queryTime=new Long((Integer)time.get("String_Node_Str"));
    this.resultSetMetaData=new SimpleResultSetMetaData(LimitBy.FINAL_SIZE,PermissionEvaluationMode.EAGER,(SearchParameters)searchParameters);
  }
 catch (  JSONException e) {
    logger.info(e.getMessage());
  }
}

Fixed version (ground truth):
public SolrSQLJSONResultSet(JSONObject json,SearchParameters searchParameters){
  try {
    solrResponse=((JSONObject)json).toString();
    JSONObject res=(JSONObject)json.get("String_Node_Str");
    docs=(JSONArray)res.get("String_Node_Str");
    JSONObject obj1=docs.getJSONObject(0);
    if (obj1.has(SOLR_STREAM_EXCEPTION)) {
      String error=obj1.get(SOLR_STREAM_EXCEPTION).toString();
      if (error.equalsIgnoreCase("String_Node_Str")) {
        throw new RuntimeException("String_Node_Str");
      }
      if (searchParameters.getExtraParameters().containsKey("String_Node_Str")) {
      }
 else {
        throw new RuntimeException("String_Node_Str" + error);
      }
    }
    this.length=docs.length();
    JSONObject time=(JSONObject)docs.get(length - 1);
    this.numberFound=length - 1;
    queryTime=new Long((Integer)time.get("String_Node_Str"));
    this.resultSetMetaData=new SimpleResultSetMetaData(LimitBy.FINAL_SIZE,PermissionEvaluationMode.EAGER,(SearchParameters)searchParameters);
  }
 catch (  JSONException e) {
    logger.info(e.getMessage());
  }
}
Program: 172019
Project: 172019
Buggy source:
/** 
 * Test for CC / BCC 
 * @throws Exception 
 */
@Test public void testSendingToCarbonCopy() throws IOException, MessagingException {
  Action mailAction=ACTION_SERVICE.createAction(MailActionExecuter.NAME);
  mailAction.setParameterValue(MailActionExecuter.PARAM_FROM,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TO,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_CC,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL,(Serializable)getModel());
  ACTION_SERVICE.executeAction(mailAction,null);
  MimeMessage message=ACTION_EXECUTER.retrieveLastTestMessage();
  Assert.assertNotNull(message);
  Address[] all=message.getAllRecipients();
  Address[] ccs=message.getRecipients(RecipientType.CC);
  Assert.assertEquals("String_Node_Str",2,all.length);
  Assert.assertEquals("String_Node_Str",1,ccs.length);
  Assert.assertTrue(ccs[0].toString().contains("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Test for CC / BCC 
 * @throws Exception 
 */
@Test public void testSendingToCarbonCopy() throws IOException, MessagingException {
  Action mailAction=ACTION_SERVICE.createAction(MailActionExecuter.NAME);
  mailAction.setParameterValue(MailActionExecuter.PARAM_FROM,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TO,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_CC,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_BCC,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL,(Serializable)getModel());
  ACTION_SERVICE.executeAction(mailAction,null);
  MimeMessage message=ACTION_EXECUTER.retrieveLastTestMessage();
  Assert.assertNotNull(message);
  Address[] all=message.getAllRecipients();
  Address[] ccs=message.getRecipients(RecipientType.CC);
  Address[] bccs=message.getRecipients(RecipientType.BCC);
  Assert.assertEquals(3,all.length);
  Assert.assertEquals(1,ccs.length);
  Assert.assertEquals(1,bccs.length);
  Assert.assertTrue(ccs[0].toString().contains("String_Node_Str"));
  Assert.assertTrue(bccs[0].toString().contains("String_Node_Str"));
}
Program: 172022
Project: 172022
Buggy source:
/** 
 * Test for CC / BCC 
 * @throws Exception 
 */
@Test public void testSendingToCarbonCopy() throws IOException, MessagingException {
  Action mailAction=ACTION_SERVICE.createAction(MailActionExecuter.NAME);
  mailAction.setParameterValue(MailActionExecuter.PARAM_FROM,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TO,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_CC,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL,(Serializable)getModel());
  ACTION_SERVICE.executeAction(mailAction,null);
  MimeMessage message=ACTION_EXECUTER.retrieveLastTestMessage();
  Assert.assertNotNull(message);
  Address[] all=message.getAllRecipients();
  Address[] ccs=message.getRecipients(RecipientType.CC);
  Assert.assertEquals("String_Node_Str",2,all.length);
  Assert.assertEquals("String_Node_Str",1,ccs.length);
  Assert.assertTrue(ccs[0].toString().contains("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Test for CC / BCC 
 * @throws Exception 
 */
@Test public void testSendingToCarbonCopy() throws IOException, MessagingException {
  Action mailAction=ACTION_SERVICE.createAction(MailActionExecuter.NAME);
  mailAction.setParameterValue(MailActionExecuter.PARAM_FROM,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TO,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_CC,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_BCC,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE,"String_Node_Str");
  mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL,(Serializable)getModel());
  ACTION_SERVICE.executeAction(mailAction,null);
  MimeMessage message=ACTION_EXECUTER.retrieveLastTestMessage();
  Assert.assertNotNull(message);
  Address[] all=message.getAllRecipients();
  Address[] ccs=message.getRecipients(RecipientType.CC);
  Address[] bccs=message.getRecipients(RecipientType.BCC);
  Assert.assertEquals(3,all.length);
  Assert.assertEquals(1,ccs.length);
  Assert.assertEquals(1,bccs.length);
  Assert.assertTrue(ccs[0].toString().contains("String_Node_Str"));
  Assert.assertTrue(bccs[0].toString().contains("String_Node_Str"));
}
Program: 172023
Project: 172023
Buggy source:
/** 
 * Register data collector with this service and start the schedule. The registered collector will be called to provide heartbeat data at the scheduled interval. Each collector registered via this method must have a unique collector id.
 * @param collector collector to register
 */
@Override public void registerCollector(final HBBaseDataCollector collector){
  if (collector.getCollectorId() == null) {
    logger.error("String_Node_Str");
    return;
  }
  for (  HBBaseDataCollector col : collectors) {
    if (collector.getCollectorId().equals(col.getCollectorId())) {
      logger.error("String_Node_Str" + collector.getCollectorId());
      return;
    }
  }
  try {
    scheduleCollector(collector);
    collectors.add(collector);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + collectorInfo(collector));
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + collectorInfo(collector),e);
  }
}

Fixed version (ground truth):
/** 
 * Register data collector with this service and start the schedule. The registered collector will be called to provide heartbeat data at the scheduled interval. Each collector registered via this method must have a unique collector id.
 * @param collector collector to register
 */
@Override public void registerCollector(final HBBaseDataCollector collector){
  for (  HBBaseDataCollector col : collectors) {
    if (collector.getCollectorId().equals(col.getCollectorId())) {
      throw new IllegalArgumentException("String_Node_Str" + collector.getCollectorId());
    }
  }
  try {
    scheduleCollector(collector);
    collectors.add(collector);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + collectorInfo(collector));
    }
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str" + collectorInfo(collector),e);
  }
}
Program: 172024
Project: 172024
Buggy source:
private void collectAndSendDataLocked(final HBBaseDataCollector collector,final HBDataSenderService hbDataSenderService) throws JobExecutionException {
  try {
    List<HBData> data=collector.collectData();
    hbDataSenderService.sendData(data);
  }
 catch (  final Exception e) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + collector.getCollectorId(),e);
    }
  }
}

Fixed version (ground truth):
private void collectAndSendDataLocked(final HBBaseDataCollector collector,final HBDataSenderService hbDataSenderService) throws JobExecutionException {
  try {
    List<HBData> data=collector.collectData();
    hbDataSenderService.sendData(data);
  }
 catch (  final Exception e) {
    logger.error("String_Node_Str" + collector.getCollectorId(),e);
  }
}
Program: 172025
Project: 172025
Buggy source:
public void execute(final JobExecutionContext jobexecutioncontext) throws JobExecutionException {
  final JobDataMap dataMap=jobexecutioncontext.getJobDetail().getJobDataMap();
  final HBBaseDataCollector collector=(HBBaseDataCollector)dataMap.get(COLLECTOR_KEY);
  final HBDataSenderService hbDataSenderService=(HBDataSenderService)dataMap.get(DATA_SENDER_SERVICE_KEY);
  final JobLockService jobLockService=(JobLockService)dataMap.get(JOB_LOCK_SERVICE_KEY);
  if (collector == null) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    return;
  }
  if (hbDataSenderService == null) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    return;
  }
  if (jobLockService == null) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    return;
  }
  QName qName=QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI,collector.getCollectorId());
  String lockToken=null;
  LockCallback lockCallback=new LockCallback(qName);
  try {
    lockToken=acquireLock(lockCallback,qName,jobLockService);
    collectAndSendDataLocked(collector,hbDataSenderService);
    try {
      Thread.sleep(LOCK_TTL_OFFSET);
    }
 catch (    InterruptedException e) {
    }
  }
 catch (  LockAcquisitionException e) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + e.getMessage());
    }
  }
 finally {
    releaseLock(lockCallback,lockToken,qName,jobLockService);
  }
}

Fixed version (ground truth):
public void execute(final JobExecutionContext jobexecutioncontext) throws JobExecutionException {
  final JobDataMap dataMap=jobexecutioncontext.getJobDetail().getJobDataMap();
  final HBBaseDataCollector collector=(HBBaseDataCollector)dataMap.get(COLLECTOR_KEY);
  final HBDataSenderService hbDataSenderService=(HBDataSenderService)dataMap.get(DATA_SENDER_SERVICE_KEY);
  final JobLockService jobLockService=(JobLockService)dataMap.get(JOB_LOCK_SERVICE_KEY);
  if (collector == null) {
    logger.error("String_Node_Str");
    return;
  }
  if (hbDataSenderService == null) {
    logger.error("String_Node_Str");
    return;
  }
  if (jobLockService == null) {
    logger.error("String_Node_Str");
    return;
  }
  QName qName=QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI,collector.getCollectorId());
  String lockToken=null;
  LockCallback lockCallback=new LockCallback(qName);
  try {
    lockToken=acquireLock(lockCallback,qName,jobLockService);
    collectAndSendDataLocked(collector,hbDataSenderService);
  }
 catch (  LockAcquisitionException e) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + e.getMessage());
    }
  }
 finally {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + collector.getCollectorId());
    }
    lockCallback.running.set(false);
  }
}
Program: 172026
Project: 172026
Buggy source:
/** 
 * Test scheduling job for collector with invalid cron expression
 */
@Test public void testInvalidCronExpression() throws Exception {
  final HBDataCollectorServiceImpl collectorService=new HBDataCollectorServiceImpl(true);
  collectorService.setScheduler(scheduler);
  SimpleHBDataCollector c1=new SimpleHBDataCollector("String_Node_Str",VALID_CRON);
  collectorService.registerCollector(c1);
  SimpleHBDataCollector c2=new SimpleHBDataCollector("String_Node_Str",INVALID_CRON);
  collectorService.registerCollector(c2);
  assertTrue(isJobScheduledForCollector(c1.getCollectorId(),scheduler));
  assertFalse(isJobScheduledForCollector(c2.getCollectorId(),scheduler));
}

Fixed version (ground truth):
/** 
 * Test scheduling job for collector with invalid cron expression
 */
@Test(expected=RuntimeException.class) public void testInvalidCronExpression() throws Exception {
  final HBDataCollectorServiceImpl collectorService=new HBDataCollectorServiceImpl(true);
  collectorService.setScheduler(scheduler);
  SimpleHBDataCollector c2=new SimpleHBDataCollector("String_Node_Str",INVALID_CRON);
  collectorService.registerCollector(c2);
}
Program: 172027
Project: 172027
Buggy source:
@Test public void testRegisterSameCollectorTwice() throws Exception {
  final HBDataCollectorServiceImpl collectorService=new HBDataCollectorServiceImpl(true);
  collectorService.setScheduler(scheduler);
  HBBaseDataCollector c1=new SimpleHBDataCollector("String_Node_Str",VALID_CRON);
  collectorService.registerCollector(c1);
  collectorService.registerCollector(c1);
  assertEquals("String_Node_Str",1,scheduler.getJobNames(Scheduler.DEFAULT_GROUP).length);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void testRegisterSameCollectorTwice() throws Exception {
  final HBDataCollectorServiceImpl collectorService=new HBDataCollectorServiceImpl(true);
  collectorService.setScheduler(scheduler);
  HBBaseDataCollector c1=new SimpleHBDataCollector("String_Node_Str",VALID_CRON);
  collectorService.registerCollector(c1);
  collectorService.registerCollector(c1);
}
Program: 172030
Project: 172030
Buggy source:
/** 
 * Register data collector with this service and start the schedule. The registered collector will be called to provide heartbeat data at the scheduled interval. Each collector registered via this method must have a unique collector id.
 * @param collector collector to register
 */
@Override public void registerCollector(final HBBaseDataCollector collector){
  if (collector.getCollectorId() == null) {
    logger.error("String_Node_Str");
    return;
  }
  for (  HBBaseDataCollector col : collectors) {
    if (collector.getCollectorId().equals(col.getCollectorId())) {
      logger.error("String_Node_Str" + collector.getCollectorId());
      return;
    }
  }
  try {
    scheduleCollector(collector);
    collectors.add(collector);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + collectorInfo(collector));
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + collectorInfo(collector),e);
  }
}

Fixed version (ground truth):
/** 
 * Register data collector with this service and start the schedule. The registered collector will be called to provide heartbeat data at the scheduled interval. Each collector registered via this method must have a unique collector id.
 * @param collector collector to register
 */
@Override public void registerCollector(final HBBaseDataCollector collector){
  for (  HBBaseDataCollector col : collectors) {
    if (collector.getCollectorId().equals(col.getCollectorId())) {
      throw new IllegalArgumentException("String_Node_Str" + collector.getCollectorId());
    }
  }
  try {
    scheduleCollector(collector);
    collectors.add(collector);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + collectorInfo(collector));
    }
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str" + collectorInfo(collector),e);
  }
}
Program: 172031
Project: 172031
Buggy source:
private void collectAndSendDataLocked(final HBBaseDataCollector collector,final HBDataSenderService hbDataSenderService) throws JobExecutionException {
  try {
    List<HBData> data=collector.collectData();
    hbDataSenderService.sendData(data);
  }
 catch (  final Exception e) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + collector.getCollectorId(),e);
    }
  }
}

Fixed version (ground truth):
private void collectAndSendDataLocked(final HBBaseDataCollector collector,final HBDataSenderService hbDataSenderService) throws JobExecutionException {
  try {
    List<HBData> data=collector.collectData();
    hbDataSenderService.sendData(data);
  }
 catch (  final Exception e) {
    logger.error("String_Node_Str" + collector.getCollectorId(),e);
  }
}
Program: 172032
Project: 172032
Buggy source:
public void execute(final JobExecutionContext jobexecutioncontext) throws JobExecutionException {
  final JobDataMap dataMap=jobexecutioncontext.getJobDetail().getJobDataMap();
  final HBBaseDataCollector collector=(HBBaseDataCollector)dataMap.get(COLLECTOR_KEY);
  final HBDataSenderService hbDataSenderService=(HBDataSenderService)dataMap.get(DATA_SENDER_SERVICE_KEY);
  final JobLockService jobLockService=(JobLockService)dataMap.get(JOB_LOCK_SERVICE_KEY);
  if (collector == null) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    return;
  }
  if (hbDataSenderService == null) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    return;
  }
  if (jobLockService == null) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    return;
  }
  QName qName=QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI,collector.getCollectorId());
  String lockToken=null;
  LockCallback lockCallback=new LockCallback(qName);
  try {
    lockToken=acquireLock(lockCallback,qName,jobLockService);
    collectAndSendDataLocked(collector,hbDataSenderService);
    try {
      Thread.sleep(LOCK_TTL_OFFSET);
    }
 catch (    InterruptedException e) {
    }
  }
 catch (  LockAcquisitionException e) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + e.getMessage());
    }
  }
 finally {
    releaseLock(lockCallback,lockToken,qName,jobLockService);
  }
}

Fixed version (ground truth):
public void execute(final JobExecutionContext jobexecutioncontext) throws JobExecutionException {
  final JobDataMap dataMap=jobexecutioncontext.getJobDetail().getJobDataMap();
  final HBBaseDataCollector collector=(HBBaseDataCollector)dataMap.get(COLLECTOR_KEY);
  final HBDataSenderService hbDataSenderService=(HBDataSenderService)dataMap.get(DATA_SENDER_SERVICE_KEY);
  final JobLockService jobLockService=(JobLockService)dataMap.get(JOB_LOCK_SERVICE_KEY);
  if (collector == null) {
    logger.error("String_Node_Str");
    return;
  }
  if (hbDataSenderService == null) {
    logger.error("String_Node_Str");
    return;
  }
  if (jobLockService == null) {
    logger.error("String_Node_Str");
    return;
  }
  QName qName=QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI,collector.getCollectorId());
  String lockToken=null;
  LockCallback lockCallback=new LockCallback(qName);
  try {
    lockToken=acquireLock(lockCallback,qName,jobLockService);
    collectAndSendDataLocked(collector,hbDataSenderService);
  }
 catch (  LockAcquisitionException e) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + e.getMessage());
    }
  }
 finally {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + collector.getCollectorId());
    }
    lockCallback.running.set(false);
  }
}
Program: 172033
Project: 172033
Buggy source:
/** 
 * Test scheduling job for collector with invalid cron expression
 */
@Test public void testInvalidCronExpression() throws Exception {
  final HBDataCollectorServiceImpl collectorService=new HBDataCollectorServiceImpl(true);
  collectorService.setScheduler(scheduler);
  SimpleHBDataCollector c1=new SimpleHBDataCollector("String_Node_Str",VALID_CRON);
  collectorService.registerCollector(c1);
  SimpleHBDataCollector c2=new SimpleHBDataCollector("String_Node_Str",INVALID_CRON);
  collectorService.registerCollector(c2);
  assertTrue(isJobScheduledForCollector(c1.getCollectorId(),scheduler));
  assertFalse(isJobScheduledForCollector(c2.getCollectorId(),scheduler));
}

Fixed version (ground truth):
/** 
 * Test scheduling job for collector with invalid cron expression
 */
@Test(expected=RuntimeException.class) public void testInvalidCronExpression() throws Exception {
  final HBDataCollectorServiceImpl collectorService=new HBDataCollectorServiceImpl(true);
  collectorService.setScheduler(scheduler);
  SimpleHBDataCollector c2=new SimpleHBDataCollector("String_Node_Str",INVALID_CRON);
  collectorService.registerCollector(c2);
}
Program: 172034
Project: 172034
Buggy source:
@Test public void testRegisterSameCollectorTwice() throws Exception {
  final HBDataCollectorServiceImpl collectorService=new HBDataCollectorServiceImpl(true);
  collectorService.setScheduler(scheduler);
  HBBaseDataCollector c1=new SimpleHBDataCollector("String_Node_Str",VALID_CRON);
  collectorService.registerCollector(c1);
  collectorService.registerCollector(c1);
  assertEquals("String_Node_Str",1,scheduler.getJobNames(Scheduler.DEFAULT_GROUP).length);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void testRegisterSameCollectorTwice() throws Exception {
  final HBDataCollectorServiceImpl collectorService=new HBDataCollectorServiceImpl(true);
  collectorService.setScheduler(scheduler);
  HBBaseDataCollector c1=new SimpleHBDataCollector("String_Node_Str",VALID_CRON);
  collectorService.registerCollector(c1);
  collectorService.registerCollector(c1);
}
Program: 172037
Project: 172037
Buggy source:
@Test public void alf18373Test(){
  long sourceSize=1024 * 1024 * 3 / 2;
  transformerDebug.pushAvailable("String_Node_Str","String_Node_Str","String_Node_Str",options);
  transformerDebug.unavailableTransformer(transformer1,"String_Node_Str","String_Node_Str",50);
  transformerDebug.unavailableTransformer(transformer2,"String_Node_Str","String_Node_Str",0);
  transformerDebug.unavailableTransformer(transformer3,"String_Node_Str","String_Node_Str",50);
  transformerDebug.unavailableTransformer(transformer4,"String_Node_Str","String_Node_Str",50);
  List<ContentTransformer> transformers=Arrays.asList(new ContentTransformer[]{});
  transformerDebug.availableTransformers(transformers,sourceSize,options,"String_Node_Str");
  transformerDebug.popAvailable();
  assertDebugEntriesEquals(new String[]{"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"},untimed(debug.getEntries(10)));
  assertLogEntriesEquals(new String[]{"String_Node_Str"},untimed(log.getEntries(10)));
}

Fixed version (ground truth):
@Test public void alf18373Test(){
  long sourceSize=1024 * 1024 * 3 / 2;
  transformerDebug.pushAvailable("String_Node_Str","String_Node_Str","String_Node_Str",options);
  transformerDebug.unavailableTransformer(transformer1,"String_Node_Str","String_Node_Str",50);
  transformerDebug.unavailableTransformer(transformer2,"String_Node_Str","String_Node_Str",0);
  transformerDebug.unavailableTransformer(transformer3,"String_Node_Str","String_Node_Str",50);
  transformerDebug.unavailableTransformer(transformer4,"String_Node_Str","String_Node_Str",50);
  List<ContentTransformer> transformers=Arrays.asList(new ContentTransformer[]{});
  transformerDebug.availableTransformers(transformers,sourceSize,options,"String_Node_Str");
  transformerDebug.popAvailable();
  assertDebugEntriesEquals(new String[]{"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"},unnumbered(untimed(debug.getEntries(10))));
  assertLogEntriesEquals(new String[]{"String_Node_Str"},unnumbered(untimed(log.getEntries(10))));
}
Program: 172038
Project: 172038
Buggy source:
private String[] unnumbered(String actual[]){
  for (int i=actual.length - 1; i >= 0; i--) {
    StringJoiner sj=new StringJoiner("String_Node_Str");
    String[] bits=actual[i].split("String_Node_Str");
    for (    String bit : bits) {
      Pattern p=Pattern.compile("String_Node_Str");
      Matcher m=p.matcher(bit);
      bit=m.replaceFirst("String_Node_Str");
      sj.add(bit);
    }
    actual[i]=sj.toString();
  }
  return actual;
}

Fixed version (ground truth):
private String[] unnumbered(String actual[]){
  for (int i=actual.length - 1; i >= 0; i--) {
    StringJoiner sj=new StringJoiner(System.lineSeparator());
    String[] bits=actual[i].split(System.lineSeparator());
    for (    String bit : bits) {
      Pattern p=Pattern.compile("String_Node_Str");
      Matcher m=p.matcher(bit);
      bit=m.replaceFirst("String_Node_Str");
      sj.add(bit);
    }
    actual[i]=sj.toString();
  }
  return actual;
}
Program: 172039
Project: 172039
Buggy source:
@Override public Set<String> getContainingAuthorities(AuthorityType type,String name,boolean immediate){
  if (!immediate && AuthorityType.getAuthorityType(name) == AuthorityType.USER) {
    Set<String> authorities=userAuthorityCache.get(name);
    if (authorities == null) {
      authorities=new TreeSet<String>();
      if (useBridgeTable) {
        listAuthoritiesByBridgeTable(authorities,name);
      }
 else {
        listAuthorities(null,name,authorities,true,true);
      }
      userAuthorityCache.put(name,Collections.unmodifiableSet(authorities));
    }
    if (type == null) {
      return authorities;
    }
    Set<String> filteredAuthorities=new TreeSet<String>();
    for (    String authority : authorities) {
      addAuthorityNameIfMatches(filteredAuthorities,authority,type);
    }
    return filteredAuthorities;
  }
 else {
    Set<String> authorities=new TreeSet<String>();
    listAuthorities(type,name,authorities,true,!immediate);
    return authorities;
  }
}

Fixed version (ground truth):
@Override public Set<String> getContainingAuthorities(AuthorityType type,String name,boolean immediate){
  if (!immediate && AuthorityType.getAuthorityType(name) == AuthorityType.USER) {
    Set<String> authorities=userAuthorityCache.get(name);
    if (authorities == null) {
      NodeRef personRef=getAuthorityOrNull(name);
      if (personRef == null) {
        return new TreeSet<String>();
      }
      name=(String)nodeService.getProperty(personRef,ContentModel.PROP_USERNAME);
      authorities=userAuthorityCache.get(name);
    }
    if (authorities == null) {
      authorities=new TreeSet<String>();
      if (useBridgeTable) {
        listAuthoritiesByBridgeTable(authorities,name);
      }
 else {
        listAuthorities(null,name,authorities,true,true);
      }
      userAuthorityCache.put(name,Collections.unmodifiableSet(authorities));
    }
    if (type == null) {
      return authorities;
    }
    Set<String> filteredAuthorities=new TreeSet<String>();
    for (    String authority : authorities) {
      addAuthorityNameIfMatches(filteredAuthorities,authority,type);
    }
    return filteredAuthorities;
  }
 else {
    Set<String> authorities=new TreeSet<String>();
    listAuthorities(type,name,authorities,true,!immediate);
    return authorities;
  }
}
Program: 172040
Project: 172040
Buggy source:
public void removeAuthority(String parentName,String childName,boolean cacheRefresh){
  NodeRef parentRef=getAuthorityOrNull(parentName);
  if (parentRef == null) {
    throw new UnknownAuthorityException("String_Node_Str" + parentName);
  }
  NodeRef childRef=getAuthorityOrNull(childName);
  if (childRef == null) {
    throw new UnknownAuthorityException("String_Node_Str" + childName);
  }
  nodeService.removeChild(parentRef,childRef);
  childAuthorityCache.remove(parentRef);
  if (AuthorityType.getAuthorityType(childName) == AuthorityType.USER) {
    userAuthorityCache.remove(childName);
  }
 else {
    userAuthorityCache.clear();
    if (cacheRefresh) {
      authorityBridgeTableCache.refresh();
    }
  }
}

Fixed version (ground truth):
public void removeAuthority(String parentName,String childName,boolean cacheRefresh){
  NodeRef parentRef=getAuthorityOrNull(parentName);
  if (parentRef == null) {
    throw new UnknownAuthorityException("String_Node_Str" + parentName);
  }
  NodeRef childRef=getAuthorityOrNull(childName);
  if (childRef == null) {
    throw new UnknownAuthorityException("String_Node_Str" + childName);
  }
  nodeService.removeChild(parentRef,childRef);
  childAuthorityCache.remove(parentRef);
  if (AuthorityType.getAuthorityType(childName) == AuthorityType.USER) {
    childName=(String)nodeService.getProperty(childRef,ContentModel.PROP_USERNAME);
    userAuthorityCache.remove(childName);
  }
 else {
    userAuthorityCache.clear();
    if (cacheRefresh) {
      authorityBridgeTableCache.refresh();
    }
  }
}
Program: 172041
Project: 172041
Buggy source:
/** 
 * Attempts to retrieve and parse an attribute in the supplied object to an integer. If the attribute cannot be found or cannot be parsed then the supplied default is returned.
 * @param attribute
 * @param defaultValue
 * @param sourceObject
 * @return
 */
public int getIntegerValue(String attribute,int defaultValue,Map<Serializable,Serializable> sourceObject){
  Integer integer=(Integer)sourceObject.get(attribute);
  if (integer == null) {
    integer=defaultValue;
  }
  return integer;
}

Fixed version (ground truth):
/** 
 * Attempts to retrieve and parse an attribute in the supplied object to an integer. If the attribute cannot be found or cannot be parsed then the supplied default is returned.
 * @param attribute
 * @param defaultValue
 * @param sourceObject
 * @return
 */
public int getIntegerValue(String attribute,int defaultValue,Map<Serializable,Serializable> sourceObject){
  int intValue=defaultValue;
  Number configuredInteger=(Number)sourceObject.get(attribute);
  if (configuredInteger != null) {
    intValue=configuredInteger.intValue();
  }
  return intValue;
}