nus-yam/ex-repair huggingface dataset:
Program: 172665
Project: 172665
Buggy source:
@Override public void handle(RoutingContext context){
  DataBase database=DataBase.getInstance();
  SafeResultSet resultSet;
  EasyJsonObject responseObject=new EasyJsonObject();
  String id=context.request().getParam("String_Node_Str");
  try {
    resultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str");
    if (resultSet.next()) {
      responseObject.put("String_Node_Str",resultSet.getString("String_Node_Str"));
      if (!resultSet.getString("String_Node_Str").isEmpty()) {
        responseObject.put("String_Node_Str",true);
        responseObject.put("String_Node_Str",resultSet.getString("String_Node_Str"));
      }
 else {
        responseObject.put("String_Node_Str",false);
      }
      context.response().setStatusCode(200);
      context.response().end(responseObject.toString());
      context.response().close();
    }
 else {
      context.response().setStatusCode(404).end();
      context.response().close();
    }
  }
 catch (  SQLException e) {
    context.response().setStatusCode(500).end();
    context.response().close();
    Log.l("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void handle(RoutingContext context){
  DataBase database=DataBase.getInstance();
  SafeResultSet resultSet;
  EasyJsonObject responseObject=new EasyJsonObject();
  EasyJsonObject tempObject=new EasyJsonObject();
  EasyJsonArray tempArray=new EasyJsonArray();
  String id=context.request().getParam("String_Node_Str");
  try {
    resultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str");
    if (resultSet.next()) {
      do {
        tempObject.put("String_Node_Str",resultSet.getInt("String_Node_Str"));
        tempObject.put("String_Node_Str",resultSet.getString("String_Node_Str"));
        if (!resultSet.getString("String_Node_Str").isEmpty()) {
          tempObject.put("String_Node_Str",true);
          tempObject.put("String_Node_Str",resultSet.getString("String_Node_Str"));
        }
 else {
          tempObject.put("String_Node_Str",false);
        }
        tempArray.add(tempObject);
      }
 while (resultSet.next());
      context.response().setStatusCode(200);
      context.response().end(responseObject.toString());
      context.response().close();
    }
 else {
      context.response().setStatusCode(404).end();
      context.response().close();
    }
  }
 catch (  SQLException e) {
    context.response().setStatusCode(500).end();
    context.response().close();
    Log.l("String_Node_Str");
  }
}
Program: 172667
Project: 172667
Buggy source:
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String title=requestObject.getString("String_Node_Str");
  String content=requestObject.getString("String_Node_Str");
  int status=database.executeUpdate("String_Node_Str",title,"String_Node_Str",content,"String_Node_Str");
  responseObject.put("String_Node_Str",status);
  return responseObject;
}

Fixed version (ground truth):
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String title=requestObject.getString("String_Node_Str");
  String content=requestObject.getString("String_Node_Str");
  int status=1;
  if (requestObject.containsKey("String_Node_Str")) {
    int no=requestObject.getInt("String_Node_Str");
    database.executeUpdate("String_Node_Str",no);
    status=database.executeUpdate("String_Node_Str",no,"String_Node_Str",title,"String_Node_Str",content,"String_Node_Str");
  }
 else {
    status=database.executeUpdate("String_Node_Str",title,"String_Node_Str",content,"String_Node_Str");
  }
  responseObject.put("String_Node_Str",status);
  return responseObject;
}
Program: 172668
Project: 172668
Buggy source:
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String id=requestObject.getString("String_Node_Str");
  String password=requestObject.getString("String_Node_Str");
  SafeResultSet resultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str");
  if (!resultSet.next() || !resultSet.getString("String_Node_Str").equals(password)) {
    responseObject.put("String_Node_Str",false);
  }
 else   if (resultSet.getString("String_Node_Str").equals(password)) {
    responseObject.put("String_Node_Str",true);
    SafeResultSet tempResultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str");
    responseObject.put("String_Node_Str",tempResultSet.getInt("String_Node_Str"));
    responseObject.put("String_Node_Str",tempResultSet.getString("String_Node_Str"));
    responseObject.put("String_Node_Str",tempResultSet.getInt("String_Node_Str"));
    responseObject.put("String_Node_Str",tempResultSet.getInt("String_Node_Str"));
  }
  return responseObject;
}

Fixed version (ground truth):
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String id=requestObject.getString("String_Node_Str");
  String password=requestObject.getString("String_Node_Str");
  SafeResultSet resultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str");
  if (!resultSet.next() || !resultSet.getString("String_Node_Str").equals(password)) {
    responseObject.put("String_Node_Str",false);
  }
 else   if (resultSet.getString("String_Node_Str").equals(password)) {
    responseObject.put("String_Node_Str",true);
    SafeResultSet tempResultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str");
    tempResultSet.next();
    responseObject.put("String_Node_Str",tempResultSet.getInt("String_Node_Str"));
    responseObject.put("String_Node_Str",tempResultSet.getString("String_Node_Str"));
    responseObject.put("String_Node_Str",tempResultSet.getInt("String_Node_Str"));
    responseObject.put("String_Node_Str",tempResultSet.getInt("String_Node_Str"));
  }
  return responseObject;
}
Program: 172669
Project: 172669
Buggy source:
private static void initialize(){
  if (!profileImgDir.exists()) {
    profileImgDir.mkdir();
  }
  ActionRegister.init("String_Node_Str","String_Node_Str");
  PostChangeDetector.getInstance().start();
  PostChangeDetector.getInstance().setOnCategoryUpdateListener(new PostUpdateListener(){
    @Override public void update(    int currentCategory){
      Calendar currentTime=Calendar.getInstance();
      int dayOfWeek=currentTime.get(Calendar.DAY_OF_WEEK);
      int hour=currentTime.get(Calendar.HOUR_OF_DAY);
      if (dayOfWeek == Calendar.MONDAY) {
        try {
          DataBase.getInstance().executeUpdate("String_Node_Str");
        }
 catch (        SQLException e) {
          e.printStackTrace();
        }
      }
      if (hour >= 0 && hour <= 8) {
        try {
          DataBase.getInstance().executeUpdate("String_Node_Str");
        }
 catch (        SQLException e) {
          e.printStackTrace();
        }
      }
    }
  }
);
  vertx=Vertx.vertx();
  options=new VertxOptions();
}

Fixed version (ground truth):
private static void initialize(){
  if (!profileImgDir.exists()) {
    profileImgDir.mkdir();
  }
  ActionRegister.init("String_Node_Str","String_Node_Str");
  PostChangeDetector.getInstance().setOnCategoryUpdateListener(new PostUpdateListener(){
    @Override public void update(    int currentCategory){
      Calendar currentTime=Calendar.getInstance();
      int dayOfWeek=currentTime.get(Calendar.DAY_OF_WEEK);
      int hour=currentTime.get(Calendar.HOUR_OF_DAY);
      if (dayOfWeek == Calendar.MONDAY) {
        try {
          DataBase.getInstance().executeUpdate("String_Node_Str");
        }
 catch (        SQLException e) {
          e.printStackTrace();
        }
      }
      if (hour >= 0 && hour <= 8) {
        try {
          DataBase.getInstance().executeUpdate("String_Node_Str");
        }
 catch (        SQLException e) {
          e.printStackTrace();
        }
      }
    }
  }
);
  vertx=Vertx.vertx();
  options=new VertxOptions();
}
Program: 172670
Project: 172670
Buggy source:
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String title=requestObject.getString("String_Node_Str");
  String content=requestObject.getString("String_Node_Str");
  String writer=requestObject.getString("String_Node_Str");
  int privacy=requestObject.getInt("String_Node_Str");
  int status=database.executeUpdate("String_Node_Str",title,"String_Node_Str",content,"String_Node_Str",writer,"String_Node_Str",privacy,"String_Node_Str");
  responseObject.put("String_Node_Str",status);
  return responseObject;
}

Fixed version (ground truth):
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String title=requestObject.getString("String_Node_Str");
  String content=requestObject.getString("String_Node_Str");
  String writer=requestObject.getString("String_Node_Str");
  boolean privacy=requestObject.getBoolean("String_Node_Str");
  int status=database.executeUpdate("String_Node_Str",title,"String_Node_Str",content,"String_Node_Str",writer,"String_Node_Str",privacy,"String_Node_Str");
  responseObject.put("String_Node_Str",status);
  return responseObject;
}
Program: 172671
Project: 172671
Buggy source:
public static boolean canApply(String id,int no) throws SQLException {
  database=DataBase.getInstance();
  resultSet=database.executeQuery("String_Node_Str",no);
  targetDay[0]=resultSet.getBoolean("String_Node_Str");
  targetDay[1]=resultSet.getBoolean("String_Node_Str");
  targetDay[2]=resultSet.getBoolean("String_Node_Str");
  targetDay[3]=resultSet.getBoolean("String_Node_Str");
  resultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str");
  if (resultSet.next()) {
    tempResultSet=database.executeQuery("String_Node_Str",resultSet.getInt("String_Node_Str"));
    do {
      if (tempResultSet.getBoolean("String_Node_Str")) {
        appliedDay[0]=true;
      }
      if (tempResultSet.getBoolean("String_Node_Str")) {
        appliedDay[1]=true;
      }
      if (tempResultSet.getBoolean("String_Node_Str")) {
        appliedDay[2]=true;
      }
      if (tempResultSet.getBoolean("String_Node_Str")) {
        appliedDay[3]=true;
      }
    }
 while (resultSet.next());
  }
 else {
    return true;
  }
  for (int i=0; i <= 3; i++) {
    if (targetDay[i] && !appliedDay[i]) {
      continue;
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public static boolean canApply(String id,int no) throws SQLException {
  database=DataBase.getInstance();
  resultSet=database.executeQuery("String_Node_Str",no);
  resultSet.next();
  targetDay[0]=resultSet.getBoolean("String_Node_Str");
  targetDay[1]=resultSet.getBoolean("String_Node_Str");
  targetDay[2]=resultSet.getBoolean("String_Node_Str");
  targetDay[3]=resultSet.getBoolean("String_Node_Str");
  resultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str");
  if (resultSet.next()) {
    tempResultSet=database.executeQuery("String_Node_Str",resultSet.getInt("String_Node_Str"));
    do {
      if (tempResultSet.getBoolean("String_Node_Str")) {
        appliedDay[0]=true;
      }
      if (tempResultSet.getBoolean("String_Node_Str")) {
        appliedDay[1]=true;
      }
      if (tempResultSet.getBoolean("String_Node_Str")) {
        appliedDay[2]=true;
      }
      if (tempResultSet.getBoolean("String_Node_Str")) {
        appliedDay[3]=true;
      }
    }
 while (resultSet.next());
  }
 else {
    return true;
  }
  for (int i=0; i <= 3; i++) {
    if (targetDay[i] && !appliedDay[i]) {
      continue;
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 172672
Project: 172672
Buggy source:
public static String getProfileImage(String id){
  hashedId=SHA256.encrypt(id);
  file=new File(directoryPath.concat(hashedId).concat("String_Node_Str"));
  try {
    fr=new FileReader(file);
    int ch;
    while ((ch=fr.read()) != -1) {
      data.append((char)ch);
    }
  }
 catch (  FileNotFoundException e) {
  }
catch (  IOException e) {
  }
  return data.toString();
}

Fixed version (ground truth):
public static String getProfileImage(String id){
  hashedId=SHA256.encrypt(id);
  file=new File(directoryPath.concat(hashedId).concat("String_Node_Str"));
  try {
    fr=new FileReader(file);
    data=new StringBuilder();
    data.append((char)fr.read());
  }
 catch (  FileNotFoundException e) {
  }
catch (  IOException e) {
  }
  return data.toString();
}
Program: 172673
Project: 172673
Buggy source:
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String id=requestObject.getString("String_Node_Str");
  SafeResultSet resultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str");
  if (resultSet.next()) {
    responseObject.put("String_Node_Str",resultSet.getInt("String_Node_Str"));
    responseObject.put("String_Node_Str",resultSet.getInt("String_Node_Str"));
  }
 else {
    responseObject.put("String_Node_Str",404);
  }
  return responseObject;
}

Fixed version (ground truth):
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String name=requestObject.getString("String_Node_Str");
  SafeResultSet resultSet=database.executeQuery("String_Node_Str",name,"String_Node_Str");
  if (resultSet.next()) {
    responseObject.put("String_Node_Str",resultSet.getInt("String_Node_Str"));
    responseObject.put("String_Node_Str",resultSet.getInt("String_Node_Str"));
  }
 else {
    responseObject.put("String_Node_Str",404);
  }
  return responseObject;
}
Program: 172674
Project: 172674
Buggy source:
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String id=requestObject.getString("String_Node_Str");
  int status=database.executeUpdate("String_Node_Str",id,"String_Node_Str");
  responseObject.put("String_Node_Str",status);
  return responseObject;
}

Fixed version (ground truth):
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String name=requestObject.getString("String_Node_Str");
  int status=database.executeUpdate("String_Node_Str",name,"String_Node_Str");
  responseObject.put("String_Node_Str",status);
  return responseObject;
}
Program: 172675
Project: 172675
Buggy source:
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  return null;
}

Fixed version (ground truth):
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String id=requestObject.getString("String_Node_Str");
  String hashedId=SHA256.encrypt(id);
  String data=requestObject.getString("String_Node_Str");
  File file=new File("String_Node_Str".concat(hashedId));
  if (!file.exists()) {
    try {
      file.createNewFile();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  try {
    FileWriter fw=new FileWriter(file);
    fw.write(data);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return responseObject;
}
Program: 172676
Project: 172676
Buggy source:
private static void initialize(){
  File profileImgDir=new File("String_Node_Str");
  if (!profileImgDir.exists()) {
    profileImgDir.mkdir();
  }
  ActionRegister.init("String_Node_Str","String_Node_Str");
  PostChangeDetector.getInstance().start();
  PostChangeDetector.getInstance().setOnCategoryUpdateListener(new PostUpdateListener(){
    @Override public void update(    int currentCategory){
      Calendar currentTime=Calendar.getInstance();
      int dayOfWeek=currentTime.get(Calendar.DAY_OF_WEEK);
      int hour=currentTime.get(Calendar.HOUR_OF_DAY);
      if (dayOfWeek == Calendar.MONDAY) {
        try {
          DataBase.getInstance().executeUpdate("String_Node_Str");
        }
 catch (        SQLException e) {
          e.printStackTrace();
        }
      }
      if (hour >= 0 && hour <= 8) {
        try {
          DataBase.getInstance().executeUpdate("String_Node_Str");
        }
 catch (        SQLException e) {
          e.printStackTrace();
        }
      }
    }
  }
);
  vertx=Vertx.vertx();
  options=new VertxOptions();
}

Fixed version (ground truth):
private static void initialize(){
  if (!profileImgDir.exists()) {
    profileImgDir.mkdir();
  }
  ActionRegister.init("String_Node_Str","String_Node_Str");
  PostChangeDetector.getInstance().start();
  PostChangeDetector.getInstance().setOnCategoryUpdateListener(new PostUpdateListener(){
    @Override public void update(    int currentCategory){
      Calendar currentTime=Calendar.getInstance();
      int dayOfWeek=currentTime.get(Calendar.DAY_OF_WEEK);
      int hour=currentTime.get(Calendar.HOUR_OF_DAY);
      if (dayOfWeek == Calendar.MONDAY) {
        try {
          DataBase.getInstance().executeUpdate("String_Node_Str");
        }
 catch (        SQLException e) {
          e.printStackTrace();
        }
      }
      if (hour >= 0 && hour <= 8) {
        try {
          DataBase.getInstance().executeUpdate("String_Node_Str");
        }
 catch (        SQLException e) {
          e.printStackTrace();
        }
      }
    }
  }
);
  vertx=Vertx.vertx();
  options=new VertxOptions();
}
Program: 172677
Project: 172677
Buggy source:
/** 
 * (non-Javadoc)
 * @see io.vertx.core.AbstractVerticle#stop(io.vertx.core.Future)
 */
public void stop(@SuppressWarnings("String_Node_Str") Future stopFuture) throws Exception {
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @see io.vertx.core.AbstractVerticle#stop(io.vertx.core.Future)
 */
@Deprecated public void stop(@SuppressWarnings("String_Node_Str") Future stopFuture) throws Exception {
}
Program: 172680
Project: 172680
Buggy source:
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String id=requestObject.getString("String_Node_Str");
  String week=requestObject.getString("String_Node_Str");
  SafeResultSet resultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str",week,"String_Node_Str");
  if (resultSet.next()) {
    responseObject.put("String_Node_Str",resultSet.getInt("String_Node_Str"));
  }
 else {
    responseObject.put("String_Node_Str",404);
  }
  responseObject.put("String_Node_Str",array);
  return responseObject;
}

Fixed version (ground truth):
@Override public EasyJsonObject action(Sender sender,int command,EasyJsonObject requestObject) throws SQLException {
  String id=requestObject.getString("String_Node_Str");
  String week=requestObject.getString("String_Node_Str");
  SafeResultSet resultSet=database.executeQuery("String_Node_Str",id,"String_Node_Str",week,"String_Node_Str");
  if (resultSet.next()) {
    responseObject.put("String_Node_Str",resultSet.getInt("String_Node_Str"));
  }
 else {
    responseObject.put("String_Node_Str",404);
  }
  return responseObject;
}
Program: 172681
Project: 172681
Buggy source:
/** 
 * Accept anything up to a newline, comma, or comment
 */
private void readFunction(int c,Runnable r) throws IOException {
  boolean endFunction=false;
  State newState=null;
  int posd=0;
  if (c == '\n' || c == ',') {
    endFunction=true;
  }
 else   if (c == '#') {
    endFunction=true;
    newState=this::readHashComment;
  }
 else   if (c == '/') {
    if (peek(0) == '/') {
      endFunction=true;
      newState=this::readSlashSlashComment;
      posd=1;
    }
 else     if (peek(0) == '*') {
      endFunction=true;
      newState=this::readBlockComment;
      posd=1;
    }
  }
  if (endFunction) {
    int end=trimTrailingWhitespaceAndComma(pos - 1,in);
    pos+=posd;
    String ret=listener.function(in,start,end - start);
    byte[] bytes=ret.getBytes(UTF_8);
    valueStart=maybeInitBAOS();
    valueSource=baos;
    valueSource.write(bytes);
    valueEnd=valueSource.size();
    r.run();
    pop();
    if (newState != null) {
      start=pos;
      push(newState);
    }
  }
}

Fixed version (ground truth):
/** 
 * Accept anything up to a newline, comma, or comment
 */
private void readFunction(int c,Runnable r) throws IOException {
  boolean endFunction=false;
  State newState=null;
  int posd=0;
  if (c == '\n' || c == ',') {
    endFunction=true;
  }
 else   if (c == '}' || c == ']') {
    endFunction=true;
    posd=-1;
  }
 else   if (c == '#') {
    endFunction=true;
    newState=this::readHashComment;
  }
 else   if (c == '/') {
    if (peek(0) == '/') {
      endFunction=true;
      newState=this::readSlashSlashComment;
      posd=1;
    }
 else     if (peek(0) == '*') {
      endFunction=true;
      newState=this::readBlockComment;
      posd=1;
    }
  }
  if (endFunction) {
    int end=trimTrailingWhitespaceAndComma(pos - 1,in);
    pos+=posd;
    String ret=listener.function(in,start,end - start);
    byte[] bytes=ret.getBytes(UTF_8);
    valueStart=maybeInitBAOS();
    valueSource=baos;
    valueSource.write(bytes);
    valueEnd=valueSource.size();
    r.run();
    pop();
    if (newState != null) {
      start=pos;
      push(newState);
    }
  }
}
Program: 172682
Project: 172682
Buggy source:
@Override public String function(byte[] src,int start,int length){
  System.out.println("String_Node_Str" + new String(src,start,length,StandardCharsets.UTF_8) + "String_Node_Str");
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String function(byte[] src,int start,int length){
  System.out.println("String_Node_Str" + new String(src,start,length,StandardCharsets.UTF_8) + "String_Node_Str");
  return new String(src,start,length,StandardCharsets.UTF_8).toUpperCase();
}
Program: 172683
Project: 172683
Buggy source:
@UiThreadTest @Test public void testRejectedOnUiThread(){
synchronized (this.lock_) {
    Promise.reject(new IllegalStateException())._catch(onUiThread(rejected(new Promise.RejectNoReturn(){
      @Override public void rejectNoReturn(      Throwable reason){
        boolean isUiThread=Looper.getMainLooper().getThread().equals(Thread.currentThread());
        Assert.assertTrue(isUiThread);
        complete_=true;
      }
    }
)));
    Assert.assertTrue(this.complete_);
  }
}

Fixed version (ground truth):
@UiThreadTest @Test public void testRejectedOnUiThread(){
synchronized (this.lock_) {
    Promise.reject(new IllegalStateException())._catch(onUiThread(rejected(new RejectNoReturn(){
      @Override public void rejectNoReturn(      Throwable reason){
        boolean isUiThread=Looper.getMainLooper().getThread().equals(Thread.currentThread());
        Assert.assertTrue(isUiThread);
        complete_=true;
      }
    }
)));
    Assert.assertTrue(this.complete_);
  }
}
Program: 172684
Project: 172684
Buggy source:
@Test public void testRejected() throws Exception {
synchronized (this.lock_) {
    Promise.reject(new IllegalStateException())._catch(onUiThread(rejected(new Promise.RejectNoReturn(){
      @Override public void rejectNoReturn(      Throwable reason){
        boolean isUiThread=Looper.getMainLooper().getThread().equals(Thread.currentThread());
        Assert.assertTrue(isUiThread);
synchronized (lock_) {
          complete_=true;
          lock_.notify();
        }
      }
    }
)));
    this.lock_.wait(5000);
    Assert.assertTrue(this.complete_);
  }
}

Fixed version (ground truth):
@Test public void testRejected() throws Exception {
synchronized (this.lock_) {
    Promise.reject(new IllegalStateException())._catch(onUiThread(rejected(new RejectNoReturn(){
      @Override public void rejectNoReturn(      Throwable reason){
        boolean isUiThread=Looper.getMainLooper().getThread().equals(Thread.currentThread());
        Assert.assertTrue(isUiThread);
synchronized (lock_) {
          complete_=true;
          lock_.notify();
        }
      }
    }
)));
    this.lock_.wait(5000);
    Assert.assertTrue(this.complete_);
  }
}
Program: 172685
Project: 172685
Buggy source:
@Test public void testResolved() throws Exception {
synchronized (this.lock_) {
    Promise.resolve(10).then(onUiThread(resolved(new Promise.ResolveNoReturn<Integer>(){
      @Override public void resolveNoReturn(      Integer value){
        boolean isUiThread=Looper.getMainLooper().getThread().equals(Thread.currentThread());
        Assert.assertTrue(isUiThread);
synchronized (lock_) {
          complete_=true;
          lock_.notify();
        }
      }
    }
)))._catch(onUiThread(rejected(new Promise.RejectNoReturn(){
      @Override public void rejectNoReturn(      Throwable reason){
      }
    }
)));
    this.lock_.wait(5000);
    Assert.assertTrue(this.complete_);
  }
}

Fixed version (ground truth):
@Test public void testResolved() throws Exception {
synchronized (this.lock_) {
    Promise.resolve(10).then(onUiThread(resolved(new ResolveNoReturn<Integer>(){
      @Override public void resolveNoReturn(      Integer value){
        boolean isUiThread=Looper.getMainLooper().getThread().equals(Thread.currentThread());
        Assert.assertTrue(isUiThread);
synchronized (lock_) {
          complete_=true;
          lock_.notify();
        }
      }
    }
)))._catch(onUiThread(rejected(new RejectNoReturn(){
      @Override public void rejectNoReturn(      Throwable reason){
      }
    }
)));
    this.lock_.wait(5000);
    Assert.assertTrue(this.complete_);
  }
}
Program: 172686
Project: 172686
Buggy source:
@UiThreadTest @Test public void testResolvedOnUiThread(){
synchronized (this.lock_) {
    Promise.resolve(10).then(onUiThread(resolved(new Promise.ResolveNoReturn<Integer>(){
      @Override public void resolveNoReturn(      Integer value){
        boolean isUiThread=Looper.getMainLooper().getThread().equals(Thread.currentThread());
        Assert.assertTrue(isUiThread);
        complete_=true;
      }
    }
)))._catch(onUiThread(rejected(new Promise.RejectNoReturn(){
      @Override public void rejectNoReturn(      Throwable reason){
      }
    }
)));
    Assert.assertTrue(this.complete_);
  }
}

Fixed version (ground truth):
@UiThreadTest @Test public void testResolvedOnUiThread(){
synchronized (this.lock_) {
    Promise.resolve(10).then(onUiThread(resolved(new ResolveNoReturn<Integer>(){
      @Override public void resolveNoReturn(      Integer value){
        boolean isUiThread=Looper.getMainLooper().getThread().equals(Thread.currentThread());
        Assert.assertTrue(isUiThread);
        complete_=true;
      }
    }
)))._catch(onUiThread(rejected(new RejectNoReturn(){
      @Override public void rejectNoReturn(      Throwable reason){
      }
    }
)));
    Assert.assertTrue(this.complete_);
  }
}
Program: 172687
Project: 172687
Buggy source:
@Override public void handleMessage(Message msg){
  RejectedOnUIThread onUIThread=(RejectedOnUIThread)msg.obj;
  onUIThread.execute(onUIThread.reason_,onUIThread.cont_);
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
  Executor onUIThread=(Executor)msg.obj;
  onUIThread.execute(onUIThread.reason_,onUIThread.cont_);
}
Program: 172688
Project: 172688
Buggy source:
/** 
 * Factory method that supports using a lambda function. It also removes the need for using the new method so its usage in the Promise statements reads more fluid.
 * @param onRejected      The real handler
 * @return                Promise.OnRejected object
 */
public static Promise.OnRejected onUiThread(@NonNull Promise.OnRejected onRejected){
  return new RejectedOnUIThread(onRejected);
}

Fixed version (ground truth):
/** 
 * Factory method that supports using a lambda function. It also removes the need for using the new method so its usage in the Promise statements reads more fluid.
 * @param onRejected      The real handler
 * @return                Promise.OnRejected object
 */
public static OnRejectedExecutor onUiThread(@NonNull Promise.OnRejected onRejected){
  return new Executor(onRejected);
}
Program: 172689
Project: 172689
Buggy source:
@Override void execute(Executor executor,final Throwable reason,final ContinuationPromise continuation){
  if (this.isUiThread()) {
    this.execute(reason,continuation);
  }
 else {
    this.reason_=reason;
    this.cont_=continuation;
    this.runOnUiThread();
  }
}

Fixed version (ground truth):
@Override void execute(java.util.concurrent.Executor executor,final Throwable reason,final ContinuationPromise continuation){
  if (this.isUiThread()) {
    this.execute(reason,continuation);
  }
 else {
    this.reason_=reason;
    this.cont_=continuation;
    this.runOnUiThread();
  }
}
Program: 172690
Project: 172690
Buggy source:
public ArrayList<String> getArray(){
  SharedPreferences sp=this.getSharedPreferences(SHARED_PREFS_NAME,Activity.MODE_PRIVATE);
  Set<String> set=sp.getStringSet("String_Node_Str",new HashSet<String>());
  return new ArrayList<String>(set);
}

Fixed version (ground truth):
public List<String> getArray(){
  List accounts=passwordDatabase.getAcc();
  return accounts;
}
Program: 172691
Project: 172691
Buggy source:
public static Bitmap getVectorBitmap(Context context,@DrawableRes int id){
  Drawable drawable=ContextCompat.getDrawable(context,id);
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)   drawable=(DrawableCompat.wrap(drawable)).mutate();
  Bitmap result=Bitmap.createBitmap(drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight(),Bitmap.Config.ARGB_8888);
  Canvas canvas=new Canvas(result);
  drawable.setBounds(0,0,canvas.getWidth(),canvas.getHeight());
  drawable.draw(canvas);
  return result;
}

Fixed version (ground truth):
public static Bitmap getVectorBitmap(Context context,@DrawableRes int id){
  Drawable drawable=VectorDrawableCompat.create(context.getResources(),id,context.getTheme());
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)   drawable=(DrawableCompat.wrap(drawable)).mutate();
  Bitmap result=Bitmap.createBitmap(drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight(),Bitmap.Config.ARGB_8888);
  Canvas canvas=new Canvas(result);
  drawable.setBounds(0,0,canvas.getWidth(),canvas.getHeight());
  drawable.draw(canvas);
  return result;
}
Program: 172696
Project: 172696
Buggy source:
public static void toast(Context context,String message){
  TextView textView=new TextView(context);
  textView.setText(message);
  textView.setTypeface(getTypeface(context));
  textView.getPaint().setShader(new LinearGradient(0,0,0,textView.getLineHeight(),ContextCompat.getColor(context,R.color.colorAccent),ContextCompat.getColor(context,R.color.colorPrimary),Shader.TileMode.REPEAT));
  Toast toast=new Toast(context);
  toast.setView(textView);
  toast.setDuration(Toast.LENGTH_SHORT);
  toast.show();
}

Fixed version (ground truth):
public static void toast(Context context,String message){
  TextView textView=new TextView(context);
  textView.setText(message);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)   textView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
  textView.setTypeface(getTypeface(context));
  textView.getPaint().setShader(new LinearGradient(0,0,0,textView.getLineHeight(),ContextCompat.getColor(context,R.color.colorAccent),ContextCompat.getColor(context,R.color.colorPrimary),Shader.TileMode.REPEAT));
  Toast toast=new Toast(context);
  toast.setView(textView);
  toast.setDuration(message.length() > 40 ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT);
  toast.show();
}
Program: 172697
Project: 172697
Buggy source:
public void stop(){
  isPlaying=false;
  setOnTouchListener(null);
  if (animator != null && animator.isStarted())   animator.cancel();
  ValueAnimator animator=ValueAnimator.ofFloat(shipPositionY,-1f);
  animator.setDuration(2000);
  animator.setInterpolator(new DecelerateInterpolator());
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator valueAnimator){
      shipPositionY=(float)valueAnimator.getAnimatedValue();
      shipRotation=720 * valueAnimator.getAnimatedFraction();
    }
  }
);
  if (isTutorial) {
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        FontUtils.toast(getContext(),"String_Node_Str");
        play();
      }
    }
);
  }
  animator.start();
  ValueAnimator animator1=ValueAnimator.ofFloat(speed,1);
  animator1.setInterpolator(new DecelerateInterpolator());
  animator1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator valueAnimator){
      speed=(float)valueAnimator.getAnimatedValue();
    }
  }
);
  animator1.start();
}

Fixed version (ground truth):
public void stop(){
  isPlaying=false;
  isTutorial=false;
  setOnTouchListener(null);
  if (animator != null && animator.isStarted())   animator.cancel();
  ValueAnimator animator=ValueAnimator.ofFloat(shipPositionY,-1f);
  animator.setDuration(2000);
  animator.setInterpolator(new DecelerateInterpolator());
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator valueAnimator){
      shipPositionY=(float)valueAnimator.getAnimatedValue();
      shipRotation=720 * valueAnimator.getAnimatedFraction();
    }
  }
);
  if (isTutorial) {
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        FontUtils.toast(getContext(),"String_Node_Str");
        play();
      }
    }
);
  }
  animator.start();
  ValueAnimator animator1=ValueAnimator.ofFloat(speed,1);
  animator1.setInterpolator(new DecelerateInterpolator());
  animator1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator valueAnimator){
      speed=(float)valueAnimator.getAnimatedValue();
    }
  }
);
  animator1.start();
}
Program: 172698
Project: 172698
Buggy source:
public static void toast(Context context,String message){
  Toast.makeText(context,message,Toast.LENGTH_SHORT).show();
}

Fixed version (ground truth):
public static void toast(Context context,String message){
  TextView textView=new TextView(context);
  textView.setText(message);
  textView.setTypeface(getTypeface(context));
  textView.getPaint().setShader(new LinearGradient(0,0,0,textView.getLineHeight(),ContextCompat.getColor(context,R.color.colorAccent),ContextCompat.getColor(context,R.color.colorPrimary),Shader.TileMode.REPEAT));
  Toast toast=new Toast(context);
  toast.setView(textView);
  toast.setDuration(Toast.LENGTH_SHORT);
  toast.show();
}
Program: 172699
Project: 172699
Buggy source:
@Override public void onBoxOpened(){
  ammoAnimator=ValueAnimator.ofFloat(ammo,Math.min(ammo + 5,weapon.capacity));
  ammoAnimator.setDuration(500);
  ammoAnimator.setInterpolator(new DecelerateInterpolator());
  ammoAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator valueAnimator){
      ammo=(float)valueAnimator.getAnimatedValue();
    }
  }
);
  ammoAnimator.start();
}

Fixed version (ground truth):
@Override public void onBoxOpened(){
  ammoAnimator=ValueAnimator.ofFloat(ammo,Math.min(ammo + 5,weapon.capacity));
  ammoAnimator.setDuration(500);
  ammoAnimator.setInterpolator(new DecelerateInterpolator());
  ammoAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator valueAnimator){
      ammo=(float)valueAnimator.getAnimatedValue();
    }
  }
);
  ammoAnimator.start();
  new Handler(Looper.getMainLooper()).post(new Runnable(){
    @Override public void run(){
      if (listener != null)       listener.onAmmoReplenished();
    }
  }
);
}
Program: 172700
Project: 172700
Buggy source:
@Override public int compareTo(final UniqueId other){
  if (other == null) {
    throw new NullPointerException();
  }
  byte[] byteArray=toByteArray();
  byte[] otherByteArray=other.toByteArray();
  for (int i=0; i < 12; i++) {
    if (byteArray[i] != otherByteArray[i]) {
      return ((byteArray[i] & 0xff) < (otherByteArray[i] & 0xff)) ? -1 : 1;
    }
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compareTo(final UniqueId other){
  if (other == null) {
    throw new NullPointerException();
  }
  byte[] byteArray=toByteArray();
  byte[] otherByteArray=other.toByteArray();
  for (int i=0; i < 15; i++) {
    if (byteArray[i] != otherByteArray[i]) {
      return ((byteArray[i] & 0xff) < (otherByteArray[i] & 0xff)) ? -1 : 1;
    }
  }
  return 0;
}
Program: 172702
Project: 172702
Buggy source:
/** 
 * Gets a new object id.
 * @return the new id
 */
public static UniqueId get(){
  return new UniqueId(dateToTimestampSeconds(new Date()),MACHINE_IDENTIFIER,PROCESS_IDENTIFIER,NEXT_COUNTER.getAndIncrement(),false);
}

Fixed version (ground truth):
/** 
 * Gets a new object id.
 * @return the new https://oss.sonatype.org/content/repositories/snapshots
 */
public static UniqueId get(){
  return new UniqueId(dateToTimestampSeconds(new Date()),MACHINE_IDENTIFIER,PROCESS_IDENTIFIER,NEXT_COUNTER.getAndIncrement(),false);
}
Program: 172703
Project: 172703
Buggy source:
/** 
 * Checks if a string could be an   {@code UniqueId}.
 * @param hexString (base16) or base64String, a potential UniqueId as a String.
 * @return whether the string could be an object id
 * @throws IllegalArgumentException if hexString is null
 */
public static boolean isValid(final String idString){
  if (idString == null) {
    throw new IllegalArgumentException();
  }
  int len=idString.length();
  if (len == 30) {
    for (int i=0; i < len; i++) {
      char c=idString.charAt(i);
      if (c >= '0' && c <= '9') {
        continue;
      }
      if (c >= 'a' && c <= 'f') {
        continue;
      }
      if (c >= 'A' && c <= 'F') {
        continue;
      }
      return false;
    }
    return true;
  }
 else   if (len == 20) {
    for (int i=0; i < len; i++) {
      char c=idString.charAt(i);
      if (c >= '0' && c <= '9') {
        continue;
      }
      if (c >= 'a' && c <= 'z') {
        continue;
      }
      if (c >= 'A' && c <= 'Z') {
        continue;
      }
      if (c == '_' || c == '-') {
        continue;
      }
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Checks if a string could be an   {@code UniqueId}.
 * @param idString  hexString (base16) or base64String, a potential UniqueId as a String.
 * @return whether the string could be an object id
 * @throws IllegalArgumentException if hexString is null
 */
public static boolean isValid(final String idString){
  if (idString == null) {
    throw new IllegalArgumentException();
  }
  int len=idString.length();
  if (len == 30) {
    for (int i=0; i < len; i++) {
      char c=idString.charAt(i);
      if (c >= '0' && c <= '9') {
        continue;
      }
      if (c >= 'a' && c <= 'f') {
        continue;
      }
      if (c >= 'A' && c <= 'F') {
        continue;
      }
      return false;
    }
    return true;
  }
 else   if (len == 20) {
    for (int i=0; i < len; i++) {
      char c=idString.charAt(i);
      if (c >= '0' && c <= '9') {
        continue;
      }
      if (c >= 'a' && c <= 'z') {
        continue;
      }
      if (c >= 'A' && c <= 'Z') {
        continue;
      }
      if (c == '_' || c == '-') {
        continue;
      }
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}
Program: 172704
Project: 172704
Buggy source:
/** 
 * Constructs a new instance from a 30-byte hexadecimal (base16 encoding) string representation.
 * @param hexString the string to convert
 * @throws IllegalArgumentException if the string is not a valid hex string representation of an UniqueId
 */
public static UniqueId fromHexString(final String hexString){
  return new UniqueId(parseHexString(hexString));
}

Fixed version (ground truth):
/** 
 * Constructs a new instance from a 30-byte hexadecimal (base16 encoding) string representation.
 * @param hexString the string to convert
 * @return new UniqueId instance
 * @throws IllegalArgumentException if the string is not a valid hex string representation of an UniqueId
 */
public static UniqueId fromHexString(final String hexString){
  return new UniqueId(parseHexString(hexString));
}
Program: 172705
Project: 172705
Buggy source:
/** 
 * Constructs a new instance from a 20-byte base64 encoding string representation.
 * @param base64String the string to convert
 * @throws IllegalArgumentException if the string is not a valid hex string representation of an UniqueId
 */
public static UniqueId fromBase64String(final String base64String){
  return new UniqueId(parseBase64String(base64String));
}

Fixed version (ground truth):
/** 
 * Constructs a new instance from a 20-byte base64 encoding string representation.
 * @param base64String the string to convert
 * @return new UniqueId instance
 * @throws IllegalArgumentException if the string is not a valid hex string representation of an UniqueId
 */
public static UniqueId fromBase64String(final String base64String){
  return new UniqueId(parseBase64String(base64String));
}
Program: 172706
Project: 172706
Buggy source:
@Override public PrimitiveObject[] getPrimitiveObjectArray(final IExpressionIndex indexList,final int start,final int length){
  PrimitiveObject[] result=new PrimitiveObject[length];
  for (int i=0; i < result.length; i++) {
    result[i]=value;
  }
  return result;
}

Fixed version (ground truth):
@Override public PrimitiveObject[] getPrimitiveObjectArray(final IExpressionIndex indexList,final int start,final int length){
  PrimitiveObject[] result=new PrimitiveObject[length];
  int loopEnd=(start + length);
  if (indexList.size() < loopEnd) {
    loopEnd=indexList.size();
  }
  for (int i=start, index=0; i < loopEnd; i++, index++) {
    if (indexList.get(i) < this.length) {
      result[index]=value;
    }
  }
  return result;
}
Program: 172707
Project: 172707
Buggy source:
@Override public void setPrimitiveObjectArray(final IExpressionIndex indexList,final int start,final int length,final IMemoryAllocator allocator){
  for (int i=0; i < length; i++) {
    try {
      allocator.setPrimitiveObject(i,value);
    }
 catch (    IOException e) {
      allocator.setNull(i);
    }
  }
}

Fixed version (ground truth):
@Override public void setPrimitiveObjectArray(final IExpressionIndex indexList,final int start,final int length,final IMemoryAllocator allocator){
  int loopEnd=(start + length);
  if (indexList.size() < loopEnd) {
    loopEnd=indexList.size();
  }
  for (int i=start, index=0; i < loopEnd; i++, index++) {
    if (this.length <= indexList.get(i)) {
      allocator.setNull(index);
    }
 else {
      try {
        allocator.setPrimitiveObject(index,value);
      }
 catch (      IOException e) {
        allocator.setNull(index);
      }
    }
  }
  for (int i=loopEnd; i < (start + length); i++) {
    allocator.setNull(i);
  }
}
Program: 172708
Project: 172708
Buggy source:
public void T_createBinary_int_1() throws IOException {
  ColumnBinary columnBinary=ConstantColumnBinaryMaker.createColumnBinary(new IntegerObj(20),"String_Node_Str",3);
  assertEquals(columnBinary.columnName,"String_Node_Str");
  assertEquals(columnBinary.rowCount,3);
  assertEquals(columnBinary.columnType,ColumnType.INTEGER);
  ConstantColumnBinaryMaker maker=new ConstantColumnBinaryMaker();
  IColumn decodeColumn=maker.toColumn(columnBinary);
  assertEquals(decodeColumn.getColumnKeys().size(),0);
  assertEquals(decodeColumn.getColumnSize(),0);
  assertEquals(20,((PrimitiveObject)(decodeColumn.get(0).getRow())).getInt());
  assertEquals(20,((PrimitiveObject)(decodeColumn.get(1).getRow())).getInt());
  assertEquals(20,((PrimitiveObject)(decodeColumn.get(2).getRow())).getInt());
  assertNull(decodeColumn.get(3).getRow());
}

Fixed version (ground truth):
@Test public void T_createBinary_int_1() throws IOException {
  ColumnBinary columnBinary=ConstantColumnBinaryMaker.createColumnBinary(new IntegerObj(20),"String_Node_Str",3);
  assertEquals(columnBinary.columnName,"String_Node_Str");
  assertEquals(columnBinary.rowCount,3);
  assertEquals(columnBinary.columnType,ColumnType.INTEGER);
  ConstantColumnBinaryMaker maker=new ConstantColumnBinaryMaker();
  IColumn decodeColumn=maker.toColumn(columnBinary);
  assertEquals(decodeColumn.getColumnKeys().size(),0);
  assertEquals(decodeColumn.getColumnSize(),0);
  assertEquals(20,((PrimitiveObject)(decodeColumn.get(0).getRow())).getInt());
  assertEquals(20,((PrimitiveObject)(decodeColumn.get(1).getRow())).getInt());
  assertEquals(20,((PrimitiveObject)(decodeColumn.get(2).getRow())).getInt());
  assertNull(decodeColumn.get(3).getRow());
}
Program: 172709
Project: 172709
Buggy source:
public void T_createBinary_float_1() throws IOException {
  ColumnBinary columnBinary=ConstantColumnBinaryMaker.createColumnBinary(new FloatObj((float)0.1),"String_Node_Str",3);
  assertEquals(columnBinary.columnName,"String_Node_Str");
  assertEquals(columnBinary.rowCount,3);
  assertEquals(columnBinary.columnType,ColumnType.FLOAT);
  ConstantColumnBinaryMaker maker=new ConstantColumnBinaryMaker();
  IColumn decodeColumn=maker.toColumn(columnBinary);
  assertEquals(decodeColumn.getColumnKeys().size(),0);
  assertEquals(decodeColumn.getColumnSize(),0);
  assertEquals((float)0.1,((PrimitiveObject)(decodeColumn.get(0).getRow())).getFloat());
  assertEquals((float)0.1,((PrimitiveObject)(decodeColumn.get(1).getRow())).getFloat());
  assertEquals((float)0.1,((PrimitiveObject)(decodeColumn.get(2).getRow())).getFloat());
  assertNull(decodeColumn.get(3).getRow());
}

Fixed version (ground truth):
@Test public void T_createBinary_float_1() throws IOException {
  ColumnBinary columnBinary=ConstantColumnBinaryMaker.createColumnBinary(new FloatObj((float)0.1),"String_Node_Str",3);
  assertEquals(columnBinary.columnName,"String_Node_Str");
  assertEquals(columnBinary.rowCount,3);
  assertEquals(columnBinary.columnType,ColumnType.FLOAT);
  ConstantColumnBinaryMaker maker=new ConstantColumnBinaryMaker();
  IColumn decodeColumn=maker.toColumn(columnBinary);
  assertEquals(decodeColumn.getColumnKeys().size(),0);
  assertEquals(decodeColumn.getColumnSize(),0);
  assertEquals((float)0.1,((PrimitiveObject)(decodeColumn.get(0).getRow())).getFloat());
  assertEquals((float)0.1,((PrimitiveObject)(decodeColumn.get(1).getRow())).getFloat());
  assertEquals((float)0.1,((PrimitiveObject)(decodeColumn.get(2).getRow())).getFloat());
  assertNull(decodeColumn.get(3).getRow());
}
Program: 172710
Project: 172710
Buggy source:
public void T_createBinary_string_1() throws IOException {
  String str="String_Node_Str";
  ColumnBinary columnBinary=ConstantColumnBinaryMaker.createColumnBinary(new StringObj(str),"String_Node_Str",3);
  assertEquals(columnBinary.columnName,"String_Node_Str");
  assertEquals(columnBinary.rowCount,3);
  assertEquals(columnBinary.columnType,ColumnType.STRING);
  ConstantColumnBinaryMaker maker=new ConstantColumnBinaryMaker();
  IColumn decodeColumn=maker.toColumn(columnBinary);
  assertEquals(decodeColumn.getColumnKeys().size(),0);
  assertEquals(decodeColumn.getColumnSize(),0);
  assertEquals(str,((PrimitiveObject)(decodeColumn.get(0).getRow())).getString());
  assertEquals(str,((PrimitiveObject)(decodeColumn.get(1).getRow())).getString());
  assertEquals(str,((PrimitiveObject)(decodeColumn.get(2).getRow())).getString());
  assertNull(decodeColumn.get(3).getRow());
}

Fixed version (ground truth):
@Test public void T_createBinary_string_1() throws IOException {
  String str="String_Node_Str";
  ColumnBinary columnBinary=ConstantColumnBinaryMaker.createColumnBinary(new StringObj(str),"String_Node_Str",3);
  assertEquals(columnBinary.columnName,"String_Node_Str");
  assertEquals(columnBinary.rowCount,3);
  assertEquals(columnBinary.columnType,ColumnType.STRING);
  ConstantColumnBinaryMaker maker=new ConstantColumnBinaryMaker();
  IColumn decodeColumn=maker.toColumn(columnBinary);
  assertEquals(decodeColumn.getColumnKeys().size(),0);
  assertEquals(decodeColumn.getColumnSize(),0);
  assertEquals(str,((PrimitiveObject)(decodeColumn.get(0).getRow())).getString());
  assertEquals(str,((PrimitiveObject)(decodeColumn.get(1).getRow())).getString());
  assertEquals(str,((PrimitiveObject)(decodeColumn.get(2).getRow())).getString());
  assertNull(decodeColumn.get(3).getRow());
}