nus-yam/ex-repair huggingface dataset:
Program: 151934
Project: 151934
Buggy source:
/** 
 * Checks out a connection from the pool. If no free connection is available, a new connection is created unless the max number of connections has been reached. If a free connection has been closed by the database, it's removed from the pool and this method is called again recursively.
 */
public synchronized Connection getConnection(){
  Connection con=null;
  if (freeConnections.size() > 0) {
    con=freeConnections.firstElement();
    freeConnections.removeElementAt(0);
    try {
      if (con.isClosed()) {
        logger.debug("String_Node_Str");
        con=getConnection();
      }
    }
 catch (    SQLException e) {
      logger.debug("String_Node_Str",e);
      con=getConnection();
    }
  }
 else   if (maxConn == 0 || checkedOut < maxConn) {
    con=newConnection();
  }
  if (con != null) {
    checkedOut++;
  }
  logger.trace("String_Node_Str" + checkedOut);
  return con;
}

Fixed version (ground truth):
/** 
 * * Checks out a connection from the pool. If no free connection is available, a new connection is created unless the max number of connections has been reached. If a free connection has been closed by the database, it is removed from the pool and this method is called again recursively.
 * @return a Connection, null if pool size has been exceeded
 */
public synchronized Connection getConnection(){
  Connection connection=null;
  if (pool.size() > 0) {
    connection=pool.firstElement();
    pool.removeElementAt(0);
    try {
      if (connection.isClosed()) {
        logger.debug("String_Node_Str");
        connection=getConnection();
      }
    }
 catch (    SQLException e) {
      logger.debug("String_Node_Str",e);
      connection=getConnection();
    }
  }
 else   if (maxConn == 0 || checkedOut < maxConn) {
    connection=newConnection();
  }
  if (connection != null) {
    checkedOut++;
  }
  logger.trace("String_Node_Str" + checkedOut);
  return connection;
}
Program: 151935
Project: 151935
Buggy source:
/** 
 * Checks in a connection to the pool. Notify other Threads that may be waiting for a connection.
 * @param con The connection to check in
 */
public synchronized void freeConnection(Connection con){
  freeConnections.addElement(con);
  checkedOut--;
  notifyAll();
}

Fixed version (ground truth):
/** 
 * Checks in a connection to the pool. Notify other Threads that may be waiting for a connection.
 * @param con The connection to check in
 */
public synchronized void freeConnection(Connection con){
  if (con != null) {
    pool.addElement(con);
    checkedOut--;
    notifyAll();
  }
}
Program: 151936
Project: 151936
Buggy source:
/** 
 * Closes all available connections.
 */
public synchronized void release(){
  Enumeration<Connection> allConnections=freeConnections.elements();
  while (allConnections.hasMoreElements()) {
    logger.debug("String_Node_Str");
    Connection con=allConnections.nextElement();
    try {
      con.close();
      logger.debug("String_Node_Str");
    }
 catch (    SQLException e) {
      logger.error("String_Node_Str",e);
    }
catch (    Exception e) {
      logger.error("String_Node_Str",e);
    }
  }
  freeConnections.removeAllElements();
}

Fixed version (ground truth):
/** 
 * Closes all available connections.
 */
public synchronized void release(){
  Enumeration<Connection> allConnections=pool.elements();
  while (allConnections.hasMoreElements()) {
    logger.debug("String_Node_Str");
    Connection con=allConnections.nextElement();
    try {
      con.close();
      logger.debug("String_Node_Str");
    }
 catch (    SQLException e) {
      logger.error("String_Node_Str",e);
    }
catch (    Exception e) {
      logger.error("String_Node_Str",e);
    }
  }
  pool.removeAllElements();
  checkedOut=0;
}
Program: 151937
Project: 151937
Buggy source:
/** 
 * Loads a Properties file from the classpath matching the given file name
 * @param pFileName
 * @return
 */
public static Properties getPropertiesFromClasspath(String pFileName){
  Properties props=new Properties();
  try {
    props.load(ClassLoader.getSystemResourceAsStream(pFileName));
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
  }
  return props;
}

Fixed version (ground truth):
/** 
 * Loads a Properties file from the classpath matching the given file name
 * @param fileName
 * @return
 */
public static Properties getPropertiesFromClasspath(String fileName){
  Properties props=new Properties();
  try {
    InputStream is=ClassLoader.getSystemResourceAsStream(fileName);
    if (is == null) {
      is=Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
      logger.debug("String_Node_Str");
    }
    props.load(is);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
  }
catch (  NullPointerException e) {
    logger.error("String_Node_Str",e);
  }
  return props;
}
Program: 151938
Project: 151938
Buggy source:
/** 
 * Loads a Properties file from the given file name
 * @param pFileName
 * @return
 */
public static Properties getPropertiesFromPath(String pFileName){
  Properties props=new Properties();
  FileInputStream fis;
  try {
    fis=new FileInputStream(pFileName);
    props.load(fis);
    fis.close();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  return props;
}

Fixed version (ground truth):
/** 
 * Loads a Properties file from the given file name
 * @param fileName
 * @return
 */
public static Properties getPropertiesFromPath(String fileName){
  Properties props=new Properties();
  FileInputStream fis;
  try {
    fis=new FileInputStream(fileName);
    props.load(fis);
    fis.close();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  return props;
}
Program: 151939
Project: 151939
Buggy source:
public void compile() throws Exception {
  LifecycleManager.getDefault().saveAll();
  for (  CoffeeScriptDataObject dataObject : data) {
    ProgressHandle handle=handle=ProgressHandleFactory.createHandle("String_Node_Str" + dataObject.getPrimaryFile().getNameExt(),this);
    try {
      handle.start();
      CoffeeScriptCompiler.CompilerResult result=CoffeeScriptSettings.getCompiler().compile(dataObject.getPrimaryFile().asText(),bare);
      if (result == null) {
        return;
      }
      if (result.getJs() != null) {
        FileObject folder=dataObject.getFolder().getPrimaryFile();
        FileObject file=folder.getFileObject(dataObject.getName(),"String_Node_Str");
        if (file != null) {
          file.delete();
        }
        file=folder.createData(dataObject.getName(),"String_Node_Str");
        file.getOutputStream().write(result.getJs().getBytes());
      }
 else {
      }
      handleResult(result);
    }
  finally {
      handle.finish();
    }
  }
}

Fixed version (ground truth):
public void compile() throws Exception {
  LifecycleManager.getDefault().saveAll();
  for (  CoffeeScriptDataObject coffeeFile : data) {
    ProgressHandle handle=ProgressHandleFactory.createHandle("String_Node_Str" + coffeeFile.getPrimaryFile().getNameExt(),this);
    try {
      handle.start();
      CoffeeScriptCompiler.CompilerResult result=CoffeeScriptSettings.getCompiler().compile(coffeeFile.getPrimaryFile().asText(),bare);
      if (result == null) {
        return;
      }
      if (result.getJs() != null) {
        CoffeeScriptUtils.writeJSForCoffeeScriptFile(result.getJs(),coffeeFile.getPrimaryFile());
      }
      handleResult(result);
    }
  finally {
      handle.finish();
    }
  }
}
Program: 151940
Project: 151940
Buggy source:
public void run(final CoffeeScriptParser.ParsingResult result,SchedulerEvent event){
  if ((result != null) && !CoffeeScriptAutocompileContext.get().isEnabled(result.getSnapshot().getSource().getFileObject())) {
    return;
  }
  if ((result != null) && (result.getCompilerResult() != null) && (result.getCompilerResult().getJs() != null)) {
    final FileObject coffeeFile=result.getSnapshot().getSource().getFileObject();
    final String js=result.getCompilerResult().getJs();
    try {
      FileObject folder=coffeeFile.getParent();
      FileObject file=folder.getFileObject(coffeeFile.getName(),"String_Node_Str");
      if (file == null) {
        file=folder.createData(coffeeFile.getName(),"String_Node_Str");
      }
      if (!file.asText().equals(js)) {
        OutputStream out=file.getOutputStream();
        try {
          out.write(js.getBytes(FileEncodingQuery.getEncoding(coffeeFile)));
          out.flush();
        }
  finally {
          if (out != null) {
            out.close();
          }
        }
      }
    }
 catch (    Exception e) {
      Exceptions.printStackTrace(e);
    }
  }
}

Fixed version (ground truth):
public void run(final CoffeeScriptParser.ParsingResult result,SchedulerEvent event){
  if ((result != null) && !CoffeeScriptAutocompileContext.get().isEnabled(result.getSnapshot().getSource().getFileObject())) {
    return;
  }
  if ((result != null) && (result.getCompilerResult() != null) && (result.getCompilerResult().getJs() != null)) {
    FileObject coffeeFile=result.getSnapshot().getSource().getFileObject();
    String js=result.getCompilerResult().getJs();
    CoffeeScriptUtils.writeJSForCoffeeScriptFile(js,coffeeFile);
  }
}
Program: 151941
Project: 151941
Buggy source:
public void packetReceived(DatagramSocket socket,DatagramPacket packet){
  int type=packet.getData()[1] & ~0x80;
  if (type == 0x60 || type == 0x56) {
    byte[] pktp=packet.getData();
    if (type == 0x56) {
      for (int i=0; i < pktp.length - 4; i++) {
        pktp[i]=packet.getData()[i + 4];
      }
      short seqno=pktp[2];
      this.putPacketInBuffer(seqno,pktp);
    }
  }
}

Fixed version (ground truth):
public void packetReceived(DatagramSocket socket,DatagramPacket packet){
  int type=packet.getData()[1] & ~0x80;
  if (type == 0x60 || type == 0x56) {
    byte[] pktp=packet.getData();
    if (type == 0x56) {
      for (int i=0; i < pktp.length - 4; i++) {
        pktp[i]=packet.getData()[i + 4];
      }
    }
    int seqno=((int)pktp[2] << 8) + (pktp[3] & 0xff);
    this.putPacketInBuffer(seqno,pktp);
  }
}
Program: 151942
Project: 151942
Buggy source:
private void putPacketInBuffer(short seqno,byte[] data){
}

Fixed version (ground truth):
private void putPacketInBuffer(int seqno,byte[] data){
  if (!ab_synced) {
    ab_write=seqno;
    ab_read=seqno - 1;
    ab_synced=true;
  }
}
Program: 151943
Project: 151943
Buggy source:
public UDPListener(DatagramSocket socket,UDPDelegate delegate){
  this.socket=socket;
  this.delegate=delegate;
  this.start();
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public UDPListener(DatagramSocket socket,UDPDelegate delegate){
  this.socket=socket;
  this.delegate=delegate;
  this.start();
}
Program: 151944
Project: 151944
Buggy source:
/** 
 * Adds packet into the buffer
 * @param seqno	seqno of the given packet. Used as index
 * @param data
 */
public void putPacketInBuffer(int seqno,byte[] data){
synchronized (lock) {
    if (!synced) {
      writeIndex=seqno;
      readIndex=seqno;
      synced=true;
    }
    @SuppressWarnings("String_Node_Str") int outputSize=0;
    if (seqno == writeIndex) {
      outputSize=this.alac_decode(data,audioBuffer[(seqno % BUFFER_FRAMES)].data);
      audioBuffer[(seqno % BUFFER_FRAMES)].ready=true;
      writeIndex++;
    }
 else     if (seqno > writeIndex) {
      server.request_resend(writeIndex,seqno);
      outputSize=this.alac_decode(data,audioBuffer[(seqno % BUFFER_FRAMES)].data);
      audioBuffer[(seqno % BUFFER_FRAMES)].ready=true;
      writeIndex=seqno + 1;
    }
 else     if (seqno > readIndex) {
      outputSize=this.alac_decode(data,audioBuffer[(seqno % BUFFER_FRAMES)].data);
      audioBuffer[(seqno % BUFFER_FRAMES)].ready=true;
    }
 else {
      System.err.println("String_Node_Str" + seqno);
    }
    actualBufSize=writeIndex - readIndex;
    if (decoder_isStopped && actualBufSize > START_FILL) {
      System.err.println(seqno);
      lock.notify();
    }
    if (writeIndex == 65536) {
      writeIndex=1;
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds packet into the buffer
 * @param seqno	seqno of the given packet. Used as index
 * @param data
 */
public void putPacketInBuffer(int seqno,byte[] data){
synchronized (lock) {
    if (!synced) {
      writeIndex=seqno;
      readIndex=seqno;
      synced=true;
    }
    @SuppressWarnings("String_Node_Str") int outputSize=0;
    if (seqno == writeIndex) {
      outputSize=this.alac_decode(data,audioBuffer[(seqno % BUFFER_FRAMES)].data);
      audioBuffer[(seqno % BUFFER_FRAMES)].ready=true;
      writeIndex++;
    }
 else     if (seqno > writeIndex) {
      server.request_resend(writeIndex,seqno);
      outputSize=this.alac_decode(data,audioBuffer[(seqno % BUFFER_FRAMES)].data);
      audioBuffer[(seqno % BUFFER_FRAMES)].ready=true;
      writeIndex=seqno + 1;
    }
 else     if (seqno > readIndex) {
      outputSize=this.alac_decode(data,audioBuffer[(seqno % BUFFER_FRAMES)].data);
      audioBuffer[(seqno % BUFFER_FRAMES)].ready=true;
    }
 else {
      System.err.println("String_Node_Str" + seqno);
    }
    actualBufSize=writeIndex - readIndex;
    if (actualBufSize < 0) {
      actualBufSize=65536 - readIndex + writeIndex;
    }
    if (decoder_isStopped && actualBufSize > START_FILL) {
      System.err.println(seqno);
      lock.notify();
    }
    if (writeIndex == 65536) {
      writeIndex=0;
    }
  }
}
Program: 151945
Project: 151945
Buggy source:
/** 
 * Returns the next ready frame. If none, waiting for one
 * @return
 */
public int[] getNextFrame(){
synchronized (lock) {
    System.err.println("String_Node_Str" + readIndex);
    actualBufSize=writeIndex - readIndex;
    if (actualBufSize < 1 || !synced) {
      if (synced) {
        System.err.println("String_Node_Str");
      }
      try {
        System.err.println("String_Node_Str");
        decoder_isStopped=true;
        lock.wait();
        decoder_isStopped=false;
        System.err.println("String_Node_Str");
        readIndex++;
        session.resetFilter();
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      return null;
    }
    if (actualBufSize >= BUFFER_FRAMES) {
      System.err.println("String_Node_Str");
      readIndex=writeIndex - START_FILL;
    }
    int read=readIndex;
    readIndex++;
    actualBufSize=writeIndex - readIndex;
    session.updateFilter(actualBufSize);
    AudioData buf=audioBuffer[read % BUFFER_FRAMES];
    if (!buf.ready) {
      System.err.println("String_Node_Str");
      for (int i=0; i < buf.data.length; i++) {
        buf.data[i]=0;
      }
    }
    buf.ready=false;
    if (readIndex == 65536) {
      readIndex=1;
    }
    return buf.data;
  }
}

Fixed version (ground truth):
/** 
 * Returns the next ready frame. If none, waiting for one
 * @return
 */
public int[] getNextFrame(){
synchronized (lock) {
    System.err.println("String_Node_Str" + readIndex);
    actualBufSize=writeIndex - readIndex;
    if (actualBufSize < 0) {
      actualBufSize=65536 - readIndex + writeIndex;
    }
    if (actualBufSize < 1 || !synced) {
      if (synced) {
        System.err.println("String_Node_Str");
      }
      try {
        System.err.println("String_Node_Str");
        decoder_isStopped=true;
        lock.wait();
        decoder_isStopped=false;
        System.err.println("String_Node_Str");
        readIndex++;
        session.resetFilter();
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      return null;
    }
    if (actualBufSize >= BUFFER_FRAMES) {
      System.err.println("String_Node_Str");
      readIndex=writeIndex - START_FILL;
    }
    int read=readIndex;
    readIndex++;
    actualBufSize=writeIndex - readIndex;
    if (actualBufSize < 0) {
      actualBufSize=65536 - readIndex + writeIndex;
    }
    session.updateFilter(actualBufSize);
    AudioData buf=audioBuffer[read % BUFFER_FRAMES];
    if (!buf.ready) {
      System.err.println("String_Node_Str");
      for (int i=0; i < buf.data.length; i++) {
        buf.data[i]=0;
      }
    }
    buf.ready=false;
    if (readIndex == 65536) {
      readIndex=0;
    }
    return buf.data;
  }
}
Program: 151947
Project: 151947
Buggy source:
private ImmutableList<LinkedHashMap<String,Object>> getDataPoints(){
  ImmutableList.Builder<LinkedHashMap<String,Object>> builder=new ImmutableList.Builder<LinkedHashMap<String,Object>>();
  try {
    for (    String line : (List<String>)IOUtils.readLines(new FileReader(subscriberConfig.getFilePath()))) {
      if (line.trim().length() > 0) {
        map.clear();
        String[] items=line.split(subscriberConfig.getSeparator());
        long dateTime=new DateTime(items[0],DateTimeZone.forID("String_Node_Str")).getMillis();
        map.put("String_Node_Str",dateTime);
        for (int j=1; j < items.length; j++) {
          double value=Double.valueOf(items[j]);
          map.put(subscriberConfig.getAttributes()[j],value);
        }
        builder.add(new LinkedHashMap(map));
      }
    }
    return builder.build();
  }
 catch (  IOException e) {
    log.error("String_Node_Str" + subscriberConfig.getFilePath());
    return null;
  }
}

Fixed version (ground truth):
private ImmutableList<LinkedHashMap<String,Object>> getDataPoints(){
  ImmutableList.Builder<LinkedHashMap<String,Object>> builder=new ImmutableList.Builder<LinkedHashMap<String,Object>>();
  try {
    for (    String line : (List<String>)IOUtils.readLines(new FileReader(subscriberConfig.getFilePath()))) {
      if (line.trim().length() > 0) {
        map.clear();
        String[] items=line.split(subscriberConfig.getSeparator());
        long dateTime=new DateTime(items[0],DateTimeZone.forID("String_Node_Str")).getMillis();
        map.put("String_Node_Str",dateTime);
        for (int j=1; j < items.length; j++) {
          double value=Double.valueOf(items[j]);
          map.put(subscriberConfig.getAttributes()[j - 1],value);
        }
        builder.add(new LinkedHashMap(map));
      }
    }
    return builder.build();
  }
 catch (  IOException e) {
    log.error("String_Node_Str" + subscriberConfig.getFilePath());
    return null;
  }
}
Program: 151948
Project: 151948
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.help);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  View v=findViewById(R.id.video);
  v.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str")));
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.help);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  View v=findViewById(R.id.video);
  v.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      try {
        startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str")));
      }
 catch (      Exception e) {
        startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str")));
      }
    }
  }
);
}
Program: 151949
Project: 151949
Buggy source:
public void onClick(View v){
  startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str")));
}

Fixed version (ground truth):
public void onClick(View v){
  try {
    startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str")));
  }
 catch (  Exception e) {
    startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str")));
  }
}
Program: 151950
Project: 151950
Buggy source:
public boolean hasMove(int color){
  Board board=game.boards.get(color);
  for (  Square seed : board.seeds()) {
    for (int p=0; p < board.pieces.size(); p++) {
      Piece piece=board.pieces.get(p);
      for (int r=0; r < piece.rotations; r++, piece.rotate(1)) {
        for (int f=0; f < piece.flips; f++, piece.flip()) {
          for (          Square s : piece.squares()) {
            int i=seed.i - s.i;
            int j=seed.j - s.j;
            if (!board.outside(s,i,j) && game.fits(piece,i,j)) {
              Log.d(tag,"String_Node_Str" + new Move(piece,i,j));
              game.boards.get(color).over=false;
              return true;
            }
          }
        }
      }
    }
  }
  game.boards.get(color).over=true;
  return false;
}

Fixed version (ground truth):
public boolean hasMove(int color){
  Board board=game.boards.get(color);
  for (  Square seed : board.seeds()) {
    for (int p=0; p < board.pieces.size(); p++) {
      Piece piece=board.pieces.get(p);
      for (int f=0; f < piece.flips; f++, piece.flip()) {
        for (int r=0; r < piece.rotations; r++, piece.rotate(1)) {
          for (          Square s : piece.squares()) {
            int i=seed.i - s.i;
            int j=seed.j - s.j;
            if (!board.outside(s,i,j) && game.fits(piece,i,j)) {
              Log.d(tag,"String_Node_Str" + new Move(piece,i,j));
              game.boards.get(color).over=false;
              return true;
            }
          }
        }
      }
    }
  }
  game.boards.get(color).over=true;
  return false;
}
Program: 151951
Project: 151951
Buggy source:
/** 
 * Setup CDI environment for the class.<br> INTERNAL: Do not use.
 */
@BeforeClass(alwaysRun=true) protected void setupCdi(){
  weld=new Weld(){
    @Override protected Deployment createDeployment(    ResourceLoader resourceLoader,    CDI11Bootstrap bootstrap){
      try {
        return new WeldTestUrlDeployment(resourceLoader,bootstrap,clazz);
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
    protected Deployment createDeployment(    ResourceLoader resourceLoader,    Bootstrap bootstrap){
      try {
        return new WeldTestUrlDeployment(resourceLoader,bootstrap,clazz);
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Setup CDI environment for the class.<br> INTERNAL: Do not use.
 */
@BeforeClass(alwaysRun=true) protected void setupCdi(){
  weld=new Weld(){
    protected Deployment createDeployment(    ResourceLoader resourceLoader,    CDI11Bootstrap bootstrap){
      try {
        return new WeldTestUrlDeployment(resourceLoader,bootstrap,clazz);
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
    protected Deployment createDeployment(    ResourceLoader resourceLoader,    Bootstrap bootstrap){
      try {
        return new WeldTestUrlDeployment(resourceLoader,bootstrap,clazz);
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
;
}
Program: 151953
Project: 151953
Buggy source:
/** 
 * Load key, enables decryption
 * @param jobId optional job id
 * @param keyId key to load
 * @param password private key-ring password
 * @throws Exception if invalid key
 */
public void loadKey(String jobId,String keyId,char[] password) throws Exception {
  if (!keys.containsKey(keyId)) {
    String v=(String)DB.execWithTransaction(db -> {
      SysConfigManager mgr=new SysConfigManager(db,"String_Node_Str");
      return mgr.get(keyId,null);
    }
);
    if (v == null) {
      throw new SecurityException("String_Node_Str");
    }
    byte[] key=PGPHelper.decrypt(v.getBytes(),privKeyRing,password);
    keys.put((jobId == null ? "String_Node_Str" : jobId) + keyId,new SecretKeySpec(key,0,key.length,"String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * Load key, enables decryption
 * @param jobId optional job id
 * @param keyId key to load
 * @param password private key-ring password
 * @throws Exception if invalid key
 */
public void loadKey(String jobId,String keyId,char[] password) throws Exception {
  if (!keys.containsKey((jobId == null ? "String_Node_Str" : jobId) + keyId)) {
    String v=(String)DB.execWithTransaction(db -> {
      SysConfigManager mgr=new SysConfigManager(db,"String_Node_Str");
      return mgr.get(keyId,null);
    }
);
    if (v == null) {
      throw new SecurityException("String_Node_Str");
    }
    byte[] key=PGPHelper.decrypt(v.getBytes(),privKeyRing,password);
    keys.put((jobId == null ? "String_Node_Str" : jobId) + keyId,new SecretKeySpec(key,0,key.length,"String_Node_Str"));
  }
}
Program: 151954
Project: 151954
Buggy source:
public void formatGrid(Grid grid){
  grid.setCellStyleGenerator(cellReference -> {
    if (cellReference.getValue() instanceof BigDecimal)     return "String_Node_Str";
    return null;
  }
);
  DecimalFormat nf=new DecimalFormat();
  nf.setGroupingUsed(false);
  if (grid.getColumn("String_Node_Str") != null && !String.class.equals(grid.getContainerDataSource().getType("String_Node_Str")))   grid.getColumn("String_Node_Str").setRenderer(new NumberRenderer(nf));
  for (  Grid.Column c : grid.getColumns()) {
    c.setHidable(true);
    ViewConfig.FieldConfig config=viewConfig.getFields().get(c.getPropertyId());
    if ("String_Node_Str".equals(c.getPropertyId())) {
      c.setExpandRatio(0);
    }
 else     if (isBooleanColumn(c)) {
      c.setExpandRatio(0);
      c.setConverter(new StringToBooleanConverter("String_Node_Str","String_Node_Str"));
    }
 else     if (isDateColumn(c)) {
      c.setRenderer(new DateRenderer(getDateFormat()));
    }
 else {
      c.setExpandRatio(1);
    }
    if (config != null) {
      if (config.getExpandRatio() != -1)       c.setExpandRatio(config.getExpandRatio());
    }
  }
  grid.setSizeFull();
}

Fixed version (ground truth):
public void formatGrid(Grid grid){
  grid.setCellStyleGenerator(cellReference -> {
    if (cellReference.getValue() instanceof BigDecimal)     return "String_Node_Str";
    return null;
  }
);
  DecimalFormat nf=new DecimalFormat();
  nf.setGroupingUsed(false);
  grid.addColumnResizeListener((Grid.ColumnResizeListener)event -> {
    int lastColumnIndex=grid.getColumns().size() - 1;
    grid.getColumns().get(lastColumnIndex).setWidth(1500);
  }
);
  if (grid.getColumn("String_Node_Str") != null && !String.class.equals(grid.getContainerDataSource().getType("String_Node_Str")))   grid.getColumn("String_Node_Str").setRenderer(new NumberRenderer(nf));
  for (  Grid.Column c : grid.getColumns()) {
    c.setHidable(true);
    if ("String_Node_Str".equals(c.getPropertyId())) {
      c.setExpandRatio(0);
    }
 else     if (isBooleanColumn(c)) {
      c.setExpandRatio(0);
      c.setConverter(new StringToBooleanConverter("String_Node_Str","String_Node_Str"));
    }
 else     if (isDateColumn(c)) {
      c.setRenderer(new DateRenderer(getDateFormat()));
    }
 else {
      c.setExpandRatio(1);
    }
    ViewConfig.FieldConfig config=viewConfig.getFields().get(c.getPropertyId());
    if (config != null) {
      if (config.getExpandRatio() != -1)       c.setExpandRatio(config.getExpandRatio());
    }
  }
  grid.setSizeFull();
}
Program: 151955
Project: 151955
Buggy source:
@Override public void enter(ViewChangeListener.ViewChangeEvent event){
  super.enter(event);
  setHelper(createHelper());
  showSpecificView(getGeneralRoute() + "String_Node_Str" + QI.getQI().getUser().getId());
}

Fixed version (ground truth):
@Override public void enter(ViewChangeListener.ViewChangeEvent event){
  setHelper(createHelper());
  getHelper().setConfiguration(getConfiguration());
  showSpecificView(getGeneralRoute() + "String_Node_Str" + QI.getQI().getUser().getId());
}
Program: 151956
Project: 151956
Buggy source:
private BigDecimal createBalanceCache(Journal journal,Account acct,short[] layers,long maxId) throws HibernateException, GLException {
  BigDecimal balance=null;
  if (acct instanceof CompositeAccount) {
    balance=ZERO;
    Iterator iter=((CompositeAccount)acct).getChildren().iterator();
    while (iter.hasNext()) {
      Account a=(Account)iter.next();
      balance=balance.add(createBalanceCache(journal,a,layers,maxId));
    }
  }
 else   if (acct instanceof FinalAccount) {
    lock(journal,acct);
    balance=getBalances(journal,acct,null,true,layers,maxId)[0];
    BalanceCache c=getBalanceCache(journal,acct,layers);
    if (c == null) {
      c=new BalanceCache();
      c.setJournal(journal);
      c.setAccount(acct);
      c.setLayers(layersToString(layers));
    }
    if (maxId != c.getRef()) {
      c.setRef(maxId);
      c.setBalance(balance);
      session.saveOrUpdate(c);
    }
  }
  return balance;
}

Fixed version (ground truth):
private BigDecimal createBalanceCache(Journal journal,Account acct,short[] layers,long maxId) throws HibernateException, GLException {
  BigDecimal balance=null;
  if (acct instanceof CompositeAccount) {
    balance=ZERO;
    Iterator iter=((CompositeAccount)acct).getChildren().iterator();
    while (iter.hasNext()) {
      Account a=(Account)iter.next();
      balance=balance.add(createBalanceCache(journal,a,layers,maxId));
    }
  }
 else   if (acct instanceof FinalAccount) {
    lock(journal,acct);
    balance=getBalances(journal,acct,null,true,layers,maxId)[0];
    BalanceCache c=getBalanceCache(journal,acct,layers);
    if (c == null) {
      c=new BalanceCache();
      c.setJournal(journal);
      c.setAccount(acct);
      c.setLayers(layersToString(layers));
    }
    if (maxId != c.getRef()) {
      c.setRef(maxId);
      c.setBalance(balance);
      session.saveOrUpdate(c);
    }
  }
  return getBalance(journal,acct,layers);
}
Program: 151957
Project: 151957
Buggy source:
/** 
 * Creates DB Object using default Hibernate instance
 * @param log Log object
 */
public DB(Log log,String configModifier){
  this(configModifier);
  setLog(log);
}

Fixed version (ground truth):
/** 
 * Creates DB Object using default Hibernate instance
 * @param log Log object
 * @param configModifier modifier
 */
public DB(Log log,String configModifier){
  this(configModifier);
  setLog(log);
}
Program: 151958
Project: 151958
Buggy source:
/** 
 * Constructs a GLTransaction out of a JDOM Element as defined in <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
 * @param elem '<entry>...</entry>' element.
 */
public GLTransaction(Element elem) throws ParseException {
  super();
  fromXML(elem);
}

Fixed version (ground truth):
/** 
 * Constructs a GLTransaction out of a JDOM Element as defined in <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
 * @param elem {@code '<entry>...</entry>}' element.
 */
public GLTransaction(Element elem) throws ParseException {
  super();
  fromXML(elem);
}
Program: 151959
Project: 151959
Buggy source:
/** 
 * Transactions should not be posted to this journal using a postDate <= the lockDate.
 * @lockDate lockDate the lock date.
 */
public void setLockDate(Date lockDate){
  this.lockDate=lockDate;
}

Fixed version (ground truth):
/** 
 * Transactions should not be posted to this journal using a postDate &lt;= the lockDate.
 * @param lockDate the lock date.
 */
public void setLockDate(Date lockDate){
  this.lockDate=lockDate;
}
Program: 151960
Project: 151960
Buggy source:
/** 
 * Called <em>after</em> the FLUSH protocol has unblocked previously blocked senders, and messages can be sent again. This callback only needs to be implemented if we require a notification of that. <p/> <p/> Note that during new view installation we provide guarantee that unblock invocation strictly follows view installation at some node A belonging to that view . However, some other message M may squeeze in between view and unblock callbacks. <p/> For more details see https://jira.jboss.org/jira/browse/JGRP-986
 */
@Override public void unblock(){
}

Fixed version (ground truth):
/** 
 * Called <em>after</em> the FLUSH protocol has unblocked previously blocked senders, and messages can be sent again. This callback only needs to be implemented if we require a notification of that. <p> Note that during new view installation we provide guarantee that unblock invocation strictly follows view installation at some node A belonging to that view . However, some other message M may squeeze in between view and unblock callbacks. <p> For more details see https://jira.jboss.org/jira/browse/JGRP-986
 */
@Override public void unblock(){
}
Program: 151961
Project: 151961
Buggy source:
/** 
 * Computes expiration based on last tick + timeout
 * @return true if lasttick+timeout < current-time
 */
public boolean hasExpired(){
  long now=System.currentTimeMillis();
  Date lastTick=getLastTick();
  long timeout=getTimeout();
  if (lastTick == null || timeout == 0)   return false;
  long exp=lastTick.getTime() + timeout;
  return now > exp;
}

Fixed version (ground truth):
/** 
 * Computes expiration based on last tick + timeout
 * @return true if lasttick+timeout &lt; current-time
 */
public boolean hasExpired(){
  long now=System.currentTimeMillis();
  Date lastTick=getLastTick();
  long timeout=getTimeout();
  if (lastTick == null || timeout == 0)   return false;
  long exp=lastTick.getTime() + timeout;
  return now > exp;
}
Program: 151962
Project: 151962
Buggy source:
/** 
 * factory method used to create a RevisionEntry associated with this user.
 * @param summary information
 * @param detail detailed information
 * @param author change author
 */
public StatusRevision logRevision(String info,User author){
  StatusRevision re=new StatusRevision();
  re.setDate(new Date());
  re.setInfo(info);
  re.setStatus((Status)this);
  re.setAuthor(author);
  getRevisions().add(re);
  return re;
}

Fixed version (ground truth):
/** 
 * factory method used to create a RevisionEntry associated with this user.
 * @param info information<!-- @param detail detailed information -->
 * @param author change author
 */
public StatusRevision logRevision(String info,User author){
  StatusRevision re=new StatusRevision();
  re.setDate(new Date());
  re.setInfo(info);
  re.setStatus((Status)this);
  re.setAuthor(author);
  getRevisions().add(re);
  return re;
}
Program: 151963
Project: 151963
Buggy source:
/** 
 * @param key status name
 * @param state Status.OK, Status.WARN, Status.ERROR or user defined
 * @param info optional information
 */
public void touch(String key,String state) throws HibernateException, SQLException {
  touch(key,state,null);
}

Fixed version (ground truth):
/** 
 * @param key status name
 * @param state Status.OK, Status.WARN, Status.ERROR or user defined<!-- @param info optional information -->
 */
public void touch(String key,String state) throws HibernateException, SQLException {
  touch(key,state,null);
}
Program: 151964
Project: 151964
Buggy source:
/** 
 * check if unexpired status entries became expired, and create  appropriate syslog event.
 * @param id status id
 */
public void check() throws HibernateException, SQLException {
  Iterator iter=findByExpired(false).iterator();
  while (iter.hasNext()) {
    check((Status)iter.next());
  }
}

Fixed version (ground truth):
/** 
 * check if unexpired status entries became expired, and create  appropriate syslog event.
 */
public void check() throws HibernateException, SQLException {
  Iterator iter=findByExpired(false).iterator();
  while (iter.hasNext()) {
    check((Status)iter.next());
  }
}
Program: 151965
Project: 151965
Buggy source:
/** 
 * Hook method to let a subclass change the way the values are compared
 * @param i index of the property being compared in de ordergiven by the <code>properties<code> attribute.
 */
protected boolean equals(int i,Object v1,Object v2){
  if (v1 instanceof Comparable && v2 != null)   return ((Comparable)v1).compareTo(v2) == 0;
 else   if (v1 != null)   return v1.equals(v2);
 else   return v2 == null;
}

Fixed version (ground truth):
/** 
 * Hook method to let a subclass change the way the values are compared
 * @param i index of the property being compared in de ordergiven by the <code>properties</code> attribute.
 */
protected boolean equals(int i,Object v1,Object v2){
  if (v1 instanceof Comparable && v2 != null)   return ((Comparable)v1).compareTo(v2) == 0;
 else   if (v1 != null)   return v1.equals(v2);
 else   return v2 == null;
}
Program: 151966
Project: 151966
Buggy source:
/** 
 * Creates a JDOM Element as defined in <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
 */
public Element toXML(boolean deep){
  Element elem=new Element("String_Node_Str");
  elem.setAttribute("String_Node_Str",Long.toString(getId()));
  Util.setDateTimeAttribute(elem,"String_Node_Str",getTimestamp());
  Util.setDateAttribute(elem,"String_Node_Str",getPostDate());
  if (getDetail() != null) {
    Element detail=new Element("String_Node_Str").setText(getDetail());
    elem.addContent(detail);
  }
  if (getTags() != null) {
    Element tags=new Element("String_Node_Str").setText(getDetail());
    elem.addContent(tags);
  }
  elem.setAttribute("String_Node_Str",getJournal().getName());
  Iterator iter=getEntries().iterator();
  while (iter.hasNext()) {
    GLEntry entry=(GLEntry)iter.next();
    elem.addContent(entry.toXML(deep));
  }
  return elem;
}

Fixed version (ground truth):
/** 
 * Creates a JDOM Element as defined in <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
 */
public Element toXML(boolean deep){
  Element elem=new Element("String_Node_Str");
  elem.setAttribute("String_Node_Str",Long.toString(getId()));
  Util.setDateTimeAttribute(elem,"String_Node_Str",getTimestamp());
  Util.setDateAttribute(elem,"String_Node_Str",getPostDate());
  if (getDetail() != null) {
    Element detail=new Element("String_Node_Str").setText(getDetail());
    elem.addContent(detail);
  }
  if (getTags() != null) {
    Element tags=new Element("String_Node_Str").setText(getTags());
    elem.addContent(tags);
  }
  elem.setAttribute("String_Node_Str",getJournal().getName());
  Iterator iter=getEntries().iterator();
  while (iter.hasNext()) {
    GLEntry entry=(GLEntry)iter.next();
    elem.addContent(entry.toXML(deep));
  }
  return elem;
}
Program: 151967
Project: 151967
Buggy source:
public String toString(){
  return new ToStringBuilder(this).append("String_Node_Str",getId()).append("String_Node_Str",getId()).toString();
}

Fixed version (ground truth):
public String toString(){
  return new ToStringBuilder(this).append("String_Node_Str",getId()).append("String_Node_Str",getDetail()).toString();
}
Program: 151968
Project: 151968
Buggy source:
@Override public void start(final Environment env) throws IOException {
  TtyFilterOutputStream out=new TtyFilterOutputStream(this.out);
  TtyFilterOutputStream err=new TtyFilterOutputStream(this.err);
  final Groovysh shell=new Groovysh(createBinding(bindings,out,err),new IO(in,out,err));
  loadDefaultScripts(shell);
  String threadName="String_Node_Str";
  wrapper=new Thread(new Runnable(){
    @Override public void run(){
      try {
        SshTerminal.registerEnvironment(env);
        shell.run();
        callback.onExit(0);
      }
 catch (      RuntimeException e) {
        callback.onExit(-1,e.getMessage());
      }
catch (      Error e) {
        callback.onExit(-1,e.getMessage());
      }
    }
  }
,threadName);
  wrapper.start();
}

Fixed version (ground truth):
@Override public void start(final Environment env) throws IOException {
  TtyFilterOutputStream out=new TtyFilterOutputStream(this.out);
  TtyFilterOutputStream err=new TtyFilterOutputStream(this.err);
  final Groovysh shell=new Groovysh(createBinding(bindings,out,err),new IO(in,out,err));
  try {
    loadDefaultScripts(shell);
  }
 catch (  Exception e) {
    createPrintStream(err).println("String_Node_Str" + e.getClass().getName() + "String_Node_Str"+ e.getMessage());
  }
  String threadName="String_Node_Str";
  wrapper=new Thread(new Runnable(){
    @Override public void run(){
      try {
        SshTerminal.registerEnvironment(env);
        shell.run();
        callback.onExit(0);
      }
 catch (      RuntimeException e) {
        callback.onExit(-1,e.getMessage());
      }
catch (      Error e) {
        callback.onExit(-1,e.getMessage());
      }
    }
  }
,threadName);
  wrapper.start();
}
Program: 151969
Project: 151969
Buggy source:
private Binding createBinding(Map<String,Object> objects,OutputStream out,OutputStream err) throws UnsupportedEncodingException {
  Binding binding=new Binding();
  if (objects != null)   for (  Map.Entry<String,Object> row : objects.entrySet())   binding.setVariable(row.getKey(),row.getValue());
  binding.setVariable("String_Node_Str",new PrintStream(out,true,"String_Node_Str"));
  binding.setVariable("String_Node_Str",new PrintStream(err,true,"String_Node_Str"));
  binding.setVariable("String_Node_Str",new Closure<List<AbstractSession>>(this){
    @Override public List<AbstractSession> call(){
      return sshd.getActiveSessions();
    }
  }
);
  return binding;
}

Fixed version (ground truth):
private Binding createBinding(Map<String,Object> objects,OutputStream out,OutputStream err) throws UnsupportedEncodingException {
  Binding binding=new Binding();
  if (objects != null)   for (  Map.Entry<String,Object> row : objects.entrySet())   binding.setVariable(row.getKey(),row.getValue());
  binding.setVariable("String_Node_Str",createPrintStream(out));
  binding.setVariable("String_Node_Str",createPrintStream(err));
  binding.setVariable("String_Node_Str",new Closure<List<AbstractSession>>(this){
    @Override public List<AbstractSession> call(){
      return sshd.getActiveSessions();
    }
  }
);
  return binding;
}
Program: 151970
Project: 151970
Buggy source:
/** 
 * Set the comma delimited list of default scripts
 * @param scriptNames script names
 */
public void setDefaultScriptNames(String scriptNames){
  service.setDefaultScripts(asList(scriptNames.split("String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * Set the comma delimited list of default scripts
 * @param scriptNames script names
 */
public void setDefaultScriptNames(String scriptNames){
  if (!scriptNames.trim().isEmpty())   service.setDefaultScripts(asList(scriptNames.split("String_Node_Str")));
}
Program: 151971
Project: 151971
Buggy source:
@Override public void start(final Environment env) throws IOException {
  TtyFilterOutputStream out=new TtyFilterOutputStream(this.out);
  TtyFilterOutputStream err=new TtyFilterOutputStream(this.err);
  final Groovysh shell=new Groovysh(createBinding(bindings,out,err),new IO(in,out,err));
  try {
    loadDefaultScripts(shell);
  }
 catch (  Exception e) {
    createPrintStream(err).println("String_Node_Str" + e.getClass().getName() + "String_Node_Str"+ e.getMessage());
  }
  String threadName="String_Node_Str";
  wrapper=new Thread(new Runnable(){
    @Override public void run(){
      try {
        SshTerminal.registerEnvironment(env);
        shell.run();
        callback.onExit(0);
      }
 catch (      RuntimeException e) {
        callback.onExit(-1,e.getMessage());
      }
catch (      Error e) {
        callback.onExit(-1,e.getMessage());
      }
    }
  }
,threadName);
  wrapper.start();
}

Fixed version (ground truth):
@Override public void start(final Environment env) throws IOException {
  TtyFilterOutputStream out=new TtyFilterOutputStream(this.out);
  TtyFilterOutputStream err=new TtyFilterOutputStream(this.err);
  IO io=new IO(in,out,err);
  io.setVerbosity(IO.Verbosity.DEBUG);
  final Groovysh shell=new Groovysh(createBinding(bindings,out,err),io);
  shell.setErrorHook(new Closure(this){
    @Override public Object call(    Object... args){
      if (args[0] instanceof InterruptedIOException || args[0] instanceof SshException) {
        shell.getRunner().setRunning(false);
      }
      return shell.getDefaultErrorHook().call(args);
    }
  }
);
  try {
    loadDefaultScripts(shell);
  }
 catch (  Exception e) {
    createPrintStream(err).println("String_Node_Str" + e.getClass().getName() + "String_Node_Str"+ e.getMessage());
  }
  session.setAttribute(SHELL_KEY,shell);
  String threadName="String_Node_Str" + session.getIoSession().getRemoteAddress().toString();
  wrapper=new Thread(new Runnable(){
    @Override public void run(){
      try {
        SshTerminal.registerEnvironment(env);
        shell.run();
        callback.onExit(0);
      }
 catch (      RuntimeException e) {
        callback.onExit(-1,e.getMessage());
      }
catch (      Error e) {
        callback.onExit(-1,e.getMessage());
      }
    }
  }
,threadName);
  wrapper.start();
}
Program: 151972
Project: 151972
Buggy source:
/** 
 * Starts Groovysh
 * @throws IOException thrown if socket cannot be opened
 */
public synchronized void start() throws IOException {
  sshd=SshServer.setUpDefaultServer();
  sshd.setPort(port);
  sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("String_Node_Str"));
  NamedFactory<UserAuth> a=new UserAuthNone.Factory();
  sshd.setUserAuthFactories(asList(a));
  sshd.setShellFactory(new GroovyShellFactory());
  sshd.start();
}

Fixed version (ground truth):
/** 
 * Starts Groovysh
 * @throws IOException thrown if socket cannot be opened
 */
public synchronized void start() throws IOException {
  sshd=SshServer.setUpDefaultServer();
  sshd.setPort(port);
  Map<String,String> properties=new HashMap<String,String>();
  properties.put(ServerFactoryManager.IDLE_TIMEOUT,"String_Node_Str");
  sshd.setProperties(properties);
  SessionFactory sessionFactory=new SessionFactory();
  sessionFactory.addListener(new SessionListener(){
    @Override public void sessionCreated(    Session session){
    }
    @Override public void sessionEvent(    Session sesssion,    Event event){
    }
    @Override public void sessionClosed(    Session session){
      Groovysh shell=session.getAttribute(SHELL_KEY);
      if (shell != null)       shell.getRunner().setRunning(false);
    }
  }
);
  sshd.setSessionFactory(sessionFactory);
  sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("String_Node_Str"));
  NamedFactory<UserAuth> a=new UserAuthNone.Factory();
  sshd.setUserAuthFactories(asList(a));
  sshd.setShellFactory(new GroovyShellFactory());
  sshd.start();
}
Program: 151973
Project: 151973
Buggy source:
@Override public Void call(){
  try {
    for (    MessageAndMetadata<Message> mam : stream) {
      BagheeraMessage bmsg=BagheeraMessage.parseFrom(ByteString.copyFrom(mam.message().payload()));
      KeyValueSink sink=sinkFactory.getSink(bmsg.getNamespace());
      if (sink == null) {
        LOG.error("String_Node_Str" + bmsg.getNamespace());
        break;
      }
      if (bmsg.getOperation() == Operation.CREATE_UPDATE && bmsg.hasId() && bmsg.hasPayload()) {
        if (validationPipeline == null || validationPipeline.isValid(bmsg.getPayload().toByteArray())) {
          if (bmsg.hasTimestamp()) {
            sink.store(bmsg.getId(),bmsg.getPayload().toByteArray(),bmsg.getTimestamp());
          }
 else {
            sink.store(bmsg.getId(),bmsg.getPayload().toByteArray());
          }
        }
 else {
          LOG.warn("String_Node_Str" + bmsg.getNamespace());
        }
      }
 else       if (bmsg.getOperation() == Operation.DELETE && bmsg.hasId()) {
        sink.delete(bmsg.getId());
      }
      consumed.mark();
    }
  }
 catch (  InvalidProtocolBufferException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  UnsupportedEncodingException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    latch.countDown();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void call(){
  try {
    for (    MessageAndMetadata<Message> mam : stream) {
      BagheeraMessage bmsg=BagheeraMessage.parseFrom(ByteString.copyFrom(mam.message().payload()));
      KeyValueSink sink=sinkFactory.getSink(bmsg.getNamespace());
      if (sink == null) {
        LOG.error("String_Node_Str" + bmsg.getNamespace());
        break;
      }
      if (bmsg.getOperation() == Operation.CREATE_UPDATE && bmsg.hasId() && bmsg.hasPayload()) {
        if (validationPipeline == null || validationPipeline.isValid(bmsg.getPayload().toByteArray())) {
          if (bmsg.hasTimestamp()) {
            sink.store(bmsg.getId(),bmsg.getPayload().toByteArray(),bmsg.getTimestamp());
          }
 else {
            sink.store(bmsg.getId(),bmsg.getPayload().toByteArray());
          }
        }
 else {
          invalidMessageMeter.mark();
          LOG.warn("String_Node_Str" + bmsg.getNamespace());
        }
      }
 else       if (bmsg.getOperation() == Operation.DELETE && bmsg.hasId()) {
        sink.delete(bmsg.getId());
      }
      consumed.mark();
    }
  }
 catch (  InvalidProtocolBufferException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  UnsupportedEncodingException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    latch.countDown();
  }
  return null;
}