Program: 35697
Project: 35697
Buggy source:
@Inject public DesignPanel(EventBus eventBus,Dispatcher dispatcher,Provider<IndicatorDialog> indicatorDialog){
  super(eventBus,dispatcher);
  treeStore=new TreeStore<ModelData>();
  this.indicatorDialog=indicatorDialog;
  DesignPanelResources.INSTANCE.css().ensureInjected();
  setLayout(new FitLayout());
  mappedIndicator=new MappedIndicatorSelection();
  treeGrid=new EditorTreeGrid<ModelData>(treeStore,createColumnModel());
  treeGrid.setSelectionModel(new ImprovedCellTreeGridSelectionModel<ModelData>());
  treeGrid.setClicksToEdit(EditorGrid.ClicksToEdit.TWO);
  treeGrid.setAutoExpandColumn("String_Node_Str");
  treeGrid.setHideHeaders(false);
  treeGrid.setLoadMask(true);
  treeGrid.getStyle().setNodeCloseIcon(null);
  treeGrid.getStyle().setNodeOpenIcon(null);
  treeGrid.getStyle().setLeafIcon(null);
  treeGrid.addListener(Events.CellClick,new Listener<GridEvent>(){
    public void handleEvent(    GridEvent ge){
switch (DesignTreeGridCellRenderer.computeTarget(ge)) {
case LABEL:
        showIndicatorForm((IndicatorDTO)ge.getModel());
      break;
case MAP_ICON:
    mapSelectionChanged((IndicatorDTO)ge.getModel());
  break;
case STAR_ICON:
starChanged((IndicatorDTO)ge.getModel());
break;
}
}
}
);
QuickTip fullNameTip=new QuickTip(treeGrid);
TreeGridDragSource source=new TreeGridDragSource(treeGrid);
source.addDNDListener(new DNDListener(){
@Override public void dragStart(DNDEvent e){
ModelData sel=((CellTreeGridSelectionModel)treeGrid.getSelectionModel()).getSelectCell().model;
if (db != null && (!db.isDesignAllowed() || sel == null || sel instanceof Folder)) {
e.setCancelled(true);
e.getStatus().setStatus(false);
return;
}
super.dragStart(e);
}
}
);
TreeGridDropTarget target=new TreeGridDropTarget(treeGrid);
target.setAllowSelfAsSource(true);
target.setFeedback(DND.Feedback.BOTH);
target.setAutoExpand(false);
target.addDNDListener(new DNDListener(){
@Override public void dragMove(DNDEvent e){
List<TreeModel> sourceData=e.getData();
ModelData source=sourceData.get(0).get("String_Node_Str");
TreeGrid.TreeNode target=treeGrid.findNode(e.getTarget());
ModelData targetParent=treeStore.getParent(target.getModel());
if (source instanceof IndicatorGroup && targetParent != null) {
e.setCancelled(true);
e.getStatus().setStatus(false);
}
 else if (source instanceof IndicatorDTO && targetParent instanceof IndicatorDTO) {
e.setCancelled(true);
e.getStatus().setStatus(false);
}
}
@Override public void dragDrop(DNDEvent e){
List<TreeModel> sourceData=e.getData();
ModelData source=sourceData.get(0).get("String_Node_Str");
onNodeDropped(source);
}
}
);
add(treeGrid);
toolBar.setListener(this);
toolBar.addButton("String_Node_Str",I18N.CONSTANTS.newIndicatorGroup(),null);
toolBar.addButton("String_Node_Str",I18N.CONSTANTS.newIndicator(),null);
toolBar.addRefreshButton();
eventBus.addListener(IndicatorEvent.CHANGED,new Listener<IndicatorEvent>(){
@Override public void handleEvent(IndicatorEvent be){
if (be.getSource() != DesignPanel.this) {
doLoad();
}
}
}
);
}

Fixed version (ground truth):
@Inject public DesignPanel(EventBus eventBus,Dispatcher dispatcher,Provider<IndicatorDialog> indicatorDialog){
  super(eventBus,dispatcher);
  treeStore=new TreeStore<ModelData>();
  this.indicatorDialog=indicatorDialog;
  DesignPanelResources.INSTANCE.css().ensureInjected();
  setLayout(new FitLayout());
  mappedIndicator=new MappedIndicatorSelection();
  treeGrid=new EditorTreeGrid<ModelData>(treeStore,createColumnModel());
  treeGrid.setSelectionModel(new ImprovedCellTreeGridSelectionModel<ModelData>());
  treeGrid.setClicksToEdit(EditorGrid.ClicksToEdit.TWO);
  treeGrid.setAutoExpandColumn("String_Node_Str");
  treeGrid.setHideHeaders(false);
  treeGrid.setLoadMask(true);
  treeGrid.getStyle().setNodeCloseIcon(null);
  treeGrid.getStyle().setNodeOpenIcon(null);
  treeGrid.getStyle().setLeafIcon(null);
  treeGrid.addListener(Events.CellClick,new Listener<GridEvent>(){
    public void handleEvent(    GridEvent ge){
switch (DesignTreeGridCellRenderer.computeTarget(ge)) {
case LABEL:
        showIndicatorForm((IndicatorDTO)ge.getModel());
      break;
case MAP_ICON:
    mapSelectionChanged((IndicatorDTO)ge.getModel());
  break;
case STAR_ICON:
starChanged((IndicatorDTO)ge.getModel());
break;
}
}
}
);
TreeGridDragSource source=new TreeGridDragSource(treeGrid);
source.addDNDListener(new DNDListener(){
@Override public void dragStart(DNDEvent e){
ModelData sel=((CellTreeGridSelectionModel)treeGrid.getSelectionModel()).getSelectCell().model;
if (db != null && (!db.isDesignAllowed() || sel == null || sel instanceof Folder)) {
e.setCancelled(true);
e.getStatus().setStatus(false);
return;
}
super.dragStart(e);
}
}
);
TreeGridDropTarget target=new TreeGridDropTarget(treeGrid);
target.setAllowSelfAsSource(true);
target.setFeedback(DND.Feedback.BOTH);
target.setAutoExpand(false);
target.addDNDListener(new DNDListener(){
@Override public void dragMove(DNDEvent e){
List<TreeModel> sourceData=e.getData();
ModelData source=sourceData.get(0).get("String_Node_Str");
TreeGrid.TreeNode target=treeGrid.findNode(e.getTarget());
ModelData targetParent=treeStore.getParent(target.getModel());
if (source instanceof IndicatorGroup && targetParent != null) {
e.setCancelled(true);
e.getStatus().setStatus(false);
}
 else if (source instanceof IndicatorDTO && targetParent instanceof IndicatorDTO) {
e.setCancelled(true);
e.getStatus().setStatus(false);
}
}
@Override public void dragDrop(DNDEvent e){
List<TreeModel> sourceData=e.getData();
ModelData source=sourceData.get(0).get("String_Node_Str");
onNodeDropped(source);
}
}
);
add(treeGrid);
toolBar.setListener(this);
toolBar.addButton("String_Node_Str",I18N.CONSTANTS.newIndicatorGroup(),null);
toolBar.addButton("String_Node_Str",I18N.CONSTANTS.newIndicator(),null);
toolBar.addRefreshButton();
eventBus.addListener(IndicatorEvent.CHANGED,new Listener<IndicatorEvent>(){
@Override public void handleEvent(IndicatorEvent be){
if (be.getSource() != DesignPanel.this) {
doLoad();
}
}
}
);
}