nus-yam/ex-repair huggingface dataset:
Program: 8084
Project: 8084
Buggy source:
private void createRequest(String sb) throws ProtocolException {
  int aStart;
  int aEnd;
  int bStart;
  int bEnd;
  int cStart;
  int cEnd;
  aStart=findNonWhitespace(sb,0);
  aEnd=findWhitespace(sb,aStart);
  bStart=findNonWhitespace(sb,aEnd);
  bEnd=findWhitespace(sb,bStart);
  cStart=findNonWhitespace(sb,bEnd);
  cEnd=findEndOfString(sb);
  if (cStart < cEnd) {
    try {
      HttpMethod method=HttpMethod.valueOf(sb.substring(aStart,aEnd).toUpperCase());
      HttpVersion version=HTTP_1_1;
      if ("String_Node_Str".equals(sb.substring(cStart,cEnd))) {
        version=HTTP_1_0;
      }
      request=new HttpRequest(method,sb.substring(bStart,bEnd),version);
    }
 catch (    Exception e) {
      throw new ProtocolException("String_Node_Str");
    }
  }
 else {
    throw new ProtocolException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void createRequest(String sb) throws ProtocolException {
  int aStart;
  int aEnd;
  int bStart;
  int bEnd;
  int cStart;
  int cEnd;
  aStart=findNonWhitespace(sb,0);
  aEnd=findWhitespace(sb,aStart);
  bStart=findNonWhitespace(sb,aEnd);
  bEnd=findWhitespace(sb,bStart);
  cStart=findNonWhitespace(sb,bEnd);
  cEnd=findEndOfString(sb,cStart);
  if (cStart < cEnd) {
    try {
      HttpMethod method=HttpMethod.valueOf(sb.substring(aStart,aEnd).toUpperCase());
      HttpVersion version=HTTP_1_1;
      if ("String_Node_Str".equals(sb.substring(cStart,cEnd))) {
        version=HTTP_1_0;
      }
      request=new HttpRequest(method,sb.substring(bStart,bEnd),version);
    }
 catch (    Exception e) {
      throw new ProtocolException("String_Node_Str");
    }
  }
 else {
    throw new ProtocolException("String_Node_Str");
  }
}
Program: 8085
Project: 8085
Buggy source:
private void doRead(SelectionKey key,long now){
  Request req=(Request)key.attachment();
  SocketChannel ch=(SocketChannel)key.channel();
  int read=0;
  boolean https=req instanceof HttpsRequest;
  try {
    if (https && !((HttpsRequest)req).handshaken) {
      buffer.clear();
      read=((HttpsRequest)req).doHandshake(buffer);
      return;
    }
 else     if (https) {
      buffer.clear();
      read=((HttpsRequest)req).unwrapRead(buffer);
    }
 else {
      buffer.clear();
      read=ch.read(buffer);
    }
  }
 catch (  IOException e) {
    if (!cleanAndRetryIfBroken(key,req)) {
      req.finish(e);
    }
  }
  if (read == -1) {
    if (!cleanAndRetryIfBroken(key,req)) {
      req.finish();
    }
  }
 else   if (read > 0) {
    req.onProgress(now);
    buffer.flip();
    try {
      if (req.decoder.decode(buffer) == ALL_READ) {
        req.finish();
        if (req.cfg.keepAlive > 0)         keepalives.offer(new PersistentConn(now + req.cfg.keepAlive,req.addr,key));
      }
    }
 catch (    HTTPException e) {
      closeQuietly(key);
      req.finish(e);
    }
catch (    Exception e) {
      closeQuietly(key);
      req.finish(e);
      HttpUtils.printError("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void doRead(SelectionKey key,long now){
  Request req=(Request)key.attachment();
  SocketChannel ch=(SocketChannel)key.channel();
  int read=0;
  boolean https=req instanceof HttpsRequest;
  try {
    if (https && !((HttpsRequest)req).handshaken) {
      buffer.clear();
      read=((HttpsRequest)req).doHandshake(buffer);
      return;
    }
 else     if (https) {
      buffer.clear();
      read=((HttpsRequest)req).unwrapRead(buffer);
    }
 else {
      buffer.clear();
      read=ch.read(buffer);
    }
  }
 catch (  IOException e) {
    if (!cleanAndRetryIfBroken(key,req)) {
      req.finish(e);
    }
  }
catch (  Exception e) {
    req.finish(e);
  }
  if (read == -1) {
    if (!cleanAndRetryIfBroken(key,req)) {
      req.finish();
    }
  }
 else   if (read > 0) {
    req.onProgress(now);
    buffer.flip();
    try {
      if (req.decoder.decode(buffer) == ALL_READ) {
        req.finish();
        if (req.cfg.keepAlive > 0)         keepalives.offer(new PersistentConn(now + req.cfg.keepAlive,req.addr,key));
      }
    }
 catch (    HTTPException e) {
      closeQuietly(key);
      req.finish(e);
    }
catch (    Exception e) {
      closeQuietly(key);
      req.finish(e);
      HttpUtils.printError("String_Node_Str",e);
    }
  }
}
Program: 8086
Project: 8086
Buggy source:
/** 
 * tricky part <p/> http-kit think all connections are keep-alived (since some say it is, but actually is not). but, some are not, http-kit pick them out **after the fact** 1. the connection is resued 2. no data received
 */
private boolean cleanAndRetryIfBroken(SelectionKey key,Request req){
  closeQuietly(key);
  keepalives.remove(key);
  if (req.isReuseConn && req.decoder.state == READ_INITIAL) {
    for (    ByteBuffer b : req.request) {
      b.position(0);
    }
    req.isReuseConn=false;
    requests.remove(req);
    pending.offer(req);
    selector.wakeup();
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * http-kit think all connections are keep-alived (since some say it is, but actually is not). but, some are not, http-kit pick them out after the fact <ol> <li>The connection is reused</li> <li>No data received</li> </ol>
 */
private boolean cleanAndRetryIfBroken(SelectionKey key,Request req){
  closeQuietly(key);
  keepalives.remove(key);
  if (req.isReuseConn && req.decoder.state == READ_INITIAL) {
    for (    ByteBuffer b : req.request) {
      b.position(0);
    }
    req.isReuseConn=false;
    requests.remove(req);
    pending.offer(req);
    selector.wakeup();
    return true;
  }
  return false;
}
Program: 8087
Project: 8087
Buggy source:
private void doWrite(SelectionKey key){
  Request req=(Request)key.attachment();
  SocketChannel ch=(SocketChannel)key.channel();
  boolean https=req instanceof HttpsRequest;
  try {
    if (https && !((HttpsRequest)req).handshaken) {
      buffer.clear();
      int b=((HttpsRequest)req).doHandshake(buffer);
    }
 else     if (https) {
      ((HttpsRequest)req).writeWrapped();
    }
 else {
      ByteBuffer[] request=req.request;
      ch.write(request);
      if (!request[request.length - 1].hasRemaining()) {
        key.interestOps(OP_READ);
      }
    }
  }
 catch (  IOException e) {
    if (!cleanAndRetryIfBroken(key,req)) {
      req.finish(e);
    }
  }
}

Fixed version (ground truth):
private void doWrite(SelectionKey key){
  Request req=(Request)key.attachment();
  SocketChannel ch=(SocketChannel)key.channel();
  boolean https=req instanceof HttpsRequest;
  try {
    if (https && !((HttpsRequest)req).handshaken) {
      buffer.clear();
      int b=((HttpsRequest)req).doHandshake(buffer);
    }
 else     if (https) {
      ((HttpsRequest)req).writeWrappedRequest();
    }
 else {
      ByteBuffer[] request=req.request;
      ch.write(request);
      if (!request[request.length - 1].hasRemaining()) {
        key.interestOps(OP_READ);
      }
    }
  }
 catch (  IOException e) {
    if (!cleanAndRetryIfBroken(key,req)) {
      req.finish(e);
    }
  }
}
Program: 8088
Project: 8088
Buggy source:
final int unwrapRead(ByteBuffer peerAppData) throws IOException {
  int read=((SocketChannel)key.channel()).read(peerNetData);
  if (read > 0) {
    peerNetData.flip();
    read=0;
    SSLEngineResult res;
    while ((res=engine.unwrap(peerNetData,peerAppData)).getStatus() == Status.OK) {
      read+=res.bytesProduced();
      if (!peerNetData.hasRemaining())       break;
    }
    peerNetData.compact();
switch (res.getStatus()) {
case OK:
case BUFFER_UNDERFLOW:
      return read;
case CLOSED:
    return read > 0 ? read : -1;
case BUFFER_OVERFLOW:
  System.out.println("String_Node_Str");
return -1;
}
}
return read;
}

Fixed version (ground truth):
final int unwrapRead(ByteBuffer peerAppData) throws IOException {
  int read=((SocketChannel)key.channel()).read(peerNetData), unwrapped=0;
  if (read > 0) {
    peerNetData.flip();
    SSLEngineResult res;
    while ((res=engine.unwrap(peerNetData,peerAppData)).getStatus() == Status.OK) {
      unwrapped+=res.bytesProduced();
      if (!peerNetData.hasRemaining())       break;
    }
    peerNetData.compact();
switch (res.getStatus()) {
case OK:
case BUFFER_UNDERFLOW:
      return unwrapped;
case CLOSED:
    System.out.println("String_Node_Str" + unwrapped);
  return unwrapped > 0 ? unwrapped : -1;
case BUFFER_OVERFLOW:
System.out.println("String_Node_Str");
return -1;
}
return unwrapped;
}
 else {
return read;
}
}
Program: 8089
Project: 8089
Buggy source:
public void recycle(Request old) throws SSLException {
  super.recycle(old);
  this.engine=((HttpsRequest)old).engine;
  this.handshaken=true;
  wrap();
}

Fixed version (ground truth):
public void recycle(Request old) throws SSLException {
  super.recycle(old);
  this.engine=((HttpsRequest)old).engine;
  this.handshaken=true;
  wrapRequest();
}
Program: 8090
Project: 8090
Buggy source:
final int doHandshake(ByteBuffer peerAppData) throws IOException {
  SSLEngineResult.HandshakeStatus hs=engine.getHandshakeStatus();
  while (!handshaken) {
switch (hs) {
case NEED_TASK:
      Runnable runnable;
    while ((runnable=engine.getDelegatedTask()) != null) {
      runnable.run();
      log("String_Node_Str",runnable,engine.getHandshakeStatus());
    }
  break;
case NEED_UNWRAP:
int read=((SocketChannel)key.channel()).read(peerNetData);
log("String_Node_Str",read,"String_Node_Str");
if (read < 0) {
log("String_Node_Str");
return -1;
}
 else {
peerNetData.flip();
SSLEngineResult res=engine.unwrap(peerNetData,peerAppData);
peerNetData.compact();
log("String_Node_Str",res);
switch (res.getStatus()) {
case BUFFER_OVERFLOW:
System.out.println("String_Node_Str");
break;
case CLOSED:
return -1;
case BUFFER_UNDERFLOW:
log("String_Node_Str");
return 0;
}
}
break;
case NEED_WRAP:
SSLEngineResult res=engine.wrap(EMPTY_BUFFER,myNetData);
log("String_Node_Str",res);
myNetData.flip();
((SocketChannel)key.channel()).write(myNetData);
if (myNetData.hasRemaining()) {
}
 else {
myNetData.clear();
if (res.getHandshakeStatus() != SSLEngineResult.HandshakeStatus.NEED_WRAP) key.interestOps(SelectionKey.OP_READ);
}
break;
}
hs=engine.getHandshakeStatus();
handshaken=hs == SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING || hs == SSLEngineResult.HandshakeStatus.FINISHED;
log("String_Node_Str",hs,handshaken);
if (handshaken) {
wrap();
writeWrapped();
}
}
return 0;
}

Fixed version (ground truth):
final int doHandshake(ByteBuffer peerAppData) throws IOException {
  SSLEngineResult.HandshakeStatus hs=engine.getHandshakeStatus();
  while (!handshaken) {
switch (hs) {
case NEED_TASK:
      Runnable runnable;
    while ((runnable=engine.getDelegatedTask()) != null) {
      runnable.run();
      log("String_Node_Str",runnable,engine.getHandshakeStatus());
    }
  break;
case NEED_UNWRAP:
int read=((SocketChannel)key.channel()).read(peerNetData);
log("String_Node_Str",read,"String_Node_Str");
if (read < 0) {
log("String_Node_Str");
return -1;
}
 else {
peerNetData.flip();
SSLEngineResult res=engine.unwrap(peerNetData,peerAppData);
peerNetData.compact();
log("String_Node_Str",res);
switch (res.getStatus()) {
case BUFFER_OVERFLOW:
System.out.println("String_Node_Str");
break;
case CLOSED:
return -1;
case BUFFER_UNDERFLOW:
log("String_Node_Str");
return 0;
}
}
break;
case NEED_WRAP:
SSLEngineResult res=engine.wrap(EMPTY_BUFFER,myNetData);
log("String_Node_Str",res);
myNetData.flip();
((SocketChannel)key.channel()).write(myNetData);
if (myNetData.hasRemaining()) {
}
 else {
myNetData.clear();
if (res.getHandshakeStatus() != SSLEngineResult.HandshakeStatus.NEED_WRAP) key.interestOps(SelectionKey.OP_READ);
}
break;
}
hs=engine.getHandshakeStatus();
handshaken=hs == SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING || hs == SSLEngineResult.HandshakeStatus.FINISHED;
log("String_Node_Str",hs,handshaken);
if (handshaken) {
wrapRequest();
writeWrappedRequest();
}
}
return 0;
}
Program: 8091
Project: 8091
Buggy source:
public static void main(String[] args) throws IOException, InterruptedException {
  HttpClient client=new HttpClient();
  String[] urls=new String[]{"String_Node_Str","String_Node_Str"};
  ExecutorService pool=Executors.newCachedThreadPool();
  for (  String url : urls) {
    final CountDownLatch cd=new CountDownLatch(1);
    HttpRequestConfig cfg=new HttpRequestConfig(HttpMethod.GET,10000,-1,SslContextFactory.getClientContext().createSSLEngine());
    client.exec(url,new TreeMap<String,Object>(),null,cfg,new RespListener(new IResponseHandler(){
      public void onSuccess(      int status,      Map<String,String> headers,      Object body){
        int length=body instanceof String ? ((String)body).length() : ((BytesInputStream)body).available();
        logger.info("String_Node_Str",status,headers,length);
        cd.countDown();
      }
      public void onThrowable(      Throwable t){
        logger.error("String_Node_Str",t);
        cd.countDown();
      }
    }
,IFilter.ACCEPT_ALL,pool));
    cd.await();
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, InterruptedException {
  HttpClient client=new HttpClient();
  String[] urls=new String[]{"String_Node_Str","String_Node_Str"};
  ExecutorService pool=Executors.newCachedThreadPool();
  for (  String url : urls) {
    final CountDownLatch cd=new CountDownLatch(1);
    SSLEngine engine=SslContextFactory.getClientContext().createSSLEngine();
    engine=null;
    HttpRequestConfig cfg=new HttpRequestConfig(HttpMethod.GET,10000,-1,engine);
    client.exec(url,new TreeMap<String,Object>(),null,cfg,new RespListener(new IResponseHandler(){
      public void onSuccess(      int status,      Map<String,String> headers,      Object body){
        int length=body instanceof String ? ((String)body).length() : ((BytesInputStream)body).available();
        logger.info("String_Node_Str",status,headers,length);
        cd.countDown();
      }
      public void onThrowable(      Throwable t){
        logger.error("String_Node_Str",t);
        cd.countDown();
      }
    }
,IFilter.ACCEPT_ALL,pool));
    cd.await();
  }
}
Program: 8092
Project: 8092
Buggy source:
private void readHeaders(ByteBuffer buffer) throws LineTooLargeException, RequestTooLargeException {
  String line=readLine(buffer);
  while (line != null && !line.isEmpty()) {
    splitAndAddHeader(line);
    line=readLine(buffer);
  }
  if (line == null) {
    return;
  }
  request.setHeaders(headers);
  String te=headers.get(TRANSFER_ENCODING);
  if (CHUNKED.equals(te)) {
    state=READ_CHUNK_SIZE;
  }
 else {
    String cl=headers.get(CONTENT_LENGTH);
    if (cl != null) {
      try {
        readRemaining=Integer.parseInt(cl);
        throwIfBodyIsTooLarge(readRemaining);
        content=new byte[readRemaining];
        state=READ_FIXED_LENGTH_CONTENT;
      }
 catch (      NumberFormatException e) {
        state=PROTOCOL_ERROR;
      }
    }
    state=ALL_READ;
  }
}

Fixed version (ground truth):
private void readHeaders(ByteBuffer buffer) throws LineTooLargeException, RequestTooLargeException {
  String line=readLine(buffer);
  while (line != null && !line.isEmpty()) {
    splitAndAddHeader(line);
    line=readLine(buffer);
  }
  if (line == null) {
    return;
  }
  request.setHeaders(headers);
  String te=headers.get(TRANSFER_ENCODING);
  if (CHUNKED.equals(te)) {
    state=READ_CHUNK_SIZE;
  }
 else {
    String cl=headers.get(CONTENT_LENGTH);
    if (cl != null) {
      try {
        readRemaining=Integer.parseInt(cl);
        throwIfBodyIsTooLarge(readRemaining);
        content=new byte[readRemaining];
        state=READ_FIXED_LENGTH_CONTENT;
      }
 catch (      NumberFormatException e) {
        state=PROTOCOL_ERROR;
      }
    }
 else {
      state=ALL_READ;
    }
  }
}
Program: 8093
Project: 8093
Buggy source:
public String getContentType(){
  return null;
}

Fixed version (ground truth):
public String getContentType(){
  return headers.get(CONTENT_TYPE);
}
Program: 8094
Project: 8094
Buggy source:
/** 
 * Configure subscribers.
 * @param listeners
 */
public void setSubscribers(Map<MetaqTopic,? extends DefaultMessageListener<?>> subscribers){
  this.subscribers=subscribers;
}

Fixed version (ground truth):
/** 
 * Configure subscribers.
 * @param listeners
 */
@SuppressWarnings("String_Node_Str") public void setSubscribers(Map subscribers){
  this.subscribers=subscribers;
}
Program: 8096
Project: 8096
Buggy source:
private void markProcessed(final Long msgId){
  SimpleFetchManager.this.messageIdCache.put(msgId,PROCESSED);
}

Fixed version (ground truth):
private void markProcessed(final Long msgId,String group){
  SimpleFetchManager.this.messageIdCache.put(this.cacheKey(msgId,group),PROCESSED);
}
Program: 8097
Project: 8097
Buggy source:
private boolean isProcessed(final Message msg){
  return SimpleFetchManager.this.messageIdCache.get(msg.getId()) != null;
}

Fixed version (ground truth):
private boolean isProcessed(final Long id,String group){
  return SimpleFetchManager.this.messageIdCache.get(this.cacheKey(id,group)) != null;
}
Program: 8098
Project: 8098
Buggy source:
protected MessageConsumer getMessageConsumer(MetaqTopic topic) throws MetaClientException {
  if (this.shareConsumer) {
    if (this.sharedConsumer == null) {
      if (this.defaultTopic == null) {
        throw new IllegalArgumentException("String_Node_Str");
      }
synchronized (this) {
        if (this.sharedConsumer == null) {
          this.sharedConsumer=this.messageSessionFactory.createConsumer(this.defaultTopic.getConsumerConfig());
          if (!StringUtils.isBlank(this.defaultTopic.getTopic())) {
            this.sharedConsumer.subscribe(this.defaultTopic.getTopic(),this.defaultTopic.getMaxBufferSize(),this.defaultMessageListener);
          }
          this.consumers.add(this.sharedConsumer);
        }
      }
    }
    return this.sharedConsumer;
  }
 else {
    if (this.defaultMessageListener != null || this.defaultTopic != null) {
      throw new IllegalStateException("String_Node_Str");
    }
    MessageConsumer consumer=this.messageSessionFactory.createConsumer(topic.getConsumerConfig());
    this.consumers.add(consumer);
    return consumer;
  }
}

Fixed version (ground truth):
protected MessageConsumer getMessageConsumer(MetaqTopic topic) throws MetaClientException {
  MessageConsumer consumer=this.getMessageConsumer0(topic);
  if (this.rejectConsumptionHandler != null) {
    consumer.setRejectConsumptionHandler(this.rejectConsumptionHandler);
  }
  return consumer;
}
Program: 8099
Project: 8099
Buggy source:
public LocalOffsetStorage(final String filePath) throws IOException {
  final File file=new File(filePath);
  if (file.exists()) {
    this.loadGroupInfo(file);
  }
 else {
    file.createNewFile();
  }
  this.channel=new RandomAccessFile(file,"String_Node_Str").getChannel();
}

Fixed version (ground truth):
public LocalOffsetStorage(final String filePath) throws IOException {
  this.filePath=filePath;
  final File file=new File(filePath);
  if (file.exists()) {
    this.loadGroupInfo(file);
  }
 else {
    file.createNewFile();
  }
}
Program: 8100
Project: 8100
Buggy source:
@Override public void commitOffset(final String group,final Collection<TopicPartitionRegInfo> infoList){
  if (infoList == null || infoList.isEmpty()) {
    return;
  }
  this.groupInfoMap.put(group,(List<TopicPartitionRegInfo>)infoList);
  try {
    final String json=JSONUtils.serializeObject(this.groupInfoMap);
    this.channel.position(0);
    final ByteBuffer buf=ByteBuffer.wrap(json.getBytes());
    while (buf.hasRemaining()) {
      this.channel.write(buf);
    }
    this.channel.truncate(this.channel.position());
  }
 catch (  final Exception e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void commitOffset(final String group,final Collection<TopicPartitionRegInfo> infoList){
  if (infoList == null || infoList.isEmpty()) {
    return;
  }
  this.groupInfoMap.put(group,(List<TopicPartitionRegInfo>)infoList);
  FileOutputStream out=null;
  FileChannel channel=null;
  try {
    final String json=JSONUtils.serializeObject(this.groupInfoMap);
    File tmpFile=new File(this.filePath + "String_Node_Str" + this.counter.incrementAndGet());
    out=new FileOutputStream(tmpFile);
    channel=out.getChannel();
    final ByteBuffer buf=ByteBuffer.wrap(json.getBytes());
    while (buf.hasRemaining()) {
      channel.write(buf);
    }
    this.close(channel);
    this.close(out);
synchronized (this) {
      if (!tmpFile.renameTo(new File(this.filePath))) {
        throw new IOException("String_Node_Str" + this.filePath);
      }
    }
  }
 catch (  final Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    if (channel != null && channel.isOpen()) {
      this.close(channel);
    }
    this.close(out);
  }
}
Program: 8101
Project: 8101
Buggy source:
@Override public void close(){
  this.close(this.channel);
}

Fixed version (ground truth):
@Override public void close(){
}
Program: 8103
Project: 8103
Buggy source:
@Override public void shutdown() throws MetaClientException {
  if (this.shutdown) {
    return;
  }
  this.shutdown=true;
  this.recoverManager.shutdown();
  for (  final Shutdownable child : this.children) {
    child.shutdown();
  }
  try {
    this.remotingClient.stop();
  }
 catch (  final NotifyRemotingException e) {
    throw new NetworkException("String_Node_Str",e);
  }
  if (this.zkClient != null) {
    this.zkClient.close();
  }
  if (!this.isHutdownHookCalled) {
    Runtime.getRuntime().removeShutdownHook(this.shutdownHook);
  }
}

Fixed version (ground truth):
@Override public synchronized void shutdown() throws MetaClientException {
  if (this.shutdown) {
    return;
  }
  this.shutdown=true;
  if (this.recoverManager != null) {
    this.recoverManager.shutdown();
  }
  for (  final Shutdownable child : this.children) {
    if (child != null) {
      child.shutdown();
    }
  }
  try {
    if (this.remotingClient != null) {
      this.remotingClient.stop();
    }
  }
 catch (  final NotifyRemotingException e) {
    throw new NetworkException("String_Node_Str",e);
  }
  if (this.zkClient != null) {
    this.zkClient.close();
  }
  if (!this.isHutdownHookCalled && this.shutdownHook != null) {
    Runtime.getRuntime().removeShutdownHook(this.shutdownHook);
  }
}
Program: 8104
Project: 8104
Buggy source:
protected String getConsumerUUID(final ConsumerConfig consumerConfig) throws Exception {
  String consumerUUID=null;
  if (consumerConfig.getConsumerId() != null) {
    consumerUUID=consumerConfig.getConsumerId();
  }
 else {
    consumerUUID=RemotingUtils.getLocalHost() + "String_Node_Str" + System.currentTimeMillis()+ "String_Node_Str"+ this.counter.incrementAndGet();
  }
  return consumerUUID;
}

Fixed version (ground truth):
protected String getConsumerUUID(final ConsumerConfig consumerConfig) throws Exception {
  String consumerUUID=null;
  if (consumerConfig.getConsumerId() != null) {
    consumerUUID=consumerConfig.getConsumerId();
  }
 else {
    consumerUUID=RemotingUtils.getLocalHost() + "String_Node_Str" + this.getPid()+ "String_Node_Str"+ System.currentTimeMillis()+ "String_Node_Str"+ this.counter.incrementAndGet();
  }
  return consumerUUID;
}
Program: 8105
Project: 8105
Buggy source:
public MetaqMessage(Message rawMessage,T body){
  super();
  this.rawMessage=rawMessage;
  this.body=body;
}

Fixed version (ground truth):
public MetaqMessage(Message rawMessage,T body){
  super();
  if (rawMessage == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.rawMessage=rawMessage;
  this.body=body;
}
Program: 8106
Project: 8106
Buggy source:
protected String getConsumerUUID(final ConsumerConfig consumerConfig) throws Exception {
  String consumerUUID=null;
  if (consumerConfig.getConsumerId() != null) {
    consumerUUID=consumerConfig.getConsumerId();
  }
 else {
    consumerUUID=RemotingUtils.getLocalAddress() + "String_Node_Str" + System.currentTimeMillis()+ "String_Node_Str"+ this.counter.incrementAndGet();
  }
  return consumerUUID;
}

Fixed version (ground truth):
protected String getConsumerUUID(final ConsumerConfig consumerConfig) throws Exception {
  String consumerUUID=null;
  if (consumerConfig.getConsumerId() != null) {
    consumerUUID=consumerConfig.getConsumerId();
  }
 else {
    consumerUUID=RemotingUtils.getLocalHost() + "String_Node_Str" + System.currentTimeMillis()+ "String_Node_Str"+ this.counter.incrementAndGet();
  }
  return consumerUUID;
}
Program: 8107
Project: 8107
Buggy source:
static ConsumerConfig updateGroupForBroadcast(final ConsumerConfig consumerConfig){
  try {
    consumerConfig.setGroup(consumerConfig.getGroup() + "String_Node_Str" + RemotingUtils.getLocalAddress().replaceAll("String_Node_Str","String_Node_Str"));
    return consumerConfig;
  }
 catch (  final Exception e) {
    throw new InvalidConsumerConfigException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
static ConsumerConfig updateGroupForBroadcast(final ConsumerConfig consumerConfig){
  try {
    consumerConfig.setGroup(consumerConfig.getGroup() + "String_Node_Str" + RemotingUtils.getLocalHost().replaceAll("String_Node_Str","String_Node_Str"));
    return consumerConfig;
  }
 catch (  final Exception e) {
    throw new InvalidConsumerConfigException("String_Node_Str",e);
  }
}
Program: 8108
Project: 8108
Buggy source:
/** 
 * Construct an IdGenerator
 */
public IdGenerator(){
  try {
    this.seed=RemotingUtils.getLocalAddress() + "String_Node_Str" + System.currentTimeMillis()+ "String_Node_Str";
    this.length=this.seed.length() + ("String_Node_Str" + Long.MAX_VALUE).length();
  }
 catch (  final Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Construct an IdGenerator
 */
public IdGenerator(){
  try {
    this.seed=RemotingUtils.getLocalHost() + "String_Node_Str" + System.currentTimeMillis()+ "String_Node_Str";
    this.length=this.seed.length() + ("String_Node_Str" + Long.MAX_VALUE).length();
  }
 catch (  final Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 8109
Project: 8109
Buggy source:
public String getBrokerHostName() throws Exception {
  final String hostName=this.config.getHostName() == null ? RemotingUtils.getLocalAddress() : this.config.getHostName();
  return hostName;
}

Fixed version (ground truth):
public String getBrokerHostName() throws Exception {
  final String hostName=this.config.getHostName() == null ? RemotingUtils.getLocalHost() : this.config.getHostName();
  return hostName;
}
Program: 8110
Project: 8110
Buggy source:
@Test public void testRegisterBrokerInZk_slave() throws Exception {
  String path="String_Node_Str";
  this.createSlaveBrokerZooKeeper();
  assertFalse(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),path));
  this.slaveBrokerZooKeeper.registerBrokerInZk();
  assertTrue(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),path));
  assertEquals("String_Node_Str" + RemotingUtils.getLocalAddress() + "String_Node_Str",ZkUtils.readData(this.slaveBrokerZooKeeper.getZkClient(),path));
  try {
    this.slaveBrokerZooKeeper.registerBrokerInZk();
    fail();
  }
 catch (  ZkNodeExistsException e) {
  }
}

Fixed version (ground truth):
@Test public void testRegisterBrokerInZk_slave() throws Exception {
  String path="String_Node_Str";
  this.createSlaveBrokerZooKeeper();
  assertFalse(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),path));
  this.slaveBrokerZooKeeper.registerBrokerInZk();
  assertTrue(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),path));
  assertEquals("String_Node_Str" + RemotingUtils.getLocalHost() + "String_Node_Str",ZkUtils.readData(this.slaveBrokerZooKeeper.getZkClient(),path));
  try {
    this.slaveBrokerZooKeeper.registerBrokerInZk();
    fail();
  }
 catch (  ZkNodeExistsException e) {
  }
}
Program: 8111
Project: 8111
Buggy source:
@Test public void testSlaveClose_masterNotClose() throws Exception {
  String masterBrokerPath="String_Node_Str";
  String masterTopicPath="String_Node_Str";
  String slaveBrokerPath="String_Node_Str";
  String slaveTopicPath="String_Node_Str";
  this.testRegisterBrokerInZk_master();
  this.testRegisterTopicInZk();
  this.testRegisterBrokerInZk_slave();
  this.testRegisterTopicInZk_slave();
  this.slaveBrokerZooKeeper.close(true);
  this.slaveBrokerZooKeeper=null;
  assertFalse(ZkUtils.pathExists(this.brokerZooKeeper.getZkClient(),slaveBrokerPath));
  assertFalse(ZkUtils.pathExists(this.brokerZooKeeper.getZkClient(),slaveTopicPath));
  assertTrue(ZkUtils.pathExists(this.brokerZooKeeper.getZkClient(),masterBrokerPath));
  assertEquals("String_Node_Str" + RemotingUtils.getLocalAddress() + "String_Node_Str",ZkUtils.readData(this.brokerZooKeeper.getZkClient(),masterBrokerPath));
  assertTrue(ZkUtils.pathExists(this.brokerZooKeeper.getZkClient(),masterTopicPath));
  assertEquals("String_Node_Str",ZkUtils.readData(this.brokerZooKeeper.getZkClient(),masterTopicPath));
}

Fixed version (ground truth):
@Test public void testSlaveClose_masterNotClose() throws Exception {
  String masterBrokerPath="String_Node_Str";
  String masterTopicPath="String_Node_Str";
  String slaveBrokerPath="String_Node_Str";
  String slaveTopicPath="String_Node_Str";
  this.testRegisterBrokerInZk_master();
  this.testRegisterTopicInZk();
  this.testRegisterBrokerInZk_slave();
  this.testRegisterTopicInZk_slave();
  this.slaveBrokerZooKeeper.close(true);
  this.slaveBrokerZooKeeper=null;
  assertFalse(ZkUtils.pathExists(this.brokerZooKeeper.getZkClient(),slaveBrokerPath));
  assertFalse(ZkUtils.pathExists(this.brokerZooKeeper.getZkClient(),slaveTopicPath));
  assertTrue(ZkUtils.pathExists(this.brokerZooKeeper.getZkClient(),masterBrokerPath));
  assertEquals("String_Node_Str" + RemotingUtils.getLocalHost() + "String_Node_Str",ZkUtils.readData(this.brokerZooKeeper.getZkClient(),masterBrokerPath));
  assertTrue(ZkUtils.pathExists(this.brokerZooKeeper.getZkClient(),masterTopicPath));
  assertEquals("String_Node_Str",ZkUtils.readData(this.brokerZooKeeper.getZkClient(),masterTopicPath));
}
Program: 8112
Project: 8112
Buggy source:
@Test public void testRegisterBrokerInZk_master() throws Exception {
  String path="String_Node_Str";
  assertFalse(ZkUtils.pathExists(this.client,path));
  this.brokerZooKeeper.registerBrokerInZk();
  assertTrue(ZkUtils.pathExists(this.client,path));
  assertEquals("String_Node_Str" + RemotingUtils.getLocalAddress() + "String_Node_Str",ZkUtils.readData(this.client,path));
  try {
    this.brokerZooKeeper.registerBrokerInZk();
    fail();
  }
 catch (  ZkNodeExistsException e) {
  }
}

Fixed version (ground truth):
@Test public void testRegisterBrokerInZk_master() throws Exception {
  String path="String_Node_Str";
  assertFalse(ZkUtils.pathExists(this.client,path));
  this.brokerZooKeeper.registerBrokerInZk();
  assertTrue(ZkUtils.pathExists(this.client,path));
  assertEquals("String_Node_Str" + RemotingUtils.getLocalHost() + "String_Node_Str",ZkUtils.readData(this.client,path));
  try {
    this.brokerZooKeeper.registerBrokerInZk();
    fail();
  }
 catch (  ZkNodeExistsException e) {
  }
}
Program: 8113
Project: 8113
Buggy source:
@Test public void testMasterClose_slaveNotClose() throws Exception {
  String masterBrokerPath="String_Node_Str";
  String masterTopicPath="String_Node_Str";
  String slaveBrokerPath="String_Node_Str";
  String slaveTopicPath="String_Node_Str";
  this.testRegisterBrokerInZk_master();
  this.testRegisterTopicInZk();
  this.testRegisterBrokerInZk_slave();
  this.testRegisterTopicInZk_slave();
  this.brokerZooKeeper.close(true);
  this.brokerZooKeeper=null;
  assertFalse(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),masterBrokerPath));
  assertFalse(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),masterTopicPath));
  assertTrue(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),slaveBrokerPath));
  assertEquals("String_Node_Str" + RemotingUtils.getLocalAddress() + "String_Node_Str",ZkUtils.readData(this.slaveBrokerZooKeeper.getZkClient(),slaveBrokerPath));
  assertTrue(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),slaveTopicPath));
  assertEquals("String_Node_Str",ZkUtils.readData(this.slaveBrokerZooKeeper.getZkClient(),slaveTopicPath));
}

Fixed version (ground truth):
@Test public void testMasterClose_slaveNotClose() throws Exception {
  String masterBrokerPath="String_Node_Str";
  String masterTopicPath="String_Node_Str";
  String slaveBrokerPath="String_Node_Str";
  String slaveTopicPath="String_Node_Str";
  this.testRegisterBrokerInZk_master();
  this.testRegisterTopicInZk();
  this.testRegisterBrokerInZk_slave();
  this.testRegisterTopicInZk_slave();
  this.brokerZooKeeper.close(true);
  this.brokerZooKeeper=null;
  assertFalse(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),masterBrokerPath));
  assertFalse(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),masterTopicPath));
  assertTrue(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),slaveBrokerPath));
  assertEquals("String_Node_Str" + RemotingUtils.getLocalHost() + "String_Node_Str",ZkUtils.readData(this.slaveBrokerZooKeeper.getZkClient(),slaveBrokerPath));
  assertTrue(ZkUtils.pathExists(this.slaveBrokerZooKeeper.getZkClient(),slaveTopicPath));
  assertEquals("String_Node_Str",ZkUtils.readData(this.slaveBrokerZooKeeper.getZkClient(),slaveTopicPath));
}
Program: 8114
Project: 8114
Buggy source:
private void setUpMeta(final String topic,final Integer maxSize) throws MetaClientException {
  this.sessionFactory=new MetaMessageSessionFactory(this.metaClientConfig);
  this.messageConsumer=this.sessionFactory.createConsumer(this.consumerConfig);
  this.messageConsumer.subscribe(topic,maxSize,new MessageListener(){
    public void recieveMessages(    final Message message){
      final MetaMessageWrapper wrapper=new MetaMessageWrapper(message);
      MetaSpout.this.id2wrapperMap.put(message.getId(),wrapper);
      MetaSpout.this.messageQueue.offer(wrapper);
      try {
        wrapper.latch.await();
      }
 catch (      final InterruptedException e) {
        Thread.currentThread().interrupt();
      }
      if (!wrapper.success) {
        throw new RuntimeException("String_Node_Str");
      }
    }
    public Executor getExecutor(){
      return null;
    }
  }
).completeSubscribe();
}

Fixed version (ground truth):
private void setUpMeta(final String topic,final Integer maxSize) throws MetaClientException {
  this.sessionFactory=new MetaMessageSessionFactory(this.metaClientConfig);
  this.messageConsumer=this.sessionFactory.createConsumer(this.consumerConfig);
  this.messageConsumer.subscribe(topic,maxSize,new MessageListener(){
    @Override public void recieveMessages(    final Message message){
      final MetaMessageWrapper wrapper=new MetaMessageWrapper(message);
      MetaSpout.this.id2wrapperMap.put(message.getId(),wrapper);
      MetaSpout.this.messageQueue.offer(wrapper);
      try {
        wrapper.latch.await();
      }
 catch (      final InterruptedException e) {
        Thread.currentThread().interrupt();
      }
      if (!wrapper.success) {
        throw new RuntimeException("String_Node_Str");
      }
    }
    @Override public Executor getExecutor(){
      return null;
    }
  }
).completeSubscribe();
}
Program: 8115
Project: 8115
Buggy source:
public void fail(final Object msgId){
  if (msgId instanceof Long) {
    final long id=(Long)msgId;
    final MetaMessageWrapper wrapper=this.id2wrapperMap.remove(id);
    if (wrapper == null) {
      log.warn(String.format("String_Node_Str",msgId.getClass().getName(),msgId));
      return;
    }
    wrapper.success=false;
    wrapper.latch.countDown();
  }
 else {
    log.warn(String.format("String_Node_Str",msgId.getClass().getName(),msgId));
  }
}

Fixed version (ground truth):
@Override public void fail(final Object msgId){
  if (msgId instanceof Long) {
    final long id=(Long)msgId;
    final MetaMessageWrapper wrapper=this.id2wrapperMap.remove(id);
    if (wrapper == null) {
      log.warn(String.format("String_Node_Str",msgId.getClass().getName(),msgId));
      return;
    }
    wrapper.success=false;
    wrapper.latch.countDown();
  }
 else {
    log.warn(String.format("String_Node_Str",msgId.getClass().getName(),msgId));
  }
}
Program: 8116
Project: 8116
Buggy source:
public void declareOutputFields(final OutputFieldsDeclarer declarer){
  declarer.declare(this.scheme.getOutputFields());
}

Fixed version (ground truth):
@Override public void declareOutputFields(final OutputFieldsDeclarer declarer){
  declarer.declare(this.scheme.getOutputFields());
}
Program: 8117
Project: 8117
Buggy source:
public void recieveMessages(final Message message){
  final MetaMessageWrapper wrapper=new MetaMessageWrapper(message);
  MetaSpout.this.id2wrapperMap.put(message.getId(),wrapper);
  MetaSpout.this.messageQueue.offer(wrapper);
  try {
    wrapper.latch.await();
  }
 catch (  final InterruptedException e) {
    Thread.currentThread().interrupt();
  }
  if (!wrapper.success) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void recieveMessages(final Message message){
  final MetaMessageWrapper wrapper=new MetaMessageWrapper(message);
  MetaSpout.this.id2wrapperMap.put(message.getId(),wrapper);
  MetaSpout.this.messageQueue.offer(wrapper);
  try {
    wrapper.latch.await();
  }
 catch (  final InterruptedException e) {
    Thread.currentThread().interrupt();
  }
  if (!wrapper.success) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 8118
Project: 8118
Buggy source:
public void nextTuple(){
  if (this.messageConsumer != null) {
    try {
      final MetaMessageWrapper wrapper=this.messageQueue.poll(WAIT_FOR_NEXT_MESSAGE,TimeUnit.MILLISECONDS);
      if (wrapper == null) {
        return;
      }
      final Message message=wrapper.message;
      this.collector.emit(this.scheme.deserialize(message.getData()),message.getId());
    }
 catch (    final InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void nextTuple(){
  if (this.messageConsumer != null) {
    try {
      final MetaMessageWrapper wrapper=this.messageQueue.poll(WAIT_FOR_NEXT_MESSAGE,TimeUnit.MILLISECONDS);
      if (wrapper == null) {
        return;
      }
      final Message message=wrapper.message;
      this.collector.emit(this.scheme.deserialize(message.getData()),message.getId());
    }
 catch (    final InterruptedException e) {
    }
  }
}
Program: 8119
Project: 8119
Buggy source:
public void ack(final Object msgId){
  if (msgId instanceof Long) {
    final long id=(Long)msgId;
    final MetaMessageWrapper wrapper=this.id2wrapperMap.remove(id);
    if (wrapper == null) {
      log.warn(String.format("String_Node_Str",msgId.getClass().getName(),msgId));
      return;
    }
    wrapper.success=true;
    wrapper.latch.countDown();
  }
 else {
    log.warn(String.format("String_Node_Str",msgId.getClass().getName(),msgId));
  }
}

Fixed version (ground truth):
@Override public void ack(final Object msgId){
  if (msgId instanceof Long) {
    final long id=(Long)msgId;
    final MetaMessageWrapper wrapper=this.id2wrapperMap.remove(id);
    if (wrapper == null) {
      log.warn(String.format("String_Node_Str",msgId.getClass().getName(),msgId));
      return;
    }
    wrapper.success=true;
    wrapper.latch.countDown();
  }
 else {
    log.warn(String.format("String_Node_Str",msgId.getClass().getName(),msgId));
  }
}
Program: 8120
Project: 8120
Buggy source:
public Executor getExecutor(){
  return null;
}

Fixed version (ground truth):
@Override public Executor getExecutor(){
  return null;
}
Program: 8121
Project: 8121
Buggy source:
public void close(){
  try {
    this.messageConsumer.shutdown();
  }
 catch (  final MetaClientException e) {
    log.error("String_Node_Str",e);
  }
  try {
    this.sessionFactory.shutdown();
  }
 catch (  final MetaClientException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void close(){
  try {
    this.messageConsumer.shutdown();
  }
 catch (  final MetaClientException e) {
    log.error("String_Node_Str",e);
  }
  try {
    this.sessionFactory.shutdown();
  }
 catch (  final MetaClientException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 8122
Project: 8122
Buggy source:
public void open(final Map conf,final TopologyContext context,final SpoutOutputCollector collector){
  final String topic=(String)conf.get(TOPIC);
  if (topic == null) {
    throw new IllegalArgumentException(TOPIC + "String_Node_Str");
  }
  Integer maxSize=(Integer)conf.get(FETCH_MAX_SIZE);
  if (maxSize == null) {
    log.warn("String_Node_Str");
    maxSize=DEFAULT_MAX_SIZE;
  }
  this.id2wrapperMap=new ConcurrentHashMap<Long,MetaMessageWrapper>();
  this.messageQueue=new LinkedTransferQueue<MetaMessageWrapper>();
  try {
    this.collector=collector;
    this.setUpMeta(topic,maxSize);
  }
 catch (  final MetaClientException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void open(final Map conf,final TopologyContext context,final SpoutOutputCollector collector){
  final String topic=(String)conf.get(TOPIC);
  if (topic == null) {
    throw new IllegalArgumentException(TOPIC + "String_Node_Str");
  }
  Integer maxSize=(Integer)conf.get(FETCH_MAX_SIZE);
  if (maxSize == null) {
    log.warn("String_Node_Str");
    maxSize=DEFAULT_MAX_SIZE;
  }
  this.id2wrapperMap=new ConcurrentHashMap<Long,MetaMessageWrapper>();
  this.messageQueue=new LinkedTransferQueue<MetaMessageWrapper>();
  try {
    this.collector=collector;
    this.setUpMeta(topic,maxSize);
  }
 catch (  final MetaClientException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 8123
Project: 8123
Buggy source:
public void start() throws IOException, InterruptedException {
  File snapFile=new File(this.snapDir).getAbsoluteFile();
  File logFile=new File(this.logDir).getAbsoluteFile();
  ZooKeeperServer server=new ZooKeeperServer(snapFile,logFile,this.tickTime);
  this.standaloneServerFactory=NIOServerCnxnFactory.createFactory(new InetSocketAddress(this.port),this.maxConnections);
  this.standaloneServerFactory.startup(server);
  logger.info("String_Node_Str" + this.port);
}

Fixed version (ground truth):
public void start() throws IOException, InterruptedException {
  File snapFile=new File(this.snapDir).getAbsoluteFile();
  if (!snapFile.exists()) {
    snapFile.mkdirs();
  }
  File logFile=new File(this.logDir).getAbsoluteFile();
  if (!logFile.exists()) {
    logFile.mkdirs();
  }
  ZooKeeperServer server=new ZooKeeperServer(snapFile,logFile,this.tickTime);
  this.standaloneServerFactory=NIOServerCnxnFactory.createFactory(new InetSocketAddress(this.port),this.maxConnections);
  this.standaloneServerFactory.startup(server);
  logger.info("String_Node_Str" + this.port);
}
Program: 8124
Project: 8124
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   if ("String_Node_Str".equals(item)) {
    this.appendHelp(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   if ("String_Node_Str".equals(item)) {
    this.realTimeStat.resetStat();
    this.append(sb,"String_Node_Str","String_Node_Str");
  }
 else {
    this.appendTopic(item,sb);
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 8125
Project: 8125
Buggy source:
/** 
 * ����topic��messageѡ�����
 * @param topic
 * @param message
 * @return ѡ�еķ���
 */
public Partition selectPartition(final String topic,final Message message,final PartitionSelector partitionSelector) throws MetaClientException {
  if (this.metaClientConfig.getServerUrl() != null) {
    return Partition.RandomPartiton;
  }
  final BrokerConnectionListener brokerConnectionListener=this.getBrokerConnectionListener(topic);
  if (brokerConnectionListener != null) {
    final BrokersInfo brokersInfo=brokerConnectionListener.brokersInfo;
    return partitionSelector.getPartition(topic,brokersInfo.oldTopicPartitionMap.get(topic),message);
  }
 else {
    return this.selectDefaultPartition(topic,message,partitionSelector,null);
  }
}

Fixed version (ground truth):
/** 
 * ����topic��messageѡ�����
 * @param topic
 * @param message
 * @return ѡ�еķ���
 */
public Partition selectPartition(final String topic,final Message message,final PartitionSelector partitionSelector) throws MetaClientException {
  try {
    message.setReadOnly(true);
    if (this.metaClientConfig.getServerUrl() != null) {
      return Partition.RandomPartiton;
    }
    final BrokerConnectionListener brokerConnectionListener=this.getBrokerConnectionListener(topic);
    if (brokerConnectionListener != null) {
      final BrokersInfo brokersInfo=brokerConnectionListener.brokersInfo;
      return partitionSelector.getPartition(topic,brokersInfo.oldTopicPartitionMap.get(topic),message);
    }
 else {
      return this.selectDefaultPartition(topic,message,partitionSelector,null);
    }
  }
  finally {
    message.setReadOnly(false);
  }
}
Program: 8126
Project: 8126
Buggy source:
/** 
 * ������Ϣpayload
 * @param data
 */
public void setData(final byte[] data){
  this.data=data;
}

Fixed version (ground truth):
/** 
 * Set the message's payload
 * @param data
 */
public void setData(final byte[] data){
  this.checkState();
  this.data=data;
}
Program: 8127
Project: 8127
Buggy source:
/** 
 * ��Ϣ�Ƿ�������
 * @return
 */
public boolean hasAttribute(){
  return this.attribute != null;
}

Fixed version (ground truth):
/** 
 * Returns whether the message has an attribute.
 * @return
 */
public boolean hasAttribute(){
  return this.attribute != null;
}
Program: 8128
Project: 8128
Buggy source:
/** 
 * ������ϢId��ֻ���ڷ��ͳɹ��󷵻ص�id����Ч�����򷵻�0
 * @return
 */
public long getId(){
  return this.id;
}

Fixed version (ground truth):
/** 
 * Returns the message's id.If it was sent success,the message id would be returned by broker,otherwise is zero.
 * @return
 */
public long getId(){
  return this.id;
}
Program: 8129
Project: 8129
Buggy source:
/** 
 * ������Ϣtopic
 * @return
 */
public String getTopic(){
  return this.topic;
}

Fixed version (ground truth):
/** 
 * Returns message's topic
 * @return
 */
public String getTopic(){
  return this.topic;
}
Program: 8130
Project: 8130
Buggy source:
/** 
 * ������Ϣtopic
 * @param topic
 */
public void setTopic(final String topic){
  this.topic=topic;
}

Fixed version (ground truth):
/** 
 * Set message's topic,if you want to send it,you must publish it at first with MessageProducer.
 * @see com.taobao.metamorphosis.client.producer.MessageProducer#publish(String)
 * @param topic
 */
public void setTopic(final String topic){
  this.checkState();
  this.topic=topic;
}
Program: 8131
Project: 8131
Buggy source:
/** 
 * ������Ϣ���ԣ���Ϣ���ԷǱ��룬����Ϊ�ַ���
 * @param attribute
 */
public void setAttribute(final String attribute){
  this.attribute=attribute;
}

Fixed version (ground truth):
/** 
 * Set message's attribute
 * @param attribute
 */
public void setAttribute(final String attribute){
  this.checkState();
  this.attribute=attribute;
}
Program: 8132
Project: 8132
Buggy source:
void setPartition(final Partition partition){
  this.partition=partition;
}

Fixed version (ground truth):
void setPartition(final Partition partition){
  this.checkState();
  this.partition=partition;
}
Program: 8133
Project: 8133
Buggy source:
/** 
 * ���ͳɹ��󣬷�����Ϣ���ڵķ���������ʧ����Ϊnull
 * @return
 */
public Partition getPartition(){
  return this.partition;
}

Fixed version (ground truth):
/** 
 * Returns message's partition in broker,if it was sent fail,it would be null.
 * @return
 */
public Partition getPartition(){
  return this.partition;
}
Program: 8134
Project: 8134
Buggy source:
/** 
 * ������Ϣ����
 * @return
 */
public String getAttribute(){
  return this.attribute;
}

Fixed version (ground truth):
/** 
 * Returns the message's attribute,may be null.
 * @return
 */
public String getAttribute(){
  return this.attribute;
}