Program: 148527
Project: 148527
Buggy source:
protected void provideViwerContent(XSDSchema xsdSchema){
  this.xsdSchema=xsdSchema;
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  XPathTreeContentProvider provider=new XPathTreeContentProvider(this.site,xsdSchema,parent);
  provider.setConceptName(this.conceptName);
  domViewer.setContentProvider(provider);
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      if (isXpath.getSelection())       xpath=getXpath(sel);
 else {
        TreeObject selectNode=(TreeObject)sel.getFirstElement();
        if (selectNode != null)         xpath=selectNode.getDisplayName();
 else         xpath="String_Node_Str";
      }
      sel.getFirstElement();
      xpathText.setText(xpath);
      getButton(IDialogConstants.OK_ID).setEnabled(xpath.length() > 0);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}

Fixed version (ground truth):
protected void provideViwerContent(XSDSchema xsdSchema){
  this.xsdSchema=xsdSchema;
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  XPathTreeContentProvider provider=new XPathTreeContentProvider(this.site,xsdSchema,parent,"String_Node_Str");
  provider.setConceptName(this.conceptName);
  domViewer.setContentProvider(provider);
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      if (isXpath.getSelection())       xpath=getXpath(sel);
 else {
        TreeObject selectNode=(TreeObject)sel.getFirstElement();
        if (selectNode != null)         xpath=selectNode.getDisplayName();
 else         xpath="String_Node_Str";
      }
      sel.getFirstElement();
      xpathText.setText(xpath);
      getButton(IDialogConstants.OK_ID).setEnabled(xpath.length() > 0);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}