Program: 148528
Project: 148528
Buggy source:
protected void provideViwerContent(XSDSchema xsdSchema){
  this.xsdSchema=xsdSchema;
  drillDownAdapter=new DrillDownAdapter(domViewer);
  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();
      xpath=getXpath(sel);
      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,String filter){
  this.xsdSchema=xsdSchema;
  drillDownAdapter=new DrillDownAdapter(domViewer);
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  XPathTreeContentProvider provider=new XPathTreeContentProvider(this.site,xsdSchema,parent,filter);
  domViewer.setContentProvider(provider);
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      xpath=getXpath(sel);
      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);
}