Program: 102007
Project: 102007
Buggy source:
@Override public DynamicVdb dynVdbConvert(IFile destination,Properties options) throws Exception {
  try {
    VdbPlugin.singleton().setConversionInProgress(true);
    DynamicVdb dynVdb=new DynamicVdb(destination);
    populateVdb(dynVdb);
    dynVdb.getProperties().remove(Xml.PREVIEW);
    this.getProperties().remove(Xml.PREVIEW);
    for (    VdbModelEntry entry : getModelEntries()) {
      VdbSourceInfo sourceInfo=entry.getSourceInfo();
      DynamicModel model=new DynamicModel();
      model.setName(entry.getName());
      model.setDescription(entry.getDescription());
      for (      Map.Entry<Object,Object> prop : getProperties().entrySet()) {
        model.setProperty(prop.getKey().toString(),prop.getValue().toString());
      }
      DynamicModel.Type type=DynamicModel.Type.fromString(entry.getType());
      model.setModelType(type);
      model.setAllowMultiSource(sourceInfo.isMultiSource());
      model.setAddColumn(sourceInfo.isAddColumn());
      model.setColumnAlias(sourceInfo.getColumnAlias());
      for (      VdbSource source : sourceInfo.getSources()) {
        VdbSource clone=source.clone();
        model.addSource(clone);
      }
      if (entry.getType().equals(ModelType.Type.VIRTUAL.getName()) || !excludeSourceMetadata) {
        TeiidModelToDdlGenerator generator=new TeiidModelToDdlGenerator();
        IFile entryFile=null;
        if (Synchronization.Synchronized == entry.getSynchronization()) {
          entryFile=entry.findFileInWorkspace();
        }
 else {
          entryFile=createEntryFile(entry);
        }
        ModelWorkspaceManager workspaceManager=ModelWorkspaceManager.getModelWorkspaceManager();
        ModelResource modelResource=(ModelResource)workspaceManager.findModelWorkspaceItem(entryFile,true);
        if (modelResource == null)         throw new Exception("String_Node_Str" + entryFile.getLocation().toOSString());
        String ddl=generator.generate(modelResource);
        Metadata metadata=new Metadata(ddl,Metadata.Type.DDL);
        model.setMetadata(metadata);
        dynVdb.addDynamicModel(model);
      }
    }
    return dynVdb;
  }
  finally {
    VdbPlugin.singleton().setConversionInProgress(false);
  }
}

Fixed version (ground truth):
@Override public DynamicVdb dynVdbConvert(IFile destination,Properties options) throws Exception {
  try {
    VdbPlugin.singleton().setConversionInProgress(true);
    DynamicVdb dynVdb=new DynamicVdb(destination);
    populateVdb(dynVdb);
    dynVdb.getProperties().remove(Xml.PREVIEW);
    this.getProperties().remove(Xml.PREVIEW);
    for (    VdbModelEntry entry : getModelEntries()) {
      VdbSourceInfo sourceInfo=entry.getSourceInfo();
      DynamicModel model=new DynamicModel();
      model.setName(entry.getName());
      model.setDescription(entry.getDescription());
      for (      Map.Entry<Object,Object> prop : getProperties().entrySet()) {
        model.setProperty(prop.getKey().toString(),prop.getValue().toString());
      }
      DynamicModel.Type type=DynamicModel.Type.fromString(entry.getType());
      model.setModelType(type);
      model.setAllowMultiSource(sourceInfo.isMultiSource());
      model.setAddColumn(sourceInfo.isAddColumn());
      model.setColumnAlias(sourceInfo.getColumnAlias());
      for (      VdbSource source : sourceInfo.getSources()) {
        VdbSource clone=source.clone();
        model.addSource(clone);
      }
      if (entry.getType().equals(ModelType.Type.VIRTUAL.getName()) || !excludeSourceMetadata) {
        TeiidModelToDdlGenerator generator=new TeiidModelToDdlGenerator();
        IFile entryFile=null;
        if (Synchronization.Synchronized == entry.getSynchronization()) {
          entryFile=entry.findFileInWorkspace();
        }
 else {
          entryFile=createEntryFile(entry);
        }
        ModelWorkspaceManager workspaceManager=ModelWorkspaceManager.getModelWorkspaceManager();
        ModelResource modelResource=(ModelResource)workspaceManager.findModelWorkspaceItem(entryFile,true);
        if (modelResource == null)         throw new Exception("String_Node_Str" + entryFile.getLocation().toOSString());
        String ddl=generator.generate(modelResource);
        Metadata metadata=new Metadata(ddl,Metadata.Type.DDL);
        model.setMetadata(metadata);
      }
      dynVdb.addDynamicModel(model);
    }
    return dynVdb;
  }
  finally {
    VdbPlugin.singleton().setConversionInProgress(false);
  }
}