nus-yam/ex-repair huggingface dataset:
Program: 121272
Project: 121272
Buggy source:
public static IConnection getPreviousParCon(Node previousNode){
  IConnection previousCon=null;
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true)) || (con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true))) {
        previousCon=con;
      }
 else {
        previousCon=getPreviousParCon((Node)con.getSource());
      }
    }
  }
  return previousCon;
}

Fixed version (ground truth):
public static IConnection getPreviousParCon(Node previousNode){
  IConnection previousCon=null;
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true)) || (con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true))) {
        previousCon=con;
        break;
      }
 else {
        previousCon=getPreviousParCon((Node)con.getSource());
      }
    }
  }
  return previousCon;
}
Program: 121273
Project: 121273
Buggy source:
public static boolean existPreviousOtherCon(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getLineStyle() == EConnectionType.ON_SUBJOB_OK || con.getLineStyle() == EConnectionType.ON_SUBJOB_ERROR || con.getLineStyle() == EConnectionType.RUN_IF || con.getLineStyle() == EConnectionType.ROUTE_WHEN || con.getLineStyle() == EConnectionType.ROUTE_CATCH || con.getLineStyle() == EConnectionType.ON_COMPONENT_OK || con.getLineStyle() == EConnectionType.ON_COMPONENT_ERROR)) {
    }
    hasInPreviousCon=true;
  }
  return hasInPreviousCon;
}

Fixed version (ground truth):
public static boolean existPreviousOtherCon(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getLineStyle() == EConnectionType.ON_SUBJOB_OK || con.getLineStyle() == EConnectionType.ON_SUBJOB_ERROR || con.getLineStyle() == EConnectionType.RUN_IF || con.getLineStyle() == EConnectionType.ROUTE_WHEN || con.getLineStyle() == EConnectionType.ROUTE_CATCH || con.getLineStyle() == EConnectionType.ON_COMPONENT_OK || con.getLineStyle() == EConnectionType.ON_COMPONENT_ERROR)) {
    }
    hasInPreviousCon=true;
    break;
  }
  return hasInPreviousCon;
}
Program: 121274
Project: 121274
Buggy source:
public static boolean isExistNextDeparCon(Node nextNode){
  boolean hasDeparInNextCon=false;
  if (nextNode.getOutgoingConnections().size() > 0) {
    for (    IConnection con : nextNode.getOutgoingConnections()) {
      if (con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true) || con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true)) {
        hasDeparInNextCon=true;
      }
 else {
        hasDeparInNextCon=isExistNextDeparCon((Node)con.getTarget());
      }
    }
  }
  return hasDeparInNextCon;
}

Fixed version (ground truth):
public static boolean isExistNextDeparCon(Node nextNode){
  boolean hasDeparInNextCon=false;
  if (nextNode.getOutgoingConnections().size() > 0) {
    for (    IConnection con : nextNode.getOutgoingConnections()) {
      if (con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true) || con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true)) {
        hasDeparInNextCon=true;
        break;
      }
 else {
        hasDeparInNextCon=isExistNextDeparCon((Node)con.getTarget());
      }
    }
  }
  return hasDeparInNextCon;
}
Program: 121275
Project: 121275
Buggy source:
public static boolean existPreviousRepar(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true))) {
      hasInPreviousCon=true;
    }
  }
  return hasInPreviousCon;
}

Fixed version (ground truth):
public static boolean existPreviousRepar(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true))) {
      hasInPreviousCon=true;
      break;
    }
  }
  return hasInPreviousCon;
}
Program: 121276
Project: 121276
Buggy source:
public static boolean isExistPreviousParCon(Node previousNode){
  boolean hasParInPreviousCon=false;
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if (con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true) || con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true)) {
        hasParInPreviousCon=true;
      }
 else {
        hasParInPreviousCon=isExistPreviousParCon((Node)con.getSource());
      }
    }
  }
  return hasParInPreviousCon;
}

Fixed version (ground truth):
public static boolean isExistPreviousParCon(Node previousNode){
  boolean hasParInPreviousCon=false;
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if (con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true) || con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true)) {
        hasParInPreviousCon=true;
        break;
      }
 else {
        hasParInPreviousCon=isExistPreviousParCon((Node)con.getSource());
      }
    }
  }
  return hasParInPreviousCon;
}
Program: 121277
Project: 121277
Buggy source:
public static boolean existPreviousNone(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getElementParameter(EParameterName.NONE.getName()) != null && con.getElementParameter(EParameterName.NONE.getName()).getValue().equals(true))) {
      hasInPreviousCon=true;
    }
  }
  return hasInPreviousCon;
}

Fixed version (ground truth):
public static boolean existPreviousNone(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getElementParameter(EParameterName.NONE.getName()) != null && con.getElementParameter(EParameterName.NONE.getName()).getValue().equals(true))) {
      hasInPreviousCon=true;
      break;
    }
  }
  return hasInPreviousCon;
}
Program: 121278
Project: 121278
Buggy source:
public static boolean existPreviousPar(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true))) {
      hasInPreviousCon=true;
    }
  }
  return hasInPreviousCon;
}

Fixed version (ground truth):
public static boolean existPreviousPar(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true))) {
      hasInPreviousCon=true;
      break;
    }
  }
  return hasInPreviousCon;
}
Program: 121279
Project: 121279
Buggy source:
public static boolean existPreviousDepar(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true))) {
      hasInPreviousCon=true;
    }
  }
  return hasInPreviousCon;
}

Fixed version (ground truth):
public static boolean existPreviousDepar(Node currentNode){
  boolean hasInPreviousCon=false;
  for (  IConnection con : currentNode.getIncomingConnections()) {
    if ((con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true))) {
      hasInPreviousCon=true;
      break;
    }
  }
  return hasInPreviousCon;
}
Program: 121280
Project: 121280
Buggy source:
public static boolean existNextDepar(Node currentNode){
  boolean hasNextCon=false;
  for (  IConnection con : currentNode.getOutgoingConnections()) {
    if ((con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true))) {
      hasNextCon=true;
    }
  }
  return hasNextCon;
}

Fixed version (ground truth):
public static boolean existNextDepar(Node currentNode){
  boolean hasNextCon=false;
  for (  IConnection con : currentNode.getOutgoingConnections()) {
    if ((con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true))) {
      hasNextCon=true;
      break;
    }
  }
  return hasNextCon;
}
Program: 121281
Project: 121281
Buggy source:
public static boolean isExistPreviouDeparCon(Node previousNode){
  boolean hasDeparInPreviousCon=false;
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if (con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true)) {
        hasDeparInPreviousCon=true;
      }
 else {
        hasDeparInPreviousCon=isExistPreviouDeparCon((Node)con.getSource());
      }
    }
  }
  return hasDeparInPreviousCon;
}

Fixed version (ground truth):
public static boolean isExistPreviouDeparCon(Node previousNode){
  boolean hasDeparInPreviousCon=false;
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if (con.getElementParameter(EParameterName.DEPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.DEPARTITIONER.getName()).getValue().equals(true)) {
        hasDeparInPreviousCon=true;
        break;
      }
 else {
        hasDeparInPreviousCon=isExistPreviouDeparCon((Node)con.getSource());
      }
    }
  }
  return hasDeparInPreviousCon;
}
Program: 121287
Project: 121287
Buggy source:
private void init(boolean duringLogon){
  removeOldComponentsUserFolder();
  long startTime=System.currentTimeMillis();
  componentList=new HashSet<IComponent>();
  customComponentList=new HashSet<IComponent>();
  skeletonList=new ArrayList<String>();
  userComponentList=new HashSet<IComponent>();
  String installLocation=new Path(Platform.getConfigurationLocation().getURL().getPath()).toFile().getAbsolutePath();
  componentToProviderMap=new HashMap<IComponent,AbstractComponentsProvider>();
  boolean isNeedClean=!cleanDone && TalendCacheUtils.isSetCleanComponentCache();
  cleanDone=true;
  isCreated=hasComponentFile(installLocation) && !isNeedClean;
  ComponentsCache cache=ComponentManager.getComponentCache();
  try {
    if (isCreated) {
      if (cache.getComponentEntryMap().isEmpty()) {
        ComponentsCache loadCache=loadComponentResource(installLocation);
        cache.getComponentEntryMap().putAll(loadCache.getComponentEntryMap());
      }
    }
 else {
      cache.getComponentEntryMap().clear();
    }
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
    cache.getComponentEntryMap().clear();
    isCreated=false;
  }
  loadComponentsFromComponentsProviderExtension();
  loadComponentsFromExtensions();
  ComponentManager.saveResource();
  log.debug(componentList.size() + "String_Node_Str" + (System.currentTimeMillis() - startTime)+ "String_Node_Str");
}

Fixed version (ground truth):
private void init(boolean duringLogon){
  removeOldComponentsUserFolder();
  long startTime=System.currentTimeMillis();
  componentList=new HashSet<IComponent>();
  customComponentList=new HashSet<IComponent>();
  skeletonList=new ArrayList<String>();
  userComponentList=new HashSet<IComponent>();
  String installLocation=new Path(Platform.getConfigurationLocation().getURL().getPath()).toFile().getAbsolutePath();
  componentToProviderMap=new HashMap<IComponent,AbstractComponentsProvider>();
  boolean isNeedClean=!cleanDone && TalendCacheUtils.isSetCleanComponentCache();
  cleanDone=true;
  isCreated=hasComponentFile(installLocation) && !isNeedClean;
  ComponentsCache cache=ComponentManager.getComponentCache();
  try {
    if (isCreated) {
      if (cache.getComponentEntryMap().isEmpty()) {
        ComponentsCache loadCache=loadComponentResource(installLocation);
        cache.getComponentEntryMap().putAll(loadCache.getComponentEntryMap());
      }
    }
 else {
      cache.getComponentEntryMap().clear();
    }
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
    cache.getComponentEntryMap().clear();
    isCreated=false;
  }
  loadComponentsFromComponentsProviderExtension();
  loadComponentsFromExtensions();
  ComponentManager.saveResource();
  log.debug(componentList.size() + "String_Node_Str" + (System.currentTimeMillis() - startTime)+ "String_Node_Str");
  if (!CommonUIPlugin.isFullyHeadless()) {
    ComponentsFactoryProvider.saveComponentVisibilityStatus();
  }
}
Program: 121291
Project: 121291
Buggy source:
public String checkUserAndPass(String username,String password){
  String errorMessage="String_Node_Str";
  if (username == null || "String_Node_Str".equals(username) || password == null || "String_Node_Str".equals(password)) {
    return errorMessage;
  }
  JSONObject tokenMessage=new JSONObject();
  try {
    tokenMessage.put("String_Node_Str",username);
    tokenMessage.put("String_Node_Str",ExchangeUtils.getPasswordHash(password));
    JSONObject token=new us.monoid.json.JSONObject();
    token.put("String_Node_Str",tokenMessage);
    String u=ExchangeWebService.exchangeWSServer + "String_Node_Str" + token;
    JSONObject answer=ExchangeWebService.readJsonFromUrl(u);
    if (answer != null && answer.get("String_Node_Str") != null && answer.get("String_Node_Str").equals("String_Node_Str")) {
      return errorMessage;
    }
  }
 catch (  JSONException e) {
    return null;
  }
catch (  IOException e) {
    return errorMessage;
  }
  return null;
}

Fixed version (ground truth):
public String checkUserAndPass(String username,String password){
  String errorMessage="String_Node_Str";
  if (username == null || "String_Node_Str".equals(username) || password == null || "String_Node_Str".equals(password)) {
    return errorMessage;
  }
  JSONObject tokenMessage=new JSONObject();
  try {
    tokenMessage.put("String_Node_Str",username);
    tokenMessage.put("String_Node_Str",password);
    JSONObject token=new us.monoid.json.JSONObject();
    token.put("String_Node_Str",tokenMessage);
    String u=ExchangeWebService.exchangeWSServer + "String_Node_Str" + token;
    JSONObject answer=ExchangeWebService.readJsonFromUrl(u);
    if (answer != null && answer.get("String_Node_Str") != null && answer.get("String_Node_Str").equals("String_Node_Str")) {
      return errorMessage;
    }
  }
 catch (  JSONException e) {
    return null;
  }
catch (  IOException e) {
    return errorMessage;
  }
  return null;
}
Program: 121292
Project: 121292
Buggy source:
public static String getPasswordHash(String passwordTemp){
  try {
    return SHA1Util.hex_sha1(passwordTemp);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return passwordTemp;
}

Fixed version (ground truth):
public static String getPasswordHash(){
  Project proj=ProjectManager.getInstance().getCurrentProject();
  return proj.getExchangeUser().getPassword();
}
Program: 121293
Project: 121293
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort,proxyUser,proxyPassword);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=null;
      if (project.getAuthor() != null) {
        connectionEmail=project.getAuthor().getLogin();
      }
 else {
        connectionEmail="String_Node_Str";
      }
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      okPressed();
    }
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort,proxyUser,proxyPassword);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,SHA1Util.hex_sha1(password));
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=null;
      if (project.getAuthor() != null) {
        connectionEmail=project.getAuthor().getLogin();
      }
 else {
        connectionEmail="String_Node_Str";
      }
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ SHA1Util.hex_sha1(password));
      okPressed();
    }
  }
}
Program: 121296
Project: 121296
Buggy source:
@Override public void run(){
  MessageDialog.openWarning(Display.getDefault().getActiveShell(),Messages.getString("String_Node_Str"),subForMsg(sb.toString()));
}

Fixed version (ground truth):
@Override public void run(){
  MessageDialog dialog=new MessageDialog(Display.getDefault().getActiveShell(),Messages.getString("String_Node_Str"),null,subForMsg(sb.toString()),4,new String[]{IDialogConstants.OK_LABEL},0){
    @Override protected void setShellStyle(    int newShellStyle){
      super.setShellStyle(getShellStyle() | SWT.NONE);
    }
  }
;
  dialog.open();
}
Program: 121302
Project: 121302
Buggy source:
/** 
 * This function will change the merge order of the connection.
 * @param id
 */
public void setInputId(int id){
  int newId=id - 1;
  int curId=0;
  if (target != null) {
    if (target.getIncomingConnections().size() < newId) {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str"));
    }
    if (target.getIncomingConnections().get(newId).equals(this)) {
      return;
    }
    for (int i=0; i < target.getIncomingConnections().size(); i++) {
      if (target.getIncomingConnections().get(i).equals(this)) {
        curId=i;
        break;
      }
    }
    Collections.swap(target.getIncomingConnections(),curId,newId);
  }
}

Fixed version (ground truth):
/** 
 * This function will change the merge order of the connection.
 * @param id
 */
@Override public void setInputId(int id){
  int newId=id - 1;
  int curId=0;
  if (target != null) {
    if (target.getIncomingConnections().size() < newId) {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str"));
    }
    if (target.getIncomingConnections().get(newId).equals(this)) {
      return;
    }
    for (int i=0; i < target.getIncomingConnections().size(); i++) {
      if (target.getIncomingConnections().get(i).equals(this)) {
        curId=i;
        break;
      }
    }
    Collections.swap(target.getIncomingConnections(),curId,newId);
  }
}
Program: 121303
Project: 121303
Buggy source:
public void setPerformanceData(String pefData){
  performance.setLabel(pefData);
}

Fixed version (ground truth):
@Override public void setPerformanceData(String pefData){
  performance.setLabel(pefData);
}
Program: 121304
Project: 121304
Buggy source:
/** 
 * Disconnect the connection This function is used before delete or reconnect a connection.
 */
public void disconnect(){
  if (isConnected) {
    INodeConnector sourceNodeConnector=getSourceNodeConnector();
    if (sourceNodeConnector != null && !sourceNodeConnector.isMultiSchema()) {
      if (lineStyle.hasConnectionCategory(IConnectionCategory.CUSTOM_NAME) || isInTypes(lineStyle,EConnectionType.ITERATE,EConnectionType.ON_COMPONENT_OK,EConnectionType.ON_COMPONENT_ERROR,EConnectionType.ON_SUBJOB_OK,EConnectionType.ON_SUBJOB_ERROR,EConnectionType.RUN_IF,EConnectionType.ROUTE,EConnectionType.ROUTE_TRY,EConnectionType.ROUTE_CATCH,EConnectionType.ROUTE_FINALLY,EConnectionType.ROUTE_ENDBLOCK,EConnectionType.ROUTE_WHEN,EConnectionType.ROUTE_OTHER,EConnectionType.STARTS)) {
        source.getProcess().removeUniqueConnectionName(uniqueName);
      }
    }
    source.removeOutput(this);
    target.removeInput(this);
    updateAllId();
    isConnected=false;
    if (lineStyle.equals(EConnectionType.SYNCHRONIZE)) {
      for (      IElementParameter param : target.getElementParameters()) {
        if (param.isBasedOnSubjobStarts()) {
          TableController.updateSubjobStarts(target,param);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Disconnect the connection This function is used before delete or reconnect a connection.
 */
@Override public void disconnect(){
  if (isConnected) {
    INodeConnector sourceNodeConnector=getSourceNodeConnector();
    if (sourceNodeConnector != null && !sourceNodeConnector.isMultiSchema()) {
      if (lineStyle.hasConnectionCategory(IConnectionCategory.CUSTOM_NAME) || isInTypes(lineStyle,EConnectionType.ITERATE,EConnectionType.ON_COMPONENT_OK,EConnectionType.ON_COMPONENT_ERROR,EConnectionType.ON_SUBJOB_OK,EConnectionType.ON_SUBJOB_ERROR,EConnectionType.RUN_IF,EConnectionType.ROUTE,EConnectionType.ROUTE_TRY,EConnectionType.ROUTE_CATCH,EConnectionType.ROUTE_FINALLY,EConnectionType.ROUTE_ENDBLOCK,EConnectionType.ROUTE_WHEN,EConnectionType.ROUTE_OTHER,EConnectionType.STARTS)) {
        source.getProcess().removeUniqueConnectionName(uniqueName);
      }
    }
    source.removeOutput(this);
    target.removeInput(this);
    updateAllId();
    isConnected=false;
    if (lineStyle.equals(EConnectionType.SYNCHRONIZE)) {
      for (      IElementParameter param : target.getElementParameters()) {
        if (param.isBasedOnSubjobStarts()) {
          TableController.updateSubjobStarts(target,param);
        }
      }
    }
  }
}
Program: 121305
Project: 121305
Buggy source:
/** 
 * Get the name/label of the connection.
 * @return Connection Name
 */
public String getName(){
  return name;
}

Fixed version (ground truth):
/** 
 * Get the name/label of the connection.
 * @return Connection Name
 */
@Override public String getName(){
  return name;
}
Program: 121306
Project: 121306
Buggy source:
public void setMetaName(String metaName){
  this.metaName=metaName;
}

Fixed version (ground truth):
@Override public void setMetaName(String metaName){
  this.metaName=metaName;
}
Program: 121307
Project: 121307
Buggy source:
private void createMeterParameters(Process process){
  IElementParameter param=new ElementParameter(this);
  param.setName(EParameterName.MONITOR_CONNECTION.getName());
  param.setDisplayName(EParameterName.MONITOR_CONNECTION.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setValue(monitorConnection);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setShow(true);
  param.setNumRow(10);
  addElementParameter(param);
  Node meterAttached=new Node(ComponentsFactoryProvider.getInstance().get("String_Node_Str",ComponentCategory.CATEGORY_4_DI.getName()),process);
  for (  IElementParameter curParam : meterAttached.getElementParameters()) {
    if (curParam.getCategory() == EComponentCategory.BASIC && !curParam.getName().equals(EParameterName.NOT_SYNCHRONIZED_SCHEMA.getName())) {
      curParam.setCategory(EComponentCategory.ADVANCED);
      curParam.setNumRow(curParam.getNumRow() + 1);
      if (curParam.getShowIf() == null || curParam.getShowIf().equals("String_Node_Str")) {
        curParam.setShowIf("String_Node_Str");
      }
 else {
        curParam.setShowIf("String_Node_Str" + curParam.getShowIf() + "String_Node_Str");
      }
      curParam.setElement(this);
      addElementParameter(curParam);
    }
  }
  meterAttached=null;
  setMonitorLabel(new MonitorConnectionLabel(this));
  updateMonitorLabel(param);
}

Fixed version (ground truth):
private void createMeterParameters(IProcess2 process){
  IElementParameter param=new ElementParameter(this);
  param.setName(EParameterName.MONITOR_CONNECTION.getName());
  param.setDisplayName(EParameterName.MONITOR_CONNECTION.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setValue(monitorConnection);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setShow(true);
  param.setNumRow(10);
  addElementParameter(param);
  Node meterAttached=new Node(ComponentsFactoryProvider.getInstance().get("String_Node_Str",ComponentCategory.CATEGORY_4_DI.getName()),process);
  for (  IElementParameter curParam : meterAttached.getElementParameters()) {
    if (curParam.getCategory() == EComponentCategory.BASIC && !curParam.getName().equals(EParameterName.NOT_SYNCHRONIZED_SCHEMA.getName())) {
      curParam.setCategory(EComponentCategory.ADVANCED);
      curParam.setNumRow(curParam.getNumRow() + 1);
      if (curParam.getShowIf() == null || curParam.getShowIf().equals("String_Node_Str")) {
        curParam.setShowIf("String_Node_Str");
      }
 else {
        curParam.setShowIf("String_Node_Str" + curParam.getShowIf() + "String_Node_Str");
      }
      curParam.setElement(this);
      addElementParameter(curParam);
    }
  }
  meterAttached=null;
  setMonitorLabel(new MonitorConnectionLabel(this));
  updateMonitorLabel(param);
}
Program: 121308
Project: 121308
Buggy source:
public String getTracesCondition(){
  return TracesConnectionUtils.getTracesConditionSet(this);
}

Fixed version (ground truth):
@Override public String getTracesCondition(){
  return TracesConnectionUtils.getTracesConditionSet(this);
}
Program: 121309
Project: 121309
Buggy source:
/** 
 * Getter for isSubjobConnection.
 * @return the isSubjobConnection
 */
public boolean isSubjobConnection(){
  return this.isSubjobConnection;
}

Fixed version (ground truth):
/** 
 * Getter for isSubjobConnection.
 * @return the isSubjobConnection
 */
@Override public boolean isSubjobConnection(){
  return this.isSubjobConnection;
}
Program: 121310
Project: 121310
Buggy source:
public void initTraceParamters(){
  List<Map<String,Object>> values=new ArrayList<Map<String,Object>>();
  IMetadataTable metadataTable=this.getMetadataTable();
  if (metadataTable != null) {
    for (    IMetadataColumn metaColumn : metadataTable.getListColumns()) {
      Map<String,Object> line=new HashMap<String,Object>();
      line.put(IConnection.TRACE_SCHEMA_COLUMN,metaColumn.getLabel());
      line.put(IConnection.TRACE_SCHEMA_COLUMN_CHECKED,true);
      line.put(IConnection.TRACE_SCHEMA_COLUMN_CONDITION,null);
      values.add(line);
    }
  }
  if (getElementParameter(EParameterName.TRACES_CONNECTION_FILTER.getName()) != null && values != null)   getElementParameter(EParameterName.TRACES_CONNECTION_FILTER.getName()).setValue(values);
  if (trace != null) {
    this.trace.setPropertyValue(EParameterName.TRACES_SHOW_ENABLE.getName(),checkTraceShowEnable());
  }
}

Fixed version (ground truth):
public void initTraceParamters(){
  List<Map<String,Object>> values=new ArrayList<Map<String,Object>>();
  IMetadataTable metadataTable=this.getMetadataTable();
  if (metadataTable != null) {
    for (    IMetadataColumn metaColumn : metadataTable.getListColumns()) {
      Map<String,Object> line=new HashMap<String,Object>();
      line.put(IConnection.TRACE_SCHEMA_COLUMN,metaColumn.getLabel());
      line.put(IConnection.TRACE_SCHEMA_COLUMN_CHECKED,true);
      line.put(IConnection.TRACE_SCHEMA_COLUMN_CONDITION,null);
      values.add(line);
    }
  }
  if (getElementParameter(EParameterName.TRACES_CONNECTION_FILTER.getName()) != null && values != null) {
    getElementParameter(EParameterName.TRACES_CONNECTION_FILTER.getName()).setValue(values);
  }
  if (trace != null) {
    this.trace.setPropertyValue(EParameterName.TRACES_SHOW_ENABLE.getName(),checkTraceShowEnable());
  }
}
Program: 121311
Project: 121311
Buggy source:
public INode getTarget(){
  return this.target;
}

Fixed version (ground truth):
@Override public INode getTarget(){
  return this.target;
}
Program: 121312
Project: 121312
Buggy source:
public String getExceptionList(){
  if (lineStyle.equals(EConnectionType.ROUTE_CATCH)) {
    return (String)getPropertyValue(EParameterName.EXCEPTIONLIST.getName());
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getExceptionList(){
  if (lineStyle.equals(EConnectionType.ROUTE_CATCH)) {
    return (String)getPropertyValue(EParameterName.EXCEPTIONLIST.getName());
  }
 else {
    return null;
  }
}
Program: 121313
Project: 121313
Buggy source:
public INodeConnector getTargetNodeConnector(){
  return target.getConnectorFromType(this.getLineStyle());
}

Fixed version (ground truth):
@Override public INodeConnector getTargetNodeConnector(){
  return target.getConnectorFromType(this.getLineStyle());
}
Program: 121314
Project: 121314
Buggy source:
/** 
 * Getter for monitorConnection.
 * @return the monitorConnection
 */
public boolean isMonitorConnection(){
  return this.monitorConnection;
}

Fixed version (ground truth):
/** 
 * Getter for monitorConnection.
 * @return the monitorConnection
 */
@Override public boolean isMonitorConnection(){
  return this.monitorConnection;
}
Program: 121315
Project: 121315
Buggy source:
public boolean isUseByMetter(){
  INode sourceNode=this.getSource();
  List<INode> metterNodes=(List<INode>)sourceNode.getProcess().getNodesOfType("String_Node_Str");
  if (metterNodes.size() > 0) {
    Iterator<INode> it=metterNodes.iterator();
    while (it.hasNext()) {
      INode node=it.next();
      String absolute=(String)node.getElementParameter("String_Node_Str").getValue();
      String reference=(String)node.getElementParameter("String_Node_Str").getValue();
      if (absolute.equals(Boolean.FALSE.toString()) && reference.equals(this.getUniqueName())) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isUseByMetter(){
  INode sourceNode=this.getSource();
  List<INode> metterNodes=(List<INode>)sourceNode.getProcess().getNodesOfType("String_Node_Str");
  if (metterNodes.size() > 0) {
    Iterator<INode> it=metterNodes.iterator();
    while (it.hasNext()) {
      INode node=it.next();
      String absolute=(String)node.getElementParameter("String_Node_Str").getValue();
      String reference=(String)node.getElementParameter("String_Node_Str").getValue();
      if (absolute.equals(Boolean.FALSE.toString()) && reference.equals(this.getUniqueName())) {
        return true;
      }
    }
  }
  return false;
}
Program: 121316
Project: 121316
Buggy source:
public int getInputId(){
  if (target != null) {
    for (int i=0; i < target.getIncomingConnections().size(); i++) {
      if (target.getIncomingConnections().get(i).equals(this)) {
        return i + 1;
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
@Override public int getInputId(){
  if (target != null) {
    for (int i=0; i < target.getIncomingConnections().size(); i++) {
      if (target.getIncomingConnections().get(i).equals(this)) {
        return i + 1;
      }
    }
  }
  return -1;
}
Program: 121317
Project: 121317
Buggy source:
public List<String> getEnabledTraceColumns(){
  return TracesConnectionUtils.getEnabledTraceColumns(this);
}

Fixed version (ground truth):
@Override public List<String> getEnabledTraceColumns(){
  return TracesConnectionUtils.getEnabledTraceColumns(this);
}
Program: 121319
Project: 121319
Buggy source:
public void setTraceData(Map<String,String> traceData){
  Map<String,String> oldData=this.traceData;
  if (!ObjectUtils.equals(oldData,traceData)) {
    this.traceData=traceData;
    if (traceData != null) {
      String traceValue=traceData.get(getName());
      trace.setTrace(traceValue);
    }
 else {
      trace.setTrace(null);
    }
  }
}

Fixed version (ground truth):
@Override public void setTraceData(Map<String,String> traceData){
  Map<String,String> oldData=this.traceData;
  if (!ObjectUtils.equals(oldData,traceData)) {
    this.traceData=traceData;
    if (traceData != null) {
      String traceValue=traceData.get(getName());
      trace.setTrace(traceValue);
    }
 else {
      trace.setTrace(null);
    }
  }
}
Program: 121320
Project: 121320
Buggy source:
public void setActivate(boolean activate){
  this.activate=activate;
  firePropertyChange(EParameterName.ACTIVATE.getName(),null,null);
}

Fixed version (ground truth):
@Override public void setActivate(boolean activate){
  this.activate=activate;
  firePropertyChange(EParameterName.ACTIVATE.getName(),null,null);
}
Program: 121322
Project: 121322
Buggy source:
public String getRouteConnectionType(){
  if (lineStyle.equals(EConnectionType.ROUTE_WHEN)) {
    return (String)getPropertyValue(EParameterName.ROUTETYPE.getName());
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getRouteConnectionType(){
  if (lineStyle.equals(EConnectionType.ROUTE_WHEN)) {
    return (String)getPropertyValue(EParameterName.ROUTETYPE.getName());
  }
 else {
    return null;
  }
}
Program: 121323
Project: 121323
Buggy source:
public INode getSource(){
  return this.source;
}

Fixed version (ground truth):
@Override public INode getSource(){
  return this.source;
}
Program: 121325
Project: 121325
Buggy source:
public boolean isActivate(){
  return this.activate;
}

Fixed version (ground truth):
@Override public boolean isActivate(){
  return this.activate;
}
Program: 121326
Project: 121326
Buggy source:
public void setReadOnly(boolean readOnly){
  this.readOnly=readOnly;
}

Fixed version (ground truth):
@Override public void setReadOnly(boolean readOnly){
  this.readOnly=readOnly;
}
Program: 121328
Project: 121328
Buggy source:
/** 
 * Getter for nodeConnector.
 * @return the nodeConnector
 */
public INodeConnector getSourceNodeConnector(){
  return source.getConnectorFromName(connectorName);
}

Fixed version (ground truth):
/** 
 * Getter for nodeConnector.
 * @return the nodeConnector
 */
@Override public INodeConnector getSourceNodeConnector(){
  return source.getConnectorFromName(connectorName);
}
Program: 121329
Project: 121329
Buggy source:
public IMetadataTable getMetadataTable(){
  if (source != null && this.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
    INodeConnector sourceNodeConnector=getSourceNodeConnector();
    if (sourceNodeConnector != null) {
      if (sourceNodeConnector.isMultiSchema()) {
        IMetadataTable table=source.getMetadataTable(metaName);
        if (table == null && source.getJobletNode() != null) {
          if (source.getMetadataList().size() > 0) {
            table=source.getMetadataList().get(0);
          }
        }
 else         if (table == null && source.getMetadataList() != null && source.getMetadataList().size() == 1) {
          table=source.getMetadataFromConnector(sourceNodeConnector.getName());
        }
        return table;
      }
 else {
        IMetadataTable table=source.getMetadataFromConnector(sourceNodeConnector.getName());
        if (table == null && source.getJobletNode() != null) {
          if (source.getMetadataList().size() > 0) {
            table=source.getMetadataList().get(0);
          }
        }
        return table;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public IMetadataTable getMetadataTable(){
  if (source != null && this.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
    INodeConnector sourceNodeConnector=getSourceNodeConnector();
    if (sourceNodeConnector != null) {
      if (sourceNodeConnector.isMultiSchema()) {
        IMetadataTable table=source.getMetadataTable(metaName);
        if (table == null && source.getJobletNode() != null) {
          if (source.getMetadataList().size() > 0) {
            table=source.getMetadataList().get(0);
          }
        }
 else         if (table == null && source.getMetadataList() != null && source.getMetadataList().size() == 1) {
          table=source.getMetadataFromConnector(sourceNodeConnector.getName());
        }
        return table;
      }
 else {
        IMetadataTable table=source.getMetadataFromConnector(sourceNodeConnector.getName());
        if (table == null && source.getJobletNode() != null) {
          if (source.getMetadataList().size() > 0) {
            table=source.getMetadataList().get(0);
          }
        }
        return table;
      }
    }
  }
  return null;
}
Program: 121330
Project: 121330
Buggy source:
public void clearPerformanceDataOnUI(){
  this.performance.clearPerformanceDataOnUI();
}

Fixed version (ground truth):
@Override public void clearPerformanceDataOnUI(){
  this.performance.clearPerformanceDataOnUI();
}
Program: 121331
Project: 121331
Buggy source:
public Map<String,String> getTraceData(){
  return this.traceData;
}

Fixed version (ground truth):
@Override public Map<String,String> getTraceData(){
  return this.traceData;
}
Program: 121332
Project: 121332
Buggy source:
public void resetStatus(){
  performance.resetStatus();
}

Fixed version (ground truth):
@Override public void resetStatus(){
  performance.resetStatus();
}
Program: 121333
Project: 121333
Buggy source:
/** 
 * Sets the connectionType.
 * @param connectionType the connectionType to set
 */
public void setConnectorName(String connectorName){
  this.connectorName=connectorName;
  updateName();
  firePropertyChange(LINESTYLE_PROP,null,connectorName);
}

Fixed version (ground truth):
/** 
 * Sets the connectionType.
 * @param connectionType the connectionType to set
 */
@Override public void setConnectorName(String connectorName){
  this.connectorName=connectorName;
  updateName();
  firePropertyChange(LINESTYLE_PROP,null,connectorName);
}
Program: 121334
Project: 121334
Buggy source:
public void setTraceConnection(boolean traceConnection){
  final String parameterName=EParameterName.TRACES_CONNECTION_ENABLE.getName();
  Object propertyValue=this.getPropertyValue(parameterName);
  if (propertyValue == null || !propertyValue.equals(new Boolean(traceConnection))) {
    super.setPropertyValue(parameterName,traceConnection);
    if (this.trace != null) {
      this.trace.setPropertyValue(parameterName,traceConnection);
    }
    if (propertyValue != null) {
      setProcessStates();
    }
    firePropertyChange(parameterName,null,traceConnection);
  }
}

Fixed version (ground truth):
@Override public void setTraceConnection(boolean traceConnection){
  final String parameterName=EParameterName.TRACES_CONNECTION_ENABLE.getName();
  Object propertyValue=this.getPropertyValue(parameterName);
  if (propertyValue == null || !propertyValue.equals(new Boolean(traceConnection))) {
    super.setPropertyValue(parameterName,traceConnection);
    if (this.trace != null) {
      this.trace.setPropertyValue(parameterName,traceConnection);
    }
    if (propertyValue != null) {
      setProcessStates();
    }
    firePropertyChange(parameterName,null,traceConnection);
  }
}
Program: 121335
Project: 121335
Buggy source:
public EConnectionType getLineStyle(){
  return lineStyle;
}

Fixed version (ground truth):
@Override public EConnectionType getLineStyle(){
  return lineStyle;
}
Program: 121336
Project: 121336
Buggy source:
/** 
 * Reconnect a connection to a new source and target.
 * @param newSource
 * @param newTarget
 */
public void reconnect(INode newSource,INode newTarget,EConnectionType newLineStyle){
  disconnect();
  this.source=newSource;
  this.target=newTarget;
  this.lineStyle=newLineStyle;
  if ((lineStyle == EConnectionType.SYNCHRONIZE) || (lineStyle == EConnectionType.PARALLELIZE)) {
    ((Process)source.getProcess()).setPropertyValue(EParameterName.MULTI_THREAD_EXECATION.getName(),Boolean.TRUE);
  }
  reconnect();
}

Fixed version (ground truth):
/** 
 * Reconnect a connection to a new source and target.
 * @param newSource
 * @param newTarget
 */
@Override public void reconnect(INode newSource,INode newTarget,EConnectionType newLineStyle){
  disconnect();
  this.source=newSource;
  this.target=newTarget;
  this.lineStyle=newLineStyle;
  if ((lineStyle == EConnectionType.SYNCHRONIZE) || (lineStyle == EConnectionType.PARALLELIZE)) {
    ((Process)source.getProcess()).setPropertyValue(EParameterName.MULTI_THREAD_EXECATION.getName(),Boolean.TRUE);
  }
  reconnect();
}
Program: 121337
Project: 121337
Buggy source:
public boolean isReadOnly(){
  return this.readOnly;
}

Fixed version (ground truth):
@Override public boolean isReadOnly(){
  return this.readOnly;
}
Program: 121338
Project: 121338
Buggy source:
public String getMetaName(){
  return metaName;
}

Fixed version (ground truth):
@Override public String getMetaName(){
  return metaName;
}
Program: 121339
Project: 121339
Buggy source:
/** 
 * Getter for connectionType.
 * @return the connectionType
 */
public String getConnectorName(){
  return connectorName;
}

Fixed version (ground truth):
/** 
 * Getter for connectionType.
 * @return the connectionType
 */
@Override public String getConnectorName(){
  return connectorName;
}
Program: 121340
Project: 121340
Buggy source:
/** 
 * feature 6355
 */
public boolean isTraceConnection(){
  Object propertyValue=this.getPropertyValue(EParameterName.TRACES_CONNECTION_ENABLE.getName());
  if (propertyValue != null && propertyValue instanceof Boolean) {
    return (Boolean)propertyValue;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * feature 6355
 */
@Override public boolean isTraceConnection(){
  Object propertyValue=this.getPropertyValue(EParameterName.TRACES_CONNECTION_ENABLE.getName());
  if (propertyValue != null && propertyValue instanceof Boolean) {
    return (Boolean)propertyValue;
  }
  return false;
}
Program: 121341
Project: 121341
Buggy source:
public String getCondition(){
  if (lineStyle.equals(EConnectionType.RUN_IF) || lineStyle.equals(EConnectionType.ROUTE_WHEN)) {
    return (String)getPropertyValue(EParameterName.CONDITION.getName());
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getCondition(){
  if (lineStyle.equals(EConnectionType.RUN_IF) || lineStyle.equals(EConnectionType.ROUTE_WHEN)) {
    return (String)getPropertyValue(EParameterName.CONDITION.getName());
  }
 else {
    return null;
  }
}
Program: 121342
Project: 121342
Buggy source:
public void updateAllId(){
  if (source != null) {
    orderConnectionsByMetadata();
    for (int i=0; i < source.getOutgoingConnections().size(); i++) {
      Connection connection=(Connection)source.getOutgoingConnections().get(i);
      connection.updateName();
    }
  }
  if (target != null) {
    for (int i=0; i < target.getIncomingConnections().size(); i++) {
      Connection connection=(Connection)target.getIncomingConnections().get(i);
      connection.updateName();
    }
  }
}

Fixed version (ground truth):
@Override public void updateAllId(){
  if (source != null) {
    orderConnectionsByMetadata();
    for (int i=0; i < source.getOutgoingConnections().size(); i++) {
      Connection connection=(Connection)source.getOutgoingConnections().get(i);
      connection.updateName();
    }
  }
  if (target != null) {
    for (int i=0; i < target.getIncomingConnections().size(); i++) {
      Connection connection=(Connection)target.getIncomingConnections().get(i);
      connection.updateName();
    }
  }
}
Program: 121343
Project: 121343
Buggy source:
public String getEndChoice(){
  if (lineStyle.equals(EConnectionType.ROUTE_WHEN)) {
    Object propertyValue=getPropertyValue(EParameterName.ENDOFCHOICE.getName());
    return propertyValue == null ? "String_Node_Str" : propertyValue.toString();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getEndChoice(){
  if (lineStyle.equals(EConnectionType.ROUTE_WHEN)) {
    Object propertyValue=getPropertyValue(EParameterName.ENDOFCHOICE.getName());
    return propertyValue == null ? "String_Node_Str" : propertyValue.toString();
  }
 else {
    return null;
  }
}
Program: 121344
Project: 121344
Buggy source:
public int getOutputId(){
  if (source != null) {
switch (lineStyle) {
case FLOW_MAIN:
case FLOW_REF:
case FLOW_MERGE:
      int total=0, currentId=-1;
    for (    Connection connection : (List<Connection>)source.getOutgoingConnections()) {
      if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.FLOW)) {
        total++;
        if (connection.equals(this)) {
          currentId=total;
        }
      }
    }
  if (total > 1) {
    return currentId;
  }
break;
default :
List<Connection> connList=(List<Connection>)source.getOutgoingConnections(lineStyle);
if (connList.size() <= 1) {
return -1;
}
for (int i=0; i < connList.size(); i++) {
IConnection connection=connList.get(i);
if (connection.equals(this)) {
return i + 1;
}
}
}
}
return -1;
}

Fixed version (ground truth):
@Override public int getOutputId(){
  if (source != null) {
switch (lineStyle) {
case FLOW_MAIN:
case FLOW_REF:
case FLOW_MERGE:
      int total=0, currentId=-1;
    for (    Connection connection : (List<Connection>)source.getOutgoingConnections()) {
      if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.FLOW)) {
        total++;
        if (connection.equals(this)) {
          currentId=total;
        }
      }
    }
  if (total > 1) {
    return currentId;
  }
break;
default :
List<Connection> connList=(List<Connection>)source.getOutgoingConnections(lineStyle);
if (connList.size() <= 1) {
return -1;
}
for (int i=0; i < connList.size(); i++) {
IConnection connection=connList.get(i);
if (connection.equals(this)) {
return i + 1;
}
}
}
}
return -1;
}
Program: 121345
Project: 121345
Buggy source:
/** 
 * Only works for FLOW_MAIN, FLOW_REF or TABLE link.
 * @return
 */
public String getUniqueName(){
  return uniqueName;
}

Fixed version (ground truth):
/** 
 * Only works for FLOW_MAIN, FLOW_REF or TABLE link.
 * @return
 */
@Override public String getUniqueName(){
  return uniqueName;
}