Program: 120695
Project: 120695
Buggy source:
/** 
 * DOC amaumont Comment method "checkDropHasValidTarget".
 */
private boolean checkDropIsValid(){
  isInputToInput=false;
  mapOneToOneAuthorized=true;
  if (targetIsExpressionFilterText() || (targetTableIsFiltersTable() || targetTableIsGlobalMapTable() || draggedData.getTransferableEntryList().size() <= 1)) {
    mapOneToOneAuthorized=false;
  }
  if (invalidKeyPressed) {
    return false;
  }
  if (zoneSource == Zone.INPUTS && zoneTarget == Zone.INPUTS) {
    isInputToInput=true;
    mapOneToOneAuthorized=false;
    List<InputTable> inputTables=mapperManager.getInputTables();
    int indexTableSource=inputTables.indexOf(dataMapTableViewSource.getDataMapTable());
    int indexTableTarget=inputTables.indexOf(dataMapTableViewTarget.getDataMapTable());
    if (currentTableTarget != null) {
      if (indexTableSource >= indexTableTarget) {
        return false;
      }
 else {
        return true;
      }
    }
 else     if (currentStyledTextTarget != null) {
      if (indexTableSource > indexTableTarget) {
        return false;
      }
 else {
        return true;
      }
    }
 else {
      throw new IllegalStateException(Messages.getString("String_Node_Str"));
    }
  }
  if (zoneSource == Zone.OUTPUTS && zoneTarget == Zone.OUTPUTS) {
    isOutputToOutput=true;
    mapOneToOneAuthorized=true;
    List<OutputTable> outputTables=mapperManager.getOutputTables();
    int indexSourceOutputTable=outputTables.indexOf(dataMapTableViewSource.getDataMapTable());
    int indexTargetOutputTable=outputTables.indexOf(dataMapTableViewTarget.getDataMapTable());
    if (indexSourceOutputTable == indexTargetOutputTable) {
      return false;
    }
 else {
      return true;
    }
  }
  if (currentTableTarget != null) {
    TableItem tableItemTarget=getTableItemFromPosition(new Point(event.x,event.y));
    if (zoneSource == Zone.VARS && zoneTarget == Zone.VARS && tableItemTarget != null) {
      if (tableItemSource == tableItemTarget || !dropVarsEntryIsValid(tableItemTarget)) {
        return false;
      }
    }
  }
  if (zoneSource == Zone.VARS && zoneTarget == Zone.INPUTS || zoneSource == Zone.OUTPUTS && zoneTarget == Zone.INPUTS || zoneSource == Zone.OUTPUTS && zoneTarget == Zone.VARS) {
    return false;
  }
  IDataMapTable dataMapTable=dataMapTableViewTarget.getDataMapTable();
  if (zoneTarget == Zone.OUTPUTS) {
    OutputTable outputTable=(OutputTable)dataMapTable;
    if (outputTable.isErrorRejectTable()) {
      if (currentTableTarget != null && event != null) {
        if (event.item instanceof TableItem) {
          Object data=event.item.getData();
          if (data instanceof OutputColumnTableEntry) {
            String label=((OutputColumnTableEntry)data).getName();
            if (mapperManager.ERROR_REJECT_MESSAGE.equals(label) || mapperManager.ERROR_REJECT_STACK_TRACE.equals(label)) {
              return false;
            }
          }
        }
      }
    }
    boolean useRepositoryMeta=outputTable.getId() != null && !"String_Node_Str".equals(outputTable.getId());
    if (useRepositoryMeta && currentStyledTextTarget != null) {
      return true;
    }
    if (useRepositoryMeta && isCursorOverHeader || useRepositoryMeta && !isCursorOverExpressionCell) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "checkDropHasValidTarget".
 */
private boolean checkDropIsValid(){
  isInputToInput=false;
  mapOneToOneAuthorized=true;
  if (targetIsExpressionFilterText() || (targetTableIsFiltersTable() || targetTableIsGlobalMapTable() || draggedData.getTransferableEntryList().size() <= 1)) {
    mapOneToOneAuthorized=false;
  }
  if (invalidKeyPressed) {
    return false;
  }
  if (zoneSource == Zone.INPUTS && zoneTarget == Zone.INPUTS) {
    isInputToInput=true;
    mapOneToOneAuthorized=false;
    List<InputTable> inputTables=mapperManager.getInputTables();
    int indexTableSource=inputTables.indexOf(dataMapTableViewSource.getDataMapTable());
    int indexTableTarget=inputTables.indexOf(dataMapTableViewTarget.getDataMapTable());
    if (currentTableTarget != null) {
      if (indexTableSource >= indexTableTarget) {
        return false;
      }
 else {
        return true;
      }
    }
 else     if (currentStyledTextTarget != null) {
      if (indexTableSource > indexTableTarget) {
        return false;
      }
 else {
        return true;
      }
    }
 else {
      throw new IllegalStateException(Messages.getString("String_Node_Str"));
    }
  }
  if (zoneSource == Zone.OUTPUTS && zoneTarget == Zone.OUTPUTS) {
    isOutputToOutput=true;
    mapOneToOneAuthorized=true;
    List<OutputTable> outputTables=mapperManager.getOutputTables();
    int indexSourceOutputTable=outputTables.indexOf(dataMapTableViewSource.getDataMapTable());
    int indexTargetOutputTable=outputTables.indexOf(dataMapTableViewTarget.getDataMapTable());
    if (indexSourceOutputTable == indexTargetOutputTable) {
      return false;
    }
 else {
      return true;
    }
  }
  if (currentTableTarget != null) {
    TableItem tableItemTarget=getTableItemFromPosition(new Point(event.x,event.y));
    if (zoneSource == Zone.VARS && zoneTarget == Zone.VARS && tableItemTarget != null) {
      if (tableItemSource == tableItemTarget || !dropVarsEntryIsValid(tableItemTarget)) {
        return false;
      }
    }
  }
  if (zoneSource == Zone.VARS && zoneTarget == Zone.INPUTS || zoneSource == Zone.OUTPUTS && zoneTarget == Zone.INPUTS || zoneSource == Zone.OUTPUTS && zoneTarget == Zone.VARS) {
    return false;
  }
  IDataMapTable dataMapTable=dataMapTableViewTarget.getDataMapTable();
  if (zoneTarget == Zone.OUTPUTS) {
    OutputTable outputTable=(OutputTable)dataMapTable;
    if (outputTable.isErrorRejectTable()) {
      if (currentTableTarget != null && event != null) {
        if (event.item instanceof TableItem) {
          Object data=event.item.getData();
          if (data instanceof OutputColumnTableEntry) {
            String label=((OutputColumnTableEntry)data).getName();
            if (mapperManager.ERROR_REJECT_MESSAGE.equals(label) || mapperManager.ERROR_REJECT_STACK_TRACE.equals(label)) {
              return false;
            }
          }
        }
      }
    }
    boolean useRepositoryMeta=outputTable.getId() != null && !"String_Node_Str".equals(outputTable.getId());
    if (!useRepositoryMeta && outputTable.getIsJoinTableOf() != null && !"String_Node_Str".equals(outputTable.getIsJoinTableOf())) {
      OutputTable mainTable=mapperManager.getOutputTableByName(outputTable.getIsJoinTableOf());
      if (mainTable != null) {
        useRepositoryMeta=mainTable.getId() != null && !"String_Node_Str".equals(mainTable.getId());
      }
    }
    if (useRepositoryMeta && currentStyledTextTarget != null) {
      return true;
    }
    if (useRepositoryMeta && isCursorOverHeader || useRepositoryMeta && !isCursorOverExpressionCell) {
      return false;
    }
  }
  return true;
}