nus-yam/ex-repair huggingface dataset:
Program: 27999
Project: 27999
Buggy source:
@Override public void getItemOffsets(Rect outRect,View view,RecyclerView parent,RecyclerView.State state){
  super.getItemOffsets(outRect,view,parent,state);
  int position=parent.getChildLayoutPosition(view);
  if (position == 0) {
    outRect.top=mHeightHeader;
  }
}

Fixed version (ground truth):
@Override public void getItemOffsets(Rect outRect,View view,RecyclerView parent,RecyclerView.State state){
  super.getItemOffsets(outRect,view,parent,state);
  if (parent.getChildAdapterPosition(view) == 0) {
    outRect.top=mHeightHeader;
  }
}
Program: 28000
Project: 28000
Buggy source:
protected void init(){
  measureHeaderHeight();
  setupAnimator();
  setupOnScrollListener();
}

Fixed version (ground truth):
protected void init(){
  setupAnimator();
  measureHeaderHeight();
  setupOnScrollListener();
}
Program: 28001
Project: 28001
Buggy source:
@Nullable public static Class<?> getGenericType(@NonNull Class<?> in,@NonNull Class<?> whichExtends){
  final Type genericSuperclass=in.getGenericSuperclass();
  if (genericSuperclass instanceof ParameterizedType) {
    final Type[] typeArgs=((ParameterizedType)genericSuperclass).getActualTypeArguments();
    for (    Type arg : typeArgs) {
      if (arg instanceof Class<?>) {
        final Class<?> argClass=(Class<?>)arg;
        if (whichExtends.isAssignableFrom(argClass)) {
          return argClass;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Nullable public static Class<?> getGenericType(@NonNull Class<?> in,@NonNull Class<?> whichExtends){
  final Type genericSuperclass=in.getGenericSuperclass();
  if (genericSuperclass instanceof ParameterizedType) {
    final Type[] typeArgs=((ParameterizedType)genericSuperclass).getActualTypeArguments();
    for (    Type arg : typeArgs) {
      if (arg instanceof ParameterizedType) {
        arg=((ParameterizedType)arg).getRawType();
      }
      if (arg instanceof Class<?>) {
        final Class<?> argClass=(Class<?>)arg;
        if (whichExtends.isAssignableFrom(argClass)) {
          return argClass;
        }
      }
    }
  }
  return null;
}
Program: 28002
Project: 28002
Buggy source:
/** 
 * Event为pic_sysphoto, pic_photo_or_album, pic_weixin时触发
 * @param reader reader
 * @return 读取结果
 * @throws XMLStreamException XML解析异常
 */
protected static Map<String,Object> eventSendPicsInfo(XMLEventReader reader) throws XMLStreamException {
  Map<String,Object> sendPicsInfoMap=new HashMap<String,Object>();
  while (reader.hasNext()) {
    XMLEvent event=reader.nextEvent();
    if (event.isStartElement()) {
      String tagName=event.asStartElement().getName().toString();
      if ("String_Node_Str".equals(tagName)) {
        sendPicsInfoMap.put(tagName,reader.getElementText());
      }
 else       if ("String_Node_Str".equals(tagName)) {
        StringBuilder sb=new StringBuilder();
        while (reader.hasNext()) {
          XMLEvent event1=reader.nextEvent();
          if (event1.isStartElement() && "String_Node_Str".equals(event1.asStartElement().getName().toString())) {
            sb.append(reader.getElementText());
            sb.append("String_Node_Str");
          }
 else           if (event1.isEndElement() && "String_Node_Str".equals(event1.asEndElement().getName().toString())) {
            break;
          }
        }
        sendPicsInfoMap.put(tagName,sb.substring(0,sb.length()));
      }
    }
  }
  return sendPicsInfoMap;
}

Fixed version (ground truth):
/** 
 * Event为pic_sysphoto, pic_photo_or_album, pic_weixin时触发
 * @param reader reader
 * @return 读取结果
 * @throws XMLStreamException XML解析异常
 */
protected static Map<String,Object> eventSendPicsInfo(XMLEventReader reader) throws XMLStreamException {
  Map<String,Object> sendPicsInfoMap=new HashMap<String,Object>();
  while (reader.hasNext()) {
    XMLEvent event=reader.nextEvent();
    if (event.isStartElement()) {
      String tagName=event.asStartElement().getName().toString();
      if ("String_Node_Str".equals(tagName)) {
        sendPicsInfoMap.put(tagName,reader.getElementText());
      }
 else       if ("String_Node_Str".equals(tagName)) {
        List<Map<String,String>> picList=CollectionUtil.newArrayList();
        while (reader.hasNext()) {
          XMLEvent event1=reader.nextEvent();
          if (event1.isStartElement() && "String_Node_Str".equals(event1.asStartElement().getName().toString())) {
            Map<String,String> picMap=new HashMap<String,String>();
            picMap.put("String_Node_Str",reader.getElementText());
            picList.add(picMap);
          }
 else           if (event1.isEndElement() && "String_Node_Str".equals(event1.asEndElement().getName().toString())) {
            break;
          }
        }
        sendPicsInfoMap.put(tagName,picList);
      }
    }
  }
  return sendPicsInfoMap;
}
Program: 28003
Project: 28003
Buggy source:
@Override public void onResponse(int resultCode,String resultJson){
  if (HttpStatus.SC_OK == resultCode) {
    GetJsApiTicketResponse response=JSONUtil.toBean(resultJson,GetJsApiTicketResponse.class);
    LOG.debug("String_Node_Str",response.getTicket());
    ApiConfig.this.jsApiTicket=response.getTicket();
    jsTokenStartTime=System.currentTimeMillis();
  }
}

Fixed version (ground truth):
@Override public void onResponse(int resultCode,String resultJson){
  if (HttpStatus.SC_OK == resultCode) {
    GetJsApiTicketResponse response=JSONUtil.toBean(resultJson,GetJsApiTicketResponse.class);
    LOG.debug("String_Node_Str",response.getTicket());
    if (StrUtil.isBlank(response.getTicket())) {
      jsTokenStartTime=oldTime;
      throw new WeixinException("String_Node_Str" + response.getErrcode() + "String_Node_Str"+ response.getErrmsg());
    }
    jsApiTicket=response.getTicket();
  }
}
Program: 28004
Project: 28004
Buggy source:
public String getJsApiTicket(){
  long now=System.currentTimeMillis();
  if (now - this.jsTokenStartTime > 7100000) {
    initJSToken();
  }
  return jsApiTicket;
}

Fixed version (ground truth):
public String getJsApiTicket(){
  long now=System.currentTimeMillis();
  if (now - this.jsTokenStartTime > 7100000) {
    getAccessToken();
    initJSToken(now);
  }
  return jsApiTicket;
}
Program: 28005
Project: 28005
Buggy source:
/** 
 * 初始化微信JS-SDK，获取JS-SDK token
 */
private void initJSToken(){
  LOG.debug("String_Node_Str");
  String url="String_Node_Str" + accessToken + "String_Node_Str";
  NetWorkCenter.get(url,null,new NetWorkCenter.ResponseCallback(){
    @Override public void onResponse(    int resultCode,    String resultJson){
      if (HttpStatus.SC_OK == resultCode) {
        GetJsApiTicketResponse response=JSONUtil.toBean(resultJson,GetJsApiTicketResponse.class);
        LOG.debug("String_Node_Str",response.getTicket());
        ApiConfig.this.jsApiTicket=response.getTicket();
        jsTokenStartTime=System.currentTimeMillis();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * 初始化微信JS-SDK，获取JS-SDK token
 * @param refreshTime 刷新时间
 */
private void initJSToken(final long refreshTime){
  LOG.debug("String_Node_Str");
  final long oldTime=this.jsTokenStartTime;
  this.jsTokenStartTime=refreshTime;
  String url="String_Node_Str" + accessToken + "String_Node_Str";
  NetWorkCenter.get(url,null,new NetWorkCenter.ResponseCallback(){
    @Override public void onResponse(    int resultCode,    String resultJson){
      if (HttpStatus.SC_OK == resultCode) {
        GetJsApiTicketResponse response=JSONUtil.toBean(resultJson,GetJsApiTicketResponse.class);
        LOG.debug("String_Node_Str",response.getTicket());
        if (StrUtil.isBlank(response.getTicket())) {
          jsTokenStartTime=oldTime;
          throw new WeixinException("String_Node_Str" + response.getErrcode() + "String_Node_Str"+ response.getErrmsg());
        }
        jsApiTicket=response.getTicket();
      }
    }
  }
);
}
Program: 28006
Project: 28006
Buggy source:
/** 
 * 构造方法二，实现同时获取access_token，启用jsApi
 * @param appid       公众号appid
 * @param secret      公众号secret
 * @param enableJsApi 是否启动js api
 */
public ApiConfig(String appid,String secret,boolean enableJsApi){
  this.appid=appid;
  this.secret=secret;
  this.enableJsApi=enableJsApi;
  initToken();
  if (enableJsApi)   initJSToken();
}

Fixed version (ground truth):
/** 
 * 构造方法二，实现同时获取access_token，启用jsApi
 * @param appid       公众号appid
 * @param secret      公众号secret
 * @param enableJsApi 是否启动js api
 */
public ApiConfig(String appid,String secret,boolean enableJsApi){
  this.appid=appid;
  this.secret=secret;
  this.enableJsApi=enableJsApi;
  long now=System.currentTimeMillis();
  initToken(now);
  if (enableJsApi)   initJSToken(now);
}
Program: 28007
Project: 28007
Buggy source:
/** 
 * 初始化微信配置，即第一次获取access_token
 */
private void initToken(){
  LOG.debug("String_Node_Str");
  String url="String_Node_Str" + this.appid + "String_Node_Str"+ this.secret;
  NetWorkCenter.get(url,null,new NetWorkCenter.ResponseCallback(){
    @Override public void onResponse(    int resultCode,    String resultJson){
      if (HttpStatus.SC_OK == resultCode) {
        GetTokenResponse response=JSONUtil.toBean(resultJson,GetTokenResponse.class);
        LOG.debug("String_Node_Str",response.getAccessToken());
        if (null == response.getAccessToken()) {
          throw new WeixinException("String_Node_Str" + response.getErrcode() + "String_Node_Str"+ response.getErrmsg());
        }
        ApiConfig.this.accessToken=response.getAccessToken();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * 初始化微信配置，即第一次获取access_token
 * @param refreshTime 刷新时间
 */
private void initToken(final long refreshTime){
  LOG.debug("String_Node_Str");
  final long oldTime=this.weixinTokenStartTime;
  this.weixinTokenStartTime=refreshTime;
  String url="String_Node_Str" + this.appid + "String_Node_Str"+ this.secret;
  NetWorkCenter.get(url,null,new NetWorkCenter.ResponseCallback(){
    @Override public void onResponse(    int resultCode,    String resultJson){
      if (HttpStatus.SC_OK == resultCode) {
        GetTokenResponse response=JSONUtil.toBean(resultJson,GetTokenResponse.class);
        LOG.debug("String_Node_Str",response.getAccessToken());
        if (null == response.getAccessToken()) {
          weixinTokenStartTime=oldTime;
          throw new WeixinException("String_Node_Str" + response.getErrcode() + "String_Node_Str"+ response.getErrmsg());
        }
        accessToken=response.getAccessToken();
      }
    }
  }
);
}
Program: 28008
Project: 28008
Buggy source:
public String getAccessToken(){
  return accessToken;
}

Fixed version (ground truth):
public String getAccessToken(){
  long now=System.currentTimeMillis();
  if (now - this.weixinTokenStartTime > 7100000) {
    initToken(now);
  }
  return accessToken;
}
Program: 28009
Project: 28009
Buggy source:
protected void logException(Exception ex){
  logger.error("String_Node_Str",ex);
}

Fixed version (ground truth):
protected void logException(String msg,Exception ex){
  logger.error(msg,ex);
}
Program: 28010
Project: 28010
Buggy source:
@Override public void run(){
  if (runningChild != null) {
    runningChild.run();
  }
 else {
    if (currentChildIndex < children.size) {
      if (randomChildren != null) {
        int last=children.size - 1;
        if (currentChildIndex < last) {
          int otherChildIndex=MathUtils.random(currentChildIndex,last);
          Task<E> tmp=randomChildren[currentChildIndex];
          randomChildren[currentChildIndex]=randomChildren[otherChildIndex];
          randomChildren[otherChildIndex]=tmp;
        }
        runningChild=randomChildren[currentChildIndex];
      }
 else {
        runningChild=children.get(currentChildIndex);
      }
      runningChild.setControl(this);
      runningChild.start();
      if (!runningChild.checkGuard(this))       runningChild.fail();
      run();
    }
 else {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (runningChild != null) {
    runningChild.run();
  }
 else {
    if (currentChildIndex < children.size) {
      if (randomChildren != null) {
        int last=children.size - 1;
        if (currentChildIndex < last) {
          int otherChildIndex=MathUtils.random(currentChildIndex,last);
          Task<E> tmp=randomChildren[currentChildIndex];
          randomChildren[currentChildIndex]=randomChildren[otherChildIndex];
          randomChildren[otherChildIndex]=tmp;
        }
        runningChild=randomChildren[currentChildIndex];
      }
 else {
        runningChild=children.get(currentChildIndex);
      }
      runningChild.setControl(this);
      runningChild.start();
      if (!runningChild.checkGuard(this))       runningChild.fail();
 else       run();
    }
 else {
    }
  }
}
Program: 28011
Project: 28011
Buggy source:
@Override protected SteeringAcceleration<T> calculateRealSteering(SteeringAcceleration<T> steering){
  steering.setZero();
  T location=(predictionTime == 0) ? owner.getPosition() : steering.linear.set(owner.getPosition()).mulAdd(owner.getLinearVelocity(),predictionTime);
  T flowVector=flowField.lookup(location);
  if (flowVector != null && !flowVector.isZero()) {
    Limiter actualLimiter=getActualLimiter();
    steering.linear.mulAdd(flowVector,actualLimiter.getMaxLinearSpeed()).sub(owner.getLinearVelocity()).limit(actualLimiter.getMaxLinearAcceleration());
  }
  return steering;
}

Fixed version (ground truth):
@Override protected SteeringAcceleration<T> calculateRealSteering(SteeringAcceleration<T> steering){
  T location=(predictionTime == 0) ? owner.getPosition() : steering.linear.set(owner.getPosition()).mulAdd(owner.getLinearVelocity(),predictionTime);
  T flowVector=flowField.lookup(location);
  steering.setZero();
  if (flowVector != null && !flowVector.isZero()) {
    Limiter actualLimiter=getActualLimiter();
    steering.linear.mulAdd(flowVector,actualLimiter.getMaxLinearSpeed()).sub(owner.getLinearVelocity()).limit(actualLimiter.getMaxLinearAcceleration());
  }
  return steering;
}
Program: 28012
Project: 28012
Buggy source:
public BehaviorTreeTestBase(String name,String description){
  this.name=name;
  this.description=description;
}

Fixed version (ground truth):
public BehaviorTreeTestBase(String name,String description){
  this.name=name;
  this.description=description;
  this.treeViewers=new Array<BehaviorTreeViewer<?>>();
}
Program: 28013
Project: 28013
Buggy source:
public static Actor createTreeViewer(String name,BehaviorTree<?> tree,Skin skin,boolean scrollable){
  @SuppressWarnings({"String_Node_Str","String_Node_Str"}) BehaviorTreeViewer<?> btv=new BehaviorTreeViewer(tree,skin);
  btv.setName(name);
  return scrollable ? new ScrollPane(btv,skin) : btv;
}

Fixed version (ground truth):
protected BehaviorTreeViewer<?> createTreeViewer(String name,BehaviorTree<?> tree,boolean loadAndSave,Skin skin){
  @SuppressWarnings({"String_Node_Str","String_Node_Str"}) BehaviorTreeViewer<?> btv=new BehaviorTreeViewer(tree,loadAndSave,skin);
  btv.setName(name);
  treeViewers.add(btv);
  return btv;
}
Program: 28014
Project: 28014
Buggy source:
public abstract void dispose();

Fixed version (ground truth):
public void dispose(){
  for (  BehaviorTreeViewer<?> treeViewer : treeViewers)   treeViewer.getBehaviorTree().reset();
}
Program: 28015
Project: 28015
Buggy source:
private void rebuildDisplayTree(IntArray taskSteps){
  displayTree.clear();
  taskNodes.clear();
  Task<T> root=tree.getChild(0);
  addToTree(displayTree,null,root,taskSteps,0);
  displayTree.expandAll();
}

Fixed version (ground truth):
private void rebuildDisplayTree(IntArray taskSteps){
  displayTree.clear();
  taskNodes.clear();
  Task<E> root=tree.getChild(0);
  addToTree(displayTree,null,root,taskSteps,0);
  displayTree.expandAll();
}
Program: 28017
Project: 28017
Buggy source:
@Override public void childAdded(Task<T> task,int index){
  TaskNode parentNode=taskNodes.get(task);
  Task<T> child=task.getChild(index);
  addToTree(displayTree,parentNode,child,null,0);
  displayTree.expandAll();
}

Fixed version (ground truth):
@Override public void childAdded(Task<E> task,int index){
  TaskNode parentNode=taskNodes.get(task);
  Task<E> child=task.getChild(index);
  addToTree(displayTree,parentNode,child,null,0);
  displayTree.expandAll();
}
Program: 28018
Project: 28018
Buggy source:
private int addToTree(Tree displayTree,TaskNode parentNode,Task<T> task,IntArray taskSteps,int taskStepIndex){
  TaskNode node=new TaskNode(task,this,taskSteps == null ? step - 1 : taskSteps.get(taskStepIndex),getSkin());
  taskNodes.put(task,node);
  if (parentNode == null) {
    displayTree.add(node);
  }
 else {
    parentNode.add(node);
  }
  taskStepIndex++;
  for (int i=0; i < task.getChildCount(); i++) {
    Task<T> child=task.getChild(i);
    taskStepIndex=addToTree(displayTree,node,child,taskSteps,taskStepIndex);
  }
  return taskStepIndex;
}

Fixed version (ground truth):
private int addToTree(Tree displayTree,TaskNode parentNode,Task<E> task,IntArray taskSteps,int taskStepIndex){
  TaskNode node=new TaskNode(task,this,taskSteps == null ? step - 1 : taskSteps.get(taskStepIndex),getSkin());
  taskNodes.put(task,node);
  if (parentNode == null) {
    displayTree.add(node);
  }
 else {
    parentNode.add(node);
  }
  taskStepIndex++;
  for (int i=0; i < task.getChildCount(); i++) {
    Task<E> child=task.getChild(i);
    taskStepIndex=addToTree(displayTree,node,child,taskSteps,taskStepIndex);
  }
  return taskStepIndex;
}
Program: 28019
Project: 28019
Buggy source:
@Override public void statusUpdated(Task<T> task,Task.Status previousStatus){
  TaskNode tn=taskNodes.get(task);
  tn.updateStatus(previousStatus,step);
}

Fixed version (ground truth):
@Override public void statusUpdated(Task<E> task,Task.Status previousStatus){
  TaskNode tn=taskNodes.get(task);
  tn.updateStatus(previousStatus,step);
}
Program: 28020
Project: 28020
Buggy source:
@Override public void changed(ChangeEvent event,Actor actor){
  if (treeStatus == SUSPENDED) {
    treeStatus=RUNNING;
    delay=runDelaySlider.getValue();
    runButton.setText("String_Node_Str");
    stepButton.setDisabled(true);
    saveButton.setDisabled(true);
    loadButton.setDisabled(true);
  }
 else {
    treeStatus=SUSPENDED;
    runButton.setText("String_Node_Str");
    stepButton.setDisabled(false);
    saveButton.setDisabled(false);
    loadButton.setDisabled(!saved);
  }
}

Fixed version (ground truth):
@Override public void changed(ChangeEvent event,Actor actor){
  if (treeStatus == SUSPENDED) {
    treeStatus=RUNNING;
    delay=runDelaySlider.getValue();
    runButton.setText("String_Node_Str");
    stepButton.setDisabled(true);
    if (saveButton != null)     saveButton.setDisabled(true);
    if (loadButton != null)     loadButton.setDisabled(true);
  }
 else {
    treeStatus=SUSPENDED;
    runButton.setText("String_Node_Str");
    stepButton.setDisabled(false);
    if (saveButton != null)     saveButton.setDisabled(false);
    if (loadButton != null)     loadButton.setDisabled(!saved);
  }
}
Program: 28021
Project: 28021
Buggy source:
@Override public Actor createActor(Skin skin){
  BehaviorTreeLibraryManager libraryManager=BehaviorTreeLibraryManager.getInstance();
  libraryManager.setLibrary(new BehaviorTreeLibrary(BehaviorTreeParser.DEBUG_HIGH));
  String name=lazy ? "String_Node_Str" : "String_Node_Str";
  tree=libraryManager.createBehaviorTree(name,new Dog("String_Node_Str"));
  return createTreeViewer(tree.getObject().name,tree,skin);
}

Fixed version (ground truth):
@Override public Actor createActor(Skin skin){
  BehaviorTreeLibraryManager libraryManager=BehaviorTreeLibraryManager.getInstance();
  libraryManager.setLibrary(new BehaviorTreeLibrary(BehaviorTreeParser.DEBUG_HIGH));
  String name=lazy ? "String_Node_Str" : "String_Node_Str";
  BehaviorTree<Dog> tree=libraryManager.createBehaviorTree(name,new Dog("String_Node_Str"));
  BehaviorTreeViewer<?> treeViewer=createTreeViewer(tree.getObject().name,tree,true,skin);
  return new ScrollPane(treeViewer,skin);
}
Program: 28022
Project: 28022
Buggy source:
@Override public void dispose(){
  tree.reset();
}

Fixed version (ground truth):
@Override public void dispose(){
  treeViewer.getBehaviorTree().reset();
}
Program: 28023
Project: 28023
Buggy source:
@Override public Actor createActor(Skin skin){
  Reader reader=null;
  try {
    reader=Gdx.files.internal("String_Node_Str").reader();
    BehaviorTreeParser<Dog> parser=new BehaviorTreeParser<Dog>(BehaviorTreeParser.DEBUG_NONE);
    tree=parser.parse(reader,new Dog("String_Node_Str"));
    return createTreeViewer(tree.getObject().name,tree,skin);
  }
  finally {
    StreamUtils.closeQuietly(reader);
  }
}

Fixed version (ground truth):
@Override public Actor createActor(Skin skin){
  Reader reader=null;
  try {
    reader=Gdx.files.internal("String_Node_Str").reader();
    BehaviorTreeParser<Dog> parser=new BehaviorTreeParser<Dog>(BehaviorTreeParser.DEBUG_NONE);
    BehaviorTree<Dog> tree=parser.parse(reader,new Dog("String_Node_Str"));
    treeViewer=createTreeViewer(tree.getObject().name,tree,true,skin);
    return new ScrollPane(treeViewer,skin);
  }
  finally {
    StreamUtils.closeQuietly(reader);
  }
}
Program: 28024
Project: 28024
Buggy source:
@Override public Actor createActor(Skin skin){
  Reader reader=null;
  try {
    reader=Gdx.files.internal("String_Node_Str").reader();
    BehaviorTreeParser<Dog> parser=new BehaviorTreeParser<Dog>(BehaviorTreeParser.DEBUG_NONE);
    BehaviorTree<Dog> treeArchetype=parser.parse(reader,null);
    tree=(BehaviorTree<Dog>)treeArchetype.cloneTask();
    tree.setObject(new Dog("String_Node_Str"));
    return createTreeViewer(tree.getObject().name,tree,skin);
  }
  finally {
    StreamUtils.closeQuietly(reader);
  }
}

Fixed version (ground truth):
@Override public Actor createActor(Skin skin){
  Reader reader=null;
  try {
    reader=Gdx.files.internal("String_Node_Str").reader();
    BehaviorTreeParser<Dog> parser=new BehaviorTreeParser<Dog>(BehaviorTreeParser.DEBUG_NONE);
    BehaviorTree<Dog> treeArchetype=parser.parse(reader,null);
    BehaviorTree<Dog> tree=(BehaviorTree<Dog>)treeArchetype.cloneTask();
    tree.setObject(new Dog("String_Node_Str"));
    BehaviorTreeViewer<?> treeViewer=createTreeViewer(tree.getObject().name,tree,true,skin);
    return new ScrollPane(treeViewer,skin);
  }
  finally {
    StreamUtils.closeQuietly(reader);
  }
}
Program: 28025
Project: 28025
Buggy source:
public static void save(Object obj){
  output.clear();
  kryo.writeObjectOrNull(output,obj,obj.getClass());
  System.out.println(output.total());
}

Fixed version (ground truth):
public static void save(Object obj){
  output.clear();
  kryo.writeObjectOrNull(output,obj,obj.getClass());
}
Program: 28026
Project: 28026
Buggy source:
private void addToTree(Tree displayTree,TaskNode parentNode,Task<T> task,IntArray taskSteps,int taskStepIndex){
  TaskNode node=new TaskNode(task,this,taskSteps == null ? step - 1 : taskSteps.get(taskStepIndex),getSkin());
  taskNodes.put(task,node);
  if (parentNode == null) {
    displayTree.add(node);
  }
 else {
    parentNode.add(node);
  }
  for (int i=0; i < task.getChildCount(); i++) {
    Task<T> child=task.getChild(i);
    addToTree(displayTree,node,child,taskSteps,taskStepIndex + 1);
  }
}

Fixed version (ground truth):
private int addToTree(Tree displayTree,TaskNode parentNode,Task<T> task,IntArray taskSteps,int taskStepIndex){
  TaskNode node=new TaskNode(task,this,taskSteps == null ? step - 1 : taskSteps.get(taskStepIndex),getSkin());
  taskNodes.put(task,node);
  if (parentNode == null) {
    displayTree.add(node);
  }
 else {
    parentNode.add(node);
  }
  taskStepIndex++;
  for (int i=0; i < task.getChildCount(); i++) {
    Task<T> child=task.getChild(i);
    taskStepIndex=addToTree(displayTree,node,child,taskSteps,taskStepIndex);
  }
  return taskStepIndex;
}
Program: 28027
Project: 28027
Buggy source:
protected void applySteering(SteeringAcceleration<Vector2> steering,float deltaTime){
  boolean anyAccelerations=false;
  if (!steeringOutput.linear.isZero()) {
    Vector2 force=steeringOutput.linear.scl(deltaTime);
    body.applyForceToCenter(force,true);
    anyAccelerations=true;
  }
  if (isIndependentFacing()) {
    if (steeringOutput.angular != 0) {
      body.applyTorque(steeringOutput.angular * deltaTime,true);
      anyAccelerations=true;
    }
  }
 else {
    Vector2 linVel=getLinearVelocity();
    if (!linVel.isZero(getZeroLinearSpeedThreshold())) {
      float newOrientation=vectorToAngle(linVel);
      body.setAngularVelocity((newOrientation - getAngularVelocity()) * deltaTime);
      body.setTransform(body.getPosition(),newOrientation);
    }
  }
  if (anyAccelerations) {
    Vector2 velocity=body.getLinearVelocity();
    float currentSpeedSquare=velocity.len2();
    float maxLinearSpeed=getMaxLinearSpeed();
    if (currentSpeedSquare > maxLinearSpeed * maxLinearSpeed) {
      body.setLinearVelocity(velocity.scl(maxLinearSpeed / (float)Math.sqrt(currentSpeedSquare)));
    }
    float maxAngVelocity=getMaxAngularSpeed();
    if (body.getAngularVelocity() > maxAngVelocity) {
      body.setAngularVelocity(maxAngVelocity);
    }
  }
}

Fixed version (ground truth):
protected void applySteering(SteeringAcceleration<Vector2> steering,float deltaTime){
  boolean anyAccelerations=false;
  if (!steeringOutput.linear.isZero()) {
    body.applyForceToCenter(steeringOutput.linear,true);
    anyAccelerations=true;
  }
  if (isIndependentFacing()) {
    if (steeringOutput.angular != 0) {
      body.applyTorque(steeringOutput.angular,true);
      anyAccelerations=true;
    }
  }
 else {
    Vector2 linVel=getLinearVelocity();
    if (!linVel.isZero(getZeroLinearSpeedThreshold())) {
      float newOrientation=vectorToAngle(linVel);
      body.setAngularVelocity((newOrientation - getAngularVelocity()) * deltaTime);
      body.setTransform(body.getPosition(),newOrientation);
    }
  }
  if (anyAccelerations) {
    Vector2 velocity=body.getLinearVelocity();
    float currentSpeedSquare=velocity.len2();
    float maxLinearSpeed=getMaxLinearSpeed();
    if (currentSpeedSquare > maxLinearSpeed * maxLinearSpeed) {
      body.setLinearVelocity(velocity.scl(maxLinearSpeed / (float)Math.sqrt(currentSpeedSquare)));
    }
    float maxAngVelocity=getMaxAngularSpeed();
    if (body.getAngularVelocity() > maxAngVelocity) {
      body.setAngularVelocity(maxAngVelocity);
    }
  }
}
Program: 28028
Project: 28028
Buggy source:
protected void addMaxLinearSpeedController(Table table,Limiter limiter){
  addMaxLinearSpeedController(table,limiter,0,500,10);
}

Fixed version (ground truth):
protected void addMaxLinearSpeedController(Table table,Limiter limiter){
  addMaxLinearSpeedController(table,limiter,0,50,1);
}
Program: 28035
Project: 28035
Buggy source:
@Override public void create(Table table){
  spriteBatch=new SpriteBatch();
  world=createWorld();
  character=createSteeringEntity(world,container.greenFish);
  character.setMaxLinearSpeed(4);
  character.setMaxLinearAcceleration(200);
  target=createSteeringEntity(world,container.target);
  markAsSensor(target);
  inputProcessor=new Box2dTargetInputProcessor(target);
  final Seek<Vector2> seekSB=new Seek<Vector2>(character,target);
  character.setSteeringBehavior(seekSB);
  Table detailTable=new Table(container.skin);
  detailTable.row();
  addMaxLinearAccelerationController(detailTable,character,0,1000,1);
  detailTable.row();
  addSeparator(detailTable);
  detailTable.row();
  addMaxLinearSpeedController(detailTable,character,0,30,1);
  detailWindow=createDetailWindow(detailTable);
}

Fixed version (ground truth):
@Override public void create(Table table){
  spriteBatch=new SpriteBatch();
  world=createWorld();
  character=createSteeringEntity(world,container.greenFish);
  character.setMaxLinearSpeed(5);
  character.setMaxLinearAcceleration(10);
  target=createSteeringEntity(world,container.target);
  markAsSensor(target);
  inputProcessor=new Box2dTargetInputProcessor(target);
  final Seek<Vector2> seekSB=new Seek<Vector2>(character,target);
  character.setSteeringBehavior(seekSB);
  Table detailTable=new Table(container.skin);
  detailTable.row();
  addMaxLinearAccelerationController(detailTable,character,0,200,1);
  detailTable.row();
  addSeparator(detailTable);
  detailTable.row();
  addMaxLinearSpeedController(detailTable,character,0,30,.5f);
  detailWindow=createDetailWindow(detailTable);
}
Program: 28036
Project: 28036
Buggy source:
@Override public void create(){
  Gdx.gl.glClearColor(.3f,.3f,.3f,1);
  fpsStringBuilder=new StringBuilder();
  skin=new Skin(Gdx.files.internal("String_Node_Str"));
  BitmapFont font=skin.get("String_Node_Str",BitmapFont.class);
  font.setMarkupEnabled(true);
  stage=new Stage();
  stage.setDebugAll(DEBUG_STAGE);
  stageWidth=stage.getWidth();
  stageHeight=stage.getHeight();
  Gdx.input.setInputProcessor(new InputMultiplexer(stage));
  Stack stack=new Stack();
  stage.addActor(stack);
  stack.setSize(stageWidth,stageHeight);
  testsTable=new Table();
  stack.add(testsTable);
  List<String> testList=createTestList();
  algorithmSelectionWindow=addBehaviorSelectionWindow("String_Node_Str",testList,0,-1);
  changeTest(0);
  fpsLabel=new Label("String_Node_Str",skin);
  stage.addActor(fpsLabel);
}

Fixed version (ground truth):
@Override public void create(){
  Gdx.gl.glClearColor(.3f,.3f,.3f,1);
  fpsStringBuilder=new StringBuilder();
  skin=new Skin(Gdx.files.internal("String_Node_Str"));
  BitmapFont font=skin.get("String_Node_Str",BitmapFont.class);
  font.getData().markupEnabled=true;
  stage=new Stage();
  stage.setDebugAll(DEBUG_STAGE);
  stageWidth=stage.getWidth();
  stageHeight=stage.getHeight();
  Gdx.input.setInputProcessor(new InputMultiplexer(stage));
  Stack stack=new Stack();
  stage.addActor(stack);
  stack.setSize(stageWidth,stageHeight);
  testsTable=new Table();
  stack.add(testsTable);
  List<String> testList=createTestList();
  algorithmSelectionWindow=addBehaviorSelectionWindow("String_Node_Str",testList,0,-1);
  changeTest(0);
  fpsLabel=new Label("String_Node_Str",skin);
  stage.addActor(fpsLabel);
}
Program: 28037
Project: 28037
Buggy source:
private void openTask(int indent,String name){
  isTask=true;
  String className=getImport(name);
  if (className == null)   className=name;
  try {
    @SuppressWarnings("String_Node_Str") Node<E> node=(Node<E>)ClassReflection.newInstance(ClassReflection.forName(className));
    if (prevNode == null) {
      root=node;
      rootIndent=indent;
      indent=0;
    }
 else {
      indent-=rootIndent;
      if (prevNode.node == root) {
        step=indent;
      }
      if (indent > currentDepth) {
        stack.add(prevNode);
      }
 else       if (indent < currentDepth) {
        int i=(currentDepth - indent) / step;
        for (int j=0; j < i; j++) {
          StackedNode<E> stackedNode=stack.pop();
          int minChildren=stackedNode.metadata.getMinChildren();
          if (stackedNode.node.getChildCount() < minChildren)           throw new GdxRuntimeException(stackedNode.name + "String_Node_Str" + stackedNode.node.getChildCount()+ "String_Node_Str"+ minChildren+ "String_Node_Str");
        }
      }
      StackedNode<E> stackedParent=stack.peek();
      int maxChildren=stackedParent.metadata.getMaxChildren();
      if (stackedParent.node.getChildCount() >= maxChildren)       throw new GdxRuntimeException(stackedParent.name + "String_Node_Str" + (stackedParent.node.getChildCount() + 1)+ "String_Node_Str"+ maxChildren+ "String_Node_Str");
      stackedParent.node.addChild(node);
    }
    prevNode=new StackedNode<E>(name,node);
    currentDepth=indent;
  }
 catch (  ReflectionException e) {
    throw new GdxRuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void openTask(int indent,String name){
  isTask=true;
  String className=getImport(name);
  if (className == null)   className=name;
  try {
    @SuppressWarnings("String_Node_Str") Node<E> node=(Node<E>)ClassReflection.newInstance(ClassReflection.forName(className));
    if (prevNode == null) {
      root=node;
      rootIndent=indent;
      indent=0;
    }
 else {
      indent-=rootIndent;
      if (prevNode.node == root) {
        step=indent;
      }
      if (indent > currentDepth) {
        stack.add(prevNode);
      }
 else       if (indent <= currentDepth) {
        int i=(currentDepth - indent) / step;
        popAndcheckMinChildren(stack.size - i);
      }
      StackedNode<E> stackedParent=stack.peek();
      int maxChildren=stackedParent.metadata.getMaxChildren();
      if (stackedParent.node.getChildCount() >= maxChildren)       throw new GdxRuntimeException(stackedParent.name + "String_Node_Str" + (stackedParent.node.getChildCount() + 1)+ "String_Node_Str"+ maxChildren+ "String_Node_Str");
      stackedParent.node.addChild(node);
    }
    prevNode=new StackedNode<E>(name,node);
    currentDepth=indent;
  }
 catch (  ReflectionException e) {
    throw new GdxRuntimeException("String_Node_Str",e);
  }
}
Program: 28038
Project: 28038
Buggy source:
@Override public void parse(char[] data,int offset,int length){
  debug=btParser.debug > BehaviorTreeParser.DEBUG_NONE;
  tagType=TAG_NONE;
  isTask=false;
  userImports.clear();
  root=null;
  prevNode=null;
  currentDepth=-1;
  step=1;
  stack.clear();
  super.parse(data,offset,length);
}

Fixed version (ground truth):
@Override public void parse(char[] data,int offset,int length){
  debug=btParser.debug > BehaviorTreeParser.DEBUG_NONE;
  tagType=TAG_NONE;
  isTask=false;
  userImports.clear();
  root=null;
  prevNode=null;
  currentDepth=-1;
  step=1;
  stack.clear();
  super.parse(data,offset,length);
  popAndcheckMinChildren(0);
  if (root == null)   throw new GdxRuntimeException("String_Node_Str");
}
Program: 28039
Project: 28039
Buggy source:
protected void setRandomNonOverlappingPosition(SteeringActor character,Array<SteeringActor> others,float minDistanceFromBoundary){
  int maxTries=Math.max(100,others.size * others.size);
  SET_NEW_POS:   while (--maxTries >= 0) {
    character.setCenterPosition(MathUtils.random(container.stageWidth),MathUtils.random(container.stageHeight));
    character.getPosition().set(character.getCenterX(),character.getCenterY());
    for (int i=0; i < others.size; i++) {
      SteeringActor other=(SteeringActor)others.get(i);
      if (character.getPosition().dst(other.getPosition()) <= character.getBoundingRadius() + other.getBoundingRadius() + minDistanceFromBoundary)       continue SET_NEW_POS;
    }
    return;
  }
  throw new GdxRuntimeException("String_Node_Str");
}

Fixed version (ground truth):
protected void setRandomNonOverlappingPosition(SteeringActor character,Array<SteeringActor> others,float minDistanceFromBoundary){
  int maxTries=Math.max(100,others.size * others.size);
  SET_NEW_POS:   while (--maxTries >= 0) {
    character.setPosition(MathUtils.random(container.stageWidth),MathUtils.random(container.stageHeight),Align.center);
    character.getPosition().set(character.getX(Align.center),character.getY(Align.center));
    for (int i=0; i < others.size; i++) {
      SteeringActor other=(SteeringActor)others.get(i);
      if (character.getPosition().dst(other.getPosition()) <= character.getBoundingRadius() + other.getBoundingRadius() + minDistanceFromBoundary)       continue SET_NEW_POS;
    }
    return;
  }
  throw new GdxRuntimeException("String_Node_Str");
}
Program: 28040
Project: 28040
Buggy source:
protected void setTargetPosition(int screenX,int screenY){
  Vector2 pos=target.getPosition();
  target.getStage().screenToStageCoordinates(pos.set(screenX,screenY));
  target.getParent().stageToLocalCoordinates(pos);
  target.setCenterPosition(pos.x,pos.y);
}

Fixed version (ground truth):
protected void setTargetPosition(int screenX,int screenY){
  Vector2 pos=target.getPosition();
  target.getStage().screenToStageCoordinates(pos.set(screenX,screenY));
  target.getParent().stageToLocalCoordinates(pos);
  target.setPosition(pos.x,pos.y,Align.center);
}
Program: 28041
Project: 28041
Buggy source:
@Override public void act(float delta){
  position.set(getCenterX(),getCenterY());
  if (steeringBehavior != null) {
    steeringBehavior.steer(steeringOutput);
    applySteering(steeringOutput,delta);
    wrapAround(position,getParent().getWidth(),getParent().getHeight());
    setCenterPosition(position.x,position.y);
  }
  super.act(delta);
}

Fixed version (ground truth):
@Override public void act(float delta){
  position.set(getX(Align.center),getY(Align.center));
  if (steeringBehavior != null) {
    steeringBehavior.steer(steeringOutput);
    applySteering(steeringOutput,delta);
    wrapAround(position,getParent().getWidth(),getParent().getHeight());
    setPosition(position.x,position.y,Align.center);
  }
  super.act(delta);
}
Program: 28051
Project: 28051
Buggy source:
@Override public void create(Table table){
  character=new SteeringActor(container.badlogicSmall,false);
  target=new SteeringActor(container.target);
  inputProcessor=new Scene2dTargetInputProcessor(target);
  character.setMaxLinearSpeed(250);
  character.setMaxLinearAcceleration(2000);
  final Seek<Vector2> seekSB=new Seek<Vector2>(character,target);
  character.setSteeringBehavior(seekSB);
  table.addActor(character);
  table.addActor(target);
  character.setCenterPosition(container.stageWidth / 2,container.stageHeight / 2);
  target.setCenterPosition(MathUtils.random(container.stageWidth),MathUtils.random(container.stageHeight));
  Table detailTable=new Table(container.skin);
  detailTable.row();
  addMaxLinearAccelerationController(detailTable,character,0,10000,20);
  detailTable.row();
  addSeparator(detailTable);
  detailTable.row();
  addMaxLinearSpeedController(detailTable,character);
  detailWindow=createDetailWindow(detailTable);
}

Fixed version (ground truth):
@Override public void create(Table table){
  character=new SteeringActor(container.badlogicSmall,false);
  target=new SteeringActor(container.target);
  inputProcessor=new Scene2dTargetInputProcessor(target);
  character.setMaxLinearSpeed(250);
  character.setMaxLinearAcceleration(2000);
  final Seek<Vector2> seekSB=new Seek<Vector2>(character,target);
  character.setSteeringBehavior(seekSB);
  table.addActor(character);
  table.addActor(target);
  character.setPosition(container.stageWidth / 2,container.stageHeight / 2,Align.center);
  target.setPosition(MathUtils.random(container.stageWidth),MathUtils.random(container.stageHeight),Align.center);
  Table detailTable=new Table(container.skin);
  detailTable.row();
  addMaxLinearAccelerationController(detailTable,character,0,10000,20);
  detailTable.row();
  addSeparator(detailTable);
  detailTable.row();
  addMaxLinearSpeedController(detailTable,character);
  detailWindow=createDetailWindow(detailTable);
}
Program: 28054
Project: 28054
Buggy source:
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=List.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class,required=true)},output={@HandlerOutput(name="String_Node_Str",type=List.class)}) public static void getAllSelectedTarget(HandlerContext handlerCtx){
  String prefix=(String)GuiUtil.getSessionValue("String_Node_Str");
  List<String> targetList=(List)handlerCtx.getInputValue("String_Node_Str");
  String resourceName=(String)handlerCtx.getInputValue("String_Node_Str");
  List<String> selectedTargetList=new ArrayList<>();
  String endpoint;
  for (  String targetName : targetList) {
    endpoint=prefix + CLUSTER + targetName+ RESOURCE_REF+ resourceName;
    boolean existsInCluster=isEndpointValid(endpoint);
    if (!existsInCluster) {
      endpoint=prefix + DEPLOYMENT_GROUP + targetName+ RESOURCE_REF+ resourceName;
      boolean existsInDeploymentGroup=isEndpointValid(endpoint);
      if (!existsInDeploymentGroup) {
        endpoint=prefix + SERVER + targetName+ RESOURCE_REF+ resourceName;
        boolean existsInServer=isEndpointValid(endpoint);
        if (existsInServer) {
          selectedTargetList.add(targetName);
        }
      }
      if (existsInDeploymentGroup) {
        selectedTargetList.add(targetName);
      }
    }
    if (existsInCluster) {
      selectedTargetList.add(targetName);
    }
  }
  handlerCtx.setOutputValue("String_Node_Str",selectedTargetList);
}

Fixed version (ground truth):
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=List.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class,required=true)},output={@HandlerOutput(name="String_Node_Str",type=List.class)}) public static void getAllSelectedTarget(HandlerContext handlerCtx){
  String prefix=(String)GuiUtil.getSessionValue(REST_URL);
  List<String> targetList=(List)handlerCtx.getInputValue("String_Node_Str");
  String resourceName=(String)handlerCtx.getInputValue(RESOURCE_NAME);
  List<String> selectedTargetList=new ArrayList<>();
  String endpoint;
  for (  String targetName : targetList) {
    endpoint=prefix + CLUSTER + targetName+ RESOURCE_REF+ resourceName;
    boolean existsInCluster=isEndpointValid(endpoint);
    if (!existsInCluster) {
      endpoint=prefix + DEPLOYMENT_GROUP + targetName+ RESOURCE_REF+ resourceName;
      boolean existsInDeploymentGroup=isEndpointValid(endpoint);
      if (!existsInDeploymentGroup) {
        endpoint=prefix + SERVER + targetName+ RESOURCE_REF+ resourceName;
        boolean existsInServer=isEndpointValid(endpoint);
        if (existsInServer) {
          selectedTargetList.add(targetName);
        }
      }
      if (existsInDeploymentGroup) {
        selectedTargetList.add(targetName);
      }
    }
    if (existsInCluster) {
      selectedTargetList.add(targetName);
    }
  }
  handlerCtx.setOutputValue("String_Node_Str",selectedTargetList);
}
Program: 28055
Project: 28055
Buggy source:
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=String.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class,required=true)},output={@HandlerOutput(name="String_Node_Str",type=Boolean.class)}) public static void isResourceInInstance(HandlerContext handlerCtx){
  String instanceName=(String)handlerCtx.getInputValue("String_Node_Str");
  String resourceName=(String)handlerCtx.getInputValue("String_Node_Str");
  String prefix=(String)GuiUtil.getSessionValue("String_Node_Str");
  String endpoint=prefix + SERVER + instanceName+ RESOURCE_REF;
  boolean isPresent=false;
  Map responseMap=RestUtil.restRequest(endpoint,null,"String_Node_Str",handlerCtx,false,true);
  Map data=(Map)responseMap.get("String_Node_Str");
  if (data != null) {
    Map extraProperties=(Map)data.get("String_Node_Str");
    if (extraProperties != null) {
      Map childResources=(Map)extraProperties.get("String_Node_Str");
      List<String> listOfResources=new ArrayList<String>(childResources.keySet());
      if (listOfResources.contains(resourceName)) {
        isPresent=true;
      }
    }
  }
  handlerCtx.setOutputValue("String_Node_Str",isPresent);
}

Fixed version (ground truth):
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=String.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class,required=true)},output={@HandlerOutput(name="String_Node_Str",type=Boolean.class)}) public static void isResourceInInstance(HandlerContext handlerCtx){
  String instanceName=(String)handlerCtx.getInputValue("String_Node_Str");
  String resourceName=(String)handlerCtx.getInputValue(RESOURCE_NAME);
  String prefix=(String)GuiUtil.getSessionValue(REST_URL);
  String endpoint=prefix + SERVER + instanceName+ RESOURCE_REF;
  boolean isPresent=false;
  Map responseMap=RestUtil.restRequest(endpoint,null,"String_Node_Str",handlerCtx,false,true);
  Map data=(Map)responseMap.get("String_Node_Str");
  if (data != null) {
    Map extraProperties=(Map)data.get("String_Node_Str");
    if (extraProperties != null) {
      Map childResources=(Map)extraProperties.get("String_Node_Str");
      List<String> listOfResources=new ArrayList<String>(childResources.keySet());
      if (listOfResources.contains(resourceName)) {
        isPresent=true;
      }
    }
  }
  handlerCtx.setOutputValue("String_Node_Str",isPresent);
}
Program: 28056
Project: 28056
Buggy source:
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=List.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class,required=true)},output={@HandlerOutput(name="String_Node_Str",type=Boolean.class)}) public static void isInstanceInDeploymentGroupWithResource(HandlerContext handlerCtx){
  List<String> selectedTargetList=(List)handlerCtx.getInputValue("String_Node_Str");
  String target=(String)handlerCtx.getInputValue("String_Node_Str");
  String prefix=(String)GuiUtil.getSessionValue("String_Node_Str");
  String resourceName=(String)handlerCtx.getInputValue("String_Node_Str");
  String endpoint;
  boolean isPresent=false;
  for (  String selectedTarget : selectedTargetList) {
    if (TargetUtil.isDeploymentGroup(selectedTarget)) {
      List<String> instancesInDeploymentGroup=TargetUtil.getDGInstances(selectedTarget);
      for (      String instance : instancesInDeploymentGroup) {
        if (instance.equals(target)) {
          endpoint=prefix + DEPLOYMENT_GROUP + selectedTarget+ RESOURCE_REF+ resourceName;
          if (isEndpointValid(endpoint)) {
            isPresent=true;
            break;
          }
        }
      }
    }
  }
  handlerCtx.setOutputValue("String_Node_Str",isPresent);
}

Fixed version (ground truth):
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=List.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class,required=true)},output={@HandlerOutput(name="String_Node_Str",type=Boolean.class)}) public static void isInstanceInDeploymentGroupWithResource(HandlerContext handlerCtx){
  List<String> selectedTargetList=(List)handlerCtx.getInputValue("String_Node_Str");
  String target=(String)handlerCtx.getInputValue("String_Node_Str");
  String prefix=(String)GuiUtil.getSessionValue(REST_URL);
  String resourceName=(String)handlerCtx.getInputValue(RESOURCE_NAME);
  String endpoint;
  boolean isPresent=false;
  for (  String selectedTarget : selectedTargetList) {
    if (TargetUtil.isDeploymentGroup(selectedTarget)) {
      List<String> instancesInDeploymentGroup=TargetUtil.getDGInstances(selectedTarget);
      for (      String instance : instancesInDeploymentGroup) {
        if (instance.equals(target)) {
          endpoint=prefix + DEPLOYMENT_GROUP + selectedTarget+ RESOURCE_REF+ resourceName;
          if (isEndpointValid(endpoint)) {
            isPresent=true;
            break;
          }
        }
      }
    }
  }
  handlerCtx.setOutputValue("String_Node_Str",isPresent);
}
Program: 28057
Project: 28057
Buggy source:
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=String.class)},output={@HandlerOutput(name="String_Node_Str",type=String.class)}) public static void getPageNumber(HandlerContext handlerCtx){
  String offsetValue=(String)handlerCtx.getInputValue("String_Node_Str");
  int result=0;
  try {
    int offSet=Integer.parseInt(offsetValue);
    result=(offSet + DEFAULT_OFFSET_INCREMENT) / DEFAULT_OFFSET_INCREMENT;
  }
 catch (  NumberFormatException ex) {
    GuiUtil.getLogger().info("String_Node_Str" + ex);
  }
  handlerCtx.setOutputValue("String_Node_Str",result);
}

Fixed version (ground truth):
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=String.class)},output={@HandlerOutput(name="String_Node_Str",type=String.class)}) public static void getPageNumber(HandlerContext handlerCtx){
  String offsetValue=(String)handlerCtx.getInputValue(OFFSET);
  int result=0;
  try {
    int offSet=Integer.parseInt(offsetValue);
    result=(offSet + DEFAULT_OFFSET_INCREMENT) / DEFAULT_OFFSET_INCREMENT;
  }
 catch (  NumberFormatException ex) {
    GuiUtil.getLogger().info(NUMBER_FORMAT_EXCEPTION_MESSAGE + ex);
  }
  handlerCtx.setOutputValue(RESULT,result);
}