Program: 149096
Project: 149096
Buggy source:
protected void createCharacteristicsContent(FormToolkit toolkit,Composite mainComposite){
  try {
    this.toolkit=toolkit;
    WSDataModel wsObject=(WSDataModel)(getXObject().getWsObject());
    Label descriptionLabel=toolkit.createLabel(mainComposite,"String_Node_Str",SWT.NULL);
    descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true,1,1));
    descriptionText=toolkit.createText(mainComposite,"String_Node_Str",SWT.BORDER | SWT.MULTI);
    descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
    descriptionText.setText(wsObject.getDescription() == null ? "String_Node_Str" : wsObject.getDescription());
    ((GridData)descriptionText.getLayoutData()).minimumHeight=30;
    descriptionText.addModifyListener(this);
    Composite btnCmp=toolkit.createComposite(mainComposite);
    btnCmp.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,2,1));
    GridLayout gLayout=new GridLayout();
    gLayout.numColumns=8;
    gLayout.horizontalSpacing=20;
    btnCmp.setLayout(gLayout);
    importXSDBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    importXSDBtn.setImage(ImageCache.getCreatedImage(EImage.IMPORT.getPath()));
    importXSDBtn.setToolTipText("String_Node_Str");
    exportBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    exportBtn.setImage(ImageCache.getCreatedImage(EImage.EXPORT.getPath()));
    exportBtn.setToolTipText("String_Node_Str");
    filterBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    filterBtn.setImage(ImageCache.getCreatedImage(EImage.FILTER_PS.getPath()));
    filterBtn.setToolTipText("String_Node_Str");
    expandBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    expandBtn.setImage(ImageCache.getCreatedImage(EImage.FLDR_OBJ.getPath()));
    expandBtn.setToolTipText("String_Node_Str");
    expandBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        Iterator it=sel.iterator();
        while (it.hasNext()) {
          Object obj=it.next();
          viewer.expandToLevel(obj,3);
        }
      }
    }
);
    foldBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    foldBtn.setImage(ImageCache.getCreatedImage(EImage.COMPRESSED_FOLDER_OBJ.getPath()));
    foldBtn.setToolTipText("String_Node_Str");
    foldBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        Iterator it=sel.iterator();
        while (it.hasNext()) {
          Object obj=it.next();
          viewer.collapseToLevel(obj,3);
        }
      }
    }
);
    expandSelBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    expandSelBtn.setImage(ImageCache.getCreatedImage(EImage.ACTIVITY_CATEGORY.getPath()));
    expandSelBtn.setToolTipText("String_Node_Str");
    expandSelBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        openXSDParticle();
      }
    }
);
    sortUPBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    sortUPBtn.setImage(ImageCache.getCreatedImage(EImage.PREV_NAV.getPath()));
    sortUPBtn.setToolTipText("String_Node_Str");
    sortUPBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        stepUp();
        viewer.refresh();
      }
    }
);
    sortDownBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    sortDownBtn.setImage(ImageCache.getCreatedImage(EImage.NEXT_NAV.getPath()));
    sortDownBtn.setToolTipText("String_Node_Str");
    sortDownBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        stepDown();
        viewer.refresh();
      }
    }
);
    importXSDBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    exportBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    filterBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    expandBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    foldBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    expandSelBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    sortUPBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    sortDownBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    filterBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        if (dataModelFilterDialog == null) {
          dataModelFilter=new DataModelFilter("String_Node_Str",false,false,false,true);
          dataModelFilterDialog=new DataModelFilterDialog(getSite().getShell(),getXObject(),dataModelFilter);
        }
        if (dataModelFilterDialog.open() == Dialog.OK) {
          ((XSDTreeContentProvider)viewer.getContentProvider()).setFilter(dataModelFilter);
          viewer.setInput(getSite());
        }
      }
    }
);
    importXSDBtn.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        FileDialog fd=new FileDialog(getSite().getShell(),SWT.OPEN);
        fd.setFilterExtensions(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
        fd.setText("String_Node_Str");
        String filename=fd.open();
        if (filename == null)         return;
        xsdSchema=null;
        inferXsdFromXml(filename);
      }
      private void inferXsdFromXml(      String xmlFile){
        int infer=0;
        String xsd="String_Node_Str";
        try {
          String inputType=xmlFile.substring(xmlFile.lastIndexOf("String_Node_Str"));
          if (inputType.equals("String_Node_Str")) {
            xsd=Util.getXML(xmlFile);
          }
 else {
            XSDDriver d=new XSDDriver();
            infer=d.doMain(new String[]{xmlFile,"String_Node_Str"});
            if (infer == 0) {
              xsd=d.outputXSD();
            }
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
          infer=2;
        }
 finally {
          if (infer == 0 && !xsd.equals("String_Node_Str")) {
            WSDataModel wsObj=(WSDataModel)(getXObject().getWsObject());
            wsObj.setXsdSchema(xsd);
            validateSchema(xsd);
            refreshData();
            markDirty();
          }
 else           if (infer != 0) {
            MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
          }
        }
      }
      void validateSchema(      String xsd){
        try {
          boolean elem=false;
          XSDSchema schema=getXSDSchema(xsd);
          NodeList nodeList=schema.getDocument().getDocumentElement().getChildNodes();
          for (int idx=0; idx < nodeList.getLength(); idx++) {
            Node node=nodeList.item(idx);
            if (node instanceof Element && node.getLocalName().indexOf("String_Node_Str") >= 0) {
              elem=true;
              break;
            }
          }
          if (!elem) {
            MessageDialog.openWarning(getSite().getShell(),"String_Node_Str","String_Node_Str");
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
);
    exportBtn.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        FileDialog fd=new FileDialog(getSite().getShell(),SWT.SAVE);
        fd.setFilterExtensions(new String[]{"String_Node_Str"});
        fd.setText("String_Node_Str");
        String filename=fd.open();
        if (filename == null)         return;
        inferXsdFromDataModule(filename);
      }
      private void inferXsdFromDataModule(      String xmlFile){
        WSDataModel wsObject=(WSDataModel)(getXObject().getWsObject());
        XSDDriver d=new XSDDriver();
        if (d.outputXSD(wsObject.getXsdSchema(),xmlFile) != null) {
          MessageDialog.openInformation(getSite().getShell(),"String_Node_Str","String_Node_Str");
        }
 else {
          MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
        }
      }
    }
);
    Label xsdLabel=toolkit.createLabel(mainComposite,"String_Node_Str",SWT.NULL);
    xsdLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true,2,1));
    xsdSchema=getXSDSchema(wsObject.getXsdSchema());
    createSash(mainComposite);
    hookContextMenu();
    hookDoubleClickAction();
    hookTypesContextMenu();
    XMLEditor xmleditor=((XObjectEditor)getEditor()).getXmlEditor();
    if (xmleditor != null && xmleditor.isDirty())     xmleditor.markDirty();
    initializeOperationHistory();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
protected void createCharacteristicsContent(FormToolkit toolkit,Composite mainComposite){
  try {
    this.toolkit=toolkit;
    WSDataModel wsObject=(WSDataModel)(getXObject().getWsObject());
    Label descriptionLabel=toolkit.createLabel(mainComposite,"String_Node_Str",SWT.NULL);
    descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true,1,1));
    descriptionText=toolkit.createText(mainComposite,"String_Node_Str",SWT.BORDER | SWT.MULTI);
    descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
    descriptionText.setText(wsObject.getDescription() == null ? "String_Node_Str" : wsObject.getDescription());
    ((GridData)descriptionText.getLayoutData()).minimumHeight=30;
    descriptionText.addModifyListener(this);
    Composite btnCmp=toolkit.createComposite(mainComposite);
    btnCmp.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,2,1));
    GridLayout gLayout=new GridLayout();
    gLayout.numColumns=8;
    gLayout.horizontalSpacing=20;
    btnCmp.setLayout(gLayout);
    importXSDBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    importXSDBtn.setImage(ImageCache.getCreatedImage(EImage.IMPORT.getPath()));
    importXSDBtn.setToolTipText("String_Node_Str");
    exportBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    exportBtn.setImage(ImageCache.getCreatedImage(EImage.EXPORT.getPath()));
    exportBtn.setToolTipText("String_Node_Str");
    filterBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    filterBtn.setImage(ImageCache.getCreatedImage(EImage.FILTER_PS.getPath()));
    filterBtn.setToolTipText("String_Node_Str");
    expandBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    expandBtn.setImage(ImageCache.getCreatedImage(EImage.FLDR_OBJ.getPath()));
    expandBtn.setToolTipText("String_Node_Str");
    expandBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        Iterator it=sel.iterator();
        while (it.hasNext()) {
          Object obj=it.next();
          viewer.expandToLevel(obj,3);
        }
      }
    }
);
    foldBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    foldBtn.setImage(ImageCache.getCreatedImage(EImage.COMPRESSED_FOLDER_OBJ.getPath()));
    foldBtn.setToolTipText("String_Node_Str");
    foldBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        Iterator it=sel.iterator();
        while (it.hasNext()) {
          Object obj=it.next();
          viewer.collapseToLevel(obj,3);
        }
      }
    }
);
    expandSelBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    expandSelBtn.setImage(ImageCache.getCreatedImage(EImage.ACTIVITY_CATEGORY.getPath()));
    expandSelBtn.setToolTipText("String_Node_Str");
    expandSelBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        openXSDParticle();
      }
    }
);
    sortUPBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    sortUPBtn.setImage(ImageCache.getCreatedImage(EImage.PREV_NAV.getPath()));
    sortUPBtn.setToolTipText("String_Node_Str");
    sortUPBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        stepUp();
        viewer.refresh();
      }
    }
);
    sortDownBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    sortDownBtn.setImage(ImageCache.getCreatedImage(EImage.NEXT_NAV.getPath()));
    sortDownBtn.setToolTipText("String_Node_Str");
    sortDownBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        stepDown();
        viewer.refresh();
      }
    }
);
    importXSDBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    exportBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    filterBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    expandBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    foldBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    expandSelBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    sortUPBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    sortDownBtn.setLayoutData(new GridData(SWT.LEFT,SWT.FILL,false,false,1,1));
    filterBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        if (dataModelFilterDialog == null) {
          dataModelFilter=new DataModelFilter("String_Node_Str",false,false,false,true);
          dataModelFilterDialog=new DataModelFilterDialog(getSite().getShell(),getXObject(),dataModelFilter);
        }
        if (dataModelFilterDialog.open() == Dialog.OK) {
          ((XSDTreeContentProvider)viewer.getContentProvider()).setFilter(dataModelFilter);
          viewer.setInput(getSite());
        }
      }
    }
);
    importXSDBtn.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        FileDialog fd=new FileDialog(getSite().getShell(),SWT.OPEN);
        fd.setFilterExtensions(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
        fd.setText("String_Node_Str");
        String filename=fd.open();
        if (filename == null)         return;
        xsdSchema=null;
        inferXsdFromXml(filename);
      }
      private void inferXsdFromXml(      String xmlFile){
        int infer=0;
        String xsd="String_Node_Str";
        try {
          String inputType=xmlFile.substring(xmlFile.lastIndexOf("String_Node_Str"));
          if (inputType.equals("String_Node_Str")) {
            xsd=Util.getXML(xmlFile);
          }
 else {
            XSDDriver d=new XSDDriver();
            infer=d.doMain(new String[]{xmlFile,"String_Node_Str"});
            if (infer == 0) {
              xsd=d.outputXSD();
            }
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
          infer=2;
        }
 finally {
          if (infer == 0 && !xsd.equals("String_Node_Str")) {
            WSDataModel wsObj=(WSDataModel)(getXObject().getWsObject());
            wsObj.setXsdSchema(xsd);
            validateSchema(xsd);
            refreshData();
            markDirty();
          }
 else           if (infer != 0) {
            MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
          }
        }
      }
      void validateSchema(      String xsd){
        try {
          boolean elem=false;
          XSDSchema schema=getXSDSchema(xsd);
          NodeList nodeList=schema.getDocument().getDocumentElement().getChildNodes();
          for (int idx=0; idx < nodeList.getLength(); idx++) {
            Node node=nodeList.item(idx);
            if (node instanceof Element && node.getLocalName().indexOf("String_Node_Str") >= 0) {
              elem=true;
              break;
            }
          }
          if (!elem) {
            MessageDialog.openWarning(getSite().getShell(),"String_Node_Str","String_Node_Str");
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
);
    exportBtn.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        FileDialog fd=new FileDialog(getSite().getShell(),SWT.SAVE);
        fd.setFilterExtensions(new String[]{"String_Node_Str"});
        fd.setText("String_Node_Str");
        String filename=fd.open();
        if (filename == null)         return;
        inferXsdFromDataModule(filename);
      }
      private void inferXsdFromDataModule(      String xmlFile){
        WSDataModel wsObject=(WSDataModel)(getXObject().getWsObject());
        XSDDriver d=new XSDDriver();
        if (d.outputXSD(wsObject.getXsdSchema(),xmlFile) != null) {
          MessageDialog.openInformation(getSite().getShell(),"String_Node_Str","String_Node_Str");
        }
 else {
          MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
        }
      }
    }
);
    xsdSchema=getXSDSchema(wsObject.getXsdSchema());
    createSash(mainComposite);
    hookContextMenu();
    hookDoubleClickAction();
    hookTypesContextMenu();
    XMLEditor xmleditor=((XObjectEditor)getEditor()).getXmlEditor();
    if (xmleditor != null && xmleditor.isDirty())     xmleditor.markDirty();
    initializeOperationHistory();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}