Program: 93320
Project: 93320
Buggy source:
AndroidPointTextContainer(Point xy,int priority,String text,Paint paintFront,Paint paintBack,SymbolContainer symbolContainer,Position position,int maxTextWidth){
  super(xy,priority,text,paintFront,paintBack,symbolContainer,position,maxTextWidth);
  if (this.textWidth > this.maxTextWidth) {
    TextPaint frontTextPaint=new TextPaint(AndroidGraphicFactory.getPaint(this.paintFront));
    TextPaint backTextPaint=null;
    if (this.paintBack != null) {
      backTextPaint=new TextPaint(AndroidGraphicFactory.getPaint(this.paintBack));
    }
    Layout.Alignment alignment=Layout.Alignment.ALIGN_CENTER;
    if (Position.LEFT == this.position || Position.BELOW_LEFT == this.position || Position.ABOVE_LEFT == this.position) {
      alignment=Layout.Alignment.ALIGN_OPPOSITE;
    }
 else     if (Position.RIGHT == this.position || Position.BELOW_RIGHT == this.position || Position.ABOVE_RIGHT == this.position) {
      alignment=Layout.Alignment.ALIGN_NORMAL;
    }
    frontTextPaint.setTextAlign(android.graphics.Paint.Align.LEFT);
    backTextPaint.setTextAlign(android.graphics.Paint.Align.LEFT);
    frontLayout=new StaticLayout(this.text,frontTextPaint,this.maxTextWidth,alignment,1,0,false);
    backLayout=null;
    if (this.paintBack != null) {
      backLayout=new StaticLayout(this.text,backTextPaint,this.maxTextWidth,alignment,1,0,false);
    }
    this.boxWidth=frontLayout.getWidth();
    this.boxHeight=frontLayout.getHeight();
  }
 else {
    this.boxWidth=textWidth;
    this.boxHeight=textHeight;
  }
switch (this.position) {
case CENTER:
    boundary=new Rectangle(-boxWidth / 2f,-boxHeight / 2f,boxWidth / 2f,boxHeight / 2f);
  break;
case BELOW:
boundary=new Rectangle(-boxWidth / 2f,0,boxWidth / 2f,boxHeight);
break;
case BELOW_LEFT:
boundary=new Rectangle(-boxWidth,0,0,boxHeight);
break;
case BELOW_RIGHT:
boundary=new Rectangle(0,0,boxWidth,boxHeight);
break;
case ABOVE:
boundary=new Rectangle(-boxWidth / 2f,-boxHeight,boxWidth / 2f,0);
break;
case ABOVE_LEFT:
boundary=new Rectangle(-boxWidth,-boxHeight,0,0);
break;
case ABOVE_RIGHT:
boundary=new Rectangle(0,-boxHeight,boxWidth,0);
break;
case LEFT:
boundary=new Rectangle(-boxWidth,-boxHeight / 2f,0,boxHeight / 2f);
break;
case RIGHT:
boundary=new Rectangle(0,-boxHeight / 2f,boxWidth,boxHeight / 2f);
break;
}
switch (this.position) {
case CENTER:
debugBoundary=new Rectangle(-textWidth / 2f,-textHeight / 2f,textWidth / 2f,textHeight / 2f);
break;
case BELOW:
debugBoundary=new Rectangle(-textWidth / 2f,0,textWidth / 2f,textHeight);
break;
case BELOW_LEFT:
debugBoundary=new Rectangle(-textWidth,0,0,textHeight);
break;
case BELOW_RIGHT:
debugBoundary=new Rectangle(0,0,textWidth,textHeight);
break;
case ABOVE:
debugBoundary=new Rectangle(-textWidth / 2f,-textHeight,textWidth / 2f,0);
break;
case ABOVE_LEFT:
debugBoundary=new Rectangle(-textWidth,-textHeight,0,0);
break;
case ABOVE_RIGHT:
debugBoundary=new Rectangle(0,-textHeight,textWidth,0);
break;
case LEFT:
debugBoundary=new Rectangle(-textWidth,-textHeight / 2f,0,textHeight / 2f);
break;
case RIGHT:
debugBoundary=new Rectangle(0,-textHeight / 2f,textWidth,textHeight / 2f);
break;
}
}

Fixed version (ground truth):
AndroidPointTextContainer(Point xy,int priority,String text,Paint paintFront,Paint paintBack,SymbolContainer symbolContainer,Position position,int maxTextWidth){
  super(xy,priority,text,paintFront,paintBack,symbolContainer,position,maxTextWidth);
  if (this.textWidth > this.maxTextWidth) {
    TextPaint frontTextPaint=new TextPaint(AndroidGraphicFactory.getPaint(this.paintFront));
    TextPaint backTextPaint=null;
    if (this.paintBack != null) {
      backTextPaint=new TextPaint(AndroidGraphicFactory.getPaint(this.paintBack));
    }
    Layout.Alignment alignment=Layout.Alignment.ALIGN_CENTER;
    if (Position.LEFT == this.position || Position.BELOW_LEFT == this.position || Position.ABOVE_LEFT == this.position) {
      alignment=Layout.Alignment.ALIGN_OPPOSITE;
    }
 else     if (Position.RIGHT == this.position || Position.BELOW_RIGHT == this.position || Position.ABOVE_RIGHT == this.position) {
      alignment=Layout.Alignment.ALIGN_NORMAL;
    }
    frontTextPaint.setTextAlign(android.graphics.Paint.Align.LEFT);
    backTextPaint.setTextAlign(android.graphics.Paint.Align.LEFT);
    frontLayout=new StaticLayout(this.text,frontTextPaint,this.maxTextWidth,alignment,1,0,false);
    backLayout=null;
    if (this.paintBack != null) {
      backLayout=new StaticLayout(this.text,backTextPaint,this.maxTextWidth,alignment,1,0,false);
    }
    this.boxWidth=frontLayout.getWidth();
    this.boxHeight=frontLayout.getHeight();
  }
 else {
    this.boxWidth=textWidth;
    this.boxHeight=textHeight;
  }
switch (this.position) {
case CENTER:
    boundary=new Rectangle(-boxWidth / 2f,-boxHeight / 2f,boxWidth / 2f,boxHeight / 2f);
  break;
case BELOW:
boundary=new Rectangle(-boxWidth / 2f,0,boxWidth / 2f,boxHeight);
break;
case BELOW_LEFT:
boundary=new Rectangle(-boxWidth,0,0,boxHeight);
break;
case BELOW_RIGHT:
boundary=new Rectangle(0,0,boxWidth,boxHeight);
break;
case ABOVE:
boundary=new Rectangle(-boxWidth / 2f,-boxHeight,boxWidth / 2f,0);
break;
case ABOVE_LEFT:
boundary=new Rectangle(-boxWidth,-boxHeight,0,0);
break;
case ABOVE_RIGHT:
boundary=new Rectangle(0,-boxHeight,boxWidth,0);
break;
case LEFT:
boundary=new Rectangle(-boxWidth,-boxHeight / 2f,0,boxHeight / 2f);
break;
case RIGHT:
boundary=new Rectangle(0,-boxHeight / 2f,boxWidth,boxHeight / 2f);
break;
}
}