Program: 124980
Project: 124980
Buggy source:
@Override public void execute(){
  try {
    if (model != null) {
      if (DirectEditType.EXPRESSION.equals(type)) {
        List<TableEntryLocation> matchedLocations=expressionManager.parseTableEntryLocation((String)newValue);
        EList<? extends INodeConnection> connections=null;
        if (targetEditPart != null && targetEditPart instanceof PigMapTableNodePart) {
          tableNodePart=(PigMapTableNodePart)targetEditPart;
          if (tableNodePart.getParent() instanceof PigMapOutputTablePart) {
            connections=model.getIncomingConnections();
          }
 else           if (tableNodePart.getParent() instanceof PigMapInputTablePart) {
            connections=((TableNode)model).getLookupIncomingConnections();
          }
        }
        List usefullConnections=new ArrayList();
        mapperData=PigMapUtil.getPigMapData(model);
        if (!matchedLocations.isEmpty()) {
          for (int i=0; i < matchedLocations.size(); i++) {
            TableEntryLocation currentLocation=matchedLocations.get(i);
            for (            INodeConnection conn : connections) {
              TableEntryLocation sourceLocation=null;
              String temp="String_Node_Str";
              if (conn.getSource() != null && conn.getSource() instanceof TableNode) {
                TableNode tableSourceNode=(TableNode)conn.getSource();
                if (tableSourceNode.eContainer() != null && tableSourceNode.eContainer() instanceof InputTable) {
                  temp=((InputTable)tableSourceNode.eContainer()).getName() + "String_Node_Str" + conn.getSource().getName();
                }
                sourceLocation=expressionManager.parseTableEntryLocation(temp).get(0);
              }
              if (currentLocation.equals(sourceLocation)) {
                usefullConnections.add(conn);
                break;
              }
            }
          }
        }
 else {
          if (!connections.isEmpty()) {
            if (tableNodePart.getParent() instanceof PigMapOutputTablePart) {
              PigMapUtil.detachConnectionsSouce(model,mapperData);
              model.getIncomingConnections().clear();
            }
 else             if (tableNodePart.getParent() instanceof PigMapInputTablePart) {
              PigMapUtil.detachLookupSource((TableNode)model,mapperData);
              ((TableNode)model).getLookupIncomingConnections().clear();
            }
          }
        }
        List<INodeConnection> copyOfConnections=new ArrayList<INodeConnection>(connections);
        copyOfConnections.removeAll(usefullConnections);
        if (tableNodePart.getParent() instanceof PigMapOutputTablePart) {
          for (          INodeConnection connection : copyOfConnections) {
            if (connection.getSource() != null) {
              if (connection.getSource().getOutgoingConnections().contains(connection)) {
                connection.getSource().getOutgoingConnections().remove(connection);
                mapperData.getConnections().remove(connection);
              }
            }
          }
          model.getIncomingConnections().removeAll(copyOfConnections);
        }
 else         if (tableNodePart.getParent() instanceof PigMapInputTablePart) {
          for (          INodeConnection connection : copyOfConnections) {
            if (connection.getSource() != null) {
              if (((TableNode)connection.getSource()).getLookupOutgoingConnections().contains(connection)) {
                ((TableNode)connection.getSource()).getLookupOutgoingConnections().remove(connection);
                mapperData.getConnections().remove(connection);
              }
            }
          }
          ((TableNode)model).getLookupIncomingConnections().removeAll(copyOfConnections);
        }
        model.setExpression((String)newValue);
      }
 else       if (DirectEditType.NODE_NAME.equals(type)) {
      }
    }
  }
 catch (  PatternSyntaxException ex) {
  }
}

Fixed version (ground truth):
@Override public void execute(){
  try {
    if (model != null) {
      if (DirectEditType.EXPRESSION.equals(type)) {
        List<TableEntryLocation> matchedLocations=expressionManager.parseTableEntryLocation((String)newValue);
        EList<? extends INodeConnection> connections=null;
        if (targetEditPart != null && targetEditPart instanceof PigMapTableNodePart) {
          tableNodePart=(PigMapTableNodePart)targetEditPart;
          if (tableNodePart.getParent() instanceof PigMapOutputTablePart) {
            connections=model.getIncomingConnections();
          }
 else           if (tableNodePart.getParent() instanceof PigMapInputTablePart) {
            connections=((TableNode)model).getLookupIncomingConnections();
          }
        }
        List usefullConnections=new ArrayList();
        mapperData=PigMapUtil.getPigMapData(model);
        if (!matchedLocations.isEmpty()) {
          for (int i=0; i < matchedLocations.size(); i++) {
            TableEntryLocation currentLocation=matchedLocations.get(i);
            boolean found=false;
            for (            INodeConnection conn : connections) {
              TableEntryLocation sourceLocation=null;
              String temp="String_Node_Str";
              if (conn.getSource() != null && conn.getSource() instanceof TableNode) {
                TableNode tableSourceNode=(TableNode)conn.getSource();
                if (tableSourceNode.eContainer() != null && tableSourceNode.eContainer() instanceof InputTable) {
                  temp=((InputTable)tableSourceNode.eContainer()).getName() + "String_Node_Str" + conn.getSource().getName();
                }
                sourceLocation=expressionManager.parseTableEntryLocation(temp).get(0);
              }
              if (currentLocation.equals(sourceLocation)) {
                found=true;
                usefullConnections.add(conn);
                break;
              }
            }
            if (!found) {
              if (mapperData != null) {
                AbstractNode sourceNode=findConnectionSource(mapperData,currentLocation);
                if (sourceNode != null && model.eContainer() != null && sourceNode.eContainer() != null) {
                  INodeConnection connection=null;
                  if (model.eContainer() instanceof OutputTable) {
                    connection=PigmapFactory.eINSTANCE.createConnection();
                    sourceNode.getOutgoingConnections().add((Connection)connection);
                    model.getIncomingConnections().add((Connection)connection);
                  }
 else                   if (model.eContainer() instanceof InputTable && sourceNode.eContainer() instanceof InputTable) {
                    TableNode source=(TableNode)sourceNode;
                    connection=PigmapFactory.eINSTANCE.createLookupConnection();
                    source.getLookupOutgoingConnections().add((LookupConnection)connection);
                    ((TableNode)model).getLookupIncomingConnections().add((LookupConnection)connection);
                  }
                  connection.setSource(sourceNode);
                  connection.setTarget(model);
                  mapperData.getConnections().add(connection);
                  usefullConnections.add(connection);
                }
              }
            }
          }
        }
 else {
          if (!connections.isEmpty()) {
            if (tableNodePart.getParent() instanceof PigMapOutputTablePart) {
              PigMapUtil.detachConnectionsSouce(model,mapperData);
              model.getIncomingConnections().clear();
            }
 else             if (tableNodePart.getParent() instanceof PigMapInputTablePart) {
              PigMapUtil.detachLookupSource((TableNode)model,mapperData);
              ((TableNode)model).getLookupIncomingConnections().clear();
            }
          }
        }
        List<INodeConnection> copyOfConnections=new ArrayList<INodeConnection>(connections);
        copyOfConnections.removeAll(usefullConnections);
        if (tableNodePart.getParent() instanceof PigMapOutputTablePart) {
          for (          INodeConnection connection : copyOfConnections) {
            if (connection.getSource() != null) {
              if (connection.getSource().getOutgoingConnections().contains(connection)) {
                connection.getSource().getOutgoingConnections().remove(connection);
                mapperData.getConnections().remove(connection);
              }
            }
          }
          model.getIncomingConnections().removeAll(copyOfConnections);
        }
 else         if (tableNodePart.getParent() instanceof PigMapInputTablePart) {
          for (          INodeConnection connection : copyOfConnections) {
            if (connection.getSource() != null) {
              if (((TableNode)connection.getSource()).getLookupOutgoingConnections().contains(connection)) {
                ((TableNode)connection.getSource()).getLookupOutgoingConnections().remove(connection);
                mapperData.getConnections().remove(connection);
              }
            }
          }
          ((TableNode)model).getLookupIncomingConnections().removeAll(copyOfConnections);
        }
        model.setExpression((String)newValue);
      }
 else       if (DirectEditType.NODE_NAME.equals(type)) {
      }
    }
  }
 catch (  PatternSyntaxException ex) {
  }
}