Program: 71969
Project: 71969
Buggy source:
private void drawBackgroudImage(DesignElementHandle handle,Graphics g,Rectangle rectangle){
  String backGroundImage=getBackgroundImage(handle);
  Object[] backGroundPosition=getBackgroundPosition(handle);
  int backGroundRepeat=getBackgroundRepeat(handle);
  if (backGroundImage != null) {
    Image image=null;
    try {
      image=ImageManager.getInstance().getImage(this.source.getTableAdapter().getModuleHandle(),backGroundImage);
    }
 catch (    SWTException e) {
      image=null;
    }
    if (image != null) {
      Rectangle area=rectangle;
      int repeat=backGroundRepeat;
      int alignment=0;
      Point position=new Point(-1,-1);
      Object xPosition=backGroundPosition[0];
      Object yPosition=backGroundPosition[1];
      org.eclipse.swt.graphics.Rectangle imageArea=image.getBounds();
      if (xPosition instanceof Integer) {
        position.x=((Integer)xPosition).intValue();
      }
 else       if (xPosition instanceof DimensionValue) {
        int percentX=(int)((DimensionValue)xPosition).getMeasure();
        position.x=(area.width - imageArea.width) * percentX / 100;
      }
 else       if (xPosition instanceof String) {
        alignment|=DesignElementHandleAdapter.getPosition((String)xPosition);
      }
      if (yPosition instanceof Integer) {
        position.y=((Integer)yPosition).intValue();
      }
 else       if (yPosition instanceof DimensionValue) {
        int percentY=(int)((DimensionValue)yPosition).getMeasure();
        position.y=(area.height - imageArea.height) * percentY / 100;
      }
 else       if (yPosition instanceof String) {
        alignment|=DesignElementHandleAdapter.getPosition((String)yPosition);
      }
      int x, y;
      Dimension size=new Rectangle(image.getBounds()).getSize();
      if (position != null && position.x != -1) {
        x=area.x + position.x;
      }
 else {
switch (alignment & PositionConstants.EAST_WEST) {
case PositionConstants.EAST:
          x=area.x + area.width - size.width;
        break;
case PositionConstants.WEST:
      x=area.x;
    break;
default :
  x=(area.width - size.width) / 2 + area.x;
break;
}
}
if (position != null && position.y != -1) {
y=area.y + position.y;
}
 else {
switch (alignment & PositionConstants.NORTH_SOUTH) {
case PositionConstants.NORTH:
y=area.y;
break;
case PositionConstants.SOUTH:
y=area.y + area.height - size.height;
break;
default :
y=(area.height - size.height) / 2 + area.y;
break;
}
}
ArrayList xyList=createImageList(x,y,size,repeat,rectangle);
Iterator iter=xyList.iterator();
Rectangle rect=new Rectangle();
g.getClip(rect);
g.setClip(rectangle);
while (iter.hasNext()) {
Point point=(Point)iter.next();
g.drawImage(image,point);
}
g.setClip(rect);
xyList.clear();
}
}
}

Fixed version (ground truth):
private void drawBackgroudImage(DesignElementHandle handle,Graphics g,Rectangle rectangle){
  String backGroundImage=getBackgroundImage(handle);
  if (backGroundImage != null) {
    Image image=null;
    try {
      image=ImageManager.getInstance().getImage(this.source.getTableAdapter().getModuleHandle(),backGroundImage);
    }
 catch (    SWTException e) {
      image=null;
    }
    if (image != null) {
      Object[] backGroundPosition=getBackgroundPosition(handle);
      int backGroundRepeat=getBackgroundRepeat(handle);
      Rectangle area=rectangle;
      int repeat=backGroundRepeat;
      int alignment=0;
      Point position=new Point(-1,-1);
      Object xPosition=backGroundPosition[0];
      Object yPosition=backGroundPosition[1];
      org.eclipse.swt.graphics.Rectangle imageArea=image.getBounds();
      if (xPosition instanceof Integer) {
        position.x=((Integer)xPosition).intValue();
      }
 else       if (xPosition instanceof DimensionValue) {
        int percentX=(int)((DimensionValue)xPosition).getMeasure();
        position.x=(area.width - imageArea.width) * percentX / 100;
      }
 else       if (xPosition instanceof String) {
        alignment|=DesignElementHandleAdapter.getPosition((String)xPosition);
      }
      if (yPosition instanceof Integer) {
        position.y=((Integer)yPosition).intValue();
      }
 else       if (yPosition instanceof DimensionValue) {
        int percentY=(int)((DimensionValue)yPosition).getMeasure();
        position.y=(area.height - imageArea.height) * percentY / 100;
      }
 else       if (yPosition instanceof String) {
        alignment|=DesignElementHandleAdapter.getPosition((String)yPosition);
      }
      int x, y;
      Dimension size=new Rectangle(image.getBounds()).getSize();
      if (position != null && position.x != -1) {
        x=area.x + position.x;
      }
 else {
switch (alignment & PositionConstants.EAST_WEST) {
case PositionConstants.EAST:
          x=area.x + area.width - size.width;
        break;
case PositionConstants.WEST:
      x=area.x;
    break;
default :
  x=(area.width - size.width) / 2 + area.x;
break;
}
}
if (position != null && position.y != -1) {
y=area.y + position.y;
}
 else {
switch (alignment & PositionConstants.NORTH_SOUTH) {
case PositionConstants.NORTH:
y=area.y;
break;
case PositionConstants.SOUTH:
y=area.y + area.height - size.height;
break;
default :
y=(area.height - size.height) / 2 + area.y;
break;
}
}
ArrayList xyList=createImageList(x,y,size,repeat,rectangle);
Iterator iter=xyList.iterator();
Rectangle rect=new Rectangle();
g.getClip(rect);
g.setClip(rectangle);
while (iter.hasNext()) {
Point point=(Point)iter.next();
g.drawImage(image,point);
}
g.setClip(rect);
xyList.clear();
}
}
}