Program: 11436
Project: 11436
Buggy source:
private void getInitialComplexSlaveImagette(final ComplexCoregData compleData,final Band slaveBand1,final Band slaveBand2,final PixelPos sGCPPixelPos){
  compleData.sII0=new double[compleData.fWindowHeight][compleData.fWindowWidth];
  compleData.sIQ0=new double[compleData.fWindowHeight][compleData.fWindowWidth];
  final int x0=(int)(sGCPPixelPos.x + 0.5);
  final int y0=(int)(sGCPPixelPos.y + 0.5);
  compleData.point0[0]=sGCPPixelPos.x;
  compleData.point0[1]=sGCPPixelPos.y;
  final int xul=x0 - compleData.fHalfWindowWidth + 1;
  final int yul=y0 - compleData.fHalfWindowHeight + 1;
  final Rectangle slaveImagetteRectangle=new Rectangle(xul,yul,compleData.fWindowWidth,compleData.fWindowHeight);
  final Tile slaveImagetteRaster1=getSourceTile(slaveBand1,slaveImagetteRectangle);
  final Tile slaveImagetteRaster2=getSourceTile(slaveBand2,slaveImagetteRectangle);
  final ProductData slaveData1=slaveImagetteRaster1.getDataBuffer();
  final ProductData slaveData2=slaveImagetteRaster2.getDataBuffer();
  final TileIndex index=new TileIndex(slaveImagetteRaster1);
  final double[][] sII0data=compleData.sII0;
  final double[][] sIQ0data=compleData.sIQ0;
  for (int j=0; j < compleData.fWindowHeight; j++) {
    index.calculateStride(yul + j);
    for (int i=0; i < compleData.fWindowWidth; i++) {
      final int idx=index.getIndex(xul + i);
      sII0data[j][i]=slaveData1.getElemDoubleAt(idx);
      sIQ0data[j][i]=slaveData2.getElemDoubleAt(idx);
    }
  }
  slaveData1.dispose();
  slaveData2.dispose();
}

Fixed version (ground truth):
private void getInitialComplexSlaveImagette(final ComplexCoregData complexData,final Band slaveBand1,final Band slaveBand2,final PixelPos sGCPPixelPos){
  complexData.sII0=new double[complexData.fWindowHeight][complexData.fWindowWidth];
  complexData.sIQ0=new double[complexData.fWindowHeight][complexData.fWindowWidth];
  complexData.point0[0]=sGCPPixelPos.x;
  complexData.point0[1]=sGCPPixelPos.y;
  final double[][] sII0data=complexData.sII0;
  final double[][] sIQ0data=complexData.sIQ0;
  final double[][] tmpI=new double[complexData.fWindowHeight][complexData.fWindowWidth];
  final double[][] tmpQ=new double[complexData.fWindowHeight][complexData.fWindowWidth];
  final int x0=(int)(sGCPPixelPos.x + 0.5);
  final int y0=(int)(sGCPPixelPos.y + 0.5);
  final int xul=x0 - complexData.fHalfWindowWidth + 1;
  final int yul=y0 - complexData.fHalfWindowHeight + 1;
  final Rectangle slaveImagetteRectangle=new Rectangle(xul,yul,complexData.fWindowWidth,complexData.fWindowHeight);
  final Tile slaveImagetteRaster1=getSourceTile(slaveBand1,slaveImagetteRectangle);
  final Tile slaveImagetteRaster2=getSourceTile(slaveBand2,slaveImagetteRectangle);
  final ProductData slaveData1=slaveImagetteRaster1.getDataBuffer();
  final ProductData slaveData2=slaveImagetteRaster2.getDataBuffer();
  final TileIndex index=new TileIndex(slaveImagetteRaster1);
  for (int j=0; j < complexData.fWindowHeight; j++) {
    index.calculateStride(yul + j);
    for (int i=0; i < complexData.fWindowWidth; i++) {
      final int idx=index.getIndex(xul + i);
      tmpI[j][i]=slaveData1.getElemDoubleAt(idx);
      tmpQ[j][i]=slaveData2.getElemDoubleAt(idx);
    }
  }
  slaveData1.dispose();
  slaveData2.dispose();
  final double xShift=sGCPPixelPos.x - x0;
  final double yShift=sGCPPixelPos.y - y0;
  getShiftedData(complexData,tmpI,tmpQ,xShift,yShift,sII0data,sIQ0data);
}