Program: 148319
Project: 148319
Buggy source:
protected void createCharacteristicsContent(FormToolkit toolkit,Composite mainComposite){
  try {
    mainComposite.getParent().setLayout(new GridLayout());
    GridData gdMainComposite=new GridData(SWT.FILL,SWT.FILL,true,true,1,1);
    gdMainComposite.widthHint=1;
    gdMainComposite.heightHint=1;
    mainComposite.setLayoutData(gdMainComposite);
    WSDataModel wsObject=(WSDataModel)(xobject.getWsObject());
    Button importXSDBtn, exportBtn, addLanBtn, deleteLanbtn, importSchemaNsBtn;
    Label descriptionLabel=toolkit.createLabel(mainComposite,"String_Node_Str",SWT.NULL);
    descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false,1,1));
    descriptionText=toolkit.createText(mainComposite,"String_Node_Str",SWT.BORDER | SWT.MULTI);
    descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,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=4;
    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");
    importSchemaNsBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    importSchemaNsBtn.setImage(ImageCache.getCreatedImage(EImage.CHECKIN_ACTION.getPath()));
    importSchemaNsBtn.setToolTipText("String_Node_Str");
    addLanGroup=new Group(btnCmp,SWT.NONE);
    addLanGroup.setText("String_Node_Str");
    addLanGroup.setToolTipText("String_Node_Str");
    addLanGroup.setBackground(btnCmp.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    addLanGroup.setLayout(new GridLayout(4,false));
    addLanGroup.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,true,false));
    langeuageLabel=toolkit.createLabel(addLanGroup,"String_Node_Str");
    languageCombo=new Combo(addLanGroup,SWT.READ_ONLY);
    addLanBtn=toolkit.createButton(addLanGroup,"String_Node_Str",SWT.NONE);
    addLanBtn.setImage(ImageCache.getCreatedImage(EImage.ADD_OBJ.getPath()));
    addLanBtn.setToolTipText("String_Node_Str");
    deleteLanbtn=toolkit.createButton(addLanGroup,"String_Node_Str",SWT.NONE);
    deleteLanbtn.setImage(ImageCache.getCreatedImage(EImage.DELETE_OBJ.getPath()));
    deleteLanbtn.setToolTipText("String_Node_Str");
    Set<String> languages=Util.lang2iso.keySet();
    for (Iterator iter=languages.iterator(); iter.hasNext(); ) {
      String language=(String)iter.next();
      languageCombo.add(language);
    }
    languageCombo.select(0);
    addLanBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        addOrDelLanguage(true);
      }
    }
);
    deleteLanbtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        addOrDelLanguage(false);
      }
    }
);
    langeuageLabel.setLayoutData(new GridData(SWT.RIGHT_TO_LEFT,SWT.CENTER,false,false,1,1));
    languageCombo.setLayoutData(new GridData(SWT.RIGHT_TO_LEFT,SWT.CENTER,false,false,1,1));
    addLanBtn.setLayoutData(new GridData(SWT.RIGHT_TO_LEFT,SWT.CENTER,false,false,1,1));
    deleteLanbtn.setLayoutData(new GridData(SWT.RIGHT_TO_LEFT,SWT.CENTER,false,false,1,1));
    importXSDBtn.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1));
    exportBtn.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1));
    importSchemaNsBtn.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1));
    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.setFilterPath(Platform.getInstanceLocation().getURL().getPath().substring(1));
        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);
            xsdSchema=Util.createXsdSchema(xsd,xobject);
            xsd=Util.nodeToString(xsdSchema.getDocument());
          }
 else {
            XSDDriver d=new XSDDriver();
            infer=d.doMain(new String[]{xmlFile,"String_Node_Str"});
            if (infer == 0) {
              xsd=d.outputXSD();
            }
          }
        }
 catch (        Exception e) {
          log.error(e.getMessage(),e);
          infer=2;
        }
 finally {
          if (infer == 0 && !xsd.equals("String_Node_Str")) {
            WSDataModel wsObj=(WSDataModel)(xobject.getWsObject());
            wsObj.setXsdSchema(xsd);
            validateSchema(xsd);
            refreshData();
            markDirtyWithoutCommit();
          }
 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) {
          log.error(e.getMessage(),e);
        }
      }
    }
);
    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.setFilterPath(Platform.getInstanceLocation().getURL().getPath().substring(1));
        fd.setText("String_Node_Str");
        String filename=fd.open();
        if (filename == null)         return;
        inferXsdFromDataModule(filename);
      }
      private void inferXsdFromDataModule(      String xmlFile){
        WSDataModel wsObject=(WSDataModel)(xobject.getWsObject());
        XSDDriver d=new XSDDriver();
        if (d.outputXSD_UTF_8(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");
        }
      }
    }
);
    importSchemaNsBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        SelectImportedModulesDialog dlg=new SelectImportedModulesDialog(getSite().getShell(),xsdSchema,xobject,"String_Node_Str");
        dlg.create();
        dlg.setBlockOnOpen(true);
        dlg.open();
        if (dlg.getReturnCode() == Window.OK) {
          doImportSchema(dlg.getImportedXSDList(),dlg.getToDelXSDList());
        }
      }
    }
);
    xsdSchema=getXSDSchema(wsObject.getXsdSchema());
    createSash(mainComposite);
    createCompDropTarget();
    hookContextMenu();
    hookDoubleClickAction();
    hookTypesContextMenu();
    initializeOperationHistory();
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
protected void createCharacteristicsContent(FormToolkit toolkit,Composite mainComposite){
  try {
    mainComposite.getParent().setLayout(new GridLayout());
    GridData gdMainComposite=new GridData(SWT.FILL,SWT.FILL,true,true,1,1);
    gdMainComposite.widthHint=1;
    gdMainComposite.heightHint=1;
    mainComposite.setLayoutData(gdMainComposite);
    WSDataModel wsObject=(WSDataModel)(xobject.getWsObject());
    Button importXSDBtn, exportBtn, addLanBtn, deleteLanbtn, importSchemaNsBtn;
    Label descriptionLabel=toolkit.createLabel(mainComposite,"String_Node_Str",SWT.NULL);
    descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false,1,1));
    descriptionText=toolkit.createText(mainComposite,"String_Node_Str",SWT.BORDER);
    descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,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=4;
    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");
    importSchemaNsBtn=toolkit.createButton(btnCmp,"String_Node_Str",SWT.PUSH);
    importSchemaNsBtn.setImage(ImageCache.getCreatedImage(EImage.CHECKIN_ACTION.getPath()));
    importSchemaNsBtn.setToolTipText("String_Node_Str");
    addLanGroup=new Group(btnCmp,SWT.NONE);
    addLanGroup.setText("String_Node_Str");
    addLanGroup.setToolTipText("String_Node_Str");
    addLanGroup.setBackground(btnCmp.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    addLanGroup.setLayout(new GridLayout(4,false));
    addLanGroup.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,true,false));
    langeuageLabel=toolkit.createLabel(addLanGroup,"String_Node_Str");
    languageCombo=new Combo(addLanGroup,SWT.READ_ONLY);
    addLanBtn=toolkit.createButton(addLanGroup,"String_Node_Str",SWT.NONE);
    addLanBtn.setImage(ImageCache.getCreatedImage(EImage.ADD_OBJ.getPath()));
    addLanBtn.setToolTipText("String_Node_Str");
    deleteLanbtn=toolkit.createButton(addLanGroup,"String_Node_Str",SWT.NONE);
    deleteLanbtn.setImage(ImageCache.getCreatedImage(EImage.DELETE_OBJ.getPath()));
    deleteLanbtn.setToolTipText("String_Node_Str");
    Set<String> languages=Util.lang2iso.keySet();
    for (Iterator iter=languages.iterator(); iter.hasNext(); ) {
      String language=(String)iter.next();
      languageCombo.add(language);
    }
    languageCombo.select(0);
    addLanBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        addOrDelLanguage(true);
      }
    }
);
    deleteLanbtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        addOrDelLanguage(false);
      }
    }
);
    langeuageLabel.setLayoutData(new GridData(SWT.RIGHT_TO_LEFT,SWT.CENTER,false,false,1,1));
    languageCombo.setLayoutData(new GridData(SWT.RIGHT_TO_LEFT,SWT.CENTER,false,false,1,1));
    addLanBtn.setLayoutData(new GridData(SWT.RIGHT_TO_LEFT,SWT.CENTER,false,false,1,1));
    deleteLanbtn.setLayoutData(new GridData(SWT.RIGHT_TO_LEFT,SWT.CENTER,false,false,1,1));
    importXSDBtn.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1));
    exportBtn.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1));
    importSchemaNsBtn.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1));
    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.setFilterPath(Platform.getInstanceLocation().getURL().getPath().substring(1));
        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);
            xsdSchema=Util.createXsdSchema(xsd,xobject);
            xsd=Util.nodeToString(xsdSchema.getDocument());
          }
 else {
            XSDDriver d=new XSDDriver();
            infer=d.doMain(new String[]{xmlFile,"String_Node_Str"});
            if (infer == 0) {
              xsd=d.outputXSD();
            }
          }
        }
 catch (        Exception e) {
          log.error(e.getMessage(),e);
          infer=2;
        }
 finally {
          if (infer == 0 && !xsd.equals("String_Node_Str")) {
            WSDataModel wsObj=(WSDataModel)(xobject.getWsObject());
            wsObj.setXsdSchema(xsd);
            validateSchema(xsd);
            refreshData();
            markDirtyWithoutCommit();
          }
 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) {
          log.error(e.getMessage(),e);
        }
      }
    }
);
    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.setFilterPath(Platform.getInstanceLocation().getURL().getPath().substring(1));
        fd.setText("String_Node_Str");
        String filename=fd.open();
        if (filename == null)         return;
        inferXsdFromDataModule(filename);
      }
      private void inferXsdFromDataModule(      String xmlFile){
        WSDataModel wsObject=(WSDataModel)(xobject.getWsObject());
        XSDDriver d=new XSDDriver();
        if (d.outputXSD_UTF_8(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");
        }
      }
    }
);
    importSchemaNsBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        SelectImportedModulesDialog dlg=new SelectImportedModulesDialog(getSite().getShell(),xsdSchema,xobject,"String_Node_Str");
        dlg.create();
        dlg.setBlockOnOpen(true);
        dlg.open();
        if (dlg.getReturnCode() == Window.OK) {
          doImportSchema(dlg.getImportedXSDList(),dlg.getToDelXSDList());
        }
      }
    }
);
    xsdSchema=getXSDSchema(wsObject.getXsdSchema());
    createSash(mainComposite);
    createCompDropTarget();
    hookContextMenu();
    hookDoubleClickAction();
    hookTypesContextMenu();
    initializeOperationHistory();
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
}