nus-yam/ex-repair huggingface dataset:
Program: 8641
Project: 8641
Buggy source:
protected void processBody(Entity entity){
  PhysicsBodyComponent physicsBodyComponent=ComponentRetriever.get(entity,PhysicsBodyComponent.class);
  PolygonComponent polygonComponent=ComponentRetriever.get(entity,PolygonComponent.class);
  TransformComponent transformComponent=ComponentRetriever.get(entity,TransformComponent.class);
  if (polygonComponent == null && physicsBodyComponent.body != null) {
    world.destroyBody(physicsBodyComponent.body);
    physicsBodyComponent.body=null;
  }
  if (physicsBodyComponent.body == null && polygonComponent != null) {
    if (polygonComponent.vertices == null)     return;
    PhysicsBodyComponent bodyPropertiesComponent=ComponentRetriever.get(entity,PhysicsBodyComponent.class);
    physicsBodyComponent.body=PhysicsBodyLoader.getInstance().createBody(world,bodyPropertiesComponent,polygonComponent.vertices,new Vector2(1,1));
    physicsBodyComponent.body.setTransform(new Vector2(transformComponent.x * PhysicsBodyLoader.getScale(),transformComponent.y * PhysicsBodyLoader.getScale()),physicsBodyComponent.body.getAngle());
    physicsBodyComponent.body.setUserData(entity);
  }
}

Fixed version (ground truth):
protected void processBody(Entity entity){
  PhysicsBodyComponent physicsBodyComponent=ComponentRetriever.get(entity,PhysicsBodyComponent.class);
  PolygonComponent polygonComponent=ComponentRetriever.get(entity,PolygonComponent.class);
  TransformComponent transformComponent=ComponentRetriever.get(entity,TransformComponent.class);
  if (polygonComponent == null && physicsBodyComponent.body != null) {
    world.destroyBody(physicsBodyComponent.body);
    physicsBodyComponent.body=null;
  }
  if (physicsBodyComponent.body == null && polygonComponent != null) {
    if (polygonComponent.vertices == null)     return;
    DimensionsComponent dimensionsComponent=ComponentRetriever.get(entity,DimensionsComponent.class);
    physicsBodyComponent.centerX=dimensionsComponent.width / 2;
    physicsBodyComponent.centerY=dimensionsComponent.height / 2;
    PhysicsBodyComponent bodyPropertiesComponent=ComponentRetriever.get(entity,PhysicsBodyComponent.class);
    physicsBodyComponent.body=PhysicsBodyLoader.getInstance().createBody(world,bodyPropertiesComponent,polygonComponent.vertices,new Vector2(1,1),transformComponent.rotation * MathUtils.degreesToRadians);
    physicsBodyComponent.body.setTransform(new Vector2(transformComponent.x * PhysicsBodyLoader.getScale(),transformComponent.y * PhysicsBodyLoader.getScale()),physicsBodyComponent.body.getAngle());
    physicsBodyComponent.body.setUserData(entity);
  }
}
Program: 8643
Project: 8643
Buggy source:
private void addEntityRemoveListener(){
  engine.addEntityListener(new EntityListener(){
    @Override public void entityAdded(    Entity entity){
      ScriptComponent scriptComponent=entity.getComponent(ScriptComponent.class);
      if (scriptComponent != null) {
        for (        IScript script : scriptComponent.scripts) {
          script.init(entity);
        }
      }
    }
    @Override public void entityRemoved(    Entity entity){
      ParentNodeComponent parentComponent=ComponentRetriever.get(entity,ParentNodeComponent.class);
      if (parentComponent == null) {
        return;
      }
      Entity parentEntity=parentComponent.parentEntity;
      NodeComponent parentNodeComponent=ComponentRetriever.get(parentEntity,NodeComponent.class);
      parentNodeComponent.removeChild(entity);
      NodeComponent nodeComponent=ComponentRetriever.get(entity,NodeComponent.class);
      if (nodeComponent != null) {
        for (        Entity node : nodeComponent.children) {
          engine.removeEntity(node);
        }
      }
      PhysicsBodyComponent physicsBodyComponent=ComponentRetriever.get(entity,PhysicsBodyComponent.class);
      if (physicsBodyComponent != null) {
        world.destroyBody(physicsBodyComponent.body);
      }
      LightObjectComponent lightObjectComponent=ComponentRetriever.get(entity,LightObjectComponent.class);
      if (lightObjectComponent != null) {
        lightObjectComponent.lightObject.remove(true);
      }
    }
  }
);
}

Fixed version (ground truth):
private void addEntityRemoveListener(){
  engine.addEntityListener(new EntityListener(){
    @Override public void entityAdded(    Entity entity){
      ScriptComponent scriptComponent=entity.getComponent(ScriptComponent.class);
      if (scriptComponent != null) {
        for (        IScript script : scriptComponent.scripts) {
          script.init(entity);
        }
      }
    }
    @Override public void entityRemoved(    Entity entity){
      ParentNodeComponent parentComponent=ComponentRetriever.get(entity,ParentNodeComponent.class);
      if (parentComponent == null) {
        return;
      }
      Entity parentEntity=parentComponent.parentEntity;
      NodeComponent parentNodeComponent=ComponentRetriever.get(parentEntity,NodeComponent.class);
      parentNodeComponent.removeChild(entity);
      NodeComponent nodeComponent=ComponentRetriever.get(entity,NodeComponent.class);
      if (nodeComponent != null) {
        for (        Entity node : nodeComponent.children) {
          engine.removeEntity(node);
        }
      }
      PhysicsBodyComponent physicsBodyComponent=ComponentRetriever.get(entity,PhysicsBodyComponent.class);
      if (physicsBodyComponent != null && physicsBodyComponent.body != null) {
        world.destroyBody(physicsBodyComponent.body);
      }
      LightObjectComponent lightObjectComponent=ComponentRetriever.get(entity,LightObjectComponent.class);
      if (lightObjectComponent != null) {
        lightObjectComponent.lightObject.remove(true);
      }
    }
  }
);
}
Program: 8644
Project: 8644
Buggy source:
@Override public void entityRemoved(Entity entity){
  ParentNodeComponent parentComponent=ComponentRetriever.get(entity,ParentNodeComponent.class);
  if (parentComponent == null) {
    return;
  }
  Entity parentEntity=parentComponent.parentEntity;
  NodeComponent parentNodeComponent=ComponentRetriever.get(parentEntity,NodeComponent.class);
  parentNodeComponent.removeChild(entity);
  NodeComponent nodeComponent=ComponentRetriever.get(entity,NodeComponent.class);
  if (nodeComponent != null) {
    for (    Entity node : nodeComponent.children) {
      engine.removeEntity(node);
    }
  }
  PhysicsBodyComponent physicsBodyComponent=ComponentRetriever.get(entity,PhysicsBodyComponent.class);
  if (physicsBodyComponent != null) {
    world.destroyBody(physicsBodyComponent.body);
  }
  LightObjectComponent lightObjectComponent=ComponentRetriever.get(entity,LightObjectComponent.class);
  if (lightObjectComponent != null) {
    lightObjectComponent.lightObject.remove(true);
  }
}

Fixed version (ground truth):
@Override public void entityRemoved(Entity entity){
  ParentNodeComponent parentComponent=ComponentRetriever.get(entity,ParentNodeComponent.class);
  if (parentComponent == null) {
    return;
  }
  Entity parentEntity=parentComponent.parentEntity;
  NodeComponent parentNodeComponent=ComponentRetriever.get(parentEntity,NodeComponent.class);
  parentNodeComponent.removeChild(entity);
  NodeComponent nodeComponent=ComponentRetriever.get(entity,NodeComponent.class);
  if (nodeComponent != null) {
    for (    Entity node : nodeComponent.children) {
      engine.removeEntity(node);
    }
  }
  PhysicsBodyComponent physicsBodyComponent=ComponentRetriever.get(entity,PhysicsBodyComponent.class);
  if (physicsBodyComponent != null && physicsBodyComponent.body != null) {
    world.destroyBody(physicsBodyComponent.body);
  }
  LightObjectComponent lightObjectComponent=ComponentRetriever.get(entity,LightObjectComponent.class);
  if (lightObjectComponent != null) {
    lightObjectComponent.lightObject.remove(true);
  }
}
Program: 8645
Project: 8645
Buggy source:
public void addParentComponent(Entity entity,Entity root){
  ParentNodeComponent parentNodeComponent=new ParentNodeComponent();
  parentNodeComponent.parentEntity=root;
  entity.add(parentNodeComponent);
  NodeComponent nodeComponent=nodeComponentMapper.get(root);
  nodeComponent.children.add(entity);
}

Fixed version (ground truth):
public void addParentComponent(Entity entity,Entity root){
  ParentNodeComponent parentNodeComponent=new ParentNodeComponent();
  parentNodeComponent.parentEntity=root;
  entity.add(parentNodeComponent);
  NodeComponent nodeComponent=nodeComponentMapper.get(root);
  nodeComponent.children.add(entity);
  if (entity.flags == COMPOSITE_TYPE) {
    NodeComponent node=new NodeComponent();
    entity.add(node);
  }
}
Program: 8646
Project: 8646
Buggy source:
public void addPhysicsComponents(Entity entity,MainItemVO vo){
  PhysicsBodyPropertiesComponent pysicsComponent=new PhysicsBodyPropertiesComponent();
  pysicsComponent.allowSleep=vo.physicsBodyData.allowSleep;
  pysicsComponent.awake=vo.physicsBodyData.awake;
  pysicsComponent.bodyType=vo.physicsBodyData.bodyType;
  pysicsComponent.bullet=vo.physicsBodyData.bullet;
  pysicsComponent.centerOfMass=vo.physicsBodyData.centerOfMass;
  pysicsComponent.damping=vo.physicsBodyData.damping;
  pysicsComponent.density=vo.physicsBodyData.density;
  pysicsComponent.friction=vo.physicsBodyData.friction;
  pysicsComponent.gravityScale=vo.physicsBodyData.gravityScale;
  pysicsComponent.mass=vo.physicsBodyData.mass;
  pysicsComponent.restitution=vo.physicsBodyData.restitution;
  pysicsComponent.rotationalInertia=vo.physicsBodyData.rotationalInertia;
  MeshComponont meshComponent=new MeshComponont();
  meshComponent.meshId=vo.meshId;
  meshComponent.minPolygonData=rm.getProjectVO().meshes.get(vo.meshId).minPolygonData;
  PhysicsBodyComponent bodyComponent=new PhysicsBodyComponent();
  bodyComponent.body=PhysicsBodyLoader.createBody(world,pysicsComponent,meshComponent.minPolygonData,new Vector2(1,1));
  entity.add(pysicsComponent);
  entity.add(meshComponent);
  entity.add(bodyComponent);
}

Fixed version (ground truth):
public void addPhysicsComponents(Entity entity,MainItemVO vo){
  if (vo.physicsBodyData == null) {
    return;
  }
  PhysicsBodyPropertiesComponent pysicsComponent=new PhysicsBodyPropertiesComponent();
  pysicsComponent.allowSleep=vo.physicsBodyData.allowSleep;
  pysicsComponent.awake=vo.physicsBodyData.awake;
  pysicsComponent.bodyType=vo.physicsBodyData.bodyType;
  pysicsComponent.bullet=vo.physicsBodyData.bullet;
  pysicsComponent.centerOfMass=vo.physicsBodyData.centerOfMass;
  pysicsComponent.damping=vo.physicsBodyData.damping;
  pysicsComponent.density=vo.physicsBodyData.density;
  pysicsComponent.friction=vo.physicsBodyData.friction;
  pysicsComponent.gravityScale=vo.physicsBodyData.gravityScale;
  pysicsComponent.mass=vo.physicsBodyData.mass;
  pysicsComponent.restitution=vo.physicsBodyData.restitution;
  pysicsComponent.rotationalInertia=vo.physicsBodyData.rotationalInertia;
  MeshComponont meshComponent=new MeshComponont();
  meshComponent.meshId=vo.meshId;
  meshComponent.minPolygonData=rm.getProjectVO().meshes.get(vo.meshId).minPolygonData;
  PhysicsBodyComponent bodyComponent=new PhysicsBodyComponent();
  bodyComponent.body=PhysicsBodyLoader.createBody(world,pysicsComponent,meshComponent.minPolygonData,new Vector2(1,1));
  entity.add(pysicsComponent);
  entity.add(meshComponent);
  entity.add(bodyComponent);
}
Program: 8647
Project: 8647
Buggy source:
public EntityFactory(RayHandler rayHandler,World world,ResourceManager rm){
  this.rayHandler=rayHandler;
  this.world=world;
  this.rm=rm;
  nodeComponentMapper=ComponentMapper.getFor(NodeComponent.class);
}

Fixed version (ground truth):
public EntityFactory(RayHandler rayHandler,World world,IResourceRetriever rm){
  this.rayHandler=rayHandler;
  this.world=world;
  this.rm=rm;
  nodeComponentMapper=ComponentMapper.getFor(NodeComponent.class);
}
Program: 8648
Project: 8648
Buggy source:
public Entity createEntity(Entity root,CompositeItemVO vo){
  Entity entity=new Entity();
  addCommonComponents(entity,vo);
  addParentComponent(entity,root);
  addPhysicsComponents(entity,vo);
  entity.flags=COMPOSITE_TYPE;
  return entity;
}

Fixed version (ground truth):
public Entity createEntity(Entity root,CompositeItemVO vo){
  Entity entity=new Entity();
  entity.flags=COMPOSITE_TYPE;
  addCommonComponents(entity,vo,vo.composite);
  addParentComponent(entity,root);
  addPhysicsComponents(entity,vo);
  return entity;
}
Program: 8649
Project: 8649
Buggy source:
public void setEntity(int i){
  currentEntityIndex=i;
  updateDataVO();
  initPlayer();
}

Fixed version (ground truth):
public void setEntity(int i){
  currentEntityIndex=i;
  setAnimation(0);
  updateDataVO();
  initPlayer();
}
Program: 8650
Project: 8650
Buggy source:
@Override public void draw(Batch batch,float parentAlpha){
  batch.setColor(1,1,1,parentAlpha * getColor().a);
  super.draw(batch,parentAlpha);
  player.setPosition(getX(),getY());
  player.setScale(dataVO.scale * this.mulX);
  player.rotate(getRotation() - player.getAngle());
  drawer.beforeDraw(player,batch);
}

Fixed version (ground truth):
@Override public void draw(Batch batch,float parentAlpha){
  batch.setColor(1,1,1,parentAlpha * getColor().a);
  super.draw(batch,parentAlpha);
  player.setPosition(getX(),getY());
  player.setPivot(getWidth() / 2,getHeight() / 2);
  player.setScale(dataVO.scale * this.mulX);
  player.rotate(getRotation() - player.getAngle());
  drawer.beforeDraw(player,batch);
}
Program: 8651
Project: 8651
Buggy source:
@Override protected Sprite loadResource(FileReference ref){
  FileHandle f;
  String filename=new File(data.getFile(ref).name).getName();
  String path=super.root + "String_Node_Str" + filename;
switch (Gdx.app.getType()) {
case iOS:
    f=Gdx.files.absolute(path);
  break;
default :
f=Gdx.files.internal(path);
break;
}
if (!f.exists()) throw new GdxRuntimeException("String_Node_Str" + path + "String_Node_Str");
if (this.packer == null && this.pack) this.packer=new PixmapPacker(this.atlasWidth,this.atlasHeight,Pixmap.Format.RGBA8888,2,true);
final Pixmap pix=new Pixmap(f);
this.pixmaps.put(ref,pix);
return null;
}

Fixed version (ground truth):
@Override protected Sprite loadResource(FileReference ref){
  FileHandle f;
  String filename=new File(data.getFile(ref).name).getName();
  String path=super.root + "String_Node_Str" + filename;
  System.out.println(path);
switch (Gdx.app.getType()) {
case iOS:
    f=Gdx.files.absolute(path);
  break;
default :
f=Gdx.files.internal(path);
break;
}
if (!f.exists()) throw new GdxRuntimeException("String_Node_Str" + path + "String_Node_Str");
if (this.packer == null && this.pack) this.packer=new PixmapPacker(this.atlasWidth,this.atlasHeight,Pixmap.Format.RGBA8888,2,true);
final Pixmap pix=new Pixmap(f);
this.pixmaps.put(ref,pix);
return null;
}
Program: 8652
Project: 8652
Buggy source:
@Override public void updateDataVO(){
  dataVO.x=getX() / this.mulX;
  dataVO.y=getY() / this.mulY;
  dataVO.rotation=getRotation();
  if (getZIndex() >= 0) {
    dataVO.zIndex=getZIndex();
  }
  if (dataVO.layerName == null || dataVO.layerName.equals("String_Node_Str")) {
    dataVO.layerName="String_Node_Str";
  }
  for (int i=0; i < items.size(); i++) {
    items.get(i).updateDataVO();
  }
  sortZindexes();
  dataVO.customVars=customVariables.saveAsString();
}

Fixed version (ground truth):
@Override public void updateDataVO(){
  dataVO.x=getX() / this.mulX;
  dataVO.y=getY() / this.mulY;
  dataVO.rotation=getRotation();
  if (getZIndex() >= 0) {
    dataVO.zIndex=getZIndex();
  }
  if (dataVO.layerName == null || dataVO.layerName.equals("String_Node_Str")) {
    dataVO.layerName="String_Node_Str";
  }
  for (int i=0; i < items.size(); i++) {
    items.get(i).updateDataVO();
  }
  sortZindexes();
  dataVO.scaleX=getScaleX();
  dataVO.scaleY=getScaleY();
  dataVO.customVars=customVariables.saveAsString();
}
Program: 8654
Project: 8654
Buggy source:
private void initStage(){
  RayHandler.setGammaCorrection(true);
  RayHandler.useDiffuseLight(true);
  rayHandler=new RayHandler(null);
  rayHandler.setAmbientLight(0.5f,0.5f,0.5f,1f);
  rayHandler.setCulling(true);
  rayHandler.setBlur(true);
  rayHandler.setBlurNum(3);
  rayHandler.setShadows(true);
  rayHandler.setCombinedMatrix(getCamera().combined);
  skeletonRenderer=new SkeletonRenderer();
  essentials.rayHandler=rayHandler;
  SpineReflectionHelper refdata=new SpineReflectionHelper();
  if (refdata.isSpineAviable) {
    essentials.spineReflectionHelper=refdata;
  }
}

Fixed version (ground truth):
private void initStage(){
  RayHandler.setGammaCorrection(true);
  RayHandler.useDiffuseLight(true);
  rayHandler=new RayHandler(null);
  rayHandler.setAmbientLight(0.5f,0.5f,0.5f,1f);
  rayHandler.setCulling(true);
  rayHandler.setBlur(true);
  rayHandler.setBlurNum(3);
  rayHandler.setShadows(true);
  rayHandler.setCombinedMatrix(getCamera().combined);
  essentials.rayHandler=rayHandler;
  SpineReflectionHelper refdata=new SpineReflectionHelper();
  if (refdata.isSpineAviable) {
    essentials.spineReflectionHelper=refdata;
  }
}
Program: 8655
Project: 8655
Buggy source:
/** 
 * Set the state of this component to the given value, applying the corresponding animation, if possible.
 * @param checked The component state.
 */
public void setChecked(boolean checked){
  mChecked=checked;
  mViewFlipper.setDisplayedChild(checked ? STATUS_CHECKED : STATUS_NOT_CHECKED);
  if (checked)   mIVAccept.startAnimation(acceptAnimation);
  mOnCheckedChangeListener.onCheckedChanged(this,mChecked);
}

Fixed version (ground truth):
/** 
 * Set the state of this component to the given value, applying the corresponding animation, if possible.
 * @param checked The component state.
 */
public void setChecked(boolean checked){
  mChecked=checked;
  mViewFlipper.setDisplayedChild(checked ? STATUS_CHECKED : STATUS_NOT_CHECKED);
  if (isChecked())   mIVAccept.startAnimation(acceptAnimation);
  mOnCheckedChangeListener.onCheckedChanged(this,isChecked());
}
Program: 8656
Project: 8656
Buggy source:
/** 
 * Set the state of this component to the given value, without applying the corresponding animation.
 * @param checked The component state.
 */
public void setCheckedInmediate(boolean checked){
  mChecked=checked;
  if (mViewFlipper.getInAnimation() != null)   mViewFlipper.setInAnimation(null);
  if (mViewFlipper.getOutAnimation() != null)   mViewFlipper.setOutAnimation(null);
  mViewFlipper.setDisplayedChild(checked ? STATUS_CHECKED : STATUS_NOT_CHECKED);
  initInAnimation();
  initOutAnimation();
  mOnCheckedChangeListener.onCheckedChanged(this,mChecked);
}

Fixed version (ground truth):
/** 
 * Set the state of this component to the given value, without applying the corresponding animation, and without firing an event.
 * @param checked The component state.
 */
public void setCheckedInmediate(boolean checked){
  mChecked=checked;
  if (mViewFlipper.getInAnimation() != null)   mViewFlipper.setInAnimation(null);
  if (mViewFlipper.getOutAnimation() != null)   mViewFlipper.setOutAnimation(null);
  mViewFlipper.setDisplayedChild(checked ? STATUS_CHECKED : STATUS_NOT_CHECKED);
  initInAnimation();
  initOutAnimation();
}
Program: 8657
Project: 8657
Buggy source:
@Override public void init(ServletConfig config) throws ServletException {
  super.init(config);
  pickUpSharedManagerIfExists(config);
  String urlPrefix=config.getInitParameter(URL_PREFIX_INIT_PARAMETER);
  initRequestProcessor(urlPrefix);
  String pluginClasses=config.getInitParameter(PLUGIN_CLASSES_INIT_PARAMETER);
  if (pluginClasses != null) {
    requestProcessor.getPluginManager().addPlugins(pluginClasses);
  }
}

Fixed version (ground truth):
@Override public void init(ServletConfig config) throws ServletException {
  super.init(config);
  pickUpSharedManagerIfExists(config);
  String urlPrefix=config.getInitParameter(URL_PREFIX_INIT_PARAMETER);
  String pluginClasses=config.getInitParameter(PLUGIN_CLASSES_INIT_PARAMETER);
  initRequestProcessor(urlPrefix,pluginClasses);
}
Program: 8658
Project: 8658
Buggy source:
public void initRequestProcessor(String urlPrefix){
  if (urlPrefix == null) {
    urlPrefix="String_Node_Str";
  }
 else {
    urlPrefix=urlPrefix.trim();
  }
  requestProcessor=new SimonConsoleRequestProcessor(urlPrefix);
  requestProcessor.initActionBindings();
}

Fixed version (ground truth):
public void initRequestProcessor(String urlPrefix,String pluginClasses){
  if (urlPrefix == null) {
    urlPrefix="String_Node_Str";
  }
 else {
    urlPrefix=urlPrefix.trim();
  }
  requestProcessor=new SimonConsoleRequestProcessor(urlPrefix);
  if (pluginClasses != null) {
    requestProcessor.getPluginManager().addPlugins(pluginClasses);
  }
  requestProcessor.initActionBindings();
}
Program: 8659
Project: 8659
Buggy source:
@Override public void execute() throws ServletException, IOException, ActionException {
  InputStream resourceIStream=null;
  try {
    resourceIStream=getClass().getResourceAsStream("String_Node_Str" + resourcePath);
    if (resourceIStream == null) {
      getContext().getResponse().sendError(HttpServletResponse.SC_NOT_FOUND);
      throw new ActionException("String_Node_Str" + resourcePath + "String_Node_Str");
    }
    String extension=resourcePath.substring(resourcePath.lastIndexOf('.') + 1).toLowerCase();
    String contentType=CONTENT_TYPES.get(extension);
    if (contentType != null) {
      getContext().setContentType(contentType);
      if (contentType.startsWith("String_Node_Str")) {
        getContext().getResponse().setCharacterEncoding("String_Node_Str");
      }
    }
    getContext().getResponse().setHeader("String_Node_Str","String_Node_Str");
    copyStream(resourceIStream);
  }
  finally {
    if (resourceIStream != null) {
      resourceIStream.close();
    }
  }
}

Fixed version (ground truth):
@Override public void execute() throws ServletException, IOException, ActionException {
  InputStream resourceIStream=null;
  try {
    resourceIStream=getClass().getResourceAsStream("String_Node_Str" + resourcePath);
    if (resourceIStream == null) {
      getContext().getResponse().setStatus(HttpServletResponse.SC_NOT_FOUND);
      throw new ActionException("String_Node_Str" + resourcePath + "String_Node_Str");
    }
    String extension=resourcePath.substring(resourcePath.lastIndexOf('.') + 1).toLowerCase();
    String contentType=CONTENT_TYPES.get(extension);
    if (contentType != null) {
      getContext().setContentType(contentType);
      if (contentType.startsWith("String_Node_Str")) {
        getContext().getResponse().setCharacterEncoding("String_Node_Str");
      }
    }
    getContext().getResponse().setHeader("String_Node_Str","String_Node_Str");
    copyStream(resourceIStream);
  }
  finally {
    if (resourceIStream != null) {
      resourceIStream.close();
    }
  }
}
Program: 8660
Project: 8660
Buggy source:
/** 
 * Factory method that creates Stopwatch name pattern - or returns   {@code null} if parameter is {@code null}.
 * @param pattern Stopwatch name pattern as string
 * @return Stopwatch name pattern or {@code null} if pattern parameter is {@code null}
 */
public static SimonPattern createForStopwatch(String pattern){
  return createForType(pattern,Stopwatch.class);
}

Fixed version (ground truth):
/** 
 * Factory method that creates Stopwatch name pattern - or returns a pattern that accepts all Stopwatches if parameter is   {@code null}.
 * @param pattern Stopwatch name pattern as string
 * @return Stopwatch name pattern
 */
public static SimonPattern createForStopwatch(String pattern){
  return createForType(pattern,Stopwatch.class);
}
Program: 8661
Project: 8661
Buggy source:
/** 
 * Factory method that creates Simon name pattern - or returns   {@code null} if parameter is {@code null}.
 * @param pattern Simon name pattern as string
 * @return Simon name pattern or {@code null} if pattern parameter is {@code null}
 */
public static SimonPattern create(String pattern){
  return createForType(pattern,Simon.class);
}

Fixed version (ground truth):
/** 
 * Factory method that creates Simon name pattern - or returns   {@code null} if parameter is {@code null}.
 * @param pattern Simon name pattern as string
 * @return Simon name pattern or {@code null} if pattern parameter is {@code null}
 */
public static SimonPattern create(String pattern){
  if (pattern == null) {
    return null;
  }
  return createForType(pattern,Simon.class);
}
Program: 8662
Project: 8662
Buggy source:
/** 
 * Factory method that creates Counter name pattern - or returns   {@code null} if parameter is {@code null}.
 * @param pattern Counter name pattern as string
 * @return Counter name pattern or {@code null} if pattern parameter is {@code null}
 */
public static SimonPattern createForCounter(String pattern){
  return createForType(pattern,Counter.class);
}

Fixed version (ground truth):
/** 
 * Factory method that creates Counter name pattern - or returns a pattern that accepts all Counters if parameter is   {@code null}.
 * @param pattern Counter name pattern as string
 * @return Counter name pattern
 */
public static SimonPattern createForCounter(String pattern){
  return createForType(pattern,Counter.class);
}
Program: 8663
Project: 8663
Buggy source:
private static SimonPattern createForType(String pattern,Class<? extends Simon> expectedType){
  if (pattern == null) {
    return null;
  }
  return new SimonPattern(pattern,expectedType);
}

Fixed version (ground truth):
private static SimonPattern createForType(String pattern,Class<? extends Simon> expectedType){
  if (pattern == null) {
    return new SimonPattern("String_Node_Str",expectedType);
  }
  return new SimonPattern(pattern,expectedType);
}
Program: 8664
Project: 8664
Buggy source:
protected String getParameter(String name){
  return getRequest().getParameter(name);
}

Fixed version (ground truth):
protected String getParameter(String name){
  String value=getRequest().getParameter(name);
  if (value != null) {
    try {
      value=URLDecoder.decode(value,getCharacterEncoding());
    }
 catch (    UnsupportedEncodingException unsupportedEncodingException) {
    }
  }
  return value;
}
Program: 8665
Project: 8665
Buggy source:
/** 
 * Add basic simons A, B, C and X. X is used to test Counter rendering
 */
private void addDefaultSimons(){
  SimonData.initialize();
}

Fixed version (ground truth):
/** 
 * Add basic simons A, B, C and X. X is used to test Counter rendering
 */
private void addDefaultSimons(){
  SimonData.initialize();
  addStopwatchSplits(SimonManager.getStopwatch("String_Node_Str"),5);
}
Program: 8667
Project: 8667
Buggy source:
/** 
 * Class constructor. It loads well known driver list from resource file drivers.properties.
 */
public Driver(){
  try {
    InputStream stream=null;
    try {
      stream=Thread.currentThread().getContextClassLoader().getResourceAsStream("String_Node_Str");
      drivers.load(stream);
    }
  finally {
      if (stream != null) {
        stream.close();
      }
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * Class constructor. It loads well known driver list from resource file drivers.properties.
 */
public Driver(){
}
Program: 8668
Project: 8668
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean acceptsURL(String url) throws SQLException {
  return url != null && url.toLowerCase().startsWith(Url.SIMON_JDBC);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean acceptsURL(String url) throws SQLException {
  return SimonConnectionConfiguration.isSimonUrl(url);
}
Program: 8669
Project: 8669
Buggy source:
/** 
 * Returns fully qualified class name of the real driver.
 * @return driver class FQN
 */
public String getRealDriver(){
  return realDriver;
}

Fixed version (ground truth):
/** 
 * Tries to determine driver class, instantiate it and register if already not registered. For more detail look at   {@link org.javasimon.jdbc4.Driver} class javadoc.
 * @param configuration instance of url object that represents url
 * @param info parameters from {@link #connect(String,java.util.Properties)} method
 * @return instance of real driver
 * @throws java.sql.SQLException if real driver can't be determined or is not registerd
 */
private java.sql.Driver getRealDriver(SimonConnectionConfiguration configuration,Properties info) throws SQLException {
  java.sql.Driver drv=null;
  try {
    drv=DriverManager.getDriver(configuration.getRealUrl());
  }
 catch (  SQLException e) {
  }
  if (drv == null && info != null && info.keySet().contains(SimonConnectionConfiguration.REAL_DRIVER)) {
    drv=registerDriver(info.getProperty(SimonConnectionConfiguration.REAL_DRIVER));
  }
  if (drv == null && configuration.getRealDriver() != null) {
    drv=registerDriver(configuration.getRealDriver());
  }
  if (drv == null) {
    if (configuration.getRealDriver() != null) {
      drv=registerDriver(configuration.getRealDriver());
    }
  }
  if (drv == null) {
    throw new SQLException("String_Node_Str");
  }
  return drv;
}
Program: 8670
Project: 8670
Buggy source:
/** 
 * Opens new Simon proxy driver connection associated with real connection to the specified database.
 * @param simonUrl JDBC connection string (i.e. jdbc:simon:h2:file:test)
 * @param info properties for connection
 * @return open connection to database or null if provided url is not accepted by this driver
 * @throws java.sql.SQLException if there is no real driver registered/recognized or opening real connection fails
 * @see org.javasimon.jdbc4.Driver
 */
@Override public Connection connect(String simonUrl,Properties info) throws SQLException {
  if (!acceptsURL(simonUrl)) {
    return null;
  }
  Url url=new Url(simonUrl);
  java.sql.Driver driver=getRealDriver(url,info);
  return new SimonConnection(driver.connect(url.getRealUrl(),info),url.getPrefix());
}

Fixed version (ground truth):
/** 
 * Opens new Simon proxy driver connection associated with real connection to the specified database.
 * @param simonUrl JDBC connection string (i.e. jdbc:simon:h2:file:test)
 * @param info properties for connection
 * @return open connection to database or null if provided url is not accepted by this driver
 * @throws java.sql.SQLException if there is no real driver registered/recognized or opening real connection fails
 * @see org.javasimon.jdbc4.Driver
 */
@Override public Connection connect(String simonUrl,Properties info) throws SQLException {
  if (!acceptsURL(simonUrl)) {
    return null;
  }
  SimonConnectionConfiguration url=new SimonConnectionConfiguration(simonUrl);
  java.sql.Driver driver=getRealDriver(url,info);
  return new SimonConnection(driver.connect(url.getRealUrl(),info),url.getPrefix());
}
Program: 8672
Project: 8672
Buggy source:
/** 
 * Class constructor. It loads well known driver list from resource file drivers.properties.
 */
public Driver(){
  try {
    InputStream stream=null;
    try {
      stream=Thread.currentThread().getContextClassLoader().getResourceAsStream("String_Node_Str");
      drivers.load(stream);
    }
  finally {
      if (stream != null) {
        stream.close();
      }
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * Class constructor. It loads well known driver list from resource file drivers.properties.
 */
public Driver(){
}
Program: 8673
Project: 8673
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean acceptsURL(String url) throws SQLException {
  return url != null && url.toLowerCase().startsWith(Url.SIMON_JDBC);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean acceptsURL(String url) throws SQLException {
  return SimonConnectionConfiguration.isSimonUrl(url);
}
Program: 8674
Project: 8674
Buggy source:
/** 
 * Returns fully qualified class name of the real driver.
 * @return driver class FQN
 */
public String getRealDriver(){
  return realDriver;
}

Fixed version (ground truth):
/** 
 * Tries to determine driver class, instantiate it and register if already not registered. For more detail look at   {@link org.javasimon.jdbc4.Driver} class javadoc.
 * @param configuration instance of url object that represents url
 * @param info parameters from {@link #connect(String,java.util.Properties)} method
 * @return instance of real driver
 * @throws java.sql.SQLException if real driver can't be determined or is not registerd
 */
private java.sql.Driver getRealDriver(SimonConnectionConfiguration configuration,Properties info) throws SQLException {
  java.sql.Driver drv=null;
  try {
    drv=DriverManager.getDriver(configuration.getRealUrl());
  }
 catch (  SQLException e) {
  }
  if (drv == null && info != null && info.keySet().contains(SimonConnectionConfiguration.REAL_DRIVER)) {
    drv=registerDriver(info.getProperty(SimonConnectionConfiguration.REAL_DRIVER));
  }
  if (drv == null && configuration.getRealDriver() != null) {
    drv=registerDriver(configuration.getRealDriver());
  }
  if (drv == null) {
    if (configuration.getRealDriver() != null) {
      drv=registerDriver(configuration.getRealDriver());
    }
  }
  if (drv == null) {
    throw new SQLException("String_Node_Str");
  }
  return drv;
}
Program: 8675
Project: 8675
Buggy source:
/** 
 * Opens new Simon proxy driver connection associated with real connection to the specified database.
 * @param simonUrl JDBC connection string (i.e. jdbc:simon:h2:file:test)
 * @param info properties for connection
 * @return open connection to database or null if provided url is not accepted by this driver
 * @throws java.sql.SQLException if there is no real driver registered/recognized or opening real connection fails
 * @see org.javasimon.jdbc4.Driver
 */
@Override public Connection connect(String simonUrl,Properties info) throws SQLException {
  if (!acceptsURL(simonUrl)) {
    return null;
  }
  Url url=new Url(simonUrl);
  java.sql.Driver driver=getRealDriver(url,info);
  return new SimonConnection(driver.connect(url.getRealUrl(),info),url.getPrefix());
}

Fixed version (ground truth):
/** 
 * Opens new Simon proxy driver connection associated with real connection to the specified database.
 * @param simonUrl JDBC connection string (i.e. jdbc:simon:h2:file:test)
 * @param info properties for connection
 * @return open connection to database or null if provided url is not accepted by this driver
 * @throws java.sql.SQLException if there is no real driver registered/recognized or opening real connection fails
 * @see org.javasimon.jdbc4.Driver
 */
@Override public Connection connect(String simonUrl,Properties info) throws SQLException {
  if (!acceptsURL(simonUrl)) {
    return null;
  }
  SimonConnectionConfiguration url=new SimonConnectionConfiguration(simonUrl);
  java.sql.Driver driver=getRealDriver(url,info);
  return new SimonConnection(driver.connect(url.getRealUrl(),info),url.getPrefix());
}
Program: 8676
Project: 8676
Buggy source:
private Simon getOrCreateSimon(String name,Class<? extends AbstractSimon> simonClass){
  if (name == null) {
    return newSimon(null,simonClass);
  }
  if (name.equals(ROOT_SIMON_NAME)) {
    throw new SimonException("String_Node_Str");
  }
  AbstractSimon simon=allSimons.get(name);
  if (simon != null && simonClass.isInstance(simon)) {
    return simon;
  }
  return createOrReplaceUnknownSimon(name,simonClass);
}

Fixed version (ground truth):
private Simon getOrCreateSimon(String name,Class<? extends AbstractSimon> simonClass){
  if (name == null) {
    return instantiateSimon(null,simonClass);
  }
  if (name.equals(ROOT_SIMON_NAME)) {
    throw new SimonException("String_Node_Str");
  }
  AbstractSimon simon=allSimons.get(name);
  if (simon != null && simonClass.isInstance(simon)) {
    return simon;
  }
  return createOrReplaceUnknownSimon(name,simonClass);
}
Program: 8677
Project: 8677
Buggy source:
private void addToHierarchy(AbstractSimon simon,String name){
  allSimons.put(name,simon);
  int ix=name.lastIndexOf(HIERARCHY_DELIMITER);
  AbstractSimon parent=rootSimon;
  if (ix != -1) {
    String parentName=name.substring(0,ix);
    parent=allSimons.get(parentName);
    if (parent == null) {
      parent=new UnknownSimon(parentName,this);
      addToHierarchy(parent,parentName);
    }
  }
  parent.addChild(simon);
}

Fixed version (ground truth):
private void addToHierarchy(AbstractSimon simon,String name){
  int ix=name.lastIndexOf(HIERARCHY_DELIMITER);
  AbstractSimon parent=rootSimon;
  if (ix != -1) {
    String parentName=name.substring(0,ix);
    parent=allSimons.get(parentName);
    if (parent == null) {
      parent=new UnknownSimon(parentName,this);
      addToHierarchy(parent,parentName);
    }
  }
  parent.addChild(simon);
  allSimons.put(name,simon);
}
Program: 8678
Project: 8678
Buggy source:
/** 
 * Entry point to the Aggregation Example.
 * @param args unused
 */
public static void main(String[] args){
  for (int i=0; i < ITERATIONS; i++) {
    Split split=SimonManager.getStopwatch(STOPWATCH_PARENT + Manager.HIERARCHY_DELIMITER + random.nextInt(STOPWATCH_COUNT)).start();
    try {
      Thread.sleep(random.nextInt(ITERATION_MS_MAX));
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    split.stop();
  }
  Simon parent=SimonManager.getSimon(STOPWATCH_PARENT);
  List<Simon> children=parent.getChildren();
  System.out.println("String_Node_Str" + children.size());
  long totalSum=0;
  for (  Simon child : children) {
    System.out.println(child);
    totalSum+=((Stopwatch)child).getTotal();
  }
  System.out.println("String_Node_Str" + SimonUtils.presentNanoTime(totalSum));
}

Fixed version (ground truth):
/** 
 * Entry point to the Aggregation Example.
 * @param args unused
 */
public static void main(String[] args){
  for (int i=0; i < ITERATIONS; i++) {
    Split split=SimonManager.getStopwatch(STOPWATCH_PARENT + Manager.HIERARCHY_DELIMITER + random.nextInt(STOPWATCH_COUNT)).start();
    ExampleUtils.waitRandomlySquared(30);
    split.stop();
  }
  Simon parent=SimonManager.getSimon(STOPWATCH_PARENT);
  List<Simon> children=parent.getChildren();
  System.out.println("String_Node_Str" + children.size());
  long totalSum=0;
  for (  Simon child : children) {
    System.out.println(child);
    totalSum+=((Stopwatch)child).getTotal();
  }
  System.out.println("String_Node_Str" + SimonUtils.presentNanoTime(totalSum));
}
Program: 8679
Project: 8679
Buggy source:
/** 
 * Entry point to the Example.
 * @param args unused
 */
public static void main(String[] args){
  Stopwatch stopwatch=SimonManager.getStopwatch("String_Node_Str");
  for (int i=1; i <= 10; i++) {
    Split split=SimonManager.getStopwatch("String_Node_Str").start();
    ExampleUtils.waitRandomly(50);
    split.stop();
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ stopwatch);
  }
  System.out.println("String_Node_Str" + stopwatch.sample());
}

Fixed version (ground truth):
/** 
 * Entry point to the Example.
 * @param args unused
 */
public static void main(String[] args){
  Stopwatch stopwatch=SimonManager.getStopwatch("String_Node_Str");
  for (int i=1; i <= 10; i++) {
    Split split=SimonManager.getStopwatch("String_Node_Str").start();
    ExampleUtils.waitRandomlySquared(50);
    split.stop();
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ stopwatch);
  }
  System.out.println("String_Node_Str" + stopwatch.sample());
}
Program: 8680
Project: 8680
Buggy source:
/** 
 * Entry point of the demo application.
 * @param args command line arguments
 * @throws InterruptedException when sleep is interrupted
 */
public static void main(String[] args) throws InterruptedException {
  for (int i=0; i < THREADS; i++) {
    new MultithreadedSleeping().start();
  }
  latch.await();
  System.out.println("String_Node_Str" + SimonManager.getStopwatch(NAME));
}

Fixed version (ground truth):
/** 
 * Entry point of the demo application.
 * @param args command line arguments
 * @throws InterruptedException when sleep is interrupted
 */
public static void main(String[] args) throws InterruptedException {
  System.out.println("String_Node_Str" + THREADS + "String_Node_Str");
  Split realTimeSplit=new Split();
  for (int i=0; i < THREADS; i++) {
    new MultithreadedSleeping().start();
  }
  latch.await();
  System.out.println("String_Node_Str" + SimonManager.getStopwatch(NAME));
  System.out.println("String_Node_Str" + realTimeSplit.stop());
}
Program: 8681
Project: 8681
Buggy source:
/** 
 * Run method implementing the code performed by the thread.
 */
@Override public void run(){
  Split split=SimonManager.getStopwatch(NAME).start();
  try {
    sleep(SLEEP);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  split.stop();
  latch.countDown();
}

Fixed version (ground truth):
/** 
 * Run method implementing the code performed by the thread.
 */
@Override public void run(){
  Stopwatch stopwatch=SimonManager.getStopwatch(NAME);
  Split split=stopwatch.start();
  try {
    sleep(SLEEP);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  split.stop();
  latch.countDown();
}
Program: 8682
Project: 8682
Buggy source:
/** 
 * Entry point of the demo application.
 * @param args command line arguments
 */
public static void main(String[] args){
  Sampler sampler=new Sampler();
  sampler.setDaemon(true);
  sampler.start();
  while (true) {
    Split split=SimonManager.getStopwatch("String_Node_Str").start();
    ExampleUtils.waitRandomly(50);
    split.stop();
  }
}

Fixed version (ground truth):
/** 
 * Entry point of the demo application.
 * @param args command line arguments
 */
public static void main(String[] args){
  Sampler sampler=new Sampler();
  sampler.setDaemon(true);
  sampler.start();
  while (true) {
    Split split=SimonManager.getStopwatch("String_Node_Str").start();
    ExampleUtils.waitRandomlySquared(50);
    split.stop();
  }
}
Program: 8683
Project: 8683
Buggy source:
/** 
 * Entry point to the JMX Callback Example.
 * @param args unused
 * @throws Exception whatever may happen in this crazy world
 */
@SuppressWarnings("String_Node_Str") public static void main(String[] args) throws Exception {
  SimonManager.callback().addCallback(new JmxRegisterCallback("String_Node_Str"));
  Counter counter=SimonManager.getCounter("String_Node_Str");
  Stopwatch stopwatch=SimonManager.getStopwatch("String_Node_Str");
  SimonManager.getCounter("String_Node_Str");
  SimonManager.getStopwatch("String_Node_Str");
  SimonManager.getStopwatch("String_Node_Str");
  System.out.println("String_Node_Str");
  while (true) {
    counter.increase();
    Split split=stopwatch.start();
    ExampleUtils.waitRandomly(40);
    split.stop();
  }
}

Fixed version (ground truth):
/** 
 * Entry point to the JMX Callback Example.
 * @param args unused
 * @throws Exception whatever may happen in this crazy world
 */
@SuppressWarnings("String_Node_Str") public static void main(String[] args) throws Exception {
  SimonManager.callback().addCallback(new JmxRegisterCallback("String_Node_Str"));
  Counter counter=SimonManager.getCounter("String_Node_Str");
  Stopwatch stopwatch=SimonManager.getStopwatch("String_Node_Str");
  SimonManager.getCounter("String_Node_Str");
  SimonManager.getStopwatch("String_Node_Str");
  SimonManager.getStopwatch("String_Node_Str");
  System.out.println("String_Node_Str");
  while (true) {
    counter.increase();
    Split split=stopwatch.start();
    ExampleUtils.waitRandomlySquared(40);
    split.stop();
  }
}
Program: 8684
Project: 8684
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected boolean shouldBeAddedStopwatchInfo(StopwatchInfo info){
  if (isJdbcResultSetNextSimon(info)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean shouldBeAddedStopwatchInfo(StopwatchInfo info){
  return !(isJdbcResultSetNextSimon(info));
}
Program: 8685
Project: 8685
Buggy source:
private Simon getOrCreateSimon(String name,Class<? extends AbstractSimon> simonClass){
  if (name == null) {
    return newSimon(null,simonClass);
  }
  if (name.equals(ROOT_SIMON_NAME)) {
    throw new SimonException("String_Node_Str");
  }
  AbstractSimon simon=allSimons.get(name);
  if (simon != null && simonClass.isInstance(simon)) {
    return simon;
  }
  return createOrReplaceUnknownSimon(name,simonClass);
}

Fixed version (ground truth):
private Simon getOrCreateSimon(String name,Class<? extends AbstractSimon> simonClass){
  if (name == null) {
    return instantiateSimon(null,simonClass);
  }
  if (name.equals(ROOT_SIMON_NAME)) {
    throw new SimonException("String_Node_Str");
  }
  AbstractSimon simon=allSimons.get(name);
  if (simon != null && simonClass.isInstance(simon)) {
    return simon;
  }
  return createOrReplaceUnknownSimon(name,simonClass);
}
Program: 8686
Project: 8686
Buggy source:
private void addToHierarchy(AbstractSimon simon,String name){
  allSimons.put(name,simon);
  int ix=name.lastIndexOf(HIERARCHY_DELIMITER);
  AbstractSimon parent=rootSimon;
  if (ix != -1) {
    String parentName=name.substring(0,ix);
    parent=allSimons.get(parentName);
    if (parent == null) {
      parent=new UnknownSimon(parentName,this);
      addToHierarchy(parent,parentName);
    }
  }
  parent.addChild(simon);
}

Fixed version (ground truth):
private void addToHierarchy(AbstractSimon simon,String name){
  int ix=name.lastIndexOf(HIERARCHY_DELIMITER);
  AbstractSimon parent=rootSimon;
  if (ix != -1) {
    String parentName=name.substring(0,ix);
    parent=allSimons.get(parentName);
    if (parent == null) {
      parent=new UnknownSimon(parentName,this);
      addToHierarchy(parent,parentName);
    }
  }
  parent.addChild(simon);
  allSimons.put(name,simon);
}
Program: 8687
Project: 8687
Buggy source:
/** 
 * Entry point to the Aggregation Example.
 * @param args unused
 */
public static void main(String[] args){
  for (int i=0; i < ITERATIONS; i++) {
    Split split=SimonManager.getStopwatch(STOPWATCH_PARENT + Manager.HIERARCHY_DELIMITER + random.nextInt(STOPWATCH_COUNT)).start();
    try {
      Thread.sleep(random.nextInt(ITERATION_MS_MAX));
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    split.stop();
  }
  Simon parent=SimonManager.getSimon(STOPWATCH_PARENT);
  List<Simon> children=parent.getChildren();
  System.out.println("String_Node_Str" + children.size());
  long totalSum=0;
  for (  Simon child : children) {
    System.out.println(child);
    totalSum+=((Stopwatch)child).getTotal();
  }
  System.out.println("String_Node_Str" + SimonUtils.presentNanoTime(totalSum));
}

Fixed version (ground truth):
/** 
 * Entry point to the Aggregation Example.
 * @param args unused
 */
public static void main(String[] args){
  for (int i=0; i < ITERATIONS; i++) {
    Split split=SimonManager.getStopwatch(STOPWATCH_PARENT + Manager.HIERARCHY_DELIMITER + random.nextInt(STOPWATCH_COUNT)).start();
    ExampleUtils.waitRandomlySquared(30);
    split.stop();
  }
  Simon parent=SimonManager.getSimon(STOPWATCH_PARENT);
  List<Simon> children=parent.getChildren();
  System.out.println("String_Node_Str" + children.size());
  long totalSum=0;
  for (  Simon child : children) {
    System.out.println(child);
    totalSum+=((Stopwatch)child).getTotal();
  }
  System.out.println("String_Node_Str" + SimonUtils.presentNanoTime(totalSum));
}
Program: 8688
Project: 8688
Buggy source:
/** 
 * Entry point to the Example.
 * @param args unused
 */
public static void main(String[] args){
  Stopwatch stopwatch=SimonManager.getStopwatch("String_Node_Str");
  for (int i=1; i <= 10; i++) {
    Split split=SimonManager.getStopwatch("String_Node_Str").start();
    ExampleUtils.waitRandomly(50);
    split.stop();
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ stopwatch);
  }
  System.out.println("String_Node_Str" + stopwatch.sample());
}

Fixed version (ground truth):
/** 
 * Entry point to the Example.
 * @param args unused
 */
public static void main(String[] args){
  Stopwatch stopwatch=SimonManager.getStopwatch("String_Node_Str");
  for (int i=1; i <= 10; i++) {
    Split split=SimonManager.getStopwatch("String_Node_Str").start();
    ExampleUtils.waitRandomlySquared(50);
    split.stop();
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ stopwatch);
  }
  System.out.println("String_Node_Str" + stopwatch.sample());
}