nus-yam/ex-repair huggingface dataset:
Program: 101942
Project: 101942
Buggy source:
@Override protected RelationalProcedure createProcedure(AstNode procedureNode,RelationalModel model) throws Exception {
  RelationalProcedure procedure=super.createProcedure(procedureNode,model);
  List<AstNode> procOptionNodes=new ArrayList<AstNode>();
  for (  AstNode child : procedureNode) {
    if (is(child,TeiidDdlLexicon.CreateProcedure.PARAMETER)) {
      createProcedureParameter(child,procedure);
    }
 else     if (is(child,TeiidDdlLexicon.CreateProcedure.RESULT_COLUMNS)) {
      RelationalProcedureResultSet result=getFactory().createProcedureResultSet();
      procedure.setResultSet(result);
      initialize(result,procedureNode);
      for (      AstNode resultCol : child) {
        if (resultCol.hasMixin(TeiidDdlLexicon.CreateProcedure.RESULT_COLUMN)) {
          createColumn(resultCol,result);
        }
      }
    }
 else     if (is(child,TeiidDdlLexicon.CreateProcedure.RESULT_DATA_TYPE)) {
      RelationalParameter param=createProcedureParameter(child,procedure);
      param.setName("String_Node_Str");
      param.setDirection(DirectionKind.RETURN_LITERAL.toString());
    }
 else     if (is(child,StandardDdlLexicon.TYPE_STATEMENT_OPTION)) {
      procOptionNodes.add(child);
    }
  }
  processOptions(procOptionNodes,procedure);
  return procedure;
}

Fixed version (ground truth):
@Override protected RelationalProcedure createProcedure(AstNode procedureNode,RelationalModel model) throws Exception {
  RelationalProcedure procedure=super.createProcedure(procedureNode,model);
  List<AstNode> procOptionNodes=new ArrayList<AstNode>();
  for (  AstNode child : procedureNode) {
    if (is(child,TeiidDdlLexicon.CreateProcedure.PARAMETER)) {
      createProcedureParameter(child,procedure);
    }
 else     if (is(child,TeiidDdlLexicon.CreateProcedure.RESULT_COLUMNS)) {
      RelationalProcedureResultSet result=getFactory().createProcedureResultSet();
      procedure.setResultSet(result);
      initialize(result,procedureNode);
      List<AstNode> resultOptionNodes=new ArrayList<AstNode>();
      for (      AstNode resultCol : child) {
        if (resultCol.hasMixin(TeiidDdlLexicon.CreateProcedure.RESULT_COLUMN)) {
          createColumn(resultCol,result);
        }
 else         if (is(child,StandardDdlLexicon.TYPE_STATEMENT_OPTION)) {
          resultOptionNodes.add(resultCol);
        }
      }
      processOptions(resultOptionNodes,result);
    }
 else     if (is(child,TeiidDdlLexicon.CreateProcedure.RESULT_DATA_TYPE)) {
      RelationalParameter param=createProcedureParameter(child,procedure);
      param.setName("String_Node_Str");
      param.setDirection(DirectionKind.RETURN_LITERAL.toString());
    }
 else     if (is(child,StandardDdlLexicon.TYPE_STATEMENT_OPTION)) {
      procOptionNodes.add(child);
    }
  }
  processOptions(procOptionNodes,procedure);
  return procedure;
}
Program: 101943
Project: 101943
Buggy source:
/** 
 * Process the options that are specific to the provided entity type
 * @param optionNodes the list of AstNode
 * @param relationalReference the RelationalReference
 */
private void processTeiidStandardOptions(List<AstNode> optionNodes,RelationalReference relationalReference){
  processTeiidCommonOptions(optionNodes,relationalReference);
  if (relationalReference instanceof RelationalTable) {
    processTeiidTableOptions(optionNodes,(RelationalTable)relationalReference);
  }
 else   if (relationalReference instanceof RelationalColumn) {
    processTeiidColumnOptions(optionNodes,(RelationalColumn)relationalReference);
  }
 else   if (relationalReference instanceof RelationalProcedure) {
    processTeiidProcedureOptions(optionNodes,(RelationalProcedure)relationalReference);
  }
}

Fixed version (ground truth):
/** 
 * Process the options that are specific to the provided entity type
 * @param optionNodes the list of AstNode
 * @param relationalReference the RelationalReference
 */
private void processTeiidStandardOptions(List<AstNode> optionNodes,RelationalReference relationalReference){
  processTeiidCommonOptions(optionNodes,relationalReference);
  if (relationalReference instanceof RelationalTable) {
    processTeiidTableOptions(optionNodes,(RelationalTable)relationalReference);
  }
 else   if (relationalReference instanceof RelationalColumn) {
    processTeiidColumnOptions(optionNodes,(RelationalColumn)relationalReference);
  }
 else   if (relationalReference instanceof RelationalProcedure) {
    processTeiidProcedureOptions(optionNodes,(RelationalProcedure)relationalReference);
  }
 else   if (relationalReference instanceof RelationalParameter) {
    processTeiidParameterOptions(optionNodes,(RelationalParameter)relationalReference);
  }
}
Program: 101945
Project: 101945
Buggy source:
@Override protected RelationalParameter createProcedureParameter(AstNode node,RelationalProcedure procedure) throws Exception {
  RelationalParameter prm=super.createProcedureParameter(node,procedure);
  String direction=node.getProperty(TeiidDdlLexicon.CreateProcedure.PARAMETER_TYPE).toString();
  String resultFlag=node.getProperty(TeiidDdlLexicon.CreateProcedure.PARAMETER_RESULT_FLAG).toString();
  if (resultFlag != null && resultFlag.equalsIgnoreCase(Boolean.TRUE.toString())) {
    direction=DirectionKind.RETURN_LITERAL.toString();
  }
  prm.setDirection(direction);
  List<AstNode> optionNodes=new ArrayList<AstNode>();
  List<AstNode> children=node.getChildren();
  for (  AstNode child : children) {
    if (is(child,StandardDdlLexicon.TYPE_STATEMENT_OPTION)) {
      optionNodes.add(child);
    }
  }
  processOptions(optionNodes,prm);
  return prm;
}

Fixed version (ground truth):
@Override protected RelationalParameter createProcedureParameter(AstNode node,RelationalProcedure procedure) throws Exception {
  RelationalParameter prm=super.createProcedureParameter(node,procedure);
  prm.setNativeType(RelationalColumn.DEFAULT_NATIVE_TYPE);
  String direction=node.getProperty(TeiidDdlLexicon.CreateProcedure.PARAMETER_TYPE).toString();
  String resultFlag=node.getProperty(TeiidDdlLexicon.CreateProcedure.PARAMETER_RESULT_FLAG).toString();
  if (resultFlag != null && resultFlag.equalsIgnoreCase(Boolean.TRUE.toString())) {
    direction=DirectionKind.RETURN_LITERAL.toString();
  }
  prm.setDirection(direction);
  List<AstNode> optionNodes=new ArrayList<AstNode>();
  List<AstNode> children=node.getChildren();
  for (  AstNode child : children) {
    if (is(child,StandardDdlLexicon.TYPE_STATEMENT_OPTION)) {
      optionNodes.add(child);
    }
  }
  processOptions(optionNodes,prm);
  return prm;
}
Program: 101946
Project: 101946
Buggy source:
private Map<String,String> getParameterOptions(ProcedureParameter parameter){
  Map<String,String> options=new HashMap<String,String>();
  if (this.includeNIS && parameter.getNameInSource() != null) {
    options.put(NAMEINSOURCE,parameter.getNameInSource());
  }
  return options;
}

Fixed version (ground truth):
private Map<String,String> getParameterOptions(ProcedureParameter parameter){
  Map<String,String> options=new HashMap<String,String>();
  if (this.includeNIS && parameter.getNameInSource() != null) {
    options.put(NAMEINSOURCE,parameter.getNameInSource());
  }
  if (this.includeNativeType) {
    options.put(NATIVE_TYPE,parameter.getNativeType());
  }
  return options;
}
Program: 101949
Project: 101949
Buggy source:
private Composite createDdlPanel(Composite parent){
  final Composite mainPanel=WidgetFactory.createPanel(parent,SWT.NONE,1,1);
  GridLayoutFactory.fillDefaults().margins(10,10).applyTo(mainPanel);
  ddlFileContentsBox=WidgetFactory.createTextBox(mainPanel);
  ddlFileContentsBox.setEditable(false);
  return mainPanel;
}

Fixed version (ground truth):
private Composite createDdlPanel(Composite parent){
  final Composite mainPanel=WidgetFactory.createPanel(parent,SWT.NONE,1,1);
  GridLayoutFactory.fillDefaults().margins(10,10).applyTo(mainPanel);
  ddlFileContentsBox=new StyledText(mainPanel,SWT.READ_ONLY | SWT.BORDER | SWT.MULTI| SWT.H_SCROLL| SWT.V_SCROLL);
  GridDataFactory.fillDefaults().grab(true,true).minSize(400,300).applyTo(ddlFileContentsBox);
  ddlFileContentsBox.setEditable(false);
  ddlFileContentsBox.setFont(monospaceFont);
  return mainPanel;
}
Program: 101952
Project: 101952
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
 */
@Override @SuppressWarnings("String_Node_Str") public void run(final IProgressMonitor monitor) throws InvocationTargetException {
  try {
    final IFile ddlFileToCreate=targetContainer.getFile(new Path(ddlFileName));
    String ddl=getDDL();
    InputStream istream=new ByteArrayInputStream(ddl.getBytes());
    ddlFileToCreate.create(istream,false,monitor);
    targetContainer.refreshLocal(IResource.DEPTH_INFINITE,monitor);
  }
 catch (  final Exception err) {
    throw new InvocationTargetException(err);
  }
 finally {
    monitor.done();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
 */
@Override public void run(final IProgressMonitor monitor) throws InvocationTargetException {
  try {
    final IFile ddlFileToCreate=targetContainer.getFile(new Path(ddlFileName));
    String ddl=getDDL();
    InputStream istream=new ByteArrayInputStream(ddl.getBytes());
    ddlFileToCreate.create(istream,false,monitor);
    targetContainer.refreshLocal(IResource.DEPTH_INFINITE,monitor);
  }
 catch (  final Exception err) {
    throw new InvocationTargetException(err);
  }
 finally {
    monitor.done();
  }
}
Program: 101953
Project: 101953
Buggy source:
private void createDDLFile(final IContainer targetContainer,final String ddlFileName){
  final IRunnableWithProgress op=new IRunnableWithProgress(){
    /** 
 * {@inheritDoc}
 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
 */
    @Override @SuppressWarnings("String_Node_Str") public void run(    final IProgressMonitor monitor) throws InvocationTargetException {
      try {
        final IFile ddlFileToCreate=targetContainer.getFile(new Path(ddlFileName));
        String ddl=getDDL();
        InputStream istream=new ByteArrayInputStream(ddl.getBytes());
        ddlFileToCreate.create(istream,false,monitor);
        targetContainer.refreshLocal(IResource.DEPTH_INFINITE,monitor);
      }
 catch (      final Exception err) {
        throw new InvocationTargetException(err);
      }
 finally {
        monitor.done();
      }
    }
  }
;
  try {
    new ProgressMonitorDialog(getShell()).run(false,true,op);
  }
 catch (  Throwable err) {
    if (err instanceof InvocationTargetException) {
      err=((InvocationTargetException)err).getTargetException();
    }
    ModelerCore.Util.log(IStatus.ERROR,err,err.getMessage());
    WidgetUtil.showError(Util.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
private void createDDLFile(final IContainer targetContainer,final String ddlFileName){
  final IRunnableWithProgress op=new IRunnableWithProgress(){
    /** 
 * {@inheritDoc}
 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
 */
    @Override public void run(    final IProgressMonitor monitor) throws InvocationTargetException {
      try {
        final IFile ddlFileToCreate=targetContainer.getFile(new Path(ddlFileName));
        String ddl=getDDL();
        InputStream istream=new ByteArrayInputStream(ddl.getBytes());
        ddlFileToCreate.create(istream,false,monitor);
        targetContainer.refreshLocal(IResource.DEPTH_INFINITE,monitor);
      }
 catch (      final Exception err) {
        throw new InvocationTargetException(err);
      }
 finally {
        monitor.done();
      }
    }
  }
;
  try {
    new ProgressMonitorDialog(getShell()).run(false,true,op);
  }
 catch (  Throwable err) {
    if (err instanceof InvocationTargetException) {
      err=((InvocationTargetException)err).getTargetException();
    }
    ModelerCore.Util.log(IStatus.ERROR,err,err.getMessage());
    WidgetUtil.showError(Util.getString("String_Node_Str"));
  }
}
Program: 101954
Project: 101954
Buggy source:
private void createDDLDisplayGroup(Composite parent){
  Group theGroup=WidgetFactory.createGroup(parent,"String_Node_Str",SWT.NONE,1,1);
  GridData groupGD=new GridData(GridData.FILL_BOTH);
  groupGD.heightHint=GROUP_HEIGHT_190;
  groupGD.widthHint=400;
  theGroup.setLayoutData(groupGD);
  ddlContentsBox=WidgetFactory.createTextBox(theGroup);
  ddlContentsBox.setEditable(false);
}

Fixed version (ground truth):
private void createDDLDisplayGroup(Composite parent){
  Group theGroup=WidgetFactory.createGroup(parent,"String_Node_Str",SWT.NONE,1,1);
  GridData groupGD=new GridData(GridData.FILL_BOTH);
  groupGD.heightHint=GROUP_HEIGHT_190;
  groupGD.widthHint=400;
  theGroup.setLayoutData(groupGD);
  ddlContentsBox=new StyledText(theGroup,SWT.READ_ONLY | SWT.BORDER | SWT.MULTI| SWT.H_SCROLL| SWT.V_SCROLL);
  GridDataFactory.fillDefaults().grab(true,true).minSize(400,300).applyTo(ddlContentsBox);
  ddlContentsBox.setEditable(false);
  ddlContentsBox.setFont(monospaceFont);
}
Program: 101955
Project: 101955
Buggy source:
@Override public void createControl(Composite parent){
  final Composite mainPanel=new Composite(parent,SWT.NONE);
  mainPanel.setLayout(new GridLayout(1,false));
  mainPanel.setLayoutData(new GridData());
  mainPanel.setSize(mainPanel.computeSize(SWT.DEFAULT,SWT.DEFAULT));
  setControl(mainPanel);
  createButtonPanel(mainPanel);
  createDDLDisplayGroup(mainPanel);
  setPageComplete(false);
}

Fixed version (ground truth):
@Override public void createControl(Composite parent){
  monospaceFont(parent);
  final Composite mainPanel=new Composite(parent,SWT.NONE);
  mainPanel.setLayout(new GridLayout(1,false));
  mainPanel.setLayoutData(new GridData());
  mainPanel.setSize(mainPanel.computeSize(SWT.DEFAULT,SWT.DEFAULT));
  setControl(mainPanel);
  createButtonPanel(mainPanel);
  createDDLDisplayGroup(mainPanel);
  setPageComplete(false);
}
Program: 101958
Project: 101958
Buggy source:
private String table(Table table){
  if (!includeTables)   return null;
  StringBuilder sb=new StringBuilder();
  sb.append(CREATE_FOREIGN_TABLE).append(SPACE);
  sb.append(getName(table));
  sb.append(SPACE + OPEN_BRACKET);
  @SuppressWarnings("String_Node_Str") List<Column> columns=table.getColumns();
  int nColumns=columns.size();
  int count=0;
  for (  Column col : columns) {
    if (count == 0)     sb.append(NEW_LINE);
    String columnStr=getColumnDdl(col);
    count++;
    sb.append(TAB).append(columnStr);
    if (count < nColumns)     sb.append(COMMA + NEW_LINE);
  }
  if (table instanceof BaseTable) {
    String constraints=getContraints((BaseTable)table);
    if (constraints != null) {
      sb.append(constraints);
    }
  }
  sb.append(NEW_LINE + CLOSE_BRACKET);
  String options=getTableOptions(table);
  if (!StringUtilities.isEmpty(options)) {
    sb.append(SPACE).append(options);
  }
  sb.append(SEMI_COLON);
  sb.append(NEW_LINE);
  return sb.toString();
}

Fixed version (ground truth):
private String table(Table table){
  if (!includeTables)   return null;
  StringBuilder sb=new StringBuilder();
  sb.append(CREATE_FOREIGN_TABLE).append(SPACE);
  sb.append(getName(table));
  sb.append(SPACE + OPEN_BRACKET);
  @SuppressWarnings("String_Node_Str") List<Column> columns=table.getColumns();
  int nColumns=columns.size();
  int count=0;
  for (  Column col : columns) {
    if (count == 0)     sb.append(NEW_LINE);
    String columnStr=getColumnDdl(col);
    count++;
    sb.append(TAB).append(columnStr);
    if (count < nColumns)     sb.append(COMMA + NEW_LINE);
  }
  if (table instanceof BaseTable) {
    String constraints=getContraints((BaseTable)table);
    if (constraints != null) {
      sb.append(COMMA);
      sb.append(constraints);
    }
  }
  sb.append(NEW_LINE + CLOSE_BRACKET);
  String options=getTableOptions(table);
  if (!StringUtilities.isEmpty(options)) {
    sb.append(SPACE).append(options);
  }
  sb.append(SEMI_COLON);
  sb.append(NEW_LINE);
  return sb.toString();
}
Program: 101959
Project: 101959
Buggy source:
public CacheDirective(TeiidParser teiidParser,Boolean prefersMemory,Long ttl){
  this(teiidParser);
  this.prefersMemory=prefersMemory;
  this.ttl=ttl;
}

Fixed version (ground truth):
public CacheDirective(ITeiidServerVersion teiidVersion,Boolean prefersMemory,Long ttl){
  this(teiidVersion);
  this.prefersMemory=prefersMemory;
  this.ttl=ttl;
}
Program: 101960
Project: 101960
Buggy source:
/** 
 * @return version
 */
public ITeiidServerVersion getTeiidVersion(){
  return this.getTeiidParser().getVersion();
}

Fixed version (ground truth):
/** 
 * @return version
 */
public ITeiidServerVersion getTeiidVersion(){
  return this.teiidVersion;
}
Program: 101961
Project: 101961
Buggy source:
public CacheDirective(TeiidParser teiidParser,Boolean prefersMemory,Long ttl){
  this(teiidParser);
  this.prefersMemory=prefersMemory;
  this.ttl=ttl;
}

Fixed version (ground truth):
public CacheDirective(ITeiidServerVersion teiidVersion,Boolean prefersMemory,Long ttl){
  this(teiidVersion);
  this.prefersMemory=prefersMemory;
  this.ttl=ttl;
}
Program: 101962
Project: 101962
Buggy source:
/** 
 * @return version
 */
public ITeiidServerVersion getTeiidVersion(){
  return this.getTeiidParser().getVersion();
}

Fixed version (ground truth):
/** 
 * @return version
 */
public ITeiidServerVersion getTeiidVersion(){
  return this.teiidVersion;
}
Program: 101964
Project: 101964
Buggy source:
/** 
 * Get the User SqlTransformation from a SqlTransformationMappingRoot. This is the nested SqlTransformation that is used to store the "user" (or non-uuid) SQL strings.
 * @param transMappingRoot the transformation mapping root
 * @return the mapping helper
 */
public static SqlTransformation getUserSqlTransformation(final SqlTransformationMappingRoot root){
  SqlTransformation nestedSqlTrans=null;
  if (root != null) {
    final MappingHelper helper=root.getHelper();
    if (helper != null) {
      for (final Iterator iter=helper.getNested().iterator(); iter.hasNext(); ) {
        final Object obj=iter.next();
        if (obj != null && obj instanceof SqlTransformation) {
          nestedSqlTrans=(SqlTransformation)obj;
          break;
        }
      }
    }
  }
  return nestedSqlTrans;
}

Fixed version (ground truth):
/** 
 * Get the User SqlTransformation from a SqlTransformationMappingRoot. This is the nested SqlTransformation that is used to store the "user" (or non-uuid) SQL strings.
 * @param root the transformation mapping root
 * @return the mapping helper
 */
public static SqlTransformation getUserSqlTransformation(final SqlTransformationMappingRoot root){
  SqlTransformation nestedSqlTrans=null;
  if (root != null) {
    final MappingHelper helper=root.getHelper();
    if (helper != null) {
      for (final Iterator iter=helper.getNested().iterator(); iter.hasNext(); ) {
        final Object obj=iter.next();
        if (obj != null && obj instanceof SqlTransformation) {
          nestedSqlTrans=(SqlTransformation)obj;
          break;
        }
      }
    }
  }
  return nestedSqlTrans;
}
Program: 101966
Project: 101966
Buggy source:
@Override protected void checkResource(IResource resource,IProgressMonitor progressMonitor,RefactoringStatus status){
  int readOnlyStatusLevel;
  String readOnlyStatusMsg;
  if (isSelectedOrChildResource(resource)) {
    readOnlyStatusLevel=IStatus.WARNING;
    readOnlyStatusMsg=RefactorResourcesUtils.getString("String_Node_Str",resource.getName());
  }
 else {
    readOnlyStatusLevel=IStatus.ERROR;
    readOnlyStatusMsg=RefactorResourcesUtils.getString("String_Node_Str",resource.getName());
  }
  RefactorResourcesUtils.checkResourceExists(resource,status);
  if (status.getSeverity() > IStatus.WARNING)   return;
  RefactorResourcesUtils.checkResourceSynched(resource,status);
  if (status.getSeverity() > IStatus.WARNING)   return;
  if (resource instanceof IProject)   checkProjectReadOnly((IProject)resource,status);
 else   RefactorResourcesUtils.checkResourceWritable(resource,status,readOnlyStatusLevel,readOnlyStatusMsg);
  if (status.getSeverity() > IStatus.WARNING)   return;
  RefactorResourcesUtils.checkExtensionManager(resource,RefactorType.DELETE,progressMonitor,status);
  if (status.getSeverity() > IStatus.WARNING)   return;
  RefactorResourcesUtils.checkModelResourceWritable(resource,status,readOnlyStatusLevel,readOnlyStatusMsg);
  if (status.getSeverity() > IStatus.WARNING)   return;
  RefactorResourcesUtils.checkSavedResource(resource,status);
  if (status.getSeverity() > IStatus.WARNING)   return;
  if (!getResources().contains(resource)) {
    RefactorResourcesUtils.checkOpenEditors(resource,status);
  }
}

Fixed version (ground truth):
@Override protected void checkResource(IResource resource,IProgressMonitor progressMonitor,RefactoringStatus status){
  int readOnlyStatusLevel;
  String readOnlyStatusMsg;
  if (isSelectedOrChildResource(resource)) {
    readOnlyStatusLevel=IStatus.WARNING;
    readOnlyStatusMsg=RefactorResourcesUtils.getString("String_Node_Str",resource.getName());
  }
 else {
    readOnlyStatusLevel=IStatus.ERROR;
    readOnlyStatusMsg=RefactorResourcesUtils.getString("String_Node_Str",resource.getName());
  }
  RefactorResourcesUtils.checkResourceExists(resource,status);
  if (status.getSeverity() > IStatus.WARNING)   return;
  RefactorResourcesUtils.checkResourceSynched(resource,status);
  if (status.getSeverity() > IStatus.WARNING)   return;
  if (resource instanceof IProject)   checkProjectReadOnly((IProject)resource,status);
 else   RefactorResourcesUtils.checkResourceWritable(resource,status,readOnlyStatusLevel,readOnlyStatusMsg);
  if (status.getSeverity() > IStatus.WARNING)   return;
  RefactorResourcesUtils.checkExtensionManager(resource,RefactorType.DELETE,progressMonitor,status);
  if (status.getSeverity() > IStatus.WARNING)   return;
  RefactorResourcesUtils.checkSavedResource(resource,status);
  if (status.getSeverity() > IStatus.WARNING)   return;
  if (!getResources().contains(resource)) {
    RefactorResourcesUtils.checkOpenEditors(resource,status);
  }
}
Program: 101970
Project: 101970
Buggy source:
/** 
 * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 * @since 4.0
 */
@Override public void createPartControl(final Composite parent){
  this.ctrl=parent;
  ComponentLoadingManager manager=ComponentLoadingManager.getInstance();
  manager.manageLoading(this);
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 * @since 4.0
 */
@Override public void createPartControl(final Composite parent){
  internalCreatePartControl(parent);
  ComponentLoadingManager manager=ComponentLoadingManager.getInstance();
  manager.manageLoading(this);
}
Program: 101972
Project: 101972
Buggy source:
@Override public void manageLoad(Properties args){
  Runnable runnable=new Runnable(){
    @Override public void run(){
      internalCreatePartControl();
    }
  }
;
  UiUtil.runInSwtThread(runnable,true);
}

Fixed version (ground truth):
@Override public void manageLoad(Properties args){
  Runnable runnable=new Runnable(){
    @Override public void run(){
      applyCustomActionService();
    }
  }
;
  UiUtil.runInSwtThread(runnable,false);
}
Program: 101973
Project: 101973
Buggy source:
/** 
 * Handles a selection changed event from the viewer. Overridden (copied, actually) from ResourceNavigator, with code to update the status line commented out, since we are adding a separate SelectionChangedListener to take care of that. Still updates the action bars and links to editor.
 * @param event the selection event
 * @since 4.0
 */
@Override protected void handleSelectionChanged(SelectionChangedEvent event){
  IStructuredSelection sel=(IStructuredSelection)event.getSelection();
  updateActionBars(sel);
  linkToEditor(sel);
  super.handleSelectionChanged(event);
}

Fixed version (ground truth):
/** 
 * Handles a selection changed event from the viewer. Overridden (copied, actually) from ResourceNavigator, with code to update the status line commented out, since we are adding a separate SelectionChangedListener to take care of that. Still updates the action bars and links to editor.
 * @param event the selection event
 * @since 4.0
 */
@Override protected void handleSelectionChanged(SelectionChangedEvent event){
  IStructuredSelection sel=(IStructuredSelection)event.getSelection();
  updateActionBars(sel);
  linkToEditor(sel);
}
Program: 101978
Project: 101978
Buggy source:
/** 
 * @param tableName
 * @param modelResource
 * @return
 */
private BaseTable getTable(String tableName,ModelResource modelResource){
  try {
    for (    EObject eObj : modelResource.getEmfResource().getContents()) {
      String eObjName=this.modelEditor.getName(eObj);
      if (eObj instanceof BaseTable && eObjName != null && eObjName.equalsIgnoreCase(tableName)) {
        return (BaseTable)eObj;
      }
    }
  }
 catch (  ModelWorkspaceException e) {
    RelationalPlugin.Util.log(IStatus.ERROR,NLS.bind(Messages.emfModelGenerator_error_finding_table_named,tableName));
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param tableName
 * @param modelResource
 * @return
 */
private BaseTable getTable(String tableName,ModelResource modelResource){
  try {
    for (    EObject eObj : modelResource.getEmfResource().getContents()) {
      String eObjName=this.getModelEditor().getName(eObj);
      if (eObj instanceof BaseTable && eObjName != null && eObjName.equalsIgnoreCase(tableName)) {
        return (BaseTable)eObj;
      }
    }
  }
 catch (  ModelWorkspaceException e) {
    RelationalPlugin.Util.log(IStatus.ERROR,NLS.bind(Messages.emfModelGenerator_error_finding_table_named,tableName));
  }
  return null;
}
Program: 101979
Project: 101979
Buggy source:
protected ModelEditor getModelEditor(){
  return this.editor;
}

Fixed version (ground truth):
protected ModelEditor getModelEditor(){
  return ModelerCore.getModelEditor();
}
Program: 101981
Project: 101981
Buggy source:
/** 
 * Construct an instance of IntermediateFormat.
 */
public IntermediateFormat(final List modelWrappers,final DdlOptions options,final IProgressMonitor monitor){
  super();
  CoreArgCheck.isNotNull(modelWrappers);
  CoreArgCheck.isNotNull(options);
  this.modelWrappers=new ArrayList(modelWrappers);
  this.options=options;
  this.editor=ModelerCore.getModelEditor();
  this.relationalEntities=new HashMap();
}

Fixed version (ground truth):
/** 
 * Construct an instance of IntermediateFormat.
 */
public IntermediateFormat(final List modelWrappers,final DdlOptions options,final IProgressMonitor monitor){
  super();
  CoreArgCheck.isNotNull(modelWrappers);
  CoreArgCheck.isNotNull(options);
  this.modelWrappers=new ArrayList(modelWrappers);
  this.options=options;
  this.relationalEntities=new HashMap();
}
Program: 101983
Project: 101983
Buggy source:
/** 
 * Perform deletes from the updateDeleteMap
 * @return number of deleted nodes.
 */
private int performTreeUpdates() throws ModelerCoreException {
  int count=0;
  final Iterator keys=updateDeleteMap.keySet().iterator();
  while (keys.hasNext()) {
    final EObject parent=(EObject)keys.next();
    final ArrayList children=(ArrayList)updateDeleteMap.get(parent);
    if (children != null) {
      final Iterator childrenIT=children.iterator();
      while (childrenIT.hasNext()) {
        final EObject child=(EObject)childrenIT.next();
        me.delete(child);
        count++;
      }
    }
  }
  return count;
}

Fixed version (ground truth):
/** 
 * Perform deletes from the updateDeleteMap
 * @return number of deleted nodes.
 */
private int performTreeUpdates() throws ModelerCoreException {
  int count=0;
  final Iterator keys=updateDeleteMap.keySet().iterator();
  while (keys.hasNext()) {
    final EObject parent=(EObject)keys.next();
    final ArrayList children=(ArrayList)updateDeleteMap.get(parent);
    if (children != null) {
      final Iterator childrenIT=children.iterator();
      while (childrenIT.hasNext()) {
        final EObject child=(EObject)childrenIT.next();
        getModelEditor().delete(child);
        count++;
      }
    }
  }
  return count;
}
Program: 101984
Project: 101984
Buggy source:
private void removeChildrenOfSameName(final EObject parent,final Class clazz,String name){
  final String newName=this.validator.createValidName(name);
  if (newName != null)   name=newName;
  final Iterator children=parent.eContents().iterator();
  while (children.hasNext()) {
    final EObject next=(EObject)children.next();
    if (clazz.isAssignableFrom(next.getClass()))     try {
      final String name2=((XmlDocumentNode)next).getName();
      if (name == null && name2 == null)       me.delete(next);
 else       if (name != null && name.equals(name2))       me.delete(next);
    }
 catch (    final ModelerCoreException e) {
      ModelerCore.Util.log(IStatus.ERROR,e,XmlDocumentPlugin.Util.getString("String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
private void removeChildrenOfSameName(final EObject parent,final Class clazz,String name){
  final String newName=this.validator.createValidName(name);
  if (newName != null)   name=newName;
  final Iterator children=parent.eContents().iterator();
  while (children.hasNext()) {
    final EObject next=(EObject)children.next();
    if (clazz.isAssignableFrom(next.getClass()))     try {
      final String name2=((XmlDocumentNode)next).getName();
      if (name == null && name2 == null)       getModelEditor().delete(next);
 else       if (name != null && name.equals(name2))       getModelEditor().delete(next);
    }
 catch (    final ModelerCoreException e) {
      ModelerCore.Util.log(IStatus.ERROR,e,XmlDocumentPlugin.Util.getString("String_Node_Str"));
    }
  }
}
Program: 101985
Project: 101985
Buggy source:
/** 
 * Create the RelationalModel object representation of an EMF Model
 * @param modelResource the ModelResource
 * @return the RelationalModel object representation
 * @throws Exception the exception
 */
public RelationalModel createRelationalModel(ModelResource modelResource) throws Exception {
  String modelName=modelEditor.getModelName(modelResource);
  RelationalModel relationalModel=new RelationalModel(modelName);
  Map<EObject,RelationalReference> deferredCreateMap=new HashMap<EObject,RelationalReference>();
  List<EObject> rootEObjs=modelResource.getAllRootEObjects();
  for (  EObject eObj : rootEObjs) {
    Map<EObject,RelationalReference> deferredObjMap=createObject(eObj,null,relationalModel);
    if (!deferredObjMap.isEmpty()) {
      deferredCreateMap.putAll(deferredObjMap);
    }
  }
  createDeferredObjects(deferredCreateMap,relationalModel);
  return relationalModel;
}

Fixed version (ground truth):
/** 
 * Create the RelationalModel object representation of an EMF Model
 * @param modelResource the ModelResource
 * @return the RelationalModel object representation
 * @throws Exception the exception
 */
public RelationalModel createRelationalModel(ModelResource modelResource) throws Exception {
  String modelName=getModelEditor().getModelName(modelResource);
  RelationalModel relationalModel=new RelationalModel(modelName);
  Map<EObject,RelationalReference> deferredCreateMap=new HashMap<EObject,RelationalReference>();
  List<EObject> rootEObjs=modelResource.getAllRootEObjects();
  for (  EObject eObj : rootEObjs) {
    Map<EObject,RelationalReference> deferredObjMap=createObject(eObj,null,relationalModel);
    if (!deferredObjMap.isEmpty()) {
      deferredCreateMap.putAll(deferredObjMap);
    }
  }
  createDeferredObjects(deferredCreateMap,relationalModel);
  return relationalModel;
}
Program: 101986
Project: 101986
Buggy source:
/** 
 * Set Description on the RelationalReference by transferring it from the EObject.
 * @param relationalRef the RelationalReference
 * @param eObject the source EObject
 */
private void setDescription(RelationalReference relationalRef,EObject eObject){
  try {
    String desc=modelEditor.getDescription(eObject);
    relationalRef.setDescription(desc);
  }
 catch (  ModelerCoreException ex) {
    RelationalPlugin.Util.log(IStatus.ERROR,NLS.bind(Messages.relationalRefFactory_errorSettingDescription,relationalRef.getName()));
    relationalRef.setDescription(null);
  }
}

Fixed version (ground truth):
/** 
 * Set Description on the RelationalReference by transferring it from the EObject.
 * @param relationalRef the RelationalReference
 * @param eObject the source EObject
 */
private void setDescription(RelationalReference relationalRef,EObject eObject){
  try {
    String desc=getModelEditor().getDescription(eObject);
    relationalRef.setDescription(desc);
  }
 catch (  ModelerCoreException ex) {
    RelationalPlugin.Util.log(IStatus.ERROR,NLS.bind(Messages.relationalRefFactory_errorSettingDescription,relationalRef.getName()));
    relationalRef.setDescription(null);
  }
}
Program: 101987
Project: 101987
Buggy source:
/** 
 * @param type type of RelationalReference to find
 * @param eObj the EObject
 * @param parent the parent reference
 * @param allModelRefs the collection of all model RelationalReferences
 * @return RelationalReference which is a match
 * @throws EntityNotFoundException
 * @throws CoreException
 */
protected <T extends RelationalReference>T find(Class<T> type,EObject eObj,RelationalReference parent,Collection<RelationalReference> allModelRefs){
  return find(type,this.modelEditor.getName(eObj),eObj,parent,allModelRefs);
}

Fixed version (ground truth):
/** 
 * @param type type of RelationalReference to find
 * @param eObj the EObject
 * @param parent the parent reference
 * @param allModelRefs the collection of all model RelationalReferences
 * @return RelationalReference which is a match
 * @throws EntityNotFoundException
 * @throws CoreException
 */
protected <T extends RelationalReference>T find(Class<T> type,EObject eObj,RelationalReference parent,Collection<RelationalReference> allModelRefs){
  return find(type,this.getModelEditor().getName(eObj),eObj,parent,allModelRefs);
}
Program: 101989
Project: 101989
Buggy source:
/** 
 * @param monitor
 * @param totalWork
 * @throws Exception
 */
public void save(IProgressMonitor monitor,int totalWork) throws Exception {
  monitor.subTask(DdlImporterI18n.SAVING_MODEL_MSG);
  if (!model.exists()) {
    ModelAnnotation modelAnnotation=model.getModelAnnotation();
    modelAnnotation.setPrimaryMetamodelUri(RelationalPackage.eNS_URI);
    modelAnnotation.setModelType(importManager.getModelType());
  }
  importStatus=EmfModelGenerator.INSTANCE.execute(diffReport,model,monitor,totalWork);
  if (importManager.getModelType() == ModelType.VIRTUAL_LITERAL) {
    Properties props=new Properties();
    boolean doGenerateDefaultSQL=importManager.optToGenerateDefaultSQL();
    if (doGenerateDefaultSQL) {
      props.put("String_Node_Str",doGenerateDefaultSQL);
      props.put("String_Node_Str",doGenerateDefaultSQL);
    }
    Collection<EObject> targets=new ArrayList<EObject>();
    for (    Object nextObj : model.getEObjects()) {
      if (nextObj instanceof Procedure || nextObj instanceof BaseTable || nextObj instanceof View) {
        try {
          NewModelObjectHelperManager.helpCreate(nextObj,props);
          targets.add((EObject)nextObj);
        }
 catch (        ModelerCoreException err) {
          DdlImporterPlugin.UTIL.log(IStatus.ERROR,err,err.getMessage());
        }
      }
    }
  }
  model.save(monitor,false);
  monitor.worked(totalWork);
  monitor.done();
}

Fixed version (ground truth):
/** 
 * @param monitor
 * @param totalWork
 * @throws Exception
 */
public void save(IProgressMonitor monitor,int totalWork) throws Exception {
  monitor.subTask(DdlImporterI18n.SAVING_MODEL_MSG);
  if (!model.exists()) {
    ModelAnnotation modelAnnotation=model.getModelAnnotation();
    modelAnnotation.setPrimaryMetamodelUri(RelationalPackage.eNS_URI);
    modelAnnotation.setModelType(importManager.getModelType());
  }
  importStatus=EmfModelGenerator.INSTANCE.execute(diffReport,model,monitor,totalWork);
  if (importManager.getModelType() == ModelType.VIRTUAL_LITERAL) {
    Properties props=new Properties();
    boolean doGenerateDefaultSQL=importManager.optToGenerateDefaultSQL();
    boolean doHelpCreateTransform=importManager.optToHelpCreateTransform();
    if (doHelpCreateTransform) {
      if (doGenerateDefaultSQL) {
        props.put("String_Node_Str",doGenerateDefaultSQL);
        props.put("String_Node_Str",doGenerateDefaultSQL);
      }
      Collection<EObject> targets=new ArrayList<EObject>();
      for (      Object nextObj : model.getEObjects()) {
        if (nextObj instanceof Procedure || nextObj instanceof BaseTable || nextObj instanceof View) {
          try {
            NewModelObjectHelperManager.helpCreate(nextObj,props);
            targets.add((EObject)nextObj);
          }
 catch (          ModelerCoreException err) {
            DdlImporterPlugin.UTIL.log(IStatus.ERROR,err,err.getMessage());
          }
        }
      }
    }
  }
  model.save(monitor,false);
  monitor.worked(totalWork);
  monitor.done();
}
Program: 101991
Project: 101991
Buggy source:
/** 
 * Perform the import
 * @param rootNode the rootNode of the DDL
 * @param importManager the import manager which maintains import options
 * @return the RelationalModel created
 * @throws Exception
 */
@Override public RelationalModel importNode(AstNode rootNode,DdlImporterManager importManager) throws Exception {
  setImporterManager(importManager);
  RelationalModel model=getFactory().createModel("String_Node_Str");
  Map<AstNode,RelationalReference> deferredCreateMap=new HashMap<AstNode,RelationalReference>();
  for (  AstNode node : rootNode) {
    if (is(node,StandardDdlLexicon.TYPE_CREATE_SCHEMA_STATEMENT)) {
      RelationalSchema schema=getFactory().createSchema();
      model.addChild(schema);
      initialize(schema,node);
      for (      AstNode node1 : node) {
        Map<AstNode,RelationalReference> deferredMap=createObject(node1,model,schema);
        if (!deferredMap.isEmpty()) {
          deferredCreateMap.putAll(deferredMap);
        }
      }
    }
 else     if (is(node,TeiidDdlLexicon.OptionNamespace.STATEMENT)) {
    }
 else {
      Map<AstNode,RelationalReference> deferredMap=createObject(node,model,null);
      if (!deferredMap.isEmpty()) {
        deferredCreateMap.putAll(deferredMap);
      }
    }
  }
  createDeferredObjects(deferredCreateMap,model);
  return model;
}

Fixed version (ground truth):
/** 
 * Perform the import
 * @param rootNode the rootNode of the DDL
 * @param importManager the import manager which maintains import options
 * @return the RelationalModel created
 * @throws Exception
 */
@Override public RelationalModel importNode(AstNode rootNode,DdlImporterManager importManager) throws Exception {
  setImporterManager(importManager);
  getImporterManager().optToGenerateDefaultSQL(false);
  getImporterManager().optToHelpCreateTransform(false);
  RelationalModel model=getFactory().createModel("String_Node_Str");
  Map<AstNode,RelationalReference> deferredCreateMap=new HashMap<AstNode,RelationalReference>();
  for (  AstNode node : rootNode) {
    if (is(node,StandardDdlLexicon.TYPE_CREATE_SCHEMA_STATEMENT)) {
      RelationalSchema schema=getFactory().createSchema();
      model.addChild(schema);
      initialize(schema,node);
      for (      AstNode node1 : node) {
        Map<AstNode,RelationalReference> deferredMap=createObject(node1,model,schema);
        if (!deferredMap.isEmpty()) {
          deferredCreateMap.putAll(deferredMap);
        }
      }
    }
 else     if (is(node,TeiidDdlLexicon.OptionNamespace.STATEMENT)) {
    }
 else {
      Map<AstNode,RelationalReference> deferredMap=createObject(node,model,null);
      if (!deferredMap.isEmpty()) {
        deferredCreateMap.putAll(deferredMap);
      }
    }
  }
  createDeferredObjects(deferredCreateMap,model);
  return model;
}
Program: 101994
Project: 101994
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.teiid.designer.core.extension.EmfModelObjectExtensionAssistant#setPropertyValue(java.lang.Object,java.lang.String,java.lang.String)
 */
@Override public void setPropertyValue(final Object modelObject,final String propId,final String newValue) throws Exception {
  super.setPropertyValue(modelObject,propId,newValue);
  if (PropertyName.same(PropertyName.AGGREGATE,propId) && !Boolean.parseBoolean(newValue)) {
    removeProperty(modelObject,PropertyName.ANALYTIC.toString());
    removeProperty(modelObject,PropertyName.ALLOWS_ORDER_BY.toString());
    removeProperty(modelObject,PropertyName.USES_DISTINCT_ROWS.toString());
    removeProperty(modelObject,PropertyName.ALLOWS_DISTINCT.toString());
    removeProperty(modelObject,PropertyName.DECOMPOSABLE.toString());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.teiid.designer.core.extension.EmfModelObjectExtensionAssistant#setPropertyValue(java.lang.Object,java.lang.String,java.lang.String)
 */
@Override public void setPropertyValue(final Object modelObject,final String propId,final String newValue) throws Exception {
  boolean isVirtual=ModelUtil.isVirtual(modelObject);
  if (isVirtual && !PropertyName.same(PropertyName.NON_PREPARED,propId)) {
    super.setPropertyValue(modelObject,propId,newValue);
  }
  if (PropertyName.same(PropertyName.AGGREGATE,propId) && !Boolean.parseBoolean(newValue)) {
    removeProperty(modelObject,PropertyName.ANALYTIC.toString());
    removeProperty(modelObject,PropertyName.ALLOWS_ORDER_BY.toString());
    removeProperty(modelObject,PropertyName.USES_DISTINCT_ROWS.toString());
    removeProperty(modelObject,PropertyName.ALLOWS_DISTINCT.toString());
    removeProperty(modelObject,PropertyName.DECOMPOSABLE.toString());
  }
}
Program: 101996
Project: 101996
Buggy source:
/** 
 * @see org.teiid.designer.webservice.IWebServiceModelBuilder#setDestinationPath(org.teiid.designer.webservice.IWebServiceXsdResource,org.eclipse.core.runtime.IPath)
 * @since 4.2
 */
@Override public void setDestinationPath(final IWebServiceXsdResource xsdResource,final IPath workspacePathForXsd){
  if (xsdResource instanceof IInternalWebServiceXsdResource) {
    final IPath existing=xsdResource.getDestinationPath();
    boolean match=false;
    if (existing == null) {
      if (workspacePathForXsd == null) {
        match=true;
      }
    }
 else {
      if (workspacePathForXsd == null) {
        match=existing.segmentCount() == 0;
      }
 else {
        match=existing.makeAbsolute().equals(workspacePathForXsd.makeAbsolute());
      }
    }
    if (!match) {
      ((IInternalWebServiceXsdResource)xsdResource).setDestinationPath(workspacePathForXsd.makeAbsolute());
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.teiid.designer.webservice.IWebServiceModelBuilder#setDestinationPath(org.teiid.designer.webservice.IWebServiceXsdResource,org.eclipse.core.runtime.IPath)
 * @since 4.2
 */
@Override public void setDestinationPath(final IWebServiceXsdResource xsdResource,final IPath workspacePathForXsd){
  if (xsdResource instanceof IInternalWebServiceXsdResource) {
    final IPath existing=xsdResource.getDestinationPath();
    boolean match=false;
    if (existing == null) {
      if (workspacePathForXsd == null) {
        match=true;
      }
    }
 else {
      if (workspacePathForXsd == null) {
        match=existing.segmentCount() == 0;
      }
 else       if (!existing.toFile().exists()) {
        match=false;
      }
 else {
        match=existing.makeAbsolute().equals(workspacePathForXsd.makeAbsolute());
      }
    }
    if (!match) {
      ((IInternalWebServiceXsdResource)xsdResource).setDestinationPath(workspacePathForXsd.makeAbsolute());
    }
  }
}
Program: 101998
Project: 101998
Buggy source:
/** 
 * @see org.teiid.designer.webservice.IWebServiceModelBuilder#setDestinationPath(org.teiid.designer.webservice.IWebServiceXsdResource,org.eclipse.core.runtime.IPath)
 * @since 4.2
 */
@Override public void setDestinationPath(final IWebServiceXsdResource xsdResource,final IPath workspacePathForXsd){
  if (xsdResource instanceof IInternalWebServiceXsdResource) {
    final IPath existing=xsdResource.getDestinationPath();
    boolean match=false;
    if (existing == null) {
      if (workspacePathForXsd == null) {
        match=true;
      }
    }
 else {
      if (workspacePathForXsd == null) {
        match=existing.segmentCount() == 0;
      }
 else {
        match=existing.makeAbsolute().equals(workspacePathForXsd.makeAbsolute());
      }
    }
    if (!match) {
      ((IInternalWebServiceXsdResource)xsdResource).setDestinationPath(workspacePathForXsd.makeAbsolute());
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.teiid.designer.webservice.IWebServiceModelBuilder#setDestinationPath(org.teiid.designer.webservice.IWebServiceXsdResource,org.eclipse.core.runtime.IPath)
 * @since 4.2
 */
@Override public void setDestinationPath(final IWebServiceXsdResource xsdResource,final IPath workspacePathForXsd){
  if (xsdResource instanceof IInternalWebServiceXsdResource) {
    final IPath existing=xsdResource.getDestinationPath();
    boolean match=false;
    if (existing == null) {
      if (workspacePathForXsd == null) {
        match=true;
      }
    }
 else {
      if (workspacePathForXsd == null) {
        match=existing.segmentCount() == 0;
      }
 else       if (!existing.toFile().exists()) {
        match=false;
      }
 else {
        match=existing.makeAbsolute().equals(workspacePathForXsd.makeAbsolute());
      }
    }
    if (!match) {
      ((IInternalWebServiceXsdResource)xsdResource).setDestinationPath(workspacePathForXsd.makeAbsolute());
    }
  }
}
Program: 102000
Project: 102000
Buggy source:
/** 
 * @param value
 */
public void setGenerateDefaultSQL(boolean value){
  this.generateDefaultSQL=value;
}

Fixed version (ground truth):
/** 
 * @param value
 */
public void setGenerateDefaultSQL(boolean value){
  importManager.optToGenerateDefaultSQL(value);
}
Program: 102001
Project: 102001
Buggy source:
/** 
 * @param monitor
 * @param totalWork
 * @throws Exception
 */
public void save(IProgressMonitor monitor,int totalWork) throws Exception {
  monitor.subTask(DdlImporterI18n.SAVING_MODEL_MSG);
  if (!model.exists()) {
    ModelAnnotation modelAnnotation=model.getModelAnnotation();
    modelAnnotation.setPrimaryMetamodelUri(RelationalPackage.eNS_URI);
    modelAnnotation.setModelType(importManager.getModelType());
  }
  importStatus=EmfModelGenerator.INSTANCE.execute(diffReport,model,monitor,totalWork);
  if (importManager.getModelType() == ModelType.VIRTUAL_LITERAL) {
    Properties props=new Properties();
    if (doGenerateDefaultSQL()) {
      props.put("String_Node_Str",generateDefaultSQL);
      props.put("String_Node_Str",generateDefaultSQL);
    }
    Collection<EObject> targets=new ArrayList<EObject>();
    for (    Object nextObj : model.getEObjects()) {
      if (nextObj instanceof Procedure || nextObj instanceof BaseTable || nextObj instanceof View) {
        try {
          NewModelObjectHelperManager.helpCreate(nextObj,props);
          targets.add((EObject)nextObj);
        }
 catch (        ModelerCoreException err) {
          DdlImporterPlugin.UTIL.log(IStatus.ERROR,err,err.getMessage());
        }
      }
    }
  }
  model.save(monitor,false);
  monitor.worked(totalWork);
  monitor.done();
}

Fixed version (ground truth):
/** 
 * @param monitor
 * @param totalWork
 * @throws Exception
 */
public void save(IProgressMonitor monitor,int totalWork) throws Exception {
  monitor.subTask(DdlImporterI18n.SAVING_MODEL_MSG);
  if (!model.exists()) {
    ModelAnnotation modelAnnotation=model.getModelAnnotation();
    modelAnnotation.setPrimaryMetamodelUri(RelationalPackage.eNS_URI);
    modelAnnotation.setModelType(importManager.getModelType());
  }
  importStatus=EmfModelGenerator.INSTANCE.execute(diffReport,model,monitor,totalWork);
  if (importManager.getModelType() == ModelType.VIRTUAL_LITERAL) {
    Properties props=new Properties();
    boolean doGenerateDefaultSQL=importManager.optToGenerateDefaultSQL();
    if (doGenerateDefaultSQL) {
      props.put("String_Node_Str",doGenerateDefaultSQL);
      props.put("String_Node_Str",doGenerateDefaultSQL);
    }
    Collection<EObject> targets=new ArrayList<EObject>();
    for (    Object nextObj : model.getEObjects()) {
      if (nextObj instanceof Procedure || nextObj instanceof BaseTable || nextObj instanceof View) {
        try {
          NewModelObjectHelperManager.helpCreate(nextObj,props);
          targets.add((EObject)nextObj);
        }
 catch (        ModelerCoreException err) {
          DdlImporterPlugin.UTIL.log(IStatus.ERROR,err,err.getMessage());
        }
      }
    }
  }
  model.save(monitor,false);
  monitor.worked(totalWork);
  monitor.done();
}