Program: 148820
Project: 148820
Buggy source:
protected void createCharacteristicsContent(FormToolkit toolkit,Composite mainComposite){
  try {
    Label descriptionLabel=toolkit.createLabel(mainComposite,"String_Node_Str",SWT.NULL);
    descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,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));
    ((GridData)descriptionText.getLayoutData()).minimumHeight=30;
    descriptionText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        if (refreshing)         return;
        markDirtyWithoutCommit();
      }
    }
);
    Util.createCompDropTarget(descriptionText);
    windowTarget=new DropTarget(this.getPartControl(),DND.DROP_MOVE);
    windowTarget.setTransfer(new Transfer[]{TextTransfer.getInstance()});
    windowTarget.addDropListener(new DCDropTargetListener());
    Composite composite=toolkit.createComposite(mainComposite,SWT.BORDER);
    composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,2,1));
    composite.setLayout(new GridLayout(1,false));
    menuTree=new TreeViewer(composite,SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    menuTree.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
    ((GridData)menuTree.getControl().getLayoutData()).heightHint=150;
    menuTree.setContentProvider(new ITreeContentProvider(){
      public void dispose(){
      }
      public Object[] getChildren(      Object parentElement){
        if (parentElement instanceof TreeEntry) {
          WSMenuEntry wsEntry=((TreeEntry)parentElement).getWsMenuEntry();
          if (wsEntry.getSubMenus() != null) {
            TreeEntry[] children=new TreeEntry[wsEntry.getSubMenus().length];
            for (int i=0; i < wsEntry.getSubMenus().length; i++) {
              children[i]=new TreeEntry((TreeEntry)parentElement,wsEntry.getSubMenus()[i]);
            }
            return children;
          }
          return null;
        }
        if (parentElement instanceof WSMenu) {
          WSMenuEntry[] menuEntries=((WSMenu)parentElement).getMenuEntries();
          if (menuEntries != null) {
            TreeEntry[] children=new TreeEntry[menuEntries.length];
            for (int i=0; i < menuEntries.length; i++) {
              children[i]=new TreeEntry(null,menuEntries[i]);
            }
            return children;
          }
          return null;
        }
        return null;
      }
      public Object[] getElements(      Object inputElement){
        return getChildren(inputElement);
      }
      public Object getParent(      Object element){
        return null;
      }
      public boolean hasChildren(      Object element){
        return ((getChildren(element) == null) || (getChildren(element).length > 0));
      }
      public void inputChanged(      Viewer viewer,      Object oldInput,      Object newInput){
      }
    }
);
    menuTree.setLabelProvider(new LabelProvider(){
      @Override public String getText(      Object element){
        WSMenuEntry wsMenuEntry=((TreeEntry)element).getWsMenuEntry();
        String label=wsMenuEntry.getId() + "String_Node_Str";
        for (int j=0; j < wsMenuEntry.getDescriptions().length; j++) {
          label+="String_Node_Str" + wsMenuEntry.getDescriptions()[j].getLanguage() + "String_Node_Str"+ wsMenuEntry.getDescriptions()[j].getLabel()+ "String_Node_Str";
        }
        if (label.length() > 200)         label=label.substring(0,197) + "String_Node_Str";
        return label;
      }
      @Override public Image getImage(      Object element){
        return ImageCache.getImage("String_Node_Str").createImage();
      }
    }
);
    menuTreeMgr=new MenuManager();
    menuTreeMgr.setRemoveAllWhenShown(true);
    menuTreeMgr.addMenuListener(new IMenuListener(){
      public void menuAboutToShow(      IMenuManager manager){
        IStructuredSelection selection=((IStructuredSelection)menuTree.getSelection());
        if ((selection == null) || (selection.getFirstElement() == null)) {
          manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
          return;
        }
        menuTreeMgr.add(new TreeEntryEditAction(menuTree));
        menuTreeMgr.add(new TreeEntryAddAction(menuTree,LOCATION_BEFORE));
        menuTreeMgr.add(new TreeEntryAddAction(menuTree,LOCATION_AFTER));
        menuTreeMgr.add(new TreeEntryAddAction(menuTree,LOCATION_UNDER));
        menuTreeMgr.add(new TreeEntryDeleteAction(menuTree));
        menuTreeMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
      }
    }
);
    menuTree.addDoubleClickListener(new IDoubleClickListener(){
      public void doubleClick(      DoubleClickEvent event){
        (new TreeEntryEditAction(menuTree)).run();
      }
    }
);
    Menu menu=menuTreeMgr.createContextMenu(menuTree.getControl());
    menuTree.getControl().setMenu(menu);
    getSite().registerContextMenu(menuTreeMgr,menuTree);
    refreshData();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
protected void createCharacteristicsContent(FormToolkit toolkit,Composite mainComposite){
  try {
    Label descriptionLabel=toolkit.createLabel(mainComposite,"String_Node_Str",SWT.NULL);
    descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,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));
    ((GridData)descriptionText.getLayoutData()).minimumHeight=30;
    descriptionText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        if (refreshing)         return;
        markDirtyWithoutCommit();
      }
    }
);
    windowTarget=new DropTarget(this.getPartControl(),DND.DROP_MOVE);
    windowTarget.setTransfer(new Transfer[]{TextTransfer.getInstance()});
    windowTarget.addDropListener(new DCDropTargetListener());
    Composite composite=toolkit.createComposite(mainComposite,SWT.BORDER);
    composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,2,1));
    composite.setLayout(new GridLayout(1,false));
    menuTree=new TreeViewer(composite,SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    menuTree.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
    ((GridData)menuTree.getControl().getLayoutData()).heightHint=150;
    menuTree.setContentProvider(new ITreeContentProvider(){
      public void dispose(){
      }
      public Object[] getChildren(      Object parentElement){
        if (parentElement instanceof TreeEntry) {
          WSMenuEntry wsEntry=((TreeEntry)parentElement).getWsMenuEntry();
          if (wsEntry.getSubMenus() != null) {
            TreeEntry[] children=new TreeEntry[wsEntry.getSubMenus().length];
            for (int i=0; i < wsEntry.getSubMenus().length; i++) {
              children[i]=new TreeEntry((TreeEntry)parentElement,wsEntry.getSubMenus()[i]);
            }
            return children;
          }
          return null;
        }
        if (parentElement instanceof WSMenu) {
          WSMenuEntry[] menuEntries=((WSMenu)parentElement).getMenuEntries();
          if (menuEntries != null) {
            TreeEntry[] children=new TreeEntry[menuEntries.length];
            for (int i=0; i < menuEntries.length; i++) {
              children[i]=new TreeEntry(null,menuEntries[i]);
            }
            return children;
          }
          return null;
        }
        return null;
      }
      public Object[] getElements(      Object inputElement){
        return getChildren(inputElement);
      }
      public Object getParent(      Object element){
        return null;
      }
      public boolean hasChildren(      Object element){
        return ((getChildren(element) == null) || (getChildren(element).length > 0));
      }
      public void inputChanged(      Viewer viewer,      Object oldInput,      Object newInput){
      }
    }
);
    menuTree.setLabelProvider(new LabelProvider(){
      @Override public String getText(      Object element){
        WSMenuEntry wsMenuEntry=((TreeEntry)element).getWsMenuEntry();
        String label=wsMenuEntry.getId() + "String_Node_Str";
        for (int j=0; j < wsMenuEntry.getDescriptions().length; j++) {
          label+="String_Node_Str" + wsMenuEntry.getDescriptions()[j].getLanguage() + "String_Node_Str"+ wsMenuEntry.getDescriptions()[j].getLabel()+ "String_Node_Str";
        }
        if (label.length() > 200)         label=label.substring(0,197) + "String_Node_Str";
        return label;
      }
      @Override public Image getImage(      Object element){
        return ImageCache.getImage("String_Node_Str").createImage();
      }
    }
);
    menuTreeMgr=new MenuManager();
    menuTreeMgr.setRemoveAllWhenShown(true);
    menuTreeMgr.addMenuListener(new IMenuListener(){
      public void menuAboutToShow(      IMenuManager manager){
        IStructuredSelection selection=((IStructuredSelection)menuTree.getSelection());
        if ((selection == null) || (selection.getFirstElement() == null)) {
          manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
          return;
        }
        menuTreeMgr.add(new TreeEntryEditAction(menuTree));
        menuTreeMgr.add(new TreeEntryAddAction(menuTree,LOCATION_BEFORE));
        menuTreeMgr.add(new TreeEntryAddAction(menuTree,LOCATION_AFTER));
        menuTreeMgr.add(new TreeEntryAddAction(menuTree,LOCATION_UNDER));
        menuTreeMgr.add(new TreeEntryDeleteAction(menuTree));
        menuTreeMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
      }
    }
);
    menuTree.addDoubleClickListener(new IDoubleClickListener(){
      public void doubleClick(      DoubleClickEvent event){
        (new TreeEntryEditAction(menuTree)).run();
      }
    }
);
    Menu menu=menuTreeMgr.createContextMenu(menuTree.getControl());
    menuTree.getControl().setMenu(menu);
    getSite().registerContextMenu(menuTreeMgr,menuTree);
    refreshData();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}