nus-yam/ex-repair huggingface dataset:
Program: 102061
Project: 102061
Buggy source:
private void updateState(){
  String endPointName=profileProperties.getProperty(IWSProfileConstants.END_POINT_NAME_PROP_ID);
  if (null == endPointName || endPointName.isEmpty()) {
    setErrorMessage(UTIL.getString("String_Node_Str"));
    return;
  }
  setErrorMessage(null);
  try {
    Port port=wsdlModel.getPort(endPointName);
    new URL(port.getLocationURI());
    profileProperties.setProperty(IWSProfileConstants.END_POINT_URI_PROP_ID,port.getLocationURI());
    profileProperties.setProperty(IWSProfileConstants.SOAP_BINDING,port.getBindingType());
  }
 catch (  Exception e) {
    setErrorMessage(UTIL.getString("String_Node_Str"));
    return;
  }
  setErrorMessage(null);
  setPageComplete(true);
  setMessage(UTIL.getString("String_Node_Str"));
}

Fixed version (ground truth):
private void updateState(){
  String endPointName=profileProperties.getProperty(IWSProfileConstants.END_POINT_NAME_PROP_ID);
  if (null == endPointName || endPointName.isEmpty()) {
    setErrorMessage(UTIL.getString("String_Node_Str"));
    return;
  }
  setErrorMessage(null);
  try {
    Port port=wsdlModel.getPort(endPointName);
    new URL(port.getLocationURI());
    String bindingType=port.getBindingType();
    profileProperties.setProperty(IWSProfileConstants.END_POINT_URI_PROP_ID,port.getLocationURI());
    if (bindingType != null) {
      profileProperties.setProperty(IWSProfileConstants.SOAP_BINDING,bindingType);
      defaultBindingText.setText(bindingType);
    }
  }
 catch (  Exception e) {
    setErrorMessage(UTIL.getString("String_Node_Str"));
    return;
  }
  setErrorMessage(null);
  setPageComplete(true);
  setMessage(UTIL.getString("String_Node_Str"));
}
Program: 102062
Project: 102062
Buggy source:
@Override public void run(){
  try {
    WSDLReader wsdlReader=wizard.getWsdlReader();
    wsdlModel=wsdlReader.getModel();
    if (wsdlModel != null) {
      endPointCombo.setItems(wsdlModel.getModelablePortNames());
    }
 else {
      endPointCombo.removeAll();
    }
  }
 catch (  ModelGenerationException ex) {
    setErrorMessage(ex.getLocalizedMessage());
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    WSDLReader wsdlReader=wizard.getWsdlReader();
    wsdlModel=wsdlReader.getModel();
    if (wsdlModel != null) {
      endPointCombo.setItems(wsdlModel.getModelablePortNames());
    }
 else {
      endPointCombo.removeAll();
    }
  }
 catch (  ModelGenerationException ex) {
    setErrorMessage(ex.getLocalizedMessage());
  }
  String endPointName=profileProperties.getProperty(IWSProfileConstants.END_POINT_NAME_PROP_ID);
  if (null != endPointName && !endPointName.isEmpty()) {
    if (endPointCombo.getItemCount() == 1) {
      endPointCombo.select(0);
    }
 else     if (endPointCombo.getItemCount() > 0) {
      String[] endPoints=endPointCombo.getItems();
      int i=0;
      for (      String next : endPoints) {
        if (next.equals(endPointName)) {
          endPointCombo.select(i);
          break;
        }
        i++;
      }
    }
  }
}
Program: 102064
Project: 102064
Buggy source:
@Override public List getSummaryData(){
  List result=super.getSummaryData();
  String endPointName=profileProperties.getProperty(IWSProfileConstants.END_POINT_NAME_PROP_ID);
  result.add(new String[]{UTIL.getString("String_Node_Str"),endPointName});
  String endPointURI=profileProperties.getProperty(IWSProfileConstants.END_POINT_URI_PROP_ID);
  result.add(new String[]{UTIL.getString("String_Node_Str"),endPointURI});
  String binding=profileProperties.getProperty(IWSProfileConstants.SOAP_BINDING);
  result.add(new String[]{UTIL.getString("String_Node_Str"),binding});
  return result;
}

Fixed version (ground truth):
@Override public List<String[]> getSummaryData(){
  @SuppressWarnings("String_Node_Str") List<String[]> result=super.getSummaryData();
  String endPointName=profileProperties.getProperty(IWSProfileConstants.END_POINT_NAME_PROP_ID);
  result.add(new String[]{UTIL.getString("String_Node_Str"),endPointName});
  String endPointURI=profileProperties.getProperty(IWSProfileConstants.END_POINT_URI_PROP_ID);
  result.add(new String[]{UTIL.getString("String_Node_Str"),endPointURI});
  String binding=profileProperties.getProperty(IWSProfileConstants.SOAP_BINDING);
  result.add(new String[]{UTIL.getString("String_Node_Str"),binding});
  return result;
}
Program: 102065
Project: 102065
Buggy source:
/** 
 * @param parentShell
 * @param title
 * @param message
 * @param permission
 * @param okEnabled
 */
public SecurityDefinitionDialog(Shell parentShell,String title,String message,Permission permission,boolean allowsFilter,boolean allowsMasking){
  super(parentShell,title,message,true);
  this.targetName=permission.getTargetName();
  isEdit=true;
  if (permission.getCondition() != null) {
    this.conditionString=permission.getCondition();
    this.constraint=permission.isConstraint();
  }
  if (permission.getMask() != null) {
    this.maskString=permission.getMask();
    this.order=permission.getOrder();
  }
  this.allowsFilter=allowsFilter;
  this.allowsMasking=allowsMasking;
}

Fixed version (ground truth):
/** 
 * @param parentShell
 * @param title
 * @param message
 * @param permission
 * @param okEnabled
 */
public SecurityDefinitionDialog(Shell parentShell,String title,String message,Permission permission,boolean allowsFilter,boolean allowsMasking,boolean existingSecurity){
  super(parentShell,title,message,existingSecurity);
  this.targetName=permission.getTargetName();
  isEdit=true;
  if (permission.getCondition() != null) {
    this.conditionString=permission.getCondition();
    this.constraint=permission.isConstraint();
  }
  if (permission.getMask() != null) {
    this.maskString=permission.getMask();
    this.order=permission.getOrder();
  }
  this.allowsFilter=allowsFilter;
  this.allowsMasking=allowsMasking;
}
Program: 102066
Project: 102066
Buggy source:
@Override protected void validate(){
  boolean enable=true;
  setErrorMessage(null);
  setMessage(Messages.clickOkToFinish);
  this.conditionString=conditionTextEditor.getText();
  this.maskString=maskTextEditor.getText();
  this.constraint=constraintButton.getSelection();
  boolean conditionEmpty=(this.conditionString == null || this.conditionString.trim().isEmpty());
  if (conditionEmpty && allowsFilter) {
    enable=false;
    setErrorMessage(Messages.conditionIsUndefined);
  }
  if (this.allowsMasking) {
    boolean maskEmpty=(maskString == null || maskString.trim().isEmpty());
    if (maskEmpty && conditionEmpty) {
      enable=false;
      setErrorMessage(Messages.noMaskOrConditionDefined);
    }
    if (this.orderText.getText() != null) {
      try {
        order=Integer.parseInt(orderText.getText());
      }
 catch (      NumberFormatException ex) {
        enable=false;
        setErrorMessage(Messages.orderMustBeAnInteger);
        return;
      }
    }
 else {
      enable=false;
      setErrorMessage(Messages.orderMustNotBeNull);
      return;
    }
  }
  getButton(IDialogConstants.OK_ID).setEnabled(enable);
}

Fixed version (ground truth):
@Override protected void validate(){
  boolean enable=true;
  setErrorMessage(null);
  setMessage(Messages.clickOkToFinish);
  this.conditionString=conditionTextEditor.getText();
  this.maskString=maskTextEditor.getText();
  this.constraint=constraintButton.getSelection();
  boolean conditionEmpty=(this.conditionString == null || this.conditionString.trim().isEmpty());
  if (this.allowsMasking) {
    boolean maskEmpty=(maskString == null || maskString.trim().isEmpty());
    if (maskEmpty && conditionEmpty) {
      enable=false;
      setErrorMessage(Messages.noMaskOrConditionDefined);
    }
    if (this.orderText.getText() != null) {
      try {
        order=Integer.parseInt(orderText.getText());
      }
 catch (      NumberFormatException ex) {
        enable=false;
        setErrorMessage(Messages.orderMustBeAnInteger);
        return;
      }
    }
 else {
      enable=false;
      setErrorMessage(Messages.orderMustNotBeNull);
      return;
    }
  }
 else   if (conditionEmpty && allowsFilter) {
    enable=false;
    setErrorMessage(Messages.conditionIsUndefined);
  }
  getButton(IDialogConstants.OK_ID).setEnabled(enable);
}
Program: 102067
Project: 102067
Buggy source:
private void handleDoubleClick(int column,Object target){
  if (column == 1 && getTreeProvider().allowsSecurity(target)) {
    Permission perm=getTreeProvider().getPermission(target);
    if (perm == null) {
      perm=getTreeProvider().createPermission(target);
    }
    boolean allowsCondition=getTreeProvider().allowsCondition(target);
    boolean allowsMask=getTreeProvider().allowsMasking(target);
    String message=getTreeProvider().getSecurityDialogMessage(target);
    SecurityDefinitionDialog dialog=new SecurityDefinitionDialog(getShell(),Messages.setSecurityValuesTitle,message,perm,allowsCondition,allowsMask);
    if (dialog.open() == Window.OK) {
      if (allowsCondition) {
        perm.setCondition(dialog.getCondition());
        perm.setConstraint(dialog.getConstraintValue());
      }
      if (allowsMask) {
        perm.setMask(dialog.getMask());
        perm.setOrder(dialog.getOrder());
      }
      getWizard().refreshAllTabs();
      validateInputs();
    }
  }
}

Fixed version (ground truth):
private void handleDoubleClick(int column,Object target){
  if (column == 1 && getTreeProvider().allowsSecurity(target)) {
    Permission perm=getTreeProvider().getPermission(target);
    boolean existingPerm=perm != null;
    if (perm == null) {
      perm=getTreeProvider().createPermission(target);
    }
    boolean allowsCondition=getTreeProvider().allowsCondition(target);
    boolean allowsMask=getTreeProvider().allowsMasking(target);
    String message=getTreeProvider().getSecurityDialogMessage(target);
    SecurityDefinitionDialog dialog=new SecurityDefinitionDialog(getShell(),Messages.setSecurityValuesTitle,message,perm,allowsCondition,allowsMask,existingPerm);
    if (dialog.open() == Window.OK) {
      if (allowsCondition) {
        perm.setCondition(dialog.getCondition());
        perm.setConstraint(dialog.getConstraintValue());
      }
      if (allowsMask) {
        perm.setMask(dialog.getMask());
        perm.setOrder(dialog.getOrder());
      }
      getWizard().refreshAllTabs();
      validateInputs();
    }
  }
}
Program: 102070
Project: 102070
Buggy source:
private String getSpaces(int nSpaces){
  StringBuffer sb=new StringBuffer(nSpaces);
  for (int i=0; i < nSpaces; i++) {
    sb.append(StringUtilities.SPACE);
  }
  return sb.toString();
}

Fixed version (ground truth):
private String getSpaces(int nSpaces){
  StringBuffer sb=new StringBuffer(nSpaces);
  for (int i=0; i < nSpaces; i++) {
    sb.append(StringConstants.SPACE);
  }
  return sb.toString();
}
Program: 102076
Project: 102076
Buggy source:
@Override public Map<String,Object> getParameterMap(){
  return this.parameterMap;
}

Fixed version (ground truth):
@Override public Map<String,Object> getParameterMap(){
  return this.parameterMap == null ? Collections.EMPTY_MAP : this.parameterMap;
}
Program: 102077
Project: 102077
Buggy source:
/** 
 * This method allows setting the values in the current info object using the values from an external info object
 * @param info the data file info object
 */
public void inject(TeiidXmlFileInfo info){
  CoreArgCheck.isNotNull(info.getDataFile(),"String_Node_Str");
  this.cachedFirstLines=info.cachedFirstLines;
  this.numberOfLinesInFile=info.getNumberOfLinesInFile();
  this.rootPath=info.getRootPath();
  this.parameterMap=info.parameterMap;
  this.columnInfoList=new ArrayList<TeiidXmlColumnInfo>();
  for (  ITeiidXmlColumnInfo iColInfo : info.getColumnInfoList()) {
    TeiidXmlColumnInfo colInfo=(TeiidXmlColumnInfo)iColInfo;
    this.columnInfoList.add(new TeiidXmlColumnInfo(colInfo.getXmlElement(),colInfo.getXmlAttribute(),colInfo.getSymbolName(),colInfo.getOrdinality(),colInfo.getDatatype(),colInfo.getDefaultValue(),getRootPath(),colInfo.getFullXmlPath()));
  }
  setStatus(info.getStatus());
  if (info.getViewTableName() != null) {
    setViewTableName(info.getViewTableName());
  }
 else {
    setViewTableName(StringUtilities.EMPTY_STRING);
  }
  if (info.getViewProcedureName() != null) {
    setViewProcedureName(info.getViewProcedureName());
  }
 else {
    setViewProcedureName(StringUtilities.EMPTY_STRING);
  }
  validate();
}

Fixed version (ground truth):
/** 
 * This method allows setting the values in the current info object using the values from an external info object
 * @param info the data file info object
 */
public void inject(TeiidXmlFileInfo info){
  CoreArgCheck.isNotNull(info.getDataFile(),"String_Node_Str");
  this.cachedFirstLines=info.cachedFirstLines;
  this.numberOfLinesInFile=info.getNumberOfLinesInFile();
  this.rootPath=info.getRootPath();
  this.parameterMap=info.parameterMap;
  this.columnInfoList=new ArrayList<TeiidXmlColumnInfo>();
  for (  ITeiidXmlColumnInfo iColInfo : info.getColumnInfoList()) {
    TeiidXmlColumnInfo colInfo=(TeiidXmlColumnInfo)iColInfo;
    this.columnInfoList.add(new TeiidXmlColumnInfo(colInfo.getXmlElement(),colInfo.getXmlAttribute(),colInfo.getSymbolName(),colInfo.getOrdinality(),colInfo.getDatatype(),colInfo.getDefaultValue(),getRootPath(),colInfo.getFullXmlPath()));
  }
  setStatus(info.getStatus());
  if (info.getViewTableName() != null) {
    setViewTableName(info.getViewTableName());
  }
 else {
    setViewTableName(StringConstants.EMPTY_STRING);
  }
  if (info.getViewProcedureName() != null) {
    setViewProcedureName(info.getViewProcedureName());
  }
 else {
    setViewProcedureName(StringConstants.EMPTY_STRING);
  }
  validate();
}
Program: 102079
Project: 102079
Buggy source:
/** 
 * @param defaultValue the column defaultValue
 */
public void setDefaultValue(String defaultValue){
  if (defaultValue == null) {
    this.defaultValue=StringUtilities.EMPTY_STRING;
  }
 else {
    this.defaultValue=defaultValue;
  }
  validate();
}

Fixed version (ground truth):
/** 
 * @param defaultValue the column defaultValue
 */
public void setDefaultValue(String defaultValue){
  if (defaultValue == null) {
    this.defaultValue=StringConstants.EMPTY_STRING;
  }
 else {
    this.defaultValue=defaultValue;
  }
  validate();
}
Program: 102080
Project: 102080
Buggy source:
/** 
 * @param name the column name (never <code>null</code> or empty).
 * @param datatype the column datatype (never <code>null</code> or empty).
 */
public TeiidXmlColumnInfo(XmlElement element,XmlAttribute attribute,String name,boolean ordinality,String datatype,String defaultValue,String rootPath,String fullXmlPath){
  super();
  initializing=true;
  this.xmlElement=element;
  this.xmlAttribute=attribute;
  setRootPath(rootPath);
  setRelativePathInternal(element);
  initNameSymbol(name);
  this.datatype=datatype;
  this.forOrdinality=ordinality;
  if (defaultValue == null) {
    this.defaultValue=StringUtilities.EMPTY_STRING;
  }
 else {
    this.defaultValue=defaultValue;
  }
  initializing=false;
}

Fixed version (ground truth):
/** 
 * @param name the column name (never <code>null</code> or empty).
 * @param datatype the column datatype (never <code>null</code> or empty).
 */
public TeiidXmlColumnInfo(XmlElement element,XmlAttribute attribute,String name,boolean ordinality,String datatype,String defaultValue,String rootPath,String fullXmlPath){
  super();
  initializing=true;
  this.xmlElement=element;
  this.xmlAttribute=attribute;
  setRootPath(rootPath);
  setRelativePathInternal(element);
  initNameSymbol(name);
  this.datatype=datatype;
  this.forOrdinality=ordinality;
  if (defaultValue == null) {
    this.defaultValue=StringConstants.EMPTY_STRING;
  }
 else {
    this.defaultValue=defaultValue;
  }
  initializing=false;
}
Program: 102081
Project: 102081
Buggy source:
/** 
 * @param xmlPath the column xmlPath
 */
public void setRelativePath(String relativePath){
  this.relativePath=new Path(relativePath);
  validate();
}

Fixed version (ground truth):
/** 
 * @param xmlPath the column xmlPath
 */
public void setRelativePath(String relativePath){
  this.relativePath=relativePath;
  validate();
}
Program: 102082
Project: 102082
Buggy source:
private void setRelativePathInternal(Object obj){
  IPath rootPath=this.rootXmlPath;
  if (obj instanceof XmlElement) {
    XmlElement element=(XmlElement)obj;
    IPath fullPath=new Path(element.getFullPath());
    IPath relativePath=fullPath.makeRelativeTo(rootPath).append(TEXT_SEGMENT);
    setRelativePath(relativePath.toString());
    return;
  }
  if (obj instanceof XmlAttribute) {
    XmlAttribute attr=(XmlAttribute)obj;
    XmlElement element=attr.getElement();
    IPath fullPath=new Path(element.getFullPath());
    IPath relativePath=fullPath.makeRelativeTo(rootPath).append('@' + attr.getName());
    setRelativePath(relativePath.toString());
    return;
  }
}

Fixed version (ground truth):
private void setRelativePathInternal(Object obj){
  String rootPath=this.rootXmlPath;
  if (obj instanceof XmlElement) {
    XmlElement element=(XmlElement)obj;
    String fullPath=element.getFullPath();
    StringBuffer relativePathBuff=new StringBuffer(getRelativePath(fullPath,rootPath));
    if (!relativePathBuff.toString().isEmpty() && !relativePathBuff.toString().endsWith(XmlElement.SEPARATOR)) {
      relativePathBuff.append(XmlElement.SEPARATOR);
    }
    relativePathBuff.append(TEXT_SEGMENT);
    setRelativePath(relativePathBuff.toString());
    return;
  }
  if (obj instanceof XmlAttribute) {
    XmlAttribute attr=(XmlAttribute)obj;
    XmlElement element=attr.getElement();
    String fullPath=element.getFullPath();
    StringBuffer relativePathBuff=new StringBuffer(getRelativePath(fullPath,rootPath));
    if (!relativePathBuff.toString().isEmpty() && !relativePathBuff.toString().endsWith(XmlElement.SEPARATOR)) {
      relativePathBuff.append(XmlElement.SEPARATOR);
    }
    relativePathBuff.append(AT_SIGN + attr.getName());
    setRelativePath(relativePathBuff.toString());
    return;
  }
}
Program: 102083
Project: 102083
Buggy source:
/** 
 * @return xmlPath the column xmlPath
 */
public String getFullXmlPath(){
  return this.rootXmlPath.append(this.relativePath).toString();
}

Fixed version (ground truth):
/** 
 * @return xmlPath the column xmlPath
 */
public String getFullXmlPath(){
  return this.rootXmlPath + XmlElement.SEPARATOR + this.relativePath;
}
Program: 102084
Project: 102084
Buggy source:
public void setRootPath(String thePath){
  boolean rootPathChanged=false;
  IPath newRootPath=null;
  if (thePath != null && thePath.length() > 0) {
    newRootPath=new Path(thePath);
  }
 else {
    newRootPath=EMPTY_PATH;
  }
  if (!this.rootXmlPath.equals(newRootPath)) {
    rootPathChanged=true;
  }
  if (rootPathChanged) {
    if (!initializing && fullPathExists()) {
      if (isXmlAttribute()) {
        String lastSegment=this.relativePath.lastSegment().toString();
        IPath fullPath=new Path(this.xmlElement.getFullPath());
        IPath relativePath=fullPath.makeRelativeTo(newRootPath).append(lastSegment);
        setRelativePath(relativePath.toString());
      }
 else {
        IPath fullPath=new Path(this.xmlElement.getFullPath());
        if (this.relativePath != null && !this.relativePath.isEmpty() && this.relativePath.lastSegment().equalsIgnoreCase(TEXT_SEGMENT)) {
          IPath shortPath=fullPath;
          IPath newFullPath=shortPath.append(TEXT_SEGMENT);
          IPath relativePath=newFullPath.makeRelativeTo(newRootPath);
          setRelativePath(relativePath.toString());
        }
 else {
          IPath theFullPath=new Path(this.xmlElement.getFullPath());
          IPath relativePath=theFullPath.makeRelativeTo(newRootPath);
          setRelativePath(relativePath.toString());
        }
      }
    }
    this.rootXmlPath=newRootPath;
  }
  if (!initializing) {
    validate();
  }
}

Fixed version (ground truth):
public void setRootPath(String thePath){
  boolean rootPathChanged=false;
  String newRootPath=null;
  if (thePath != null && thePath.length() > 0) {
    newRootPath=thePath;
  }
 else {
    newRootPath=StringConstants.EMPTY_STRING;
  }
  if (!this.rootXmlPath.equalsIgnoreCase(newRootPath)) {
    rootPathChanged=true;
  }
  if (rootPathChanged) {
    if (!initializing && fullPathExists()) {
      if (isXmlAttribute()) {
        String fullPath=this.xmlElement.getFullPath() + XmlElement.SEPARATOR + AT_SIGN+ getXmlAttribute().getName();
        String relativePath=getRelativePath(fullPath,newRootPath);
        setRelativePath(relativePath);
      }
 else {
        String fullPath=this.xmlElement.getFullPath();
        if (this.relativePath != null && !this.relativePath.isEmpty() && TEXT_SEGMENT.equalsIgnoreCase(getLastSegment(this.relativePath))) {
          String shortPath=fullPath;
          String newFullPath=shortPath + XmlElement.SEPARATOR + TEXT_SEGMENT;
          String relativePath=getRelativePath(newFullPath,newRootPath);
          setRelativePath(relativePath);
        }
 else {
          String theFullPath=this.xmlElement.getFullPath();
          String relativePath=getRelativePath(theFullPath,newRootPath);
          setRelativePath(relativePath);
        }
      }
    }
    this.rootXmlPath=newRootPath;
  }
  if (!initializing) {
    validate();
  }
}
Program: 102085
Project: 102085
Buggy source:
private boolean fullPathExists(){
  IPath fullXmlElementPath=new Path(this.xmlElement.getFullPath());
  boolean pathOK=true;
  if (isXmlAttribute()) {
    IPath thisFullPath=new Path(getFullXmlPath());
    IPath shortPath=thisFullPath.removeLastSegments(1);
    int nSegs=shortPath.segmentCount();
    if (fullXmlElementPath.matchingFirstSegments(shortPath) != nSegs) {
      pathOK=false;
    }
  }
 else {
    IPath thisFullPath=new Path(getFullXmlPath());
    if (thisFullPath.lastSegment().equalsIgnoreCase(TEXT_SEGMENT)) {
      IPath shortPath=thisFullPath.removeLastSegments(1);
      int nSegs=shortPath.segmentCount();
      if (fullXmlElementPath.matchingFirstSegments(shortPath) != nSegs) {
        pathOK=false;
      }
    }
 else {
      pathOK=thisFullPath.equals(fullXmlElementPath);
    }
  }
  return pathOK;
}

Fixed version (ground truth):
private boolean fullPathExists(){
  String fullXmlElementPath=this.xmlElement.getFullPath();
  boolean pathOK=true;
  if (isXmlAttribute()) {
    String thisFullPath=getFullXmlPath();
    thisFullPath=collapseDotDots(thisFullPath);
    String shortPath=removeLastSegment(thisFullPath);
    int nSegs=getPathSegments(shortPath).size();
    if (getMatchingSegmentCount(fullXmlElementPath,shortPath) != nSegs) {
      pathOK=false;
    }
  }
 else {
    String thisFullPath=getFullXmlPath();
    if (TEXT_SEGMENT.equalsIgnoreCase(getLastSegment(thisFullPath))) {
      thisFullPath=collapseDotDots(thisFullPath);
      String shortPath=removeLastSegment(thisFullPath);
      int nSegs=getPathSegments(shortPath).size();
      if (getMatchingSegmentCount(fullXmlElementPath,shortPath) != nSegs) {
        pathOK=false;
      }
    }
 else {
      pathOK=thisFullPath.equals(fullXmlElementPath);
    }
  }
  return pathOK;
}
Program: 102086
Project: 102086
Buggy source:
/** 
 * @return xmlPath the column xmlPath
 */
public String getRelativePath(){
  return this.relativePath.toString();
}

Fixed version (ground truth):
/** 
 * Form the relative path from the full path and the root path
 * @param fullPath the full path
 * @param rootPath the root path
 * @return the relative path
 */
private String getRelativePath(String fullPath,String rootPath){
  StringBuffer resultBuff=new StringBuffer();
  int nMatch=getMatchingSegmentCount(fullPath,rootPath);
  int extraSegs=getPathSegments(rootPath).size() - nMatch;
  List<String> segments=getPathSegments(fullPath);
  for (int i=0; i < segments.size(); i++) {
    if (i >= nMatch) {
      if (i != nMatch)       resultBuff.append(XmlElement.SEPARATOR);
      resultBuff.append(segments.get(i));
    }
  }
  for (int i=0; i < extraSegs; i++) {
    resultBuff.insert(0,DOT_DOT + XmlElement.SEPARATOR);
  }
  return resultBuff.toString();
}
Program: 102088
Project: 102088
Buggy source:
/** 
 * @param < V >
 * @param parent the parent panel (never <code>null</code>)
 * @param span the layout data horizontal span
 * @param tableProvider
 * @param columnProviders
 */
public <V>TableAndToolBar(final Composite parent,final int span,final TableProvider<T> tableProvider,final ColumnProvider<T,V>... columnProviders){
  table=new Table<T>(parent,tableProvider,columnProviders);
  ToolBar toolBar=new ToolBar(parent,SWT.PUSH | SWT.BORDER);
  this.toolBarMgr=new ToolBarManager(toolBar);
  if (tableProvider.isDoubleClickSupported()) {
    getViewer().addDoubleClickListener(new IDoubleClickListener(){
      @Override public void doubleClick(      final DoubleClickEvent event){
        tableProvider.doubleClicked((T)((IStructuredSelection)event.getSelection()).getFirstElement());
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * @param < V >
 * @param parent the parent panel (never <code>null</code>)
 * @param tableStyle the table style
 * @param span the layout data horizontal span
 * @param tableProvider the table provider
 * @param columnProviders the column providers
 */
public <V>TableAndToolBar(final Composite parent,final int tableStyle,final int span,final TableProvider<T> tableProvider,final ColumnProvider<T,V>... columnProviders){
  if (tableStyle == -1) {
    table=new Table<T>(parent,tableProvider,columnProviders);
  }
 else {
    table=new Table<T>(parent,tableStyle,tableProvider,columnProviders);
  }
  ToolBar toolBar=new ToolBar(parent,SWT.PUSH | SWT.BORDER);
  this.toolBarMgr=new ToolBarManager(toolBar);
  if (tableProvider.isDoubleClickSupported()) {
    getViewer().addDoubleClickListener(new IDoubleClickListener(){
      @Override public void doubleClick(      final DoubleClickEvent event){
        tableProvider.doubleClicked((T)((IStructuredSelection)event.getSelection()).getFirstElement());
      }
    }
);
  }
}
Program: 102090
Project: 102090
Buggy source:
public static void doCreateDataSource(String vdbName,ITeiidServer teiidServer) throws Exception {
  final IWorkbenchWindow iww=VdbUiPlugin.singleton.getCurrentWorkbenchWindow();
  VdbDataSourceInfo info=new VdbDataSourceInfo(vdbName,vdbName,vdbName);
  info.setPassword(teiidServer.getTeiidJdbcInfo().getPassword());
  info.setUsername(teiidServer.getTeiidJdbcInfo().getUsername());
  ITeiidDataSource vdbDS=teiidServer.getDataSource(info.getJndiName());
  if (vdbDS != null) {
    boolean overwrite=MessageDialog.openQuestion(iww.getShell(),getString("String_Node_Str"),getString("String_Node_Str",info.getJndiName(),vdbName));
    if (!overwrite)     return;
  }
  final CreateVdbDataSourceDialog dialog=new CreateVdbDataSourceDialog(iww.getShell(),info,teiidServer);
  final int rc=dialog.open();
  if (rc != Window.OK)   return;
  teiidServer.getOrCreateDataSource(info.getDisplayName(),info.getJndiName(),"String_Node_Str",info.getProperties());
}

Fixed version (ground truth):
/** 
 * Creates Data Source for a VDB
 * @param vdbName the VDB name
 * @param teiidServer the TeiidServer
 * @param withDeployment 'true' if dialog is shown during deployment, 'false' if not
 * @throws Exception the exception
 */
public static void doCreateDataSource(String vdbName,ITeiidServer teiidServer,boolean withDeployment) throws Exception {
  final IWorkbenchWindow iww=VdbUiPlugin.singleton.getCurrentWorkbenchWindow();
  VdbDataSourceInfo info=new VdbDataSourceInfo(vdbName,vdbName,vdbName);
  info.setPassword(teiidServer.getTeiidJdbcInfo().getPassword());
  info.setUsername(teiidServer.getTeiidJdbcInfo().getUsername());
  final CreateVdbDataSourceDialog dialog=new CreateVdbDataSourceDialog(iww.getShell(),info,teiidServer,withDeployment);
  final int rc=dialog.open();
  if (rc != Window.OK)   return;
  ITeiidDataSource vdbDS=teiidServer.getDataSource(info.getJndiName());
  if (vdbDS != null) {
    teiidServer.deleteDataSource(info.getJndiName());
  }
  teiidServer.getOrCreateDataSource(info.getDisplayName(),info.getJndiName(),"String_Node_Str",info.getProperties());
}
Program: 102092
Project: 102092
Buggy source:
/** 
 * CreateDataSourceDialog constructor
 * @param shell the shell
 * @param teiidImportServer the TeiidServer
 * @param editDSName if non-null, this is edit of an existing source.  Otherwise this iscreation of a new source.
 */
public CreateVdbDataSourceDialog(Shell shell,VdbDataSourceInfo vdbDataSourceInfo,ITeiidServer server){
  super(shell);
  this.vdbName=vdbDataSourceInfo.getVdbName();
  this.vdbDataSourceInfo=vdbDataSourceInfo;
  this.nameValidator=new StringNameValidator(new char[]{'_','-'});
  this.server=server;
}

Fixed version (ground truth):
/** 
 * CreateDataSourceDialog constructor
 * @param shell the shell
 * @param teiidImportServer the TeiidServer
 * @param editDSName if non-null, this is edit of an existing source.  Otherwise this is
 * @param withDeployment 'true' if dialog is called as part of a deployment, 'false' if not.creation of a new source.
 */
public CreateVdbDataSourceDialog(Shell shell,VdbDataSourceInfo vdbDataSourceInfo,ITeiidServer server,boolean withDeployment){
  super(shell);
  this.vdbName=vdbDataSourceInfo.getVdbName();
  this.vdbDataSourceInfo=vdbDataSourceInfo;
  this.nameValidator=new StringNameValidator(new char[]{'_','-'});
  this.server=server;
  this.withDeployment=withDeployment;
}
Program: 102093
Project: 102093
Buggy source:
@Override public void modifyText(ModifyEvent e){
  String text=dataSourceNameText.getText();
  if (text != null && text.trim().length() > 0) {
    vdbDataSourceInfo.setJndiName(text);
  }
  validate();
}

Fixed version (ground truth):
@Override public void modifyText(ModifyEvent e){
  String text=dataSourceNameText.getText();
  vdbDataSourceInfo.setJndiName(text);
  validate();
}
Program: 102094
Project: 102094
Buggy source:
/** 
 * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
 */
@Override protected Control createButtonBar(Composite parent){
  Control buttonBar=super.createButtonBar(parent);
  getButton(OK).setEnabled(true);
  validate();
  return buttonBar;
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
 */
@Override protected Control createButtonBar(Composite parent){
  Control buttonBar=super.createButtonBar(parent);
  getButton(OK).setEnabled(true);
  if (this.withDeployment) {
    getButton(OK).setText(getString("String_Node_Str"));
    getButton(CANCEL).setText(getString("String_Node_Str"));
  }
  validate();
  return buttonBar;
}
Program: 102096
Project: 102096
Buggy source:
private boolean validate(){
  String errorMessage=null;
  String warningMessage=null;
  if (!this.nameValidator.isValidName(this.vdbDataSourceInfo.getJndiName())) {
    errorMessage=getString("String_Node_Str");
  }
  if (errorMessage == null) {
    try {
      if (server.getDataSource(this.vdbDataSourceInfo.getJndiName()) != null) {
        warningMessage=getString("String_Node_Str",this.vdbDataSourceInfo.getJndiName());
      }
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  if (errorMessage == null) {
    setErrorMessage(null);
    getButton(OK).setEnabled(true);
    if (warningMessage != null) {
      setMessage(warningMessage,IMessageProvider.WARNING);
    }
 else {
      setMessage(getString("String_Node_Str",this.vdbDataSourceInfo.getJndiName()),IMessageProvider.NONE);
    }
  }
 else {
    getButton(OK).setEnabled(false);
    setErrorMessage(errorMessage);
  }
  return true;
}

Fixed version (ground truth):
private boolean validate(){
  String errorMessage=null;
  String warningMessage=null;
  if (!this.nameValidator.isValidName(this.vdbDataSourceInfo.getJndiName())) {
    errorMessage=getString("String_Node_Str");
  }
  if (errorMessage == null) {
    try {
      if (server.getDataSource(this.vdbDataSourceInfo.getJndiName()) != null) {
        if (this.withDeployment) {
          warningMessage=getString("String_Node_Str",this.vdbDataSourceInfo.getJndiName());
        }
 else {
          warningMessage=getString("String_Node_Str",this.vdbDataSourceInfo.getJndiName());
        }
      }
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  if (errorMessage == null) {
    setErrorMessage(null);
    getButton(OK).setEnabled(true);
    if (warningMessage != null) {
      setMessage(warningMessage,IMessageProvider.WARNING);
    }
 else {
      if (this.withDeployment) {
        setMessage(getString("String_Node_Str",this.vdbDataSourceInfo.getJndiName()),IMessageProvider.NONE);
      }
 else {
        setMessage(getString("String_Node_Str",this.vdbDataSourceInfo.getJndiName()),IMessageProvider.NONE);
      }
    }
  }
 else {
    getButton(OK).setEnabled(false);
    setErrorMessage(errorMessage);
  }
  return true;
}
Program: 102098
Project: 102098
Buggy source:
public static boolean containsGlobalDataTypeImport(final XSDSchema schema){
  boolean containsImport=false;
  if (schema != null) {
    final List<XSDSchemaContent> contents=schema.getContents();
    for (int i=0; i < contents.size(); i++) {
      final Object content=contents.get(i);
      if (content instanceof XSDImport) {
        if (DatatypeConstants.BUILTIN_DATATYPES_URI.equals(((XSDImport)content).getNamespace())) {
          containsImport=true;
          break;
        }
      }
    }
  }
  return containsImport;
}

Fixed version (ground truth):
private boolean containsGlobalDataTypeImport(final XSDSchema schema){
  boolean containsImport=false;
  if (schema != null) {
    final List<XSDSchemaContent> contents=schema.getContents();
    for (int i=0; i < contents.size(); i++) {
      final Object content=contents.get(i);
      if (content instanceof XSDImport) {
        if (DatatypeConstants.BUILTIN_DATATYPES_URI.equals(((XSDImport)content).getNamespace())) {
          containsImport=true;
          break;
        }
      }
    }
  }
  return containsImport;
}
Program: 102099
Project: 102099
Buggy source:
public XSDSchema importSchema(String path){
  XSDParser parser=new XSDParser(null);
  parser.parse(path);
  XSDSchema schema=parser.getSchema();
  schema.setSchemaLocation(path);
  return schema;
}

Fixed version (ground truth):
private XSDSchema importSchema(String path){
  XSDParser parser=new XSDParser(null);
  parser.parse(path);
  XSDSchema schema=parser.getSchema();
  schema.setSchemaLocation(path);
  return schema;
}
Program: 102101
Project: 102101
Buggy source:
/** 
 * Copies Web files into the WAR build directory structure.
 * @param contextDirectory
 * @param webInfDirectory
 * @since 7.1
 */
private void getWebFiles(File contextDirectory,File webInfDirectory,boolean containsGlobalDataTypes) throws Exception {
  final String webLibPath=WebServiceLibPlugin.getDefault().getSoapWebLibDirectoryPath();
  final String webAppsDirectoryName=webLibPath + File.separator + WEBAPPS;
  final File webAppsDirectory=new File(webAppsDirectoryName);
  FileUtils.copyRecursively(webAppsDirectory,contextDirectory,null,false);
  if (!containsGlobalDataTypes) {
    File builtInDataTypeSchemaFile=new File(webInfDirectory.getPath() + "String_Node_Str" + DatatypeConstants.DATATYPES_MODEL_FILE_NAME);
    boolean deleted=builtInDataTypeSchemaFile.delete();
  }
}

Fixed version (ground truth):
/** 
 * Copies Web files into the WAR build directory structure.
 * @param contextDirectory
 * @param webInfDirectory
 * @since 7.1
 */
private void getWebFiles(File contextDirectory,File webInfDirectory,boolean containsGlobalDataTypes) throws Exception {
  final String webLibPath=WebServiceLibPlugin.getDefault().getSoapWebLibDirectoryPath();
  final String webAppsDirectoryName=webLibPath + File.separator + WEBAPPS;
  final File webAppsDirectory=new File(webAppsDirectoryName);
  FileUtils.copyRecursively(webAppsDirectory,contextDirectory,null,false);
  if (!containsGlobalDataTypes) {
    File builtInDataTypeSchemaFile=new File(webInfDirectory.getPath() + "String_Node_Str" + DatatypeConstants.DATATYPES_MODEL_FILE_NAME);
    builtInDataTypeSchemaFile.delete();
  }
}
Program: 102102
Project: 102102
Buggy source:
/** 
 * Return the Resource instance corresponding to the specified URI string. The URI represents a relative path within the workspace to particular file resource. If the URI is one of the well-known Teiid Designer/EMF identifiers to a global resource such as <p> "http://www.metamatrix.com/metamodels/SimpleDatatypes-instance" "http://www.w3.org/2001/XMLSchema" "http://www.w3.org/2001/MagicXMLSchema" "http://www.w3.org/2001/XMLSchema-instance" </p> then null is returned since there is no Resource in the workspace that represents any one of those models.
 * @param workspaceUri the URI string
 * @return the IResource identified by the URI if it exists; may return null
 */
public Resource findResource(final String workspaceUri){
  if (!WorkspaceResourceFinderUtil.isValidWorkspaceUri(workspaceUri))   return null;
  final String normalizedUriString=WorkspaceResourceFinderUtil.normalizeUriString(workspaceUri);
  File modelFile=new File(normalizedUriString);
  if (modelFile.exists()) {
    return getExistingVdbResource(modelFile);
  }
  Resource fileResource=null;
  final Resource[] fileResources=this.vdbModelFiles;
  fileResource=getResourceStartsWithHttp(fileResources,normalizedUriString);
  if (fileResource != null)   return fileResource;
  fileResource=getResourceStartsWithPathSeparator(fileResources,normalizedUriString);
  if (fileResource != null)   return fileResource;
  fileResource=getResourceByLocation(fileResources,normalizedUriString);
  if (fileResource != null)   return fileResource;
  return null;
}

Fixed version (ground truth):
/** 
 * Return the Resource instance corresponding to the specified URI string. The URI represents a relative path within the workspace to particular file resource. If the URI is one of the well-known Teiid Designer/EMF identifiers to a global resource such as <p> "http://www.metamatrix.com/metamodels/SimpleDatatypes-instance" "http://www.w3.org/2001/XMLSchema" "http://www.w3.org/2001/MagicXMLSchema" "http://www.w3.org/2001/XMLSchema-instance" </p> then null is returned since there is no Resource in the workspace that represents any one of those models.
 * @param workspaceUri the URI string
 * @return the IResource identified by the URI if it exists; may return null
 */
public Resource findResource(final String workspaceUri){
  if (!WorkspaceResourceFinderUtil.isValidWorkspaceUri(workspaceUri))   return null;
  final String normalizedUriString=WorkspaceResourceFinderUtil.normalizeUriString(workspaceUri);
  File modelFile=new File(normalizedUriString);
  if (modelFile.exists()) {
    return getExistingVdbResource(modelFile);
  }
  Resource fileResource=null;
  final Collection<Resource> fileResources=this.vdbResourceFiles;
  fileResource=getResourceStartsWithHttp(fileResources,normalizedUriString);
  if (fileResource != null)   return fileResource;
  fileResource=getResourceStartsWithPathSeparator(fileResources,normalizedUriString);
  if (fileResource != null)   return fileResource;
  fileResource=getResourceByLocation(fileResources,normalizedUriString);
  if (fileResource != null)   return fileResource;
  return null;
}
Program: 102103
Project: 102103
Buggy source:
private Resource getExistingVdbResource(File file){
  for (  Resource modelFile : this.vdbModelFiles) {
    String vdbFileStr=WorkspaceResourceFinderUtil.normalizeUriString(modelFile.getURI().toFileString());
    String prefix=vdbFileStr.substring(0,vdbFileStr.indexOf("String_Node_Str") > -1 ? vdbFileStr.indexOf("String_Node_Str") : 0);
    if (prefix.length() > 0 && prefix.contains("String_Node_Str")) {
      vdbFileStr=vdbFileStr.replace(prefix,"String_Node_Str");
    }
    String fileStr=file.getPath();
    if (vdbFileStr.equals(fileStr)) {
      return modelFile;
    }
  }
  return null;
}

Fixed version (ground truth):
private Resource getExistingVdbResource(File file){
  for (  Resource modelFile : this.vdbResourceFiles) {
    String vdbFileStr=WorkspaceResourceFinderUtil.normalizeUriString(modelFile.getURI().toFileString());
    String prefix=vdbFileStr.substring(0,vdbFileStr.indexOf("String_Node_Str") > -1 ? vdbFileStr.indexOf("String_Node_Str") : 0);
    if (prefix.length() > 0 && prefix.contains("String_Node_Str")) {
      vdbFileStr=vdbFileStr.replace(prefix,"String_Node_Str");
    }
    String fileStr=file.getPath();
    if (vdbFileStr.equals(fileStr)) {
      return modelFile;
    }
  }
  return null;
}
Program: 102104
Project: 102104
Buggy source:
private static Resource getResourceByLocation(final Resource[] fileResources,final String workspaceUri){
  Resource fileResource=null;
  String resourceLocation;
  for (  final Resource fileResource2 : fileResources) {
    fileResource=fileResource2;
    resourceLocation=fileResource.getURI().toString();
    if (workspaceUri.endsWith(resourceLocation))     return fileResource;
  }
  for (  final Resource fileResource2 : fileResources) {
    fileResource=fileResource2;
    final String fileNameSegment=fileResource.getURI().lastSegment();
    if (fileNameSegment != null && fileNameSegment.equalsIgnoreCase(workspaceUri))     return fileResource;
  }
  for (  final Resource fileResource2 : fileResources) {
    fileResource=fileResource2;
    final IPath resrcLocation=new Path(fileResource.getURI().toFileString());
    resourceLocation=resrcLocation.toOSString();
    if (resourceLocation.endsWith(workspaceUri))     return fileResource;
    resourceLocation=resrcLocation.toString();
    resourceLocation=resourceLocation.replaceAll("String_Node_Str","String_Node_Str");
    resourceLocation=resourceLocation.replaceAll(StringUtilities.SPACE,"String_Node_Str");
    if (resourceLocation.endsWith(workspaceUri))     return fileResource;
  }
  return null;
}

Fixed version (ground truth):
private static Resource getResourceByLocation(final Collection<Resource> fileResources,final String workspaceUri){
  Resource fileResource=null;
  String resourceLocation;
  for (  final Resource fileResource2 : fileResources) {
    fileResource=fileResource2;
    resourceLocation=fileResource.getURI().toString();
    if (workspaceUri.endsWith(resourceLocation))     return fileResource;
  }
  for (  final Resource fileResource2 : fileResources) {
    fileResource=fileResource2;
    final String fileNameSegment=fileResource.getURI().lastSegment();
    if (fileNameSegment != null && fileNameSegment.equalsIgnoreCase(workspaceUri))     return fileResource;
  }
  for (  final Resource fileResource2 : fileResources) {
    fileResource=fileResource2;
    final IPath resrcLocation=new Path(fileResource.getURI().toFileString());
    resourceLocation=resrcLocation.toOSString();
    if (resourceLocation.endsWith(workspaceUri))     return fileResource;
    resourceLocation=resrcLocation.toString();
    resourceLocation=resourceLocation.replaceAll("String_Node_Str","String_Node_Str");
    resourceLocation=resourceLocation.replaceAll(StringConstants.SPACE,"String_Node_Str");
    if (resourceLocation.endsWith(workspaceUri))     return fileResource;
  }
  return null;
}
Program: 102105
Project: 102105
Buggy source:
private Resource getResourceStartsWithHttp(final Resource[] fileResources,final String workspaceUri){
  File file=null;
  String targetNamespace;
  if (workspaceUri.startsWith("String_Node_Str")) {
    for (    final Resource fileResource2 : fileResources) {
      File modelFile=new File(fileResource2.getURI().toFileString());
      file=modelFile;
      targetNamespace=getXsdTargetNamespace(file);
      if (workspaceUri.equals(targetNamespace))       return fileResource2;
    }
  }
  return null;
}

Fixed version (ground truth):
private Resource getResourceStartsWithHttp(final Collection<Resource> fileResources,final String workspaceUri){
  File file=null;
  String targetNamespace;
  if (workspaceUri.startsWith("String_Node_Str")) {
    for (    final Resource fileResource2 : fileResources) {
      File modelFile=new File(fileResource2.getURI().toFileString());
      file=modelFile;
      targetNamespace=getXsdTargetNamespace(file);
      if (workspaceUri.equals(targetNamespace))       return fileResource2;
    }
  }
  return null;
}
Program: 102106
Project: 102106
Buggy source:
private static Resource getResourceStartsWithPathSeparator(final Resource[] fileResources,final String workspaceUri){
  Resource fileResource=null;
  IPath pathInWorkspace;
  if (workspaceUri.charAt(0) == IPath.SEPARATOR) {
    pathInWorkspace=new Path(workspaceUri);
    URI pathInWorkspaceURI=URI.createURI(pathInWorkspace.toString());
    for (    final Resource fileResource2 : fileResources) {
      fileResource=fileResource2;
      if (fileResource != null && fileResource.getURI().equals(pathInWorkspaceURI))       return fileResource;
    }
  }
  return null;
}

Fixed version (ground truth):
private static Resource getResourceStartsWithPathSeparator(final Collection<Resource> fileResources,final String workspaceUri){
  Resource fileResource=null;
  IPath pathInWorkspace;
  if (workspaceUri.charAt(0) == IPath.SEPARATOR) {
    pathInWorkspace=new Path(workspaceUri);
    URI pathInWorkspaceURI=URI.createURI(pathInWorkspace.toString());
    for (    final Resource fileResource2 : fileResources) {
      fileResource=fileResource2;
      if (fileResource != null && fileResource.getURI().equals(pathInWorkspaceURI))       return fileResource;
    }
  }
  return null;
}
Program: 102107
Project: 102107
Buggy source:
/** 
 * @return collection of Resource's
 */
public Collection<Resource> getWebServiceResources(){
  Collection<Resource> webServiceModels=new ArrayList<Resource>();
  try {
    Collection<File> modelFiles=getVdb().getModelFiles();
    for (    File modelFile : modelFiles) {
      boolean isVisible=true;
      Resource res=this.container.getResource(URI.createFileURI(modelFile.getPath()),true);
      if (isVisible && ModelUtil.isModelFile(res) && !ModelUtil.isXsdFile(res)) {
        EObject firstEObj=res.getContents().get(0);
        ModelAnnotation ma=ModelerCore.getModelEditor().getModelAnnotation(firstEObj);
        String mmURI=ma.getPrimaryMetamodelUri();
        if (ModelUtil.URI_WEB_SERVICES_VIEW_MODEL.equalsIgnoreCase(mmURI)) {
          webServiceModels.add(res);
        }
      }
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  return webServiceModels;
}

Fixed version (ground truth):
/** 
 * @return collection of Resource's
 * @throws CoreException
 */
public Collection<Resource> getWebServiceResources() throws CoreException {
  Collection<Resource> webServiceModels=new ArrayList<Resource>();
  Collection<File> modelFiles=getVdb().getModelFiles();
  for (  File modelFile : modelFiles) {
    boolean isVisible=true;
    Resource res=this.container.getResource(URI.createFileURI(modelFile.getPath()),true);
    if (isVisible && ModelUtil.isModelFile(res) && !ModelUtil.isXsdFile(res)) {
      EObject firstEObj=res.getContents().get(0);
      ModelAnnotation ma=ModelerCore.getModelEditor().getModelAnnotation(firstEObj);
      String mmURI=ma.getPrimaryMetamodelUri();
      if (ModelUtil.URI_WEB_SERVICES_VIEW_MODEL.equalsIgnoreCase(mmURI)) {
        webServiceModels.add(res);
      }
    }
  }
  return webServiceModels;
}
Program: 102108
Project: 102108
Buggy source:
private void initialize() throws CoreException {
  this.container=(ContainerImpl)ModelerCore.createContainer("String_Node_Str");
  ModelEditorImpl.setContainer(this.container);
  try {
    this.vdb=new Vdb(vdbFile,false,new NullProgressMonitor());
  }
 catch (  Exception ex) {
    throw ErrorHandler.toCoreException(ex);
  }
  Collection<Resource> theFiles=new ArrayList<Resource>();
  Collection<File> modelFiles=getVdb().getModelFiles();
  for (  File modelFile : modelFiles) {
    Resource res=this.container.getResource(URI.createFileURI(modelFile.getPath()),true);
    theFiles.add(res);
  }
  this.vdbModelFiles=theFiles.toArray(new Resource[0]);
}

Fixed version (ground truth):
private void initialize() throws CoreException {
  this.container=(ContainerImpl)ModelerCore.createContainer("String_Node_Str");
  ModelEditorImpl.setContainer(this.container);
  try {
    this.vdb=new Vdb(vdbFile,false,new NullProgressMonitor());
  }
 catch (  Exception ex) {
    throw ErrorHandler.toCoreException(ex);
  }
  Collection<Resource> resourceFiles=new ArrayList<Resource>();
  Collection<File> modelFiles=getVdb().getModelFiles();
  for (  File modelFile : modelFiles) {
    Resource res=this.container.getResource(URI.createFileURI(modelFile.getPath()),true);
    resourceFiles.add(res);
  }
  Collection<File> schemaFiles=getVdb().getSchemaFiles();
  for (  File modelFile : schemaFiles) {
    Resource res=this.container.getResource(URI.createFileURI(modelFile.getPath()),true);
    resourceFiles.add(res);
  }
  this.vdbResourceFiles=resourceFiles;
}