Program: 141820
Project: 141820
Buggy source:
/** 
 * To optimize, right now it will write the xsd file many times. Since there is no clues if the parameters comes from the same xsd, generate it everytime right now.
 * @param oper
 * @param hashMap
 */
private void populateMessage2(ParameterInfo parameter,QName portTypeQName,Operation oper,Map<byte[],String> schemaToFileMap){
  String name=parameter.getName();
  XmlFileConnection connection=ConnectionFactory.eINSTANCE.createXmlFileConnection();
  connection.setName(ERepositoryObjectType.METADATA_FILE_XML.getKey());
  connection.setXmlFilePath(name + "String_Node_Str");
  XmlFileConnectionItem connectionItem=PropertiesFactory.eINSTANCE.createXmlFileConnectionItem();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  connectionProperty.setAuthor(((RepositoryContext)CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
  connectionProperty.setLabel(name);
  connectionProperty.setVersion(VersionUtils.DEFAULT_VERSION);
  connectionProperty.setStatusCode("String_Node_Str");
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  connection.setInputModel(false);
  connection.setFileContent(parameter.getSchema());
  XSDSchema xsdSchema;
  try {
    String filePath=schemaToFileMap.get(parameter.getSchema());
    if (filePath == null) {
      return;
    }
    xsdSchema=populationUtil.getXSDSchema(filePath);
    List<ATreeNode> rootNodes=populationUtil.getAllRootNodes(xsdSchema);
    ATreeNode node=null;
    for (    ATreeNode curNode : rootNodes) {
      String curName=(String)curNode.getValue();
      if (curName.contains("String_Node_Str")) {
        if (curName.split("String_Node_Str")[1].equals(name)) {
          node=curNode;
          break;
        }
      }
 else       if (curName.equals(name)) {
        node=curNode;
        break;
      }
    }
    node=populationUtil.getSchemaTree(xsdSchema,node,true);
    orderId=1;
    loopElementFound=false;
    if (ConnectionHelper.getTables(connection).isEmpty()) {
      MetadataTable table=ConnectionFactory.eINSTANCE.createMetadataTable();
      RecordFile record=(RecordFile)ConnectionHelper.getPackage(connection.getName(),connection,RecordFile.class);
      if (record != null) {
        PackageHelper.addMetadataTable(table,record);
      }
 else {
        RecordFile newrecord=RecordFactory.eINSTANCE.createRecordFile();
        newrecord.setName(connection.getName());
        ConnectionHelper.addPackage(newrecord,connection);
        PackageHelper.addMetadataTable(table,newrecord);
      }
    }
    boolean haveElement=false;
    for (    Object curNode : node.getChildren()) {
      if (((ATreeNode)curNode).getType() == ATreeNode.ELEMENT_TYPE) {
        haveElement=true;
        break;
      }
    }
    fillRootInfo(connection,node,"String_Node_Str",!haveElement);
  }
 catch (  MalformedURLException e1) {
    ExceptionHandler.process(e1);
  }
catch (  URISyntaxException e1) {
    ExceptionHandler.process(e1);
  }
catch (  OdaException e) {
    ExceptionHandler.process(e);
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  String nextId=factory.getNextId();
  connectionProperty.setId(nextId);
  try {
    String folderString=parameter.getNameSpace() + "String_Node_Str" + portTypeQName.getLocalPart();
    try {
      URI uri=new URI(folderString);
      String scheme=uri.getScheme();
      if (scheme != null) {
        folderString=folderString.substring(scheme.length());
      }
    }
 catch (    URISyntaxException e) {
    }
    if (folderString.startsWith("String_Node_Str")) {
      folderString=folderString.substring(1);
    }
    folderString=FolderNameUtil.replaceAllLimited(folderString);
    IPath path=new Path(folderString + "String_Node_Str" + oper.getName());
    factory.create(connectionItem,path);
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    RepositoryManager.refresh(ERepositoryObjectType.METADATA_FILE_XML);
  }
 catch (  PersistenceException e) {
  }
}

Fixed version (ground truth):
/** 
 * To optimize, right now it will write the xsd file many times. Since there is no clues if the parameters comes from the same xsd, generate it everytime right now.
 * @param oper
 * @param hashMap
 */
private void populateMessage2(ParameterInfo parameter,QName portTypeQName,Operation oper,Map<byte[],String> schemaToFileMap){
  String name=parameter.getName();
  XmlFileConnection connection=ConnectionFactory.eINSTANCE.createXmlFileConnection();
  connection.setName(ERepositoryObjectType.METADATA_FILE_XML.getKey());
  connection.setXmlFilePath(name + "String_Node_Str");
  XmlFileConnectionItem connectionItem=PropertiesFactory.eINSTANCE.createXmlFileConnectionItem();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  connectionProperty.setAuthor(((RepositoryContext)CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
  connectionProperty.setLabel(name);
  connectionProperty.setVersion(VersionUtils.DEFAULT_VERSION);
  connectionProperty.setStatusCode("String_Node_Str");
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  connection.setInputModel(false);
  connection.setFileContent(parameter.getSchema());
  XSDSchema xsdSchema;
  try {
    String filePath=schemaToFileMap.get(parameter.getSchema());
    if (filePath == null) {
      return;
    }
    xsdSchema=populationUtil.getXSDSchema(filePath);
    List<ATreeNode> rootNodes=populationUtil.getAllRootNodes(xsdSchema);
    ATreeNode node=null;
    for (    ATreeNode curNode : rootNodes) {
      String curName=(String)curNode.getValue();
      if (curName.contains("String_Node_Str")) {
        if (curName.split("String_Node_Str")[1].equals(name)) {
          node=curNode;
          break;
        }
      }
 else       if (curName.equals(name)) {
        node=curNode;
        break;
      }
    }
    node=populationUtil.getSchemaTree(xsdSchema,node,true);
    orderId=1;
    loopElementFound=false;
    if (ConnectionHelper.getTables(connection).isEmpty()) {
      MetadataTable table=ConnectionFactory.eINSTANCE.createMetadataTable();
      table.setId(ProxyRepositoryFactory.getInstance().getNextId());
      RecordFile record=(RecordFile)ConnectionHelper.getPackage(connection.getName(),connection,RecordFile.class);
      if (record != null) {
        PackageHelper.addMetadataTable(table,record);
      }
 else {
        RecordFile newrecord=RecordFactory.eINSTANCE.createRecordFile();
        newrecord.setName(connection.getName());
        ConnectionHelper.addPackage(newrecord,connection);
        PackageHelper.addMetadataTable(table,newrecord);
      }
    }
    boolean haveElement=false;
    for (    Object curNode : node.getChildren()) {
      if (((ATreeNode)curNode).getType() == ATreeNode.ELEMENT_TYPE) {
        haveElement=true;
        break;
      }
    }
    fillRootInfo(connection,node,"String_Node_Str",!haveElement);
  }
 catch (  MalformedURLException e1) {
    ExceptionHandler.process(e1);
  }
catch (  URISyntaxException e1) {
    ExceptionHandler.process(e1);
  }
catch (  OdaException e) {
    ExceptionHandler.process(e);
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  String nextId=factory.getNextId();
  connectionProperty.setId(nextId);
  try {
    String folderString=parameter.getNameSpace() + "String_Node_Str" + portTypeQName.getLocalPart();
    try {
      URI uri=new URI(folderString);
      String scheme=uri.getScheme();
      if (scheme != null) {
        folderString=folderString.substring(scheme.length());
      }
    }
 catch (    URISyntaxException e) {
    }
    if (folderString.startsWith("String_Node_Str")) {
      folderString=folderString.substring(1);
    }
    folderString=FolderNameUtil.replaceAllLimited(folderString);
    IPath path=new Path(folderString + "String_Node_Str" + oper.getName());
    factory.create(connectionItem,path);
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    RepositoryManager.refresh(ERepositoryObjectType.METADATA_FILE_XML);
  }
 catch (  PersistenceException e) {
  }
}