Program: 11540
Project: 11540
Buggy source:
/** 
 * Compute slave GCPs for the given tile.
 * @param slaveBand  the input band
 * @param slaveBand2 for complex
 * @param targetBand the output band
 */
private synchronized void computeSlaveGCPs(final Band slaveBand,final Band slaveBand2,final Band targetBand,final String bandCountStr) throws OperatorException {
  if (gcpsComputedMap.get(slaveBand))   return;
  try {
    final ProductNodeGroup<Placemark> targetGCPGroup=targetProduct.getGcpGroup(targetBand);
    final GeoCoding tgtGeoCoding=targetProduct.getGeoCoding();
    final int[] offset=new int[2];
    if (computeOffset) {
      determiningImageOffset(slaveBand,slaveBand2,offset);
    }
    final ThreadManager threadManager=new ThreadManager();
    final int numberOfMasterGCPs=masterGcpGroup.getNodeCount();
    final StatusProgressMonitor status=new StatusProgressMonitor(numberOfMasterGCPs,"String_Node_Str" + bandCountStr + ' '+ slaveBand.getName()+ "String_Node_Str");
    for (int i=0; i < numberOfMasterGCPs; ++i) {
      checkForCancellation();
      final Placemark mPin=masterGcpGroup.get(i);
      if (checkMasterGCPValidity(mPin)) {
        final GeoPos mGCPGeoPos=mPin.getGeoPos();
        final PixelPos mGCPPixelPos=mPin.getPixelPos();
        final PixelPos sGCPPixelPos=new PixelPos(mPin.getPixelPos().x + offset[0],mPin.getPixelPos().y + offset[1]);
        if (!checkSlaveGCPValidity(sGCPPixelPos)) {
          continue;
        }
        final Thread worker=new Thread(){
          @Override public void run(){
            boolean getSlaveGCP=getCoarseSlaveGCPPosition(slaveBand,slaveBand2,mGCPPixelPos,sGCPPixelPos);
            if (getSlaveGCP && complexCoregistration && applyFineRegistration) {
              getSlaveGCP=getFineSlaveGCPPosition(slaveBand,slaveBand2,mGCPPixelPos,sGCPPixelPos);
            }
            if (getSlaveGCP) {
              final Placemark sPin=Placemark.createPointPlacemark(GcpDescriptor.getInstance(),mPin.getName(),mPin.getLabel(),mPin.getDescription(),sGCPPixelPos,mGCPGeoPos,tgtGeoCoding);
              addPlacemark(sPin);
            }
          }
          private synchronized void addPlacemark(          final Placemark pin){
            targetGCPGroup.add(pin);
          }
        }
;
        threadManager.add(worker);
      }
      status.worked(i);
    }
    threadManager.finish();
    gcpsComputedMap.put(slaveBand,true);
    MemUtils.tileCacheFreeOldTiles();
    status.done();
  }
 catch (  Throwable e) {
    OperatorUtils.catchOperatorException(getId() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Compute slave GCPs for the given tile.
 * @param slaveBand  the input band
 * @param slaveBand2 for complex
 * @param targetBand the output band
 */
private synchronized void computeSlaveGCPs(final Band slaveBand,final Band slaveBand2,final Band targetBand,final String bandCountStr) throws OperatorException {
  if (gcpsComputedMap.get(slaveBand)) {
    return;
  }
  gcpsComputedMap.put(slaveBand,true);
  try {
    final ProductNodeGroup<Placemark> targetGCPGroup=targetProduct.getGcpGroup(targetBand);
    final GeoCoding tgtGeoCoding=targetProduct.getGeoCoding();
    final int[] offset=new int[2];
    if (computeOffset) {
      determiningImageOffset(slaveBand,slaveBand2,offset);
    }
    final ThreadManager threadManager=new ThreadManager();
    final int numberOfMasterGCPs=masterGcpGroup.getNodeCount();
    final StatusProgressMonitor status=new StatusProgressMonitor(numberOfMasterGCPs,"String_Node_Str" + bandCountStr + ' '+ slaveBand.getName()+ "String_Node_Str");
    for (int i=0; i < numberOfMasterGCPs; ++i) {
      checkForCancellation();
      final Placemark mPin=masterGcpGroup.get(i);
      if (checkMasterGCPValidity(mPin)) {
        final GeoPos mGCPGeoPos=mPin.getGeoPos();
        final PixelPos mGCPPixelPos=mPin.getPixelPos();
        final PixelPos sGCPPixelPos=new PixelPos(mPin.getPixelPos().x + offset[0],mPin.getPixelPos().y + offset[1]);
        if (!checkSlaveGCPValidity(sGCPPixelPos)) {
          continue;
        }
        final Thread worker=new Thread(){
          @Override public void run(){
            boolean getSlaveGCP=getCoarseSlaveGCPPosition(slaveBand,slaveBand2,mGCPPixelPos,sGCPPixelPos);
            if (getSlaveGCP && complexCoregistration && applyFineRegistration) {
              getSlaveGCP=getFineSlaveGCPPosition(slaveBand,slaveBand2,mGCPPixelPos,sGCPPixelPos);
            }
            if (getSlaveGCP) {
              final Placemark sPin=Placemark.createPointPlacemark(GcpDescriptor.getInstance(),mPin.getName(),mPin.getLabel(),mPin.getDescription(),sGCPPixelPos,mGCPGeoPos,tgtGeoCoding);
              addPlacemark(sPin);
            }
          }
          private synchronized void addPlacemark(          final Placemark pin){
            targetGCPGroup.add(pin);
          }
        }
;
        threadManager.add(worker);
      }
      status.worked(i);
    }
    threadManager.finish();
    MemUtils.tileCacheFreeOldTiles();
    status.done();
  }
 catch (  Throwable e) {
    OperatorUtils.catchOperatorException(getId() + "String_Node_Str",e);
  }
}