Program: 170772
Project: 170772
Buggy source:
public static SWTSkinObjectContainer buildStandAlone(SWTSkinObjectContainer soParent,String skinRef,SWTSkin skin,String parentID,String id,Object datasource,int controlType,TreeItem swtItem,UISWTViewEventListener original_event_listener,boolean listener_is_new){
  Control control=null;
  Composite parent=soParent.getComposite();
  if (skinRef != null) {
    Shell shell=parent.getShell();
    Cursor cursor=shell.getCursor();
    try {
      shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
      SWTSkinObjectContainer soContents=(SWTSkinObjectContainer)skin.createSkinObject("String_Node_Str" + uniqueNumber++,SO_ID_ENTRY_WRAPPER,soParent,null);
      SWTSkinObject skinObject=skin.createSkinObject(id,skinRef,soContents,datasource);
      control=skinObject.getControl();
      control.setLayoutData(Utils.getFilledFormData());
      control.getParent().layout(true,true);
      soContents.setVisible(true);
      return (soContents);
    }
  finally {
      shell.setCursor(cursor);
    }
  }
 else {
    if ((original_event_listener instanceof UISWTViewCoreEventListenerEx && ((UISWTViewCoreEventListenerEx)original_event_listener).isCloneable()) || (original_event_listener instanceof UISWTViewEventListenerEx)) {
      final UISWTViewImpl view=new UISWTViewImpl(id,parentID,true);
      final UISWTViewEventListener event_listener=original_event_listener instanceof UISWTViewEventListenerEx ? ((UISWTViewEventListenerEx)original_event_listener).getClone() : ((UISWTViewCoreEventListenerEx)original_event_listener).getClone();
      try {
        view.setEventListener(event_listener,false);
      }
 catch (      Throwable e) {
        Debug.out(e);
      }
      view.setDatasource(datasource);
      try {
        SWTSkinObjectContainer soContents=(SWTSkinObjectContainer)skin.createSkinObject("String_Node_Str" + uniqueNumber++,SO_ID_ENTRY_WRAPPER,soParent);
        parent.setBackgroundMode(SWT.INHERIT_NONE);
        final Composite viewComposite=soContents.getComposite();
        boolean doGridLayout=true;
        if (controlType == CONTROLTYPE_SKINOBJECT) {
          doGridLayout=false;
        }
        if (doGridLayout) {
          GridLayout gridLayout=new GridLayout();
          gridLayout.horizontalSpacing=gridLayout.verticalSpacing=gridLayout.marginHeight=gridLayout.marginWidth=0;
          viewComposite.setLayout(gridLayout);
          viewComposite.setLayoutData(Utils.getFilledFormData());
        }
        view.setPluginSkinObject(soContents);
        view.initialize(viewComposite);
        soContents.addListener(new SWTSkinObjectListener(){
          @Override public Object eventOccured(          SWTSkinObject skinObject,          int eventType,          Object params){
            if (eventType == SWTSkinObjectListener.EVENT_OBFUSCATE) {
              Map data=new HashMap();
              data.put("String_Node_Str",(Image)params);
              data.put("String_Node_Str",false);
              view.triggerEvent(UISWTViewEvent.TYPE_OBFUSCATE,data);
            }
            return null;
          }
        }
);
        if (PAINT_BG) {
          if (swtItem != null) {
            swtItem.setText(view.getFullTitle());
          }
        }
        Composite iviewComposite=view.getComposite();
        control=iviewComposite;
        if (doGridLayout) {
          Object existingLayoutData=iviewComposite.getLayoutData();
          Object existingParentLayoutData=iviewComposite.getParent().getLayoutData();
          if (existingLayoutData == null || !(existingLayoutData instanceof GridData) && (existingParentLayoutData instanceof GridLayout)) {
            GridData gridData=new GridData(GridData.FILL_BOTH);
            iviewComposite.setLayoutData(gridData);
          }
        }
        parent.layout(true,true);
        final UIUpdater updater=UIUpdaterSWT.getInstance();
        if (updater != null) {
          updater.addUpdater(new UIUpdatable(){
            @Override public void updateUI(){
              if (viewComposite.isDisposed()) {
                updater.removeUpdater(this);
              }
 else {
                view.triggerEvent(UISWTViewEvent.TYPE_REFRESH,null);
              }
            }
            @Override public String getUpdateUIName(){
              return ("String_Node_Str");
            }
          }
);
          if (event_listener instanceof IViewRequiresPeriodicUpdates) {
            updater.addPeriodicUpdater(new UIUpdatable(){
              @Override public void updateUI(){
                if (viewComposite.isDisposed()) {
                  updater.removePeriodicUpdater(this);
                }
 else {
                  event_listener.eventOccurred(new UISWTViewEvent(){
                    @Override public UISWTView getView(){
                      return null;
                    }
                    @Override public int getType(){
                      return (StatsView.EVENT_PERIODIC_UPDATE);
                    }
                    @Override public Object getData(){
                      return null;
                    }
                  }
);
                }
              }
              @Override public String getUpdateUIName(){
                return ("String_Node_Str");
              }
            }
);
          }
        }
        soContents.setVisible(true);
        view.triggerEvent(UISWTViewEvent.TYPE_FOCUSGAINED,null);
        iviewComposite.addDisposeListener(new DisposeListener(){
          @Override public void widgetDisposed(          DisposeEvent arg0){
            view.triggerEvent(UISWTViewEvent.TYPE_DESTROY,null);
          }
        }
);
        return (soContents);
      }
 catch (      Throwable e) {
        Debug.out(e);
      }
    }
  }
  return (null);
}

Fixed version (ground truth):
public static SWTSkinObjectContainer buildStandAlone(SWTSkinObjectContainer soParent,String skinRef,SWTSkin skin,String parentID,String id,Object datasource,int controlType,TreeItem swtItem,UISWTViewEventListener original_event_listener,boolean listener_is_new){
  Control control=null;
  Composite parent=soParent.getComposite();
  if (skinRef != null) {
    Shell shell=parent.getShell();
    Cursor cursor=shell.getCursor();
    try {
      shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
      SWTSkinObjectContainer soContents=(SWTSkinObjectContainer)skin.createSkinObject("String_Node_Str" + uniqueNumber++,SO_ID_ENTRY_WRAPPER,soParent,null);
      SWTSkinObject skinObject=skin.createSkinObject(id,skinRef,soContents,datasource);
      control=skinObject.getControl();
      control.setLayoutData(Utils.getFilledFormData());
      control.getParent().layout(true,true);
      soContents.setVisible(true);
      return (soContents);
    }
  finally {
      shell.setCursor(cursor);
    }
  }
 else {
    if ((original_event_listener instanceof UISWTViewCoreEventListenerEx && ((UISWTViewCoreEventListenerEx)original_event_listener).isCloneable()) || (original_event_listener instanceof UISWTViewEventListenerEx)) {
      final UISWTViewImpl view=new UISWTViewImpl(id,parentID,true);
      final UISWTViewEventListener event_listener=original_event_listener instanceof UISWTViewEventListenerEx ? ((UISWTViewEventListenerEx)original_event_listener).getClone() : ((UISWTViewCoreEventListenerEx)original_event_listener).getClone();
      try {
        view.setEventListener(event_listener,false);
      }
 catch (      Throwable e) {
        Debug.out(e);
      }
      view.setDatasource(datasource);
      try {
        SWTSkinObjectContainer soContents=(SWTSkinObjectContainer)skin.createSkinObject("String_Node_Str" + uniqueNumber++,SO_ID_ENTRY_WRAPPER,soParent);
        parent.setBackgroundMode(SWT.INHERIT_NONE);
        final Composite viewComposite=soContents.getComposite();
        boolean doGridLayout=true;
        if (controlType == CONTROLTYPE_SKINOBJECT) {
          doGridLayout=false;
        }
        if (doGridLayout) {
          GridLayout gridLayout=new GridLayout();
          gridLayout.horizontalSpacing=gridLayout.verticalSpacing=gridLayout.marginHeight=gridLayout.marginWidth=0;
          viewComposite.setLayout(gridLayout);
          viewComposite.setLayoutData(Utils.getFilledFormData());
        }
        view.setPluginSkinObject(soContents);
        view.initialize(viewComposite);
        viewComposite.setData(Utils.RELAYOUT_UP_STOP_HERE,true);
        soContents.addListener(new SWTSkinObjectListener(){
          @Override public Object eventOccured(          SWTSkinObject skinObject,          int eventType,          Object params){
            if (eventType == SWTSkinObjectListener.EVENT_OBFUSCATE) {
              Map data=new HashMap();
              data.put("String_Node_Str",(Image)params);
              data.put("String_Node_Str",false);
              view.triggerEvent(UISWTViewEvent.TYPE_OBFUSCATE,data);
            }
            return null;
          }
        }
);
        if (PAINT_BG) {
          if (swtItem != null) {
            swtItem.setText(view.getFullTitle());
          }
        }
        Composite iviewComposite=view.getComposite();
        control=iviewComposite;
        if (doGridLayout) {
          Object existingLayoutData=iviewComposite.getLayoutData();
          Object existingParentLayoutData=iviewComposite.getParent().getLayoutData();
          if (existingLayoutData == null || !(existingLayoutData instanceof GridData) && (existingParentLayoutData instanceof GridLayout)) {
            GridData gridData=new GridData(GridData.FILL_BOTH);
            iviewComposite.setLayoutData(gridData);
          }
        }
        parent.layout(true,true);
        final UIUpdater updater=UIUpdaterSWT.getInstance();
        if (updater != null) {
          updater.addUpdater(new UIUpdatable(){
            @Override public void updateUI(){
              if (viewComposite.isDisposed()) {
                updater.removeUpdater(this);
              }
 else {
                view.triggerEvent(UISWTViewEvent.TYPE_REFRESH,null);
              }
            }
            @Override public String getUpdateUIName(){
              return ("String_Node_Str");
            }
          }
);
          if (event_listener instanceof IViewRequiresPeriodicUpdates) {
            updater.addPeriodicUpdater(new UIUpdatable(){
              @Override public void updateUI(){
                if (viewComposite.isDisposed()) {
                  updater.removePeriodicUpdater(this);
                }
 else {
                  event_listener.eventOccurred(new UISWTViewEvent(){
                    @Override public UISWTView getView(){
                      return null;
                    }
                    @Override public int getType(){
                      return (StatsView.EVENT_PERIODIC_UPDATE);
                    }
                    @Override public Object getData(){
                      return null;
                    }
                  }
);
                }
              }
              @Override public String getUpdateUIName(){
                return ("String_Node_Str");
              }
            }
);
          }
        }
        soContents.setVisible(true);
        view.triggerEvent(UISWTViewEvent.TYPE_FOCUSGAINED,null);
        iviewComposite.addDisposeListener(new DisposeListener(){
          @Override public void widgetDisposed(          DisposeEvent arg0){
            view.triggerEvent(UISWTViewEvent.TYPE_DESTROY,null);
          }
        }
);
        return (soContents);
      }
 catch (      Throwable e) {
        Debug.out(e);
      }
    }
  }
  return (null);
}