Program: 143688
Project: 143688
Buggy source:
/** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#respond(org.apache.wicket.ajax.AjaxRequestTarget)
 */
@Override protected void respond(AjaxRequestTarget target){
  Request request=RequestCycle.get().getRequest();
  String action=request.getParameter(DraggableBehavior.PARAM_ACTION);
  String id=extractId(request.getParameter(DraggableBehavior.PARAM_DRAGGABLE_ID));
  if (id != null) {
    final String finalId=id.endsWith(TemplateGenerator.WRAPPER_SUFFIX) ? id.substring(0,id.length() - 8) : id;
    MarkupContainer comp=(MarkupContainer)getComponent();
    Component child=(Component)comp.visitChildren(Component.class,new IVisitor<Component>(){
      public Object component(      Component component){
        String markupId=component.getMarkupId();
        if (finalId.equals(markupId))         return component;
        return IVisitor.CONTINUE_TRAVERSAL;
      }
    }
);
    if (child != null && action != null) {
      int height=stripUnitPart(request.getParameter(PARAM_RESIZE_HEIGHT));
      int width=stripUnitPart(request.getParameter(PARAM_RESIZE_WIDTH));
      int x=stripUnitPart(request.getParameter(DraggableBehavior.PARAM_X));
      int y=stripUnitPart(request.getParameter(DraggableBehavior.PARAM_Y));
      if (action.equals(ACTION_SELECT)) {
        Object ret=callback.executeOnSelect(getJSEvent(EventType.rightClick,0,new Point(x,y),new IComponent[]{(IComponent)child}));
        if (ret instanceof Boolean && !((Boolean)ret).booleanValue()) {
          onSelectComponent=null;
        }
 else {
          target.appendJavascript("String_Node_Str" + id + "String_Node_Str");
        }
        return;
      }
      if (child != onSelectComponent) {
        onSelectComponent=(IComponent)child;
      }
      if (action.equals(ACTION_RESIZE)) {
        if (width != -1 && height != -1) {
          if (child instanceof ISupportWebBounds) {
            Insets paddingAndBorder=((ISupportWebBounds)child).getPaddingAndBorder();
            if (paddingAndBorder != null) {
              height+=paddingAndBorder.bottom + paddingAndBorder.top;
              width+=paddingAndBorder.left + paddingAndBorder.right;
            }
          }
          if (child instanceof IScriptableProvider)           ((IRuntimeComponent)((IScriptableProvider)child).getScriptObject()).setSize(width,height);
          if (child instanceof IProviderStylePropertyChanges)           ((IProviderStylePropertyChanges)child).getStylePropertyChanges().setRendered();
        }
        callback.executeOnResize(getJSEvent(EventType.onDrop,0,new Point(x,y),new IComponent[]{(IComponent)child}));
      }
 else       if (action.equals(DraggableBehavior.ACTION_DRAG_START)) {
        Object onDragAllowed=callback.executeOnDrag(getJSEvent(EventType.onDrag,0,new Point(x,y),new IComponent[]{(IComponent)child}));
        if ((onDragAllowed instanceof Boolean && !((Boolean)onDragAllowed).booleanValue()) || (onDragAllowed instanceof Number && ((Number)onDragAllowed).intValue() == DRAGNDROP.NONE)) {
          onDragComponent=null;
        }
 else {
          onDragComponent=(IComponent)child;
        }
      }
 else {
        if (child == onDragComponent) {
          if (x != -1 && y != -1) {
            ((IRuntimeComponent)((IScriptableProvider)child).getScriptObject()).setLocation(x,y);
            if (child instanceof IProviderStylePropertyChanges) {
              if ((child).getParent() instanceof WrapperContainer) {
                WrapperContainer wrapper=(WrapperContainer)(child).getParent();
                wrapper.getStylePropertyChanges().getChanges();
                wrapper.getStylePropertyChanges().setRendered();
              }
              ((IProviderStylePropertyChanges)child).getStylePropertyChanges().setRendered();
            }
          }
          callback.executeOnDrop(getJSEvent(EventType.onDrop,0,new Point(x,y),new IComponent[]{(IComponent)child}));
        }
      }
    }
  }
  WebEventExecutor.generateResponse(target,getComponent().getPage());
  target.prependJavascript("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#respond(org.apache.wicket.ajax.AjaxRequestTarget)
 */
@Override protected void respond(AjaxRequestTarget target){
  Request request=RequestCycle.get().getRequest();
  String action=request.getParameter(DraggableBehavior.PARAM_ACTION);
  String id=extractId(request.getParameter(DraggableBehavior.PARAM_DRAGGABLE_ID));
  if (id != null) {
    final String finalId=id.endsWith(TemplateGenerator.WRAPPER_SUFFIX) ? id.substring(0,id.length() - 8) : id;
    MarkupContainer comp=(MarkupContainer)getComponent();
    Component child=(Component)comp.visitChildren(Component.class,new IVisitor<Component>(){
      public Object component(      Component component){
        String markupId=component.getMarkupId();
        if (finalId.equals(markupId))         return component;
        return IVisitor.CONTINUE_TRAVERSAL;
      }
    }
);
    if (child instanceof IComponent && action != null) {
      int height=stripUnitPart(request.getParameter(PARAM_RESIZE_HEIGHT));
      int width=stripUnitPart(request.getParameter(PARAM_RESIZE_WIDTH));
      int x=stripUnitPart(request.getParameter(DraggableBehavior.PARAM_X));
      int y=stripUnitPart(request.getParameter(DraggableBehavior.PARAM_Y));
      if (action.equals(ACTION_SELECT)) {
        Object ret=callback.executeOnSelect(getJSEvent(EventType.action,0,new Point(x,y),new IComponent[]{(IComponent)child}));
        if (ret instanceof Boolean && !((Boolean)ret).booleanValue()) {
          onSelectComponent=null;
        }
 else {
          target.appendJavascript("String_Node_Str" + id + "String_Node_Str");
        }
        return;
      }
      if (child != onSelectComponent) {
        onSelectComponent=(IComponent)child;
      }
      if (action.equals(ACTION_RESIZE)) {
        if (width != -1 && height != -1) {
          if (child instanceof ISupportWebBounds) {
            Insets paddingAndBorder=((ISupportWebBounds)child).getPaddingAndBorder();
            if (paddingAndBorder != null) {
              height+=paddingAndBorder.bottom + paddingAndBorder.top;
              width+=paddingAndBorder.left + paddingAndBorder.right;
            }
          }
          if (child instanceof IScriptableProvider)           ((IRuntimeComponent)((IScriptableProvider)child).getScriptObject()).setSize(width,height);
          if (child instanceof IProviderStylePropertyChanges)           ((IProviderStylePropertyChanges)child).getStylePropertyChanges().setRendered();
        }
        callback.executeOnResize(getJSEvent(EventType.onDrop,0,new Point(x,y),new IComponent[]{(IComponent)child}));
      }
 else       if (action.equals(DraggableBehavior.ACTION_DRAG_START)) {
        Object onDragAllowed=callback.executeOnDrag(getJSEvent(EventType.onDrag,0,new Point(x,y),new IComponent[]{(IComponent)child}));
        if ((onDragAllowed instanceof Boolean && !((Boolean)onDragAllowed).booleanValue()) || (onDragAllowed instanceof Number && ((Number)onDragAllowed).intValue() == DRAGNDROP.NONE)) {
          onDragComponent=null;
        }
 else {
          onDragComponent=(IComponent)child;
        }
      }
 else {
        if (child == onDragComponent) {
          if (x != -1 && y != -1) {
            ((IRuntimeComponent)((IScriptableProvider)child).getScriptObject()).setLocation(x,y);
            if (child instanceof IProviderStylePropertyChanges) {
              if ((child).getParent() instanceof WrapperContainer) {
                WrapperContainer wrapper=(WrapperContainer)(child).getParent();
                wrapper.getStylePropertyChanges().getChanges();
                wrapper.getStylePropertyChanges().setRendered();
              }
              ((IProviderStylePropertyChanges)child).getStylePropertyChanges().setRendered();
            }
          }
          callback.executeOnDrop(getJSEvent(EventType.onDrop,0,new Point(x,y),new IComponent[]{(IComponent)child}));
        }
      }
    }
  }
  WebEventExecutor.generateResponse(target,getComponent().getPage());
  target.prependJavascript("String_Node_Str");
}