nus-yam/ex-repair huggingface dataset:
Program: 39501
Project: 39501
Buggy source:
@Override public Animation getAnimation(){
  return null;
}

Fixed version (ground truth):
@Override public Animation getAnimation(){
  return animation;
}
Program: 39502
Project: 39502
Buggy source:
@Override public Movement availableMovement(CollisionPolygon collisionPolygon,Float speed){
  if (bufferedMovement.canMove(collisionPolygon,speed,board)) {
    currentMovement=bufferedMovement;
    bufferedMovement=new NullMovement();
    return currentMovement;
  }
 else   if (currentMovement.canMove(collisionPolygon,speed,board)) {
    return currentMovement;
  }
  return movementBuilder.stoppedFrom(currentMovement);
}

Fixed version (ground truth):
@Override public Movement availableMovement(CollisionPolygon collisionPolygon,Float speed){
  if (bufferedMovement.canMove(collisionPolygon,speed,board)) {
    currentMovement=bufferedMovement;
    bufferedMovement=new NullMovement();
    return currentMovement;
  }
 else   if (currentMovement.canMove(collisionPolygon,speed,board)) {
    return currentMovement;
  }
  bufferedMovement=new NullMovement();
  return movementBuilder.stoppedFrom(currentMovement);
}
Program: 39503
Project: 39503
Buggy source:
@Test public void shouldReturnStoppedCorrespondenceIfCantMoveAnywhere() throws Exception {
  Stopped stopped=mock(Stopped.class);
  when(bufferedMovement.canMove(collisionPolygon,speed,board)).thenReturn(false);
  when(currentMovement.canMove(collisionPolygon,speed,board)).thenReturn(false);
  when(movementBuilder.stoppedFrom(currentMovement)).thenReturn(stopped);
  Movement result=movementStrategy.availableMovement(collisionPolygon,speed);
  assertSame(stopped,result);
}

Fixed version (ground truth):
@Test public void shouldReturnStoppedCorrespondenceIfCantMoveAnywhere() throws Exception {
  Stopped stopped=mock(Stopped.class);
  when(bufferedMovement.canMove(collisionPolygon,speed,board)).thenReturn(false);
  when(currentMovement.canMove(collisionPolygon,speed,board)).thenReturn(false);
  when(movementBuilder.stoppedFrom(currentMovement)).thenReturn(stopped);
  Movement result=movementStrategy.availableMovement(collisionPolygon,speed);
  assertSame(stopped,result);
  assertTrue(movementStrategy.bufferedMovement instanceof NullMovement);
}
Program: 39504
Project: 39504
Buggy source:
public PacMan(CollisionPolygon collisionPolygon,Direction direction,Board board){
  currentCollisionPolygon=collisionPolygon;
  currentDirection=direction;
  bufferedDirection=direction;
  this.board=board;
}

Fixed version (ground truth):
public PacMan(CollisionPolygon collisionPolygon,Direction direction,Board board){
  currentCollisionPolygon=collisionPolygon;
  currentDirection=direction;
  bufferedDirection=new NullDirection();
  this.board=board;
}
Program: 39505
Project: 39505
Buggy source:
public void move(){
  if (bufferedDirection.canMove(currentCollisionPolygon,SPEED,board)) {
    currentCollisionPolygon=bufferedDirection.move(currentCollisionPolygon,SPEED);
    currentDirection=bufferedDirection;
  }
 else   if (currentDirection.canMove(currentCollisionPolygon,SPEED,board)) {
    currentCollisionPolygon=currentDirection.move(currentCollisionPolygon,SPEED);
  }
}

Fixed version (ground truth):
public void move(){
  if (bufferedDirection.canMove(currentCollisionPolygon,SPEED,board)) {
    currentCollisionPolygon=bufferedDirection.move(currentCollisionPolygon,SPEED);
    currentDirection=bufferedDirection;
    bufferedDirection=new NullDirection();
  }
 else   if (currentDirection.canMove(currentCollisionPolygon,SPEED,board)) {
    currentCollisionPolygon=currentDirection.move(currentCollisionPolygon,SPEED);
  }
}
Program: 39506
Project: 39506
Buggy source:
@Test public void shouldMoveToBufferedIfPossible() throws Exception {
  CollisionPolygon movedCollisionPolygon=mock(CollisionPolygon.class);
  Direction bufferedDirection=mock(Direction.class);
  pacMan.bufferedDirection=bufferedDirection;
  when(bufferedDirection.canMove(collisionPolygon,PacMan.SPEED,board)).thenReturn(true);
  when(bufferedDirection.move(collisionPolygon,PacMan.SPEED)).thenReturn(movedCollisionPolygon);
  pacMan.move();
  verify(bufferedDirection).canMove(collisionPolygon,PacMan.SPEED,board);
  verify(bufferedDirection).move(collisionPolygon,PacMan.SPEED);
  assertSame(pacMan.currentCollisionPolygon,movedCollisionPolygon);
  assertSame(pacMan.currentDirection,bufferedDirection);
}

Fixed version (ground truth):
@Test public void shouldMoveToBufferedIfPossible() throws Exception {
  CollisionPolygon movedCollisionPolygon=mock(CollisionPolygon.class);
  Direction bufferedDirection=mock(Direction.class);
  pacMan.bufferedDirection=bufferedDirection;
  when(bufferedDirection.canMove(collisionPolygon,PacMan.SPEED,board)).thenReturn(true);
  when(bufferedDirection.move(collisionPolygon,PacMan.SPEED)).thenReturn(movedCollisionPolygon);
  pacMan.move();
  verify(bufferedDirection).canMove(collisionPolygon,PacMan.SPEED,board);
  verify(bufferedDirection).move(collisionPolygon,PacMan.SPEED);
  assertSame(pacMan.currentCollisionPolygon,movedCollisionPolygon);
  assertSame(pacMan.currentDirection,bufferedDirection);
  assertTrue(pacMan.bufferedDirection instanceof NullDirection);
}
Program: 39507
Project: 39507
Buggy source:
@Test public void shouldSetCurrentDirectionAsDefault() throws Exception {
  assertSame(initialDirection,pacMan.currentDirection);
}

Fixed version (ground truth):
@Test public void shouldSetCurrentDirectionAsDefault() throws Exception {
  assertSame(initialDirection,pacMan.currentDirection);
  assertTrue(pacMan.bufferedDirection instanceof NullDirection);
}
Program: 39508
Project: 39508
Buggy source:
public PacMan create() throws SlickException {
  Map<Direction,Animation> animationMap=new HashMap<Direction,Animation>();
  animationMap.put(DOWN,animationFactory.createFromPath(70,createPathsFrom(DOWN)));
  animationMap.put(UP,animationFactory.createFromPath(70,createPathsFrom(UP)));
  animationMap.put(LEFT,animationFactory.createFromPath(70,createPathsFrom(LEFT)));
  animationMap.put(RIGHT,animationFactory.createFromPath(70,createPathsFrom(RIGHT)));
  return new PacMan(new SquarePolygon(25,25,25),animationMap,RIGHT);
}

Fixed version (ground truth):
public PacMan create() throws SlickException {
  Map<Direction,Animation> animationMap=new HashMap<Direction,Animation>();
  animationMap.put(DOWN,animationFactory.createFromPath(70,createPathsFrom(DOWN)));
  animationMap.put(UP,animationFactory.createFromPath(70,createPathsFrom(UP)));
  animationMap.put(LEFT,animationFactory.createFromPath(70,createPathsFrom(LEFT)));
  animationMap.put(RIGHT,animationFactory.createFromPath(70,createPathsFrom(RIGHT)));
  return new PacMan(new SquarePolygon(24.5f,24.5f,26f),animationMap,RIGHT);
}
Program: 39509
Project: 39509
Buggy source:
public List<Block> from(TiledMap map){
  Integer blockWidth=map.getTileWidth();
  Integer width=map.getWidth();
  Integer height=map.getHeight();
  List<Block> blocks=new ArrayList<Block>();
  for (int x=0; x < width; x++) {
    for (int y=0; y < height; y++) {
      int tileId=map.getTileId(x,y,COLLISION_LAYER);
      if (Boolean.valueOf(map.getTileProperty(tileId,COLLIDABLE,DEFAULT_COLLIDABLE_VALUE))) {
        blocks.add(new Block(new SquarePolygon(x * blockWidth,y * blockWidth,blockWidth)));
      }
    }
  }
  return blocks;
}

Fixed version (ground truth):
public List<Block> from(TiledMap map){
  Integer blockWidth=map.getTileWidth();
  Integer width=map.getWidth();
  Integer height=map.getHeight();
  List<Block> blocks=new ArrayList<Block>();
  for (int x=0; x < width; x++) {
    for (int y=0; y < height; y++) {
      int tileId=map.getTileId(x,y,COLLISION_LAYER);
      if (isCollidable(map,tileId)) {
        blocks.add(new Block(new SquarePolygon((float)x * blockWidth,(float)y * blockWidth,(float)blockWidth)));
      }
    }
  }
  return blocks;
}
Program: 39510
Project: 39510
Buggy source:
private float[] createPoints(Integer x,Integer y,Integer width){
  Integer endingX=width - 1;
  Integer endingY=endingX;
  return new float[]{x,y,x + endingX,y,x + endingX,y + endingY,x,y + endingY};
}

Fixed version (ground truth):
private float[] createPoints(Float x,Float y,Float width){
  Float endingX=width - 1;
  Float endingY=endingX;
  return new float[]{x,y,x + endingX,y,x + endingX,y + endingY,x,y + endingY};
}
Program: 39511
Project: 39511
Buggy source:
private void draw(Renderable renderable,Graphics g,Integer x,Integer y){
  g.pushTransform();
  g.translate(x,y);
  renderable.draw(g);
  g.popTransform();
}

Fixed version (ground truth):
private void draw(Renderable renderable,Graphics g,Float x,Float y){
  g.pushTransform();
  g.translate(x,y);
  renderable.draw(g);
  g.popTransform();
}
Program: 39512
Project: 39512
Buggy source:
@Override public void render(Renderable renderable,Graphics g){
  Point position=renderable.getPosition();
  draw(renderable,g,position.getX(),position.getY());
}

Fixed version (ground truth):
@Override public void render(Renderable renderable,Graphics g){
  Point position=renderable.getPosition();
  draw(renderable,g,(float)position.getX(),(float)position.getY());
}
Program: 39513
Project: 39513
Buggy source:
@Test public void shouldCreateSquarePolygon() throws Exception {
  int x=10;
  int y=20;
  int width=25;
  SquarePolygon square=new SquarePolygon(x,y,width);
  Polygon expectedPolygon=new Polygon(new float[]{x,y,x + width - 1,y,x + width - 1,y + width - 1,x,y + width - 1});
  Polygon actualPolygon=square.getPolygon();
  assertEquals(expectedPolygon.getPointCount(),actualPolygon.getPointCount());
  assertTrue(actualPolygon.closed());
  validatePolygons(expectedPolygon,actualPolygon);
}

Fixed version (ground truth):
@Test public void shouldCreateSquarePolygon() throws Exception {
  float x=10f;
  float y=20f;
  float width=25f;
  SquarePolygon square=new SquarePolygon(x,y,width);
  Polygon expectedPolygon=new Polygon(new float[]{x,y,x + width - 1,y,x + width - 1,y + width - 1,x,y + width - 1});
  Polygon actualPolygon=square.getPolygon();
  assertEquals(expectedPolygon.getPointCount(),actualPolygon.getPointCount());
  assertTrue(actualPolygon.closed());
  validatePolygons(expectedPolygon,actualPolygon);
}
Program: 39514
Project: 39514
Buggy source:
@Test public void shouldDrawItSelf() throws Exception {
  SquarePolygon squarePolygon=new SquarePolygon(0,0,10);
  Graphics g=mock(Graphics.class);
  squarePolygon.draw(g);
  verify(g).draw(eq(squarePolygon.getPolygon()));
}

Fixed version (ground truth):
@Test public void shouldDrawItSelf() throws Exception {
  SquarePolygon squarePolygon=new SquarePolygon(0f,0f,10f);
  Graphics g=mock(Graphics.class);
  squarePolygon.draw(g);
  verify(g).draw(eq(squarePolygon.getPolygon()));
}
Program: 39515
Project: 39515
Buggy source:
@Test public void shouldReturnCurrentPosition() throws Exception {
  Renderable squarePolygon=new SquarePolygon(2,1,10);
  assertEquals(2,squarePolygon.getPosition().getX());
  assertEquals(1,squarePolygon.getPosition().getY());
}

Fixed version (ground truth):
@Test public void shouldReturnCurrentPosition() throws Exception {
  Renderable squarePolygon=new SquarePolygon(2f,1f,10f);
  assertEquals(2,squarePolygon.getPosition().getX(),1);
  assertEquals(1,squarePolygon.getPosition().getY(),1);
}
Program: 39516
Project: 39516
Buggy source:
@Test public void shouldTranslateObjectBeforeRendering() throws Exception {
  Graphics g=mock(Graphics.class);
  Renderer renderer=new DefaultRenderer();
  Renderable renderable=mock(Renderable.class);
  Point point=new Point(10,10);
  when(renderable.getPosition()).thenReturn(point);
  renderer.render(renderable,g);
  verify(g).pushTransform();
  verify(g).translate(point.getX(),point.getY());
  verify(renderable).draw(g);
  verify(g).popTransform();
}

Fixed version (ground truth):
@Test public void shouldTranslateObjectBeforeRendering() throws Exception {
  Graphics g=mock(Graphics.class);
  Renderer renderer=new DefaultRenderer();
  Renderable renderable=mock(Renderable.class);
  Point point=new Point(10,10);
  when(renderable.getPosition()).thenReturn(point);
  renderer.render(renderable,g);
  verify(g).pushTransform();
  verify(g).translate((float)point.getX(),(float)point.getY());
  verify(renderable).draw(g);
  verify(g).popTransform();
}
Program: 39517
Project: 39517
Buggy source:
@Test public void shouldTranslateObjectWithGivenSpeedBeforeRendering() throws Exception {
  Graphics g=mock(Graphics.class);
  Renderer renderer=new DefaultRenderer();
  Renderable renderable=mock(Renderable.class);
  Point point=new Point(10,10);
  when(renderable.getPosition()).thenReturn(point);
  renderer.render(renderable,g);
  verify(g).pushTransform();
  verify(g).translate(point.getX(),point.getY());
  verify(renderable).draw(g);
  verify(g).popTransform();
}

Fixed version (ground truth):
@Test public void shouldTranslateObjectWithGivenSpeedBeforeRendering() throws Exception {
  Graphics g=mock(Graphics.class);
  Renderer renderer=new DefaultRenderer();
  Renderable renderable=mock(Renderable.class);
  Point point=new Point(10,10);
  when(renderable.getPosition()).thenReturn(point);
  renderer.render(renderable,g);
  verify(g).pushTransform();
  verify(g).translate((float)point.getX(),(float)point.getY());
  verify(renderable).draw(g);
  verify(g).popTransform();
}
Program: 39518
Project: 39518
Buggy source:
public List<Block> from(TiledMap map){
  Integer blockWidth=map.getTileWidth();
  Integer width=map.getWidth();
  Integer height=map.getHeight();
  List<Block> blocks=new ArrayList<Block>();
  for (int x=0; x < width; x++) {
    for (int y=0; y < height; y++) {
      int tileId=map.getTileId(x,y,COLLISION_LAYER);
      if (Boolean.valueOf(map.getTileProperty(tileId,"String_Node_Str","String_Node_Str"))) {
        blocks.add(new Block(new SquarePolygon(x * blockWidth,y * blockWidth,blockWidth)));
      }
    }
  }
  return blocks;
}

Fixed version (ground truth):
public List<Block> from(TiledMap map){
  Integer blockWidth=map.getTileWidth();
  Integer width=map.getWidth();
  Integer height=map.getHeight();
  List<Block> blocks=new ArrayList<Block>();
  for (int x=0; x < width; x++) {
    for (int y=0; y < height; y++) {
      int tileId=map.getTileId(x,y,COLLISION_LAYER);
      if (Boolean.valueOf(map.getTileProperty(tileId,COLLIDABLE,DEFAULT_COLLIDABLE_VALUE))) {
        blocks.add(new Block(new SquarePolygon(x * blockWidth,y * blockWidth,blockWidth)));
      }
    }
  }
  return blocks;
}
Program: 39519
Project: 39519
Buggy source:
public static void main(String[] args) throws Exception {
  String title="String_Node_Str";
  DefaultRenderer renderer=new DefaultRenderer();
  BoardFactory boardFactory=new BoardFactory(new MapFactory(),new BlockFactory());
  PacManFactory pacManFactory=new PacManFactory(new AnimationFactory());
  PacManGame pacManGame=new PacManGame(title,pacManFactory,boardFactory,renderer);
  AppGameContainer container=new AppGameContainer(pacManGame);
  container.setDisplayMode(700,775,false);
  container.start();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  String title="String_Node_Str";
  DefaultRenderer renderer=new DefaultRenderer();
  BoardFactory boardFactory=new BoardFactory(new MapFactory(),new BlockFactory());
  PacManFactory pacManFactory=new PacManFactory(new AnimationFactory());
  PacManGame pacManGame=new PacManGame(title,pacManFactory,boardFactory,renderer);
  AppGameContainer container=new AppGameContainer(pacManGame);
  container.setDisplayMode(700,800,false);
  container.start();
}
Program: 39520
Project: 39520
Buggy source:
@Override public void update(GameContainer gc,int delta) throws SlickException {
  Direction direction=pacMan.currentDirection();
  Direction nextDirection=direction.next(gc.getInput());
  SquarePolygon squarePolygon=pacMan.translate(delta * PacMan.SPEED,nextDirection);
  if (!board.isCollidingWith(squarePolygon.getPolygon())) {
    pacMan.updateCollisionPolygon(squarePolygon);
    pacMan.updateDirection(nextDirection);
  }
}

Fixed version (ground truth):
@Override public void update(GameContainer gc,int delta) throws SlickException {
  updatePacMan(gc,delta);
}
Program: 39521
Project: 39521
Buggy source:
@Test public void shouldSetInitialDirectionAndDrawPacMan() throws Exception {
  Point position=new Point(20,20);
  Polygon polygon=mock(Polygon.class);
  when(squarePolygon.getPosition()).thenReturn(position);
  when(squarePolygon.getPolygon()).thenReturn(polygon);
  pacMan.draw(null);
  verify(leftAnimation).draw(0,0,polygon.getWidth(),polygon.getHeight());
}

Fixed version (ground truth):
@Test public void shouldSetInitialDirectionAndDrawPacMan() throws Exception {
  int x=20;
  int y=30;
  Point position=new Point(x,y);
  Polygon polygon=mock(Polygon.class);
  Graphics g=mock(Graphics.class);
  when(squarePolygon.getPosition()).thenReturn(position);
  when(squarePolygon.getPolygon()).thenReturn(polygon);
  pacMan.draw(g);
  verify(leftAnimation).draw(0,0,polygon.getWidth(),polygon.getHeight());
}
Program: 39522
Project: 39522
Buggy source:
@Test public void shouldNotMovePacManIfWillColideWithBoard() throws Exception {
  Direction nextDirection=DOWN;
  SquarePolygon collisionPolygon=mock(SquarePolygon.class);
  mockPacManCollision(nextDirection,true,collisionPolygon);
  verify(pacMan,never()).updateCollisionPolygon(eq(collisionPolygon));
  verify(pacMan,never()).updateDirection(eq(nextDirection));
}

Fixed version (ground truth):
@Test public void shouldNotMovePacManIfWillColideWithBoard() throws Exception {
  Direction currentDirection=LEFT;
  int delta=1;
  GameContainer gc=mock(GameContainer.class);
  Input input=mock(Input.class);
  final SquarePolygon collisionPolygon=mock(SquarePolygon.class);
  Polygon polygonForNextDirection=mock(Polygon.class);
  final SquarePolygon collisionPolygonForCurrentDirection=mock(SquarePolygon.class);
  Polygon polygonForCurrentDirection=mock(Polygon.class);
  Answer<SquarePolygon> collisionPolygonAnswer=new Answer<SquarePolygon>(){
    private int invocationCount;
    public SquarePolygon answer(    InvocationOnMock invocation) throws Throwable {
      if (invocationCount == 0) {
        invocationCount++;
        return collisionPolygon;
      }
      return collisionPolygonForCurrentDirection;
    }
  }
;
  when(gc.getInput()).thenReturn(input);
  when(pacMan.currentDirection()).thenReturn(currentDirection);
  when(input.isKeyDown(eq(KEY_DOWN))).thenReturn(true);
  when(pacMan.translate(eq(delta * PacMan.SPEED),any(Direction.class))).thenAnswer(collisionPolygonAnswer);
  when(collisionPolygon.getPolygon()).thenReturn(polygonForNextDirection);
  when(board.isCollidingWith(eq(polygonForNextDirection))).thenReturn(true);
  when(collisionPolygonForCurrentDirection.getPolygon()).thenReturn(polygonForCurrentDirection);
  when(board.isCollidingWith(eq(polygonForCurrentDirection))).thenReturn(false);
  pacManGame.update(gc,delta);
  verify(pacMan).updateCollisionPolygon(eq(collisionPolygonForCurrentDirection));
  verify(pacMan).updateDirection(eq(currentDirection));
}
Program: 39523
Project: 39523
Buggy source:
@Test public void shouldMovePacManIfWillNotCollideWithBoard() throws Exception {
  Direction nextDirection=DOWN;
  SquarePolygon collisionPolygon=mock(SquarePolygon.class);
  mockPacManCollision(nextDirection,false,collisionPolygon);
  verify(pacMan).updateCollisionPolygon(eq(collisionPolygon));
  verify(pacMan).updateDirection(eq(nextDirection));
}

Fixed version (ground truth):
@Test public void shouldMovePacManIfWillNotCollideWithBoard() throws Exception {
  Direction nextDirection=DOWN;
  SquarePolygon collisionPolygon=mock(SquarePolygon.class);
  int delta=1;
  GameContainer gc=mock(GameContainer.class);
  Input input=mock(Input.class);
  Polygon polygon=mock(Polygon.class);
  when(gc.getInput()).thenReturn(input);
  when(pacMan.currentDirection()).thenReturn(LEFT);
  when(input.isKeyDown(eq(KEY_DOWN))).thenReturn(true);
  when(pacMan.translate(eq(delta * PacMan.SPEED),eq(nextDirection))).thenReturn(collisionPolygon);
  when(collisionPolygon.getPolygon()).thenReturn(polygon);
  when(board.isCollidingWith(eq(polygon))).thenReturn(false);
  pacManGame.update(gc,delta);
  verify(pacMan).updateCollisionPolygon(eq(collisionPolygon));
  verify(pacMan).updateDirection(eq(nextDirection));
}
Program: 39524
Project: 39524
Buggy source:
protected void doExecute() throws Exception {
  new LangBuilder(langDir,langFile,langCode);
}

Fixed version (ground truth):
protected void doExecute() throws Exception {
  new LangBuilder(langDir,langFile,langPlugin,langTranslate);
}
Program: 39525
Project: 39525
Buggy source:
protected void copyServicePropertiesFile(){
  File servicePropertiesFile=new File(resourcesDir,"String_Node_Str");
  if (servicePropertiesFile.exists()) {
    FileUtil.copyFile(servicePropertiesFile,new File(implDir,"String_Node_Str"));
  }
}

Fixed version (ground truth):
protected void copyServicePropertiesFile() throws Exception {
  File servicePropertiesFile=new File(resourcesDir,"String_Node_Str");
  if (servicePropertiesFile.exists()) {
    FileUtil.copyFile(servicePropertiesFile,new File(implDir,"String_Node_Str"));
  }
}
Program: 39527
Project: 39527
Buggy source:
private void waitForApplicationTargetState(String applicationName,boolean targetState,int timeout) throws DeploymentException {
  if (log.isLoggable(Level.FINER)) {
    log.entering(className,"String_Node_Str");
  }
  ObjectName appMBean=null;
  try {
    appMBean=new ObjectName("String_Node_Str" + applicationName);
  }
 catch (  MalformedObjectNameException e) {
    throw new DeploymentException("String_Node_Str" + applicationName + "String_Node_Str",e);
  }
catch (  NullPointerException e) {
    throw new DeploymentException("String_Node_Str",e);
  }
  try {
    int timeleft=timeout * 1000;
    while (mbsc.isRegistered(appMBean) != targetState) {
      Thread.sleep(100);
      if (timeleft <= 0)       throw new DeploymentException("String_Node_Str");
      timeleft-=100;
    }
    if (targetState == true) {
      String applicationState=null;
      while (applicationState == null || !applicationState.contentEquals("String_Node_Str")) {
        Thread.sleep(100);
        applicationState=(String)mbsc.getAttribute(appMBean,"String_Node_Str");
        if (timeleft <= 0)         throw new DeploymentException("String_Node_Str");
        timeleft-=100;
      }
    }
  }
 catch (  Exception e) {
    throw new DeploymentException("String_Node_Str",e);
  }
  if (log.isLoggable(Level.FINER)) {
    log.exiting(className,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void waitForApplicationTargetState(String applicationName,boolean targetState,int timeout) throws DeploymentException {
  if (log.isLoggable(Level.FINER)) {
    log.entering(className,"String_Node_Str");
  }
  ObjectName appMBean=null;
  ObjectName listAllApps=null;
  try {
    appMBean=new ObjectName("String_Node_Str" + applicationName);
    listAllApps=new ObjectName("String_Node_Str");
  }
 catch (  MalformedObjectNameException e) {
    throw new DeploymentException("String_Node_Str" + applicationName + "String_Node_Str",e);
  }
catch (  NullPointerException e) {
    throw new DeploymentException("String_Node_Str",e);
  }
  try {
    int timeleft=timeout * 1000;
    while (mbsc.isRegistered(appMBean) != targetState) {
      Thread.sleep(100);
      if (timeleft <= 0) {
        Set<ObjectInstance> allApps=mbsc.queryMBeans(null,null);
        log.fine("String_Node_Str" + allApps.size());
        for (        ObjectInstance app : allApps) {
          log.fine(app.getObjectName().toString());
        }
        throw new DeploymentException("String_Node_Str");
      }
      timeleft-=100;
    }
    if (targetState == true) {
      String applicationState=null;
      while (applicationState == null || !applicationState.contentEquals("String_Node_Str")) {
        Thread.sleep(100);
        applicationState=(String)mbsc.getAttribute(appMBean,"String_Node_Str");
        if (timeleft <= 0)         throw new DeploymentException("String_Node_Str");
        timeleft-=100;
      }
    }
  }
 catch (  Exception e) {
    throw new DeploymentException("String_Node_Str",e);
  }
  if (log.isLoggable(Level.FINER)) {
    log.exiting(className,"String_Node_Str");
  }
}
Program: 39528
Project: 39528
Buggy source:
/** 
 * Creates a ContainerComponent object.
 * @param element an Element object containing the Java model element to use.
 * @param container a Container object containing the Container annotation to use.
 */
public ContainerComponent(Element element,Container annotation){
  super(annotation,element);
  setWidgetType(annotation.dojoType());
  setRequiredCss(annotation.requiredCss());
  setDisplayName(annotation.displayName());
  setJsfNode(annotation.jsfNode());
  setRendersChildren(annotation.rendersChildren());
  setIsContainer(annotation.isContainer());
}

Fixed version (ground truth):
/** 
 * Creates a ContainerComponent object.
 * @param element an Element object containing the Java model element to use.
 * @param container a Container object containing the Container annotation to use.
 */
public ContainerComponent(Element element,Container annotation){
  super(annotation,element);
  setWidgetType(annotation.dojoType());
  setRequiredCss(annotation.requiredCss());
  setDisplayName(annotation.displayName());
  setJsfNode(annotation.jsfNode());
  setRendersChildren(annotation.rendersChildren());
  setIsDijitContainer(annotation.isDijitContainer());
}
Program: 39529
Project: 39529
Buggy source:
@Override public final void decode(FacesContext context,UIComponent component){
  PostBackHandler postBackHandler;
  if (!component.isRendered()) {
    return;
  }
  postBackHandler=((DojoWidget)component).getPostBackHandler();
  if (null == postBackHandler) {
    return;
  }
  postBackHandler.retrievePostBackValue(context,component);
}

Fixed version (ground truth):
@Override public final void decode(FacesContext context,UIComponent component){
  PostBackHandler postBackHandler;
  if (!component.isRendered()) {
    return;
  }
  postBackHandler=((DojoWidget)component).getPostBackHandler();
  if (null == postBackHandler) {
    return;
  }
  postBackHandler.retrievePostBackValue(context,component);
  if (component instanceof ClientBehaviorHolder) {
    decodeClientBehaviors(context,component);
  }
}
Program: 39530
Project: 39530
Buggy source:
protected TransitionProperty(String name,String propertyName){
  super(name,propertyName,validValues);
}

Fixed version (ground truth):
public TransitionProperty(String name,String propertyName){
  super(name,propertyName,validValues);
}
Program: 39531
Project: 39531
Buggy source:
public static LibraryService getInstance(){
  return instance;
}

Fixed version (ground truth):
/** 
 * @return instance of LibraryService which is loaded by ServiceLoader
 */
public static LibraryService getInstance(){
  return instance;
}
Program: 39532
Project: 39532
Buggy source:
public boolean isSet(UIComponent component){
  if (null != component.getValueExpression(name)) {
    return true;
  }
  return (null != Helper.getAttributeValue(component,name));
}

Fixed version (ground truth):
/** 
 * @param component
 * @return true if the attribute is set to a value expression or theattribute value is not null, false otherwise
 */
public boolean isSet(UIComponent component){
  if (null != component.getValueExpression(name)) {
    return true;
  }
  return (null != Helper.getAttributeValue(component,name));
}
Program: 39534
Project: 39534
Buggy source:
/** 
 * @param view to which to add a script block component
 */
public static void addScriptBlockToView(UIViewRoot view){
  FacesContext context=FacesContext.getCurrentInstance();
  PartialViewContext pvContext=context.getPartialViewContext();
  boolean partialUpdate=(null != pvContext) && pvContext.isAjaxRequest();
  DojoScriptBlockComponent sb=null;
  sb=findInitBlockComponent(view.getComponentResources(context,partialUpdate ? BODY_BEGIN : BODY_END));
  if (null == sb) {
    sb=new DojoScriptBlockComponent(DESTROY_BLOCK_ID);
    if (partialUpdate) {
      view.addComponentResource(context,sb,BODY_BEGIN);
      for (      String id : pvContext.getRenderIds()) {
        checkAndAddDestroyScript(sb,view.findComponent(id));
      }
      pvContext.getRenderIds().add(sb.getId());
    }
 else {
      view.addComponentResource(context,sb,BODY_END);
    }
    sb=new DojoScriptBlockComponent(INIT_BLOCK_ID);
    if (partialUpdate) {
      view.addComponentResource(context,sb,BODY_BEGIN);
      pvContext.getRenderIds().add(sb.getId());
    }
 else {
      view.addComponentResource(context,sb,BODY_END);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param view to which to add a script block component
 */
public static void addScriptBlockToView(UIViewRoot view){
  FacesContext context=FacesContext.getCurrentInstance();
  PartialViewContext pvContext=context.getPartialViewContext();
  boolean partialUpdate=(null != pvContext) && pvContext.isAjaxRequest();
  DojoScriptBlockComponent sb=null;
  sb=findInitBlockComponent(view.getComponentResources(context,partialUpdate ? BODY_BEGIN : BODY_END));
  if (null == sb) {
    sb=new DojoScriptBlockComponent(DESTROY_BLOCK_ID);
    if (partialUpdate) {
      view.addComponentResource(context,sb,BODY_BEGIN);
      for (      String id : pvContext.getRenderIds()) {
        checkAndAddDestroyScript(sb,view.findComponent(id));
      }
      pvContext.getRenderIds().add(sb.getId());
    }
 else {
      view.addComponentResource(context,sb,BODY_END);
    }
    LibraryService libraryService=LibraryService.getInstance();
    sb=new DojoScriptBlockComponent(INIT_BLOCK_ID,libraryService.getRequiredDojoModules());
    if (partialUpdate) {
      view.addComponentResource(context,sb,BODY_BEGIN);
      pvContext.getRenderIds().add(sb.getId());
    }
 else {
      view.addComponentResource(context,sb,BODY_END);
    }
  }
}
Program: 39535
Project: 39535
Buggy source:
public DojoScriptBlockComponent(String id){
  super();
  setId(id);
  if (id.equals(INIT_BLOCK_ID)) {
    getFacesContext().getViewRoot().subscribeToViewEvent(javax.faces.event.PreRenderViewEvent.class,this);
  }
}

Fixed version (ground truth):
public DojoScriptBlockComponent(String id,String[] requires){
  super();
  setId(id);
  if (id.equals(INIT_BLOCK_ID)) {
    getFacesContext().getViewRoot().subscribeToViewEvent(javax.faces.event.PreRenderViewEvent.class,this);
  }
  if (requires != null && requires.length > 0) {
    for (    String requiredModule : requires) {
      addRequires(requiredModule);
    }
  }
}
Program: 39536
Project: 39536
Buggy source:
/** 
 * Add css file to list of css files to import.
 * @param requiredCss path of required css file
 */
public void addRequiredCss(String requiredCss){
  if (!requiredCssAdded.contains(requiredCss)) {
    styleBlock.append("String_Node_Str").append(getLibraryUrlPrefix(getFacesContext())).append(requiredCss).append("String_Node_Str");
    requiredCssAdded.add(requiredCss);
  }
}

Fixed version (ground truth):
/** 
 * Add css file to list of css files to import.
 * @param requiredCss path of required css file
 */
public void addRequiredCss(String requiredCss){
  if (!requiredCssAdded.contains(requiredCss)) {
    styleBlock.append("String_Node_Str").append(themeHandler.getCssUrl(getFacesContext(),requiredCss)).append("String_Node_Str");
    requiredCssAdded.add(requiredCss);
  }
}
Program: 39537
Project: 39537
Buggy source:
DojoTheme(boolean moveIfNecessary){
  super();
  if (moveIfNecessary) {
    getFacesContext().getViewRoot().subscribeToViewEvent(javax.faces.event.PostAddToViewEvent.class,this);
  }
  getFacesContext().getViewRoot().subscribeToViewEvent(javax.faces.event.PreRenderViewEvent.class,this);
  super.setId(DojoTheme.RESOURCE_ID);
}

Fixed version (ground truth):
DojoTheme(boolean moveIfNecessary){
  super();
  UIViewRoot viewRoot=getFacesContext().getViewRoot();
  if (moveIfNecessary) {
    viewRoot.subscribeToViewEvent(javax.faces.event.PostAddToViewEvent.class,this);
  }
  viewRoot.subscribeToViewEvent(javax.faces.event.PreRenderViewEvent.class,this);
  super.setId(DojoTheme.RESOURCE_ID);
  LibraryService libraryService=LibraryService.getInstance();
  themeHandler=libraryService.getThemeHandler();
  String[] requiredCss=themeHandler.getRequiredCss(getFacesContext());
  if (requiredCss != null && requiredCss.length > 0) {
    DojoStyleComponent styleComponent=DojoStyleComponent.findStyleBlockComponent(viewRoot);
    for (    String css : requiredCss) {
      styleComponent.addRequiredCss(css);
    }
  }
}
Program: 39538
Project: 39538
Buggy source:
@Override public void encodeAll(FacesContext context) throws IOException {
  String linkTag=(String)context.getAttributes().get(THEME_LINK);
  if (null == linkTag) {
    String themeName=getName();
    StringBuilder themeCssLink=new StringBuilder("String_Node_Str");
    themeCssLink.append(getLibraryUrlPrefix(context)).append("String_Node_Str").append(themeName).append('/').append(themeName).append("String_Node_Str");
    themeCssLink.append("String_Node_Str");
    linkTag=themeCssLink.toString();
    context.getAttributes().put(THEME_LINK,linkTag);
  }
  context.getResponseWriter().write(linkTag);
}

Fixed version (ground truth):
@Override public void encodeAll(FacesContext context) throws IOException {
  String linkTag=(String)context.getAttributes().get(THEME_LINK);
  if (null == linkTag) {
    String themeName=getName();
    StringBuilder themeCssLink=new StringBuilder("String_Node_Str");
    themeCssLink.append(themeHandler.getThemeUrl(context,themeName));
    themeCssLink.append("String_Node_Str");
    linkTag=themeCssLink.toString();
    context.getAttributes().put(THEME_LINK,linkTag);
  }
  context.getResponseWriter().write(linkTag);
}
Program: 39539
Project: 39539
Buggy source:
@Override public void encodeEnd(FacesContext context,UIComponent component) throws IOException {
  DojoWidget dojoWidget=(DojoWidget)component;
  component.popComponentFromEL(context);
  if (dojoWidget.getWidgetType().isDijit()) {
    String closeTag=dojoWidget.getElement().getElementClose(context,component);
    if (null != closeTag) {
      ResponseWriter writer=context.getResponseWriter();
      writer.write(closeTag);
    }
  }
  addInitScriptToScriptBlock(context,component);
}

Fixed version (ground truth):
@Override public void encodeEnd(FacesContext context,UIComponent component) throws IOException {
  DojoWidget dojoWidget=(DojoWidget)component;
  component.popComponentFromEL(context);
  if (dojoWidget.getWidgetType().isDijit()) {
    String closeTag=dojoWidget.getElement().getElementClose(context,component);
    if (null != closeTag) {
      ResponseWriter writer=context.getResponseWriter();
      writer.write(closeTag);
    }
  }
  addInitScriptToScriptBlock(context,component);
  if (component.getId().equals(context.getAttributes().get(START_UP_CONTAINER_ID))) {
    context.getAttributes().remove(START_UP_CONTAINER_ID);
  }
}
Program: 39541
Project: 39541
Buggy source:
@Override public void encodeBegin(FacesContext context,UIComponent component) throws IOException {
  DojoWidget dojoWidget=(DojoWidget)component;
  if (dojoWidget.getWidgetType().isDijit()) {
    ResponseWriter writer=context.getResponseWriter();
    writer.write(dojoWidget.getElement().getElement(context,component));
  }
  component.pushComponentToEL(context,component);
}

Fixed version (ground truth):
@Override public void encodeBegin(FacesContext context,UIComponent component) throws IOException {
  DojoWidget dojoWidget=(DojoWidget)component;
  if (dojoWidget.getWidgetType().isDijit()) {
    ResponseWriter writer=context.getResponseWriter();
    writer.write(dojoWidget.getElement().getElement(context,component));
  }
  component.pushComponentToEL(context,component);
  if (component instanceof UIPanel && !context.getAttributes().containsKey(START_UP_CONTAINER_ID)) {
    context.getAttributes().put(START_UP_CONTAINER_ID,component.getId());
  }
}
Program: 39542
Project: 39542
Buggy source:
@Override public String getAsPropertyValue(UIComponent component){
  Object value=getAttributeValue(component);
  if (null == value) {
    if (null != component.getAttributes().get("String_Node_Str")) {
      return "String_Node_Str";
    }
  }
  return super.getAsPropertyValue(component);
}

Fixed version (ground truth):
@Override public String getAsPropertyValue(UIComponent component){
  Object value=getAttributeValue(component);
  if (null == value) {
    if (null != component.getAttributes().get("String_Node_Str") || ((UICommand)component).getActionListeners().length > 0) {
      return Helper.quote("String_Node_Str");
    }
  }
  return super.getAsPropertyValue(component);
}
Program: 39543
Project: 39543
Buggy source:
String getAsJavascriptDate(String valueAsString){
  StringBuffer newDate=new StringBuffer("String_Node_Str").append(Helper.makeStringVar(valueAsString.replaceAll("String_Node_Str","String_Node_Str"))).append(')');
  return newDate.toString();
}

Fixed version (ground truth):
String getAsJavascriptDate(String valueAsString){
  if (valueAsString != null) {
    StringBuffer newDate=new StringBuffer("String_Node_Str").append(Helper.makeStringVar(valueAsString.replaceAll("String_Node_Str","String_Node_Str"))).append(')');
    return newDate.toString();
  }
  return valueAsString;
}
Program: 39544
Project: 39544
Buggy source:
public ShowCaseResourceBundle(){
  setTaglibXmlFilePath("String_Node_Str");
  try {
    init();
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public ShowCaseResourceBundle() throws IOException {
  try {
    DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
    DocumentBuilder builder=dbf.newDocumentBuilder();
    for (    String taglibXmlFilePath : taglibXmlFilePaths) {
      Enumeration<URL> enumer=Thread.currentThread().getContextClassLoader().getResources(taglibXmlFilePath);
      while (enumer.hasMoreElements()) {
        Document doc=builder.parse(enumer.nextElement().openStream());
        parse(doc);
      }
    }
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}
Program: 39545
Project: 39545
Buggy source:
private Validator getDataStroeValidator(SelectItemStoreComponent selectItemStore){
  Collection<org.dojoserverfaces.widget.property.Property> propertyHandlers=((DojoWidget)selectItemStore).getPropertyHandlers();
  for (  org.dojoserverfaces.widget.property.Property property : propertyHandlers) {
    if ("String_Node_Str".equals(property.getName()) && property instanceof Validator) {
      return (Validator)property;
    }
  }
  return null;
}

Fixed version (ground truth):
private Validator getDataStroeValidator(DojoWidget selectItemStore){
  Collection<org.dojoserverfaces.widget.property.Property> propertyHandlers=selectItemStore.getPropertyHandlers();
  for (  org.dojoserverfaces.widget.property.Property property : propertyHandlers) {
    if ("String_Node_Str".equals(property.getName()) && property instanceof Validator) {
      return (Validator)property;
    }
  }
  return null;
}
Program: 39546
Project: 39546
Buggy source:
@Override public void validate(FacesContext context,UIComponent comp,Object value) throws ValidatorException {
  String storeId=(String)comp.getAttributes().get(this.getName());
  if (storeId == null || value == null)   return;
  UIComponent storeComp=context.getViewRoot().findComponent(storeId);
  if (storeComp != null && (storeComp instanceof SelectItemStoreComponent)) {
    Validator validator=getDataStroeValidator((SelectItemStoreComponent)storeComp);
    if (validator != null) {
      validator.validate(context,(UIComponent)storeComp,value);
    }
  }
}

Fixed version (ground truth):
@Override public void validate(FacesContext context,UIComponent comp,Object value) throws ValidatorException {
  String storeId=(String)comp.getAttributes().get(this.getName());
  if (storeId == null || value == null)   return;
  UIComponent storeComp=context.getViewRoot().findComponent(storeId);
  if (storeComp != null && (storeComp instanceof DojoWidget)) {
    Validator validator=getDataStroeValidator((DojoWidget)storeComp);
    if (validator != null) {
      validator.validate(context,(UIComponent)storeComp,value);
    }
  }
}
Program: 39547
Project: 39547
Buggy source:
private Validator getDataStroeValidator(SelectItemStoreComponent selectItemStore){
  Collection<org.dojoserverfaces.widget.property.Property> propertyHandlers=((DojoWidget)selectItemStore).getPropertyHandlers();
  for (  org.dojoserverfaces.widget.property.Property property : propertyHandlers) {
    if ("String_Node_Str".equals(property.getName()) && property instanceof Validator) {
      return (Validator)property;
    }
  }
  return null;
}

Fixed version (ground truth):
private Validator getDataStroeValidator(DojoWidget selectItemStore){
  Collection<org.dojoserverfaces.widget.property.Property> propertyHandlers=selectItemStore.getPropertyHandlers();
  for (  org.dojoserverfaces.widget.property.Property property : propertyHandlers) {
    if ("String_Node_Str".equals(property.getName()) && property instanceof Validator) {
      return (Validator)property;
    }
  }
  return null;
}
Program: 39548
Project: 39548
Buggy source:
@Override public void validate(FacesContext context,UIComponent comp,Object value) throws ValidatorException {
  String storeId=(String)comp.getAttributes().get(this.getName());
  if (storeId == null || value == null)   return;
  UIComponent storeComp=context.getViewRoot().findComponent(storeId);
  if (storeComp != null && (storeComp instanceof SelectItemStoreComponent)) {
    Validator validator=getDataStroeValidator((SelectItemStoreComponent)storeComp);
    if (validator != null) {
      validator.validate(context,(UIComponent)storeComp,value);
    }
  }
}

Fixed version (ground truth):
@Override public void validate(FacesContext context,UIComponent comp,Object value) throws ValidatorException {
  String storeId=(String)comp.getAttributes().get(this.getName());
  if (storeId == null || value == null)   return;
  UIComponent storeComp=context.getViewRoot().findComponent(storeId);
  if (storeComp != null && (storeComp instanceof DojoWidget)) {
    Validator validator=getDataStroeValidator((DojoWidget)storeComp);
    if (validator != null) {
      validator.validate(context,(UIComponent)storeComp,value);
    }
  }
}
Program: 39549
Project: 39549
Buggy source:
public static void extract(@Required(message="String_Node_Str") String rawHtml){
  GooseResponseData responseData=new GooseResponseData();
  if (validation.hasErrors()) {
    String em="String_Node_Str";
    for (    Error e : validation.errors())     em+=e.message() + "String_Node_Str";
    responseData.setStatusError();
    responseData.setErrorMsg(em);
    renderJSON(responseData);
  }
  try {
    ContentExtractor extractor=new ContentExtractor();
    String result=extractor.extractContentFromHtmlString(rawHtml);
    responseData.setResult(result);
  }
 catch (  Exception e) {
    responseData.setStatusError();
    responseData.setErrorMsg("String_Node_Str" + e.getMessage());
  }
  renderJSON(responseData);
}

Fixed version (ground truth):
public static void extract(@Required(message="String_Node_Str") String rawHtml){
  GooseResponseData responseData=new GooseResponseData();
  if (validation.hasErrors()) {
    String em="String_Node_Str";
    for (    Error e : validation.errors())     em+=e.message() + "String_Node_Str";
    responseData.setStatusError();
    responseData.setErrorMsg(em);
    renderJSON(responseData);
  }
  try {
    ContentExtractor extractor=new ContentExtractor();
    String result=extractor.extractContentFromHtmlString(rawHtml);
    responseData.setResult(result);
  }
 catch (  Exception e) {
    responseData.setStatusError();
    responseData.setErrorMsg("String_Node_Str" + e.getMessage());
    renderJSON(responseData);
  }
  renderJSON(responseData);
}
Program: 39550
Project: 39550
Buggy source:
public void renderType(RenderType $type){
  _renderType=$type;
  _renderTypeInt=renderTypeToInt(_renderType);
}

Fixed version (ground truth):
public void renderType(RenderType $type){
  _renderType=$type;
}
Program: 39553
Project: 39553
Buggy source:
public Light(){
  super(null);
  ambient=new Color4Managed(128,128,128,255,this);
  diffuse=new Color4Managed(255,255,255,255,this);
  specular=new Color4Managed(0,0,0,255,this);
  emissive=new Color4Managed(0,0,0,255,this);
  position=new Number3dManaged(0f,0f,5f,this);
  direction=new Number3dManaged(0,0,-1,this);
  _attenuation=new Number3dManaged(1f,0f,0f,this);
  _isVisible=new BooleanManaged(true,this);
  type(LightType.DIRECTIONAL);
  _positionAndTypeFloatBuffer=Utils.makeFloatBuffer4(0,0,0,0);
  setDirtyFlag();
}

Fixed version (ground truth):
public Light(){
  super(null);
  ambient=new Color4Managed(128,128,128,255,this);
  diffuse=new Color4Managed(255,255,255,255,this);
  specular=new Color4Managed(0,0,0,255,this);
  emissive=new Color4Managed(0,0,0,255,this);
  position=new Number3dManaged(0f,0f,5f,this);
  direction=new Number3dManaged(0f,0f,-1f,this);
  _attenuation=new Number3dManaged(1f,0f,0f,this);
  _isVisible=new BooleanManaged(true,this);
  type(LightType.DIRECTIONAL);
  _positionAndTypeFloatBuffer=Utils.makeFloatBuffer4(0,0,0,0);
  setDirtyFlag();
}
Program: 39554
Project: 39554
Buggy source:
/** 
 * Used by Renderer
 */
public void commitToFloatBuffer(){
  this.toFloatBuffer(_fb);
}

Fixed version (ground truth):
/** 
 * Used by Renderer
 */
public void commitToFloatBuffer(){
  toFloatBuffer(_fb);
}
Program: 39555
Project: 39555
Buggy source:
/** 
 * Convenience method
 */
public void toFloatBuffer(FloatBuffer $floatBuffer){
  $floatBuffer.position(0);
  $floatBuffer.put((float)_x / 255f);
  $floatBuffer.put((float)_y / 255f);
  $floatBuffer.put((float)_z / 255f);
  $floatBuffer.position(0);
}

Fixed version (ground truth):
/** 
 * Convenience method
 */
public void toFloatBuffer(FloatBuffer $floatBuffer){
  $floatBuffer.position(0);
  $floatBuffer.put(_x);
  $floatBuffer.put(_y);
  $floatBuffer.put(_z);
  $floatBuffer.position(0);
}
Program: 39556
Project: 39556
Buggy source:
private void build(){
  color=new Color4();
  faces=new Rectangle[6];
  Rectangle north=new Rectangle(size,size,quality,quality,color);
  Rectangle east=new Rectangle(size,size,quality,quality,color);
  Rectangle south=new Rectangle(size,size,quality,quality,color);
  Rectangle west=new Rectangle(size,size,quality,quality,color);
  Rectangle up=new Rectangle(size,size,quality,quality,color);
  Rectangle down=new Rectangle(size,size,quality,quality,color);
  north.position().z=halfSize;
  north.lightingEnabled(false);
  east.rotation().y=-90;
  east.position().x=-halfSize;
  east.lightingEnabled(false);
  south.rotation().y=180;
  south.position().z=-halfSize;
  south.lightingEnabled(false);
  west.rotation().y=90;
  west.position().x=halfSize;
  west.lightingEnabled(false);
  up.rotation().x=-90;
  up.position().y=halfSize;
  up.lightingEnabled(false);
  down.rotation().x=90;
  down.position().y=-halfSize;
  down.lightingEnabled(false);
  faces[Face.North.ordinal()]=north;
  faces[Face.East.ordinal()]=east;
  faces[Face.South.ordinal()]=south;
  faces[Face.West.ordinal()]=west;
  faces[Face.Up.ordinal()]=up;
  faces[Face.Down.ordinal()]=down;
  addChild(north);
  addChild(east);
  addChild(south);
  addChild(west);
  addChild(up);
  addChild(down);
}

Fixed version (ground truth):
private void build(){
  color=new Color4();
  faces=new Rectangle[6];
  Rectangle north=new Rectangle(size,size,quality,quality,color);
  Rectangle east=new Rectangle(size,size,quality,quality,color);
  Rectangle south=new Rectangle(size,size,quality,quality,color);
  Rectangle west=new Rectangle(size,size,quality,quality,color);
  Rectangle up=new Rectangle(size,size,quality,quality,color);
  Rectangle down=new Rectangle(size,size,quality,quality,color);
  north.position().z=halfSize;
  north.lightingEnabled(false);
  east.rotation().y=-90;
  east.position().x=halfSize;
  east.doubleSidedEnabled(true);
  east.lightingEnabled(false);
  south.rotation().y=180;
  south.position().z=-halfSize;
  south.lightingEnabled(false);
  west.rotation().y=90;
  west.position().x=-halfSize;
  west.doubleSidedEnabled(true);
  west.lightingEnabled(false);
  up.rotation().x=90;
  up.position().y=halfSize;
  up.doubleSidedEnabled(true);
  up.lightingEnabled(false);
  down.rotation().x=-90;
  down.position().y=-halfSize;
  down.doubleSidedEnabled(true);
  down.lightingEnabled(false);
  faces[Face.North.ordinal()]=north;
  faces[Face.East.ordinal()]=east;
  faces[Face.South.ordinal()]=south;
  faces[Face.West.ordinal()]=west;
  faces[Face.Up.ordinal()]=up;
  faces[Face.Down.ordinal()]=down;
  addChild(north);
  addChild(east);
  addChild(south);
  addChild(west);
  addChild(up);
  addChild(down);
}