nus-yam/ex-repair huggingface dataset:
Program: 8135
Project: 8135
Buggy source:
/** 
 * �˷����Ѿ����������Ƿ���false�����ų�δ��ĳ���汾���Ƴ��˷������벻Ҫ��ʹ�á�
 * @return
 */
@Deprecated public boolean isOrdered(){
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether the message is in order,it is deprecated and will be removed in future version.
 * @return
 */
@Deprecated public boolean isOrdered(){
  return false;
}
Program: 8136
Project: 8136
Buggy source:
/** 
 * ������Ϣpayload
 * @return
 */
public byte[] getData(){
  return this.data;
}

Fixed version (ground truth):
/** 
 * Returns message's payload
 * @return
 */
public byte[] getData(){
  return this.data;
}
Program: 8137
Project: 8137
Buggy source:
public SamsaCommandProcessor(final MessageStoreManager storeManager,final ExecutorsManager executorsManager,final StatsManager statsManager,final RemotingServer remotingServer,final MetaConfig metaConfig,final IdWorker idWorker,final BrokerZooKeeper brokerZooKeeper,final RemotingClient remotingClient,final String slave,final int callbackThreadCount) throws NotifyRemotingException, InterruptedException {
  super(storeManager,executorsManager,statsManager,remotingServer,metaConfig,idWorker,brokerZooKeeper);
  this.slaveUrl=MetamorphosisWireFormatType.SCHEME + "String_Node_Str" + slave;
  this.remotingClient=remotingClient;
  this.callBackExecutor=new ThreadPoolExecutor(callbackThreadCount,callbackThreadCount,60,TimeUnit.SECONDS,new ArrayBlockingQueue<Runnable>(10000),new ThreadPoolExecutor.CallerRunsPolicy());
  log.info("String_Node_Str" + this.slaveUrl);
  this.remotingClient.connect(this.slaveUrl);
  try {
    this.remotingClient.awaitReadyInterrupt(this.slaveUrl);
  }
 catch (  final NotifyRemotingException e) {
    log.error("String_Node_Str" + this.slaveUrl + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
public SamsaCommandProcessor(final MessageStoreManager storeManager,final ExecutorsManager executorsManager,final StatsManager statsManager,final RemotingServer remotingServer,final MetaConfig metaConfig,final IdWorker idWorker,final BrokerZooKeeper brokerZooKeeper,final RemotingClient remotingClient,final String slave,final int callbackThreadCount) throws NotifyRemotingException, InterruptedException {
  super(storeManager,executorsManager,statsManager,remotingServer,metaConfig,idWorker,brokerZooKeeper);
  this.slaveUrl=MetamorphosisWireFormatType.SCHEME + "String_Node_Str" + slave;
  this.remotingClient=remotingClient;
  this.callBackExecutor=new ThreadPoolExecutor(callbackThreadCount,callbackThreadCount,60,TimeUnit.SECONDS,new ArrayBlockingQueue<Runnable>(10000),new ThreadPoolExecutor.CallerRunsPolicy());
  this.sentSlaveFailureCounter=new AtomicInteger(0);
  log.info("String_Node_Str" + this.slaveUrl);
  this.remotingClient.addConnectionLifeCycleListener(new SlaveConnectionLifeCycleListener());
  this.remotingClient.connect(this.slaveUrl);
  try {
    this.remotingClient.awaitReadyInterrupt(this.slaveUrl);
  }
 catch (  final NotifyRemotingException e) {
    log.error("String_Node_Str" + this.slaveUrl + "String_Node_Str",e);
  }
}
Program: 8138
Project: 8138
Buggy source:
@Override public void onResponse(final ResponseCommand responseCommand,final Connection conn){
  if (responseCommand.getResponseStatus() == ResponseStatus.NO_ERROR) {
synchronized (this) {
      this.slaveSuccess=true;
    }
  }
  this.tryComplete();
}

Fixed version (ground truth):
@Override public void onResponse(final ResponseCommand responseCommand,final Connection conn){
  if (responseCommand.getResponseStatus() == ResponseStatus.NO_ERROR) {
    SamsaCommandProcessor.this.sentSlaveFailureCounter.set(0);
synchronized (this) {
      this.slaveSuccess=true;
    }
  }
 else {
    SamsaCommandProcessor.this.whenSentSlaveFailed();
  }
  this.tryComplete();
}
Program: 8139
Project: 8139
Buggy source:
public SamsaCommandProcessor(final MessageStoreManager storeManager,final ExecutorsManager executorsManager,final StatsManager statsManager,final RemotingServer remotingServer,final MetaConfig metaConfig,final IdWorker idWorker,final BrokerZooKeeper brokerZooKeeper,final RemotingClient remotingClient,final String slave,final int callbackThreadCount) throws NotifyRemotingException, InterruptedException {
  super(storeManager,executorsManager,statsManager,remotingServer,metaConfig,idWorker,brokerZooKeeper);
  this.slaveUrl=MetamorphosisWireFormatType.SCHEME + "String_Node_Str" + slave;
  this.remotingClient=remotingClient;
  this.callBackExecutor=new ThreadPoolExecutor(callbackThreadCount,callbackThreadCount,60,TimeUnit.SECONDS,new ArrayBlockingQueue<Runnable>(10000),new ThreadPoolExecutor.CallerRunsPolicy());
  this.sentSlaveFailureCounter=new AtomicInteger(0);
  log.info("String_Node_Str" + this.slaveUrl);
  this.remotingClient.addConnectionLifeCycleListener(new SlaveConnectionLifeCycleListener());
  this.remotingClient.connect(this.slaveUrl);
  try {
    this.remotingClient.awaitReadyInterrupt(this.slaveUrl);
  }
 catch (  final NotifyRemotingException e) {
    log.error("String_Node_Str" + this.slaveUrl + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
public SamsaCommandProcessor(final MessageStoreManager storeManager,final ExecutorsManager executorsManager,final StatsManager statsManager,final RemotingServer remotingServer,final MetaConfig metaConfig,final IdWorker idWorker,final BrokerZooKeeper brokerZooKeeper,final RemotingClient remotingClient,final String slave,final int callbackThreadCount) throws NotifyRemotingException, InterruptedException {
  super(storeManager,executorsManager,statsManager,remotingServer,metaConfig,idWorker,brokerZooKeeper);
  this.slaveUrl=MetamorphosisWireFormatType.SCHEME + "String_Node_Str" + slave;
  this.remotingClient=remotingClient;
  this.callBackExecutor=new ThreadPoolExecutor(callbackThreadCount,callbackThreadCount,60,TimeUnit.SECONDS,new ArrayBlockingQueue<Runnable>(10000),new ThreadPoolExecutor.CallerRunsPolicy());
  log.info("String_Node_Str" + this.slaveUrl);
  this.remotingClient.connect(this.slaveUrl);
  try {
    this.remotingClient.awaitReadyInterrupt(this.slaveUrl);
  }
 catch (  final NotifyRemotingException e) {
    log.error("String_Node_Str" + this.slaveUrl + "String_Node_Str",e);
  }
}
Program: 8140
Project: 8140
Buggy source:
@Override public void onResponse(final ResponseCommand responseCommand,final Connection conn){
  if (responseCommand.getResponseStatus() == ResponseStatus.NO_ERROR) {
    SamsaCommandProcessor.this.sentSlaveFailureCounter.set(0);
synchronized (this) {
      this.slaveSuccess=true;
    }
  }
 else {
    SamsaCommandProcessor.this.whenSentSlaveFailed();
  }
  this.tryComplete();
}

Fixed version (ground truth):
@Override public void onResponse(final ResponseCommand responseCommand,final Connection conn){
  if (responseCommand.getResponseStatus() == ResponseStatus.NO_ERROR) {
synchronized (this) {
      this.slaveSuccess=true;
    }
  }
  this.tryComplete();
}
Program: 8141
Project: 8141
Buggy source:
private void makeTopicsPatSet(){
  final Set<Pattern> set=new HashSet<Pattern>();
  for (  final String topic : this.metaConfig.getStatTopicSet()) {
    set.add(Pattern.compile(topic.replaceAll("String_Node_Str","String_Node_Str")));
  }
  this.legalTopicPatSet=set;
}

Fixed version (ground truth):
private void makeTopicsPatSet(){
  final Set<Pattern> set=new HashSet<Pattern>();
  for (  final TopicConfig topicConfig : this.metaConfig.getTopicConfigMap().values()) {
    if (topicConfig.isStat()) {
      set.add(Pattern.compile(topicConfig.getTopic().replaceAll("String_Node_Str","String_Node_Str")));
    }
  }
  this.legalTopicPatSet=set;
}
Program: 8142
Project: 8142
Buggy source:
public StatsManager(final MetaConfig metaConfig,final MessageStoreManager messageStoreManager,final RemotingServer remotingServer){
  super();
  MetaStatLog.startRealTimeStat=this.startRealTimeStat;
  this.metaConfig=metaConfig;
  this.messageStoreManager=messageStoreManager;
  this.remotingServer=remotingServer;
  this.cmdPut=new AtomicLong(0);
  this.cmdGet=new AtomicLong(0);
  this.cmdOffset=new AtomicLong(0);
  this.getMiss=new AtomicLong(0);
  this.getFailed=new AtomicLong(0);
  this.putFailed=new AtomicLong(0);
  this.txBegin=new AtomicLong(0);
  this.txXABegin=new AtomicLong(0);
  this.txRollback=new AtomicLong(0);
  this.txCommit=new AtomicLong(0);
  this.realTimeStat=new RealTimeStat();
  this.legalTopicPatSet=new HashSet<Pattern>();
  this.metaConfig.addPropertyChangeListener("String_Node_Str",new PropertyChangeListener(){
    @Override public void propertyChange(    final PropertyChangeEvent evt){
      StatsManager.this.makeTopicsPatSet();
    }
  }
);
  this.metaConfig.addPropertyChangeListener("String_Node_Str",new PropertyChangeListener(){
    @Override public void propertyChange(    final PropertyChangeEvent evt){
      log.info("String_Node_Str" + StatsManager.this.metaConfig.getStatTopicSet());
      StatsManager.this.makeTopicsPatSet();
    }
  }
);
  this.makeTopicsPatSet();
}

Fixed version (ground truth):
public StatsManager(final MetaConfig metaConfig,final MessageStoreManager messageStoreManager,final RemotingServer remotingServer){
  super();
  MetaStatLog.startRealTimeStat=this.startRealTimeStat;
  this.metaConfig=metaConfig;
  this.messageStoreManager=messageStoreManager;
  this.remotingServer=remotingServer;
  this.cmdPut=new AtomicLong(0);
  this.cmdGet=new AtomicLong(0);
  this.cmdOffset=new AtomicLong(0);
  this.getMiss=new AtomicLong(0);
  this.getFailed=new AtomicLong(0);
  this.putFailed=new AtomicLong(0);
  this.txBegin=new AtomicLong(0);
  this.txXABegin=new AtomicLong(0);
  this.txRollback=new AtomicLong(0);
  this.txCommit=new AtomicLong(0);
  this.realTimeStat=new RealTimeStat();
  this.legalTopicPatSet=new HashSet<Pattern>();
  this.metaConfig.addPropertyChangeListener("String_Node_Str",new PropertyChangeListener(){
    @Override public void propertyChange(    final PropertyChangeEvent evt){
      StatsManager.this.makeTopicsPatSet();
    }
  }
);
  this.metaConfig.addPropertyChangeListener("String_Node_Str",new PropertyChangeListener(){
    @Override public void propertyChange(    final PropertyChangeEvent evt){
      StatsManager.this.makeTopicsPatSet();
    }
  }
);
  this.makeTopicsPatSet();
}
Program: 8143
Project: 8143
Buggy source:
@Override public void propertyChange(final PropertyChangeEvent evt){
  log.info("String_Node_Str" + StatsManager.this.metaConfig.getStatTopicSet());
  StatsManager.this.makeTopicsPatSet();
}

Fixed version (ground truth):
@Override public void propertyChange(final PropertyChangeEvent evt){
  StatsManager.this.makeTopicsPatSet();
}
Program: 8144
Project: 8144
Buggy source:
private void populateZookeeperConfig(final Ini conf){
  final Section zkConf=conf.get("String_Node_Str");
  if (StringUtils.isNotBlank(zkConf.get("String_Node_Str"))) {
    this.diamondZKDataId=zkConf.get("String_Node_Str");
  }
  if (StringUtils.isNotBlank(zkConf.get("String_Node_Str"))) {
    this.diamondZKGroup=zkConf.get("String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkConnect=zkConf.get("String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkSessionTimeoutMs=this.getInt(zkConf,"String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkConnectionTimeoutMs=this.getInt(zkConf,"String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkSyncTimeMs=this.getInt(zkConf,"String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkEnable=this.getBoolean(zkConf,"String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkRoot=zkConf.get("String_Node_Str");
  }
}

Fixed version (ground truth):
private void populateZookeeperConfig(final Ini conf){
  final Section zkConf=conf.get("String_Node_Str");
  Set<String> configKeySet=zkConf.keySet();
  Set<String> validKeySet=new ZKConfig().getFieldSet();
  validKeySet.addAll(this.getFieldSet());
  this.checkConfigKeys(configKeySet,validKeySet);
  if (StringUtils.isNotBlank(zkConf.get("String_Node_Str"))) {
    this.diamondZKDataId=zkConf.get("String_Node_Str");
  }
  if (StringUtils.isNotBlank(zkConf.get("String_Node_Str"))) {
    this.diamondZKGroup=zkConf.get("String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkConnect=zkConf.get("String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkSessionTimeoutMs=this.getInt(zkConf,"String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkConnectionTimeoutMs=this.getInt(zkConf,"String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkSyncTimeMs=this.getInt(zkConf,"String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkEnable=this.getBoolean(zkConf,"String_Node_Str");
  }
  if (!StringUtils.isBlank(zkConf.get("String_Node_Str"))) {
    this.newZkConfigIfNull();
    this.zkConfig.zkRoot=zkConf.get("String_Node_Str");
  }
}
Program: 8145
Project: 8145
Buggy source:
public TopicConfig getTopicConfig(final String topic){
  final TopicConfig topicConfig=this.topicConfigMap.get(topic);
  return topicConfig != null ? topicConfig : new TopicConfig(topic,this);
}

Fixed version (ground truth):
public TopicConfig getTopicConfig(final String topic){
  TopicConfig topicConfig=this.topicConfigMap.get(topic);
  if (topicConfig == null) {
    topicConfig=new TopicConfig(topic,this);
    TopicConfig old=this.topicConfigMap.putIfAbsent(topic,topicConfig);
    if (old != null) {
      topicConfig=old;
    }
  }
  return topicConfig;
}
Program: 8148
Project: 8148
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + this.brokerId + "String_Node_Str"+ this.dataPath+ "String_Node_Str"+ this.serverPort+ "String_Node_Str"+ this.hostName+ "String_Node_Str"+ this.numPartitions+ "String_Node_Str"+ this.unflushThreshold+ "String_Node_Str"+ this.unflushInterval+ "String_Node_Str"+ this.maxSegmentSize+ "String_Node_Str"+ this.maxTransferSize+ "String_Node_Str"+ this.topics+ "String_Node_Str"+ this.slaveConfig+ "String_Node_Str"+ this.getProcessThreadCount+ "String_Node_Str"+ this.putProcessThreadCount+ "String_Node_Str"+ this.zkConfig+ "String_Node_Str"+ this.diamondZKDataId+ "String_Node_Str"+ this.diamondZKGroup+ "String_Node_Str"+ this.deletePolicy+ "String_Node_Str"+ this.topicConfigMap+ "String_Node_Str"+ this.propertyChangeSupport+ "String_Node_Str"+ this.statTopicSet+ "String_Node_Str"+ this.lastModified+ "String_Node_Str"+ this.path+ "String_Node_Str"+ this.maxCheckpoints+ "String_Node_Str"+ this.checkpointInterval+ "String_Node_Str"+ this.maxTxTimeoutTimerCapacity+ "String_Node_Str"+ this.flushTxLogAtCommit+ "String_Node_Str"+ this.maxTxTimeoutInSeconds+ "String_Node_Str"+ this.dataLogPath+ "String_Node_Str"+ this.deleteWhen+ "String_Node_Str"+ this.quartzThreadCount+ "String_Node_Str"+ this.configFileChecksum+ "String_Node_Str"+ this.acceptPublish+ "String_Node_Str"+ this.acceptSubscribe+ "String_Node_Str"+ this.closedPartitionMap+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + this.brokerId + "String_Node_Str"+ this.dataPath+ "String_Node_Str"+ this.serverPort+ "String_Node_Str"+ this.hostName+ "String_Node_Str"+ this.numPartitions+ "String_Node_Str"+ this.unflushThreshold+ "String_Node_Str"+ this.unflushInterval+ "String_Node_Str"+ this.maxSegmentSize+ "String_Node_Str"+ this.maxTransferSize+ "String_Node_Str"+ this.topics+ "String_Node_Str"+ this.slaveConfig+ "String_Node_Str"+ this.getProcessThreadCount+ "String_Node_Str"+ this.putProcessThreadCount+ "String_Node_Str"+ this.zkConfig+ "String_Node_Str"+ this.diamondZKDataId+ "String_Node_Str"+ this.diamondZKGroup+ "String_Node_Str"+ this.deletePolicy+ "String_Node_Str"+ this.topicConfigMap+ "String_Node_Str"+ this.propertyChangeSupport+ "String_Node_Str"+ this.stat+ "String_Node_Str"+ this.lastModified+ "String_Node_Str"+ this.path+ "String_Node_Str"+ this.maxCheckpoints+ "String_Node_Str"+ this.checkpointInterval+ "String_Node_Str"+ this.maxTxTimeoutTimerCapacity+ "String_Node_Str"+ this.flushTxLogAtCommit+ "String_Node_Str"+ this.maxTxTimeoutInSeconds+ "String_Node_Str"+ this.dataLogPath+ "String_Node_Str"+ this.deleteWhen+ "String_Node_Str"+ this.quartzThreadCount+ "String_Node_Str"+ this.configFileChecksum+ "String_Node_Str"+ this.acceptPublish+ "String_Node_Str"+ this.acceptSubscribe+ "String_Node_Str"+ this.closedPartitionMap+ "String_Node_Str";
}
Program: 8149
Project: 8149
Buggy source:
public MessageStore(final String topic,final int partition,final MetaConfig metaConfig,final DeletePolicy deletePolicy,final long offsetIfCreate) throws IOException {
  this.metaConfig=metaConfig;
  this.topic=topic;
  final TopicConfig topicConfig=this.metaConfig.getTopicConfig(this.topic);
  String dataPath=metaConfig.getDataPath();
  if (topicConfig != null) {
    dataPath=topicConfig.getDataPath();
  }
  final File parentDir=new File(dataPath);
  this.checkDir(parentDir);
  this.partitionDir=new File(dataPath + File.separator + topic+ "String_Node_Str"+ partition);
  this.checkDir(this.partitionDir);
  this.partition=partition;
  this.unflushed=new AtomicInteger(0);
  this.lastFlushTime=new AtomicLong(SystemTimer.currentTimeMillis());
  this.unflushThreshold=topicConfig.getUnflushThreshold();
  this.deletePolicy=deletePolicy;
  this.checkDir(this.partitionDir);
  this.loadSegments(offsetIfCreate);
  if (this.unflushThreshold <= 0) {
    this.start();
  }
}

Fixed version (ground truth):
public MessageStore(final String topic,final int partition,final MetaConfig metaConfig,final DeletePolicy deletePolicy,final long offsetIfCreate) throws IOException {
  this.metaConfig=metaConfig;
  this.topic=topic;
  final TopicConfig topicConfig=this.metaConfig.getTopicConfig(this.topic);
  String dataPath=metaConfig.getDataPath();
  if (topicConfig != null) {
    dataPath=topicConfig.getDataPath();
  }
  final File parentDir=new File(dataPath);
  this.checkDir(parentDir);
  this.partitionDir=new File(dataPath + File.separator + topic+ "String_Node_Str"+ partition);
  this.checkDir(this.partitionDir);
  this.partition=partition;
  this.unflushed=new AtomicInteger(0);
  this.lastFlushTime=new AtomicLong(SystemTimer.currentTimeMillis());
  this.unflushThreshold=topicConfig.getUnflushThreshold();
  this.deletePolicy=deletePolicy;
  this.checkDir(this.partitionDir);
  this.loadSegments(offsetIfCreate);
}
Program: 8150
Project: 8150
Buggy source:
private void appendBuffer(final ByteBuffer buffer,final AppendCallback cb){
  if (this.unflushThreshold <= 0) {
    this.bufferQueue.offer(new WriteRequest(buffer,cb));
  }
 else {
    final int remainning=buffer.remaining();
    this.writeLock.lock();
    try {
      final Segment cur=this.segments.last();
      final long offset=cur.start + cur.fileMessageSet.append(buffer);
      this.mayBeFlush(1);
      this.mayBeRoll();
      if (cb != null) {
        cb.appendComplete(new Location(offset,remainning));
      }
    }
 catch (    final IOException e) {
      log.error("String_Node_Str",e);
      if (cb != null) {
        cb.appendComplete(Location.InvalidLocaltion);
      }
    }
 finally {
      this.writeLock.unlock();
    }
  }
}

Fixed version (ground truth):
private void appendBuffer(final ByteBuffer buffer,final AppendCallback cb){
  final int remainning=buffer.remaining();
  this.writeLock.lock();
  try {
    final Segment cur=this.segments.last();
    final long offset=cur.start + cur.fileMessageSet.append(buffer);
    if (this.useGroupCommit()) {
      long lastFlushPos=cur.fileMessageSet.highWaterMark();
      Location location=new Location(offset,remainning);
      WriteRequest writeRequest=new WriteRequest(cb,location);
      writeRequest.location=location;
      this.toFlush.offer(writeRequest);
      if (!this.writeLock.hasQueuedThreads() || cur.fileMessageSet.getSizeInBytes() > lastFlushPos + this.MAX_BATCH_SIZE) {
        this.flush0();
        this.notifyCallbacks();
        this.toFlush.clear();
        this.mayBeRoll();
      }
    }
 else {
      this.mayBeFlush(1);
      this.mayBeRoll();
      if (cb != null) {
        cb.appendComplete(new Location(offset,remainning));
      }
    }
  }
 catch (  final IOException e) {
    log.error("String_Node_Str",e);
    if (cb != null) {
      cb.appendComplete(Location.InvalidLocaltion);
    }
  }
 finally {
    this.writeLock.unlock();
  }
}
Program: 8151
Project: 8151
Buggy source:
public Segment(final long start,final File file,final boolean mutable){
  super();
  this.start=start;
  this.file=file;
  log.warn("String_Node_Str" + this.file.getAbsolutePath());
  try {
    final FileChannel channel=new RandomAccessFile(this.file,"String_Node_Str").getChannel();
    this.fileMessageSet=new FileMessageSet(channel,0,channel.size(),mutable);
  }
 catch (  final IOException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public Segment(final long start,final File file,final boolean mutable){
  super();
  this.start=start;
  this.file=file;
  log.info("String_Node_Str" + this.file.getAbsolutePath());
  try {
    final FileChannel channel=new RandomAccessFile(this.file,"String_Node_Str").getChannel();
    this.fileMessageSet=new FileMessageSet(channel,0,channel.size(),mutable);
  }
 catch (  final IOException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 8152
Project: 8152
Buggy source:
private void flush0() throws IOException {
  if (this.unflushThreshold <= 0) {
    return;
  }
  this.segments.last().fileMessageSet.flush();
  this.unflushed.set(0);
  this.lastFlushTime.set(SystemTimer.currentTimeMillis());
}

Fixed version (ground truth):
private void flush0() throws IOException {
  this.segments.last().fileMessageSet.flush();
  this.unflushed.set(0);
  this.lastFlushTime.set(SystemTimer.currentTimeMillis());
}
Program: 8153
Project: 8153
Buggy source:
@Override public void close() throws IOException {
  for (  final Segment segment : this.segments.view()) {
    segment.fileMessageSet.close();
  }
  this.interrupt();
  try {
    this.join(5000);
  }
 catch (  final InterruptedException e) {
    Thread.currentThread().interrupt();
  }
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  for (  final Segment segment : this.segments.view()) {
    segment.fileMessageSet.close();
  }
  this.writeLock.lock();
  try {
    this.notifyCallbacks();
    this.toFlush.clear();
  }
  finally {
    this.writeLock.unlock();
  }
}
Program: 8154
Project: 8154
Buggy source:
public WriteRequest(final ByteBuffer buf,final AppendCallback cb){
  super();
  this.buf=buf;
  this.cb=cb;
}

Fixed version (ground truth):
public WriteRequest(final AppendCallback cb,Location location){
  super();
  this.cb=cb;
  this.location=location;
}
Program: 8155
Project: 8155
Buggy source:
private void parseStatsValues(InetSocketAddress sockAddr,Map<InetSocketAddress,StatsResult> rt,String group,String body) throws URISyntaxException {
  String[] lines=body.split("String_Node_Str");
  Map<String,String> values=new HashMap<String,String>();
  for (  String line : lines) {
    String[] tmp=line.split("String_Node_Str");
    if (tmp.length >= 2) {
      values.put(tmp[0],tmp[1]);
    }
  }
  rt.put(sockAddr,new StatsResult(values));
}

Fixed version (ground truth):
private void parseStatsValues(InetSocketAddress sockAddr,Map<InetSocketAddress,StatsResult> rt,String group,String body) throws URISyntaxException {
  String[] lines=body.split("String_Node_Str");
  Map<String,String> values=new HashMap<String,String>();
  for (  String line : lines) {
    int index=line.indexOf("String_Node_Str");
    if (index > 0) {
      String key=line.substring(0,index);
      String value=line.substring(index + 1);
      values.put(key,value);
    }
 else {
      values.put(line,"String_Node_Str");
    }
  }
  rt.put(sockAddr,new StatsResult(values));
}
Program: 8156
Project: 8156
Buggy source:
public String getStatsInfo(final String item){
  final StringBuilder sb=new StringBuilder(1024);
  sb.append("String_Node_Str");
  if (StringUtils.isBlank(item)) {
    this.appendSystemStatsInfo(sb);
  }
 else   if ("String_Node_Str".equals(item)) {
    this.appendTopicsInfo(sb);
  }
 else   if ("String_Node_Str".equals(item)) {
    this.appendOffsetInfo(sb);
  }
 else   if ("String_Node_Str".equals(item)) {
    this.appendRealTime(sb);
  }
 else {
    this.appendTopic(item,sb);
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String getStatsInfo(final String item){
  final StringBuilder sb=new StringBuilder(1024);
  sb.append("String_Node_Str");
  if (StringUtils.isBlank(item)) {
    this.appendSystemStatsInfo(sb);
  }
 else   if ("String_Node_Str".equals(item)) {
    this.appendTopicsInfo(sb);
  }
 else   if ("String_Node_Str".equals(item)) {
    this.appendOffsetInfo(sb);
  }
 else   if ("String_Node_Str".equals(item)) {
    this.appendRealTime(sb);
  }
 else   if ("String_Node_Str".equals(item)) {
    this.appendHelp(sb);
  }
 else {
    this.appendTopic(item,sb);
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 8157
Project: 8157
Buggy source:
ZKLoadRebalanceListener getBrokerConnectionListener(final FetchManager fetchManager){
  final FutureTask<ZKLoadRebalanceListener> task=this.consumerLoadBalanceListeners.get(fetchManager);
  if (task != null) {
    try {
      return task.get();
    }
 catch (    final Exception e) {
      log.error("String_Node_Str",e);
      return null;
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public ZKLoadRebalanceListener getBrokerConnectionListener(final FetchManager fetchManager){
  final FutureTask<ZKLoadRebalanceListener> task=this.consumerLoadBalanceListeners.get(fetchManager);
  if (task != null) {
    try {
      return task.get();
    }
 catch (    final Exception e) {
      log.error("String_Node_Str",e);
      return null;
    }
  }
 else {
    return null;
  }
}
Program: 8158
Project: 8158
Buggy source:
@Override public void stopFetchRunner() throws InterruptedException {
  this.shutdown=true;
  if (this.fetchRunners != null) {
    for (    final Thread thread : this.fetchRunners) {
      if (thread != null) {
        thread.interrupt();
        try {
          thread.join(5000);
        }
 catch (        final InterruptedException e) {
          Thread.currentThread().interrupt();
        }
      }
    }
  }
  if (this.requestQueue != null) {
    while (this.requestQueue.size() != this.fetchRequestCount) {
      Thread.sleep(50);
    }
  }
}

Fixed version (ground truth):
@Override public void stopFetchRunner() throws InterruptedException {
  this.shutdown=true;
  if (this.fetchRunners != null) {
    for (    final Thread thread : this.fetchRunners) {
      if (thread != null) {
        thread.interrupt();
        try {
          thread.join(5000);
        }
 catch (        final InterruptedException e) {
          Thread.currentThread().interrupt();
        }
      }
    }
  }
  if (this.requestQueue != null) {
    while (this.requestQueue.size() != this.fetchRequestCount) {
      Thread.sleep(50);
    }
  }
  this.fetchRequestCount=0;
}
Program: 8159
Project: 8159
Buggy source:
FetchManager getFetchManager(){
  return this.fetchManager;
}

Fixed version (ground truth):
public FetchManager getFetchManager(){
  return this.fetchManager;
}
Program: 8162
Project: 8162
Buggy source:
@Test public void testSendOrderedMessage() throws Exception {
  final String topic="String_Node_Str";
  final byte[] data="String_Node_Str".getBytes();
  final Message message=new Message(topic,data);
  final String url="String_Node_Str";
  final Partition partition=new Partition("String_Node_Str");
  EasyMock.expect(this.producerZooKeeper.selectPartition(topic,message,this.partitionSelector)).andReturn(partition).times(2);
  EasyMock.expect(this.producerZooKeeper.selectBroker(topic,partition)).andReturn(url);
  EasyMock.expect(this.localMessageStorageManager.getMessageCount(topic,partition)).andReturn(0);
  OpaqueGenerator.resetOpaque();
  final int flag=MessageFlagUtils.getFlag(null);
  EasyMock.expect(this.remotingClient.invokeToGroup(url,new PutCommand(topic,partition.getPartition(),data,null,flag,Integer.MIN_VALUE),3000,TimeUnit.MILLISECONDS)).andReturn(new BooleanCommand(Integer.MIN_VALUE,200,"String_Node_Str"));
  this.mocksControl.replay();
  assertEquals(0,message.getId());
  final SendResult sendResult=this.producer.sendMessage(message);
  this.mocksControl.verify();
  assertTrue(sendResult.isSuccess());
  assertEquals(1024,sendResult.getOffset());
  assertEquals(1,sendResult.getPartition().getPartition());
  assertEquals(0,sendResult.getPartition().getBrokerId());
  assertEquals(1111,message.getId());
}

Fixed version (ground truth):
@Test public void testSendOrderedMessage() throws Exception {
  final String topic="String_Node_Str";
  final byte[] data="String_Node_Str".getBytes();
  final Message message=new Message(topic,data);
  final String url="String_Node_Str";
  final Partition partition=new Partition("String_Node_Str");
  EasyMock.expect(this.producerZooKeeper.selectPartition(topic,message,this.partitionSelector)).andReturn(partition).times(2);
  EasyMock.expect(this.producerZooKeeper.selectBroker(topic,partition)).andReturn(url);
  EasyMock.expect(this.localMessageStorageManager.getMessageCount(topic,partition)).andReturn(0);
  OpaqueGenerator.resetOpaque();
  final int flag=MessageFlagUtils.getFlag(null);
  EasyMock.expect(this.remotingClient.invokeToGroup(url,new PutCommand(topic,partition.getPartition(),data,null,flag,CheckSum.crc32(data),Integer.MIN_VALUE),3000,TimeUnit.MILLISECONDS)).andReturn(new BooleanCommand(Integer.MIN_VALUE,200,"String_Node_Str"));
  this.mocksControl.replay();
  assertEquals(0,message.getId());
  final SendResult sendResult=this.producer.sendMessage(message);
  this.mocksControl.verify();
  assertTrue(sendResult.isSuccess());
  assertEquals(1024,sendResult.getOffset());
  assertEquals(1,sendResult.getPartition().getPartition());
  assertEquals(0,sendResult.getPartition().getBrokerId());
  assertEquals(1111,message.getId());
}
Program: 8163
Project: 8163
Buggy source:
@Test public void testSendOrderedMessageServerError() throws Exception {
  final String topic="String_Node_Str";
  final byte[] data="String_Node_Str".getBytes();
  final Message message=new Message(topic,data);
  final String url="String_Node_Str";
  final Partition partition=new Partition("String_Node_Str");
  EasyMock.expect(this.producerZooKeeper.selectPartition(topic,message,this.partitionSelector)).andReturn(partition);
  EasyMock.expect(this.producerZooKeeper.selectBroker(topic,partition)).andReturn(url);
  OpaqueGenerator.resetOpaque();
  final int flag=MessageFlagUtils.getFlag(null);
  EasyMock.expect(this.remotingClient.invokeToGroup(url,new PutCommand(topic,partition.getPartition(),data,null,flag,Integer.MIN_VALUE),3000,TimeUnit.MILLISECONDS)).andReturn(new BooleanCommand(Integer.MIN_VALUE,500,"String_Node_Str"));
  this.mocksControl.replay();
  assertEquals(0,message.getId());
  final SendResult sendResult=this.producer.sendMessage(message);
  this.mocksControl.verify();
  assertFalse(sendResult.isSuccess());
  assertEquals(-1,sendResult.getOffset());
  assertNull(sendResult.getPartition());
  assertEquals("String_Node_Str",sendResult.getErrorMessage());
}

Fixed version (ground truth):
@Test public void testSendOrderedMessageServerError() throws Exception {
  final String topic="String_Node_Str";
  final byte[] data="String_Node_Str".getBytes();
  final Message message=new Message(topic,data);
  final String url="String_Node_Str";
  final Partition partition=new Partition("String_Node_Str");
  EasyMock.expect(this.producerZooKeeper.selectPartition(topic,message,this.partitionSelector)).andReturn(partition);
  EasyMock.expect(this.producerZooKeeper.selectBroker(topic,partition)).andReturn(url);
  OpaqueGenerator.resetOpaque();
  final int flag=MessageFlagUtils.getFlag(null);
  EasyMock.expect(this.remotingClient.invokeToGroup(url,new PutCommand(topic,partition.getPartition(),data,null,flag,CheckSum.crc32(data),Integer.MIN_VALUE),3000,TimeUnit.MILLISECONDS)).andReturn(new BooleanCommand(Integer.MIN_VALUE,500,"String_Node_Str"));
  this.mocksControl.replay();
  assertEquals(0,message.getId());
  final SendResult sendResult=this.producer.sendMessage(message);
  this.mocksControl.verify();
  assertFalse(sendResult.isSuccess());
  assertEquals(-1,sendResult.getOffset());
  assertNull(sendResult.getPartition());
  assertEquals("String_Node_Str",sendResult.getErrorMessage());
}
Program: 8164
Project: 8164
Buggy source:
@Test public void testSendMessageInterrupted() throws Exception {
  boolean interrupted=false;
  try {
    final String topic="String_Node_Str";
    final byte[] data="String_Node_Str".getBytes();
    final Message message=new Message(topic,data);
    final String url="String_Node_Str";
    final Partition partition=new Partition("String_Node_Str");
    EasyMock.expect(this.producerZooKeeper.selectPartition(topic,message,this.partitionSelector)).andReturn(partition);
    EasyMock.expect(this.producerZooKeeper.selectBroker(topic,partition)).andReturn(url);
    OpaqueGenerator.resetOpaque();
    final int flag=MessageFlagUtils.getFlag(null);
    EasyMock.expect(this.remotingClient.invokeToGroup(url,new PutCommand(topic,partition.getPartition(),data,null,flag,Integer.MIN_VALUE),3000,TimeUnit.MILLISECONDS)).andThrow(new InterruptedException());
    this.mocksControl.replay();
    this.producer.sendMessage(message);
  }
 catch (  final InterruptedException e) {
    interrupted=true;
  }
  this.mocksControl.verify();
  assertTrue(interrupted);
}

Fixed version (ground truth):
@Test public void testSendMessageInterrupted() throws Exception {
  boolean interrupted=false;
  try {
    final String topic="String_Node_Str";
    final byte[] data="String_Node_Str".getBytes();
    final Message message=new Message(topic,data);
    final String url="String_Node_Str";
    final Partition partition=new Partition("String_Node_Str");
    EasyMock.expect(this.producerZooKeeper.selectPartition(topic,message,this.partitionSelector)).andReturn(partition);
    EasyMock.expect(this.producerZooKeeper.selectBroker(topic,partition)).andReturn(url);
    OpaqueGenerator.resetOpaque();
    final int flag=MessageFlagUtils.getFlag(null);
    EasyMock.expect(this.remotingClient.invokeToGroup(url,new PutCommand(topic,partition.getPartition(),data,null,flag,CheckSum.crc32(data),Integer.MIN_VALUE),3000,TimeUnit.MILLISECONDS)).andThrow(new InterruptedException());
    this.mocksControl.replay();
    this.producer.sendMessage(message);
  }
 catch (  final InterruptedException e) {
    interrupted=true;
  }
  this.mocksControl.verify();
  assertTrue(interrupted);
}
Program: 8165
Project: 8165
Buggy source:
protected Map<String,List<String>> getPartitionStringsForTopics(final Map<String,String> myConsumerPerTopicMap){
  return ConsumerZooKeeper.this.metaZookeeper.getPartitionStringsForTopics(myConsumerPerTopicMap.keySet());
}

Fixed version (ground truth):
protected Map<String,List<String>> getPartitionStringsForTopics(final Map<String,String> myConsumerPerTopicMap){
  return ConsumerZooKeeper.this.metaZookeeper.getPartitionStringsForSubTopics(myConsumerPerTopicMap.keySet());
}
Program: 8166
Project: 8166
Buggy source:
/** 
 * ȡ��ע��consumer
 * @param fetchManager
 */
public void unRegisterConsumer(final FetchManager fetchManager){
  try {
    final FutureTask<ZKLoadRebalanceListener> futureTask=this.consumerLoadBalanceListeners.remove(fetchManager);
    if (futureTask != null) {
      final ZKLoadRebalanceListener listener=futureTask.get();
      if (listener != null) {
        listener.commitOffsets();
        this.zkClient.unsubscribeStateChanges(new ZKSessionExpireListenner(listener));
        final ZKGroupDirs dirs=this.metaZookeeper.new ZKGroupDirs(listener.consumerConfig.getGroup());
        this.zkClient.unsubscribeChildChanges(dirs.consumerRegistryDir,listener);
        log.info("String_Node_Str" + dirs.consumerRegistryDir);
        for (        final String topic : listener.topicSubcriberRegistry.keySet()) {
          final String partitionPath=this.metaZookeeper.brokerTopicsPath + "String_Node_Str" + topic;
          this.zkClient.unsubscribeChildChanges(partitionPath,listener);
          log.info("String_Node_Str" + partitionPath);
        }
        listener.releaseAllPartitionOwnership();
        ZkUtils.deletePath(this.zkClient,listener.dirs.consumerRegistryDir + "String_Node_Str" + listener.consumerIdString);
      }
    }
  }
 catch (  final InterruptedException e) {
    Thread.interrupted();
    log.error("String_Node_Str",e);
  }
catch (  final Exception e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * ȡ��ע��consumer
 * @param fetchManager
 */
public void unRegisterConsumer(final FetchManager fetchManager){
  try {
    final FutureTask<ZKLoadRebalanceListener> futureTask=this.consumerLoadBalanceListeners.remove(fetchManager);
    if (futureTask != null) {
      final ZKLoadRebalanceListener listener=futureTask.get();
      if (listener != null) {
        listener.commitOffsets();
        this.zkClient.unsubscribeStateChanges(new ZKSessionExpireListenner(listener));
        final ZKGroupDirs dirs=this.metaZookeeper.new ZKGroupDirs(listener.consumerConfig.getGroup());
        this.zkClient.unsubscribeChildChanges(dirs.consumerRegistryDir,listener);
        log.info("String_Node_Str" + dirs.consumerRegistryDir);
        for (        final String topic : listener.topicSubcriberRegistry.keySet()) {
          final String partitionPath=this.metaZookeeper.brokerTopicsSubPath + "String_Node_Str" + topic;
          this.zkClient.unsubscribeChildChanges(partitionPath,listener);
          log.info("String_Node_Str" + partitionPath);
        }
        listener.releaseAllPartitionOwnership();
        ZkUtils.deletePath(this.zkClient,listener.dirs.consumerRegistryDir + "String_Node_Str" + listener.consumerIdString);
      }
    }
  }
 catch (  final InterruptedException e) {
    Thread.interrupted();
    log.error("String_Node_Str",e);
  }
catch (  final Exception e) {
    log.error("String_Node_Str",e);
  }
}
Program: 8168
Project: 8168
Buggy source:
@Override public synchronized void shutdown() throws MetaClientException {
  if (this.fetchManager.isShutdown()) {
    return;
  }
  try {
    this.fetchManager.stopFetchRunner();
    this.consumerZooKeeper.unRegisterConsumer(this.fetchManager);
  }
 catch (  final InterruptedException e) {
    Thread.currentThread().interrupt();
  }
 finally {
    this.scheduledExecutorService.shutdownNow();
    this.offsetStorage.close();
    this.subscribeInfoManager.removeGroup(this.consumerConfig.getGroup());
    this.messageSessionFactory.removeChild(this);
  }
}

Fixed version (ground truth):
@Override public synchronized void shutdown() throws MetaClientException {
  if (this.fetchManager.isShutdown()) {
    return;
  }
  try {
    this.fetchManager.stopFetchRunner();
    this.consumerZooKeeper.unRegisterConsumer(this.fetchManager);
    for (    String topic : this.publishedTopics) {
      this.producerZooKeeper.unPublishTopic(topic,this);
    }
  }
 catch (  final InterruptedException e) {
    Thread.currentThread().interrupt();
  }
 finally {
    this.scheduledExecutorService.shutdownNow();
    this.offsetStorage.close();
    this.subscribeInfoManager.removeGroup(this.consumerConfig.getGroup());
    this.messageSessionFactory.removeChild(this);
  }
}
Program: 8169
Project: 8169
Buggy source:
/** 
 * ����Ĭ��topic������
 * @param topic
 */
public synchronized void setDefaultTopic(final String topic){
  if (this.defaultTopic != null && !this.defaultTopic.equals(topic)) {
    throw new IllegalStateException("String_Node_Str" + this.defaultTopic);
  }
  this.defaultTopic=topic;
  this.publishTopic(topic);
}

Fixed version (ground truth):
/** 
 * ����Ĭ��topic������
 * @param topic
 */
public synchronized void setDefaultTopic(final String topic,Object ref){
  if (this.defaultTopic != null && !this.defaultTopic.equals(topic)) {
    throw new IllegalStateException("String_Node_Str" + this.defaultTopic);
  }
  this.defaultTopic=topic;
  this.publishTopic(topic,ref);
}
Program: 8170
Project: 8170
Buggy source:
private void publishTopicInternal(final String topic,final BrokerConnectionListener listener) throws Exception, NotifyRemotingException, InterruptedException {
  final String partitionPath=this.metaZookeeper.brokerTopicsPath + "String_Node_Str" + topic;
  ZkUtils.makeSurePersistentPathExists(ProducerZooKeeper.this.zkClient,partitionPath);
  ProducerZooKeeper.this.zkClient.subscribeChildChanges(partitionPath,listener);
  listener.syncedUpdateBrokersInfo();
}

Fixed version (ground truth):
private void publishTopicInternal(final String topic,final BrokerConnectionListener listener) throws Exception, NotifyRemotingException, InterruptedException {
  final String partitionPath=this.metaZookeeper.brokerTopicsPubPath + "String_Node_Str" + topic;
  ZkUtils.makeSurePersistentPathExists(ProducerZooKeeper.this.zkClient,partitionPath);
  ProducerZooKeeper.this.zkClient.subscribeChildChanges(partitionPath,listener);
  listener.syncedUpdateBrokersInfo();
}
Program: 8171
Project: 8171
Buggy source:
public void publishTopic(final String topic){
  if (this.topicConnectionListeners.get(topic) != null) {
    return;
  }
  final FutureTask<BrokerConnectionListener> task=new FutureTask<BrokerConnectionListener>(new Callable<BrokerConnectionListener>(){
    @Override public BrokerConnectionListener call() throws Exception {
      final BrokerConnectionListener listener=new BrokerConnectionListener(topic);
      if (ProducerZooKeeper.this.zkClient != null) {
        ProducerZooKeeper.this.publishTopicInternal(topic,listener);
      }
      return listener;
    }
  }
);
  final FutureTask<BrokerConnectionListener> existsTask=this.topicConnectionListeners.putIfAbsent(topic,task);
  if (existsTask == null) {
    task.run();
  }
}

Fixed version (ground truth):
public void publishTopic(final String topic,final Object ref){
  if (this.topicConnectionListeners.get(topic) != null) {
    this.addRef(topic,ref);
    return;
  }
  final FutureTask<BrokerConnectionListener> task=new FutureTask<BrokerConnectionListener>(new Callable<BrokerConnectionListener>(){
    @Override public BrokerConnectionListener call() throws Exception {
      final BrokerConnectionListener listener=new BrokerConnectionListener(topic);
      if (ProducerZooKeeper.this.zkClient != null) {
        ProducerZooKeeper.this.publishTopicInternal(topic,listener);
      }
      listener.references.add(ref);
      return listener;
    }
  }
);
  final FutureTask<BrokerConnectionListener> existsTask=this.topicConnectionListeners.putIfAbsent(topic,task);
  if (existsTask == null) {
    task.run();
  }
 else {
    this.addRef(topic,ref);
  }
}
Program: 8172
Project: 8172
Buggy source:
@Override public BrokerConnectionListener call() throws Exception {
  final BrokerConnectionListener listener=new BrokerConnectionListener(topic);
  if (ProducerZooKeeper.this.zkClient != null) {
    ProducerZooKeeper.this.publishTopicInternal(topic,listener);
  }
  return listener;
}

Fixed version (ground truth):
@Override public BrokerConnectionListener call() throws Exception {
  final BrokerConnectionListener listener=new BrokerConnectionListener(topic);
  if (ProducerZooKeeper.this.zkClient != null) {
    ProducerZooKeeper.this.publishTopicInternal(topic,listener);
  }
  listener.references.add(ref);
  return listener;
}
Program: 8173
Project: 8173
Buggy source:
@Override public void setDefaultTopic(final String topic){
  this.producerZooKeeper.setDefaultTopic(topic);
}

Fixed version (ground truth):
@Override public void setDefaultTopic(final String topic){
  if (!this.publishedTopics.contains(topic)) {
    this.producerZooKeeper.setDefaultTopic(topic,this);
    this.publishedTopics.add(topic);
  }
}
Program: 8174
Project: 8174
Buggy source:
@Override public void publish(final String topic){
  this.checkState();
  this.checkTopic(topic);
  this.producerZooKeeper.publishTopic(topic);
}

Fixed version (ground truth):
@Override public void publish(final String topic){
  this.checkState();
  this.checkTopic(topic);
  if (!this.publishedTopics.contains(topic)) {
    this.producerZooKeeper.publishTopic(topic,this);
    this.publishedTopics.add(topic);
  }
}
Program: 8175
Project: 8175
Buggy source:
@Override public synchronized void shutdown() throws MetaClientException {
  if (this.shutdown) {
    return;
  }
  this.shutdown=true;
  this.messageSessionFactory.removeChild(this);
}

Fixed version (ground truth):
@Override public synchronized void shutdown() throws MetaClientException {
  if (this.shutdown) {
    return;
  }
  for (  String topic : this.publishedTopics) {
    this.producerZooKeeper.unPublishTopic(topic,this);
  }
  this.shutdown=true;
  this.publishedTopics.clear();
  this.messageSessionFactory.removeChild(this);
}
Program: 8176
Project: 8176
Buggy source:
@Test public void testGet() throws Exception {
  final String topic="String_Node_Str";
  final int maxSize=1024;
  final Partition partition=new Partition("String_Node_Str");
  final long offset=12;
  final byte[] data="String_Node_Str".getBytes();
  final String url="String_Node_Str";
  final MessageIterator messageIterator=new MessageIterator(topic,data);
  this.producerZooKeeper.publishTopic(topic);
  EasyMock.expectLastCall();
  EasyMock.expect(this.producerZooKeeper.selectBroker(topic,partition)).andReturn(url);
  EasyMock.expect(this.remotingClient.invokeToGroup(url,new GetCommand(topic,this.consumerConfig.getGroup(),partition.getPartition(),offset,maxSize,Integer.MIN_VALUE),10000,TimeUnit.MILLISECONDS)).andReturn(new DataCommand(data,Integer.MIN_VALUE));
  this.mocksControl.replay();
  OpaqueGenerator.resetOpaque();
  assertEquals(messageIterator,this.consumer.get(topic,partition,offset,maxSize));
  this.mocksControl.verify();
}

Fixed version (ground truth):
@Test public void testGet() throws Exception {
  final String topic="String_Node_Str";
  final int maxSize=1024;
  final Partition partition=new Partition("String_Node_Str");
  final long offset=12;
  final byte[] data="String_Node_Str".getBytes();
  final String url="String_Node_Str";
  final MessageIterator messageIterator=new MessageIterator(topic,data);
  this.producerZooKeeper.publishTopic(topic,this.consumer);
  EasyMock.expectLastCall();
  EasyMock.expect(this.producerZooKeeper.selectBroker(topic,partition)).andReturn(url);
  EasyMock.expect(this.remotingClient.invokeToGroup(url,new GetCommand(topic,this.consumerConfig.getGroup(),partition.getPartition(),offset,maxSize,Integer.MIN_VALUE),10000,TimeUnit.MILLISECONDS)).andReturn(new DataCommand(data,Integer.MIN_VALUE));
  this.mocksControl.replay();
  OpaqueGenerator.resetOpaque();
  assertEquals(messageIterator,this.consumer.get(topic,partition,offset,maxSize));
  this.mocksControl.verify();
}