Program: 143756
Project: 143756
Buggy source:
/** 
 * @param component2
 * @param response
 */
@SuppressWarnings("String_Node_Str") public static void generateDragAttach(Component component,IHeaderResponse response){
  DraggableBehavior draggableBehavior=null;
  Component behaviorComponent=component;
  if ((behaviorComponent instanceof IComponent) && !(behaviorComponent instanceof IDataRenderer)) {
    behaviorComponent=(Component)component.findParent(IDataRenderer.class);
  }
  if (behaviorComponent != null) {
    Iterator<IBehavior> behaviors=behaviorComponent.getBehaviors().iterator();
    Object behavior;
    while (behaviors.hasNext()) {
      behavior=behaviors.next();
      if (behavior instanceof DraggableBehavior) {
        draggableBehavior=(DraggableBehavior)behavior;
        break;
      }
    }
  }
  if (draggableBehavior == null)   return;
  boolean bUseProxy=draggableBehavior.isUseProxy();
  boolean bXConstraint=draggableBehavior.isXConstraint();
  boolean bYConstraint=draggableBehavior.isYConstraint();
  CharSequence dragUrl=draggableBehavior.getCallbackUrl();
  String jsCode=null;
  if (behaviorComponent instanceof IDataRenderer) {
    final StringBuilder sbAttachDrag=new StringBuilder(100);
    sbAttachDrag.append("String_Node_Str");
    final StringBuilder sbAttachDrop=new StringBuilder(100);
    sbAttachDrop.append("String_Node_Str");
    if (behaviorComponent instanceof WebDataRenderer) {
      boolean hasDragEvent=((WebDataRenderer)behaviorComponent).getDragNDropController().getForm().getOnDragMethodID() > 0;
      boolean hasDropEvent=((WebDataRenderer)behaviorComponent).getDragNDropController().getForm().getOnDropMethodID() > 0;
      if (component instanceof WebDataRenderer) {
        if (hasDragEvent)         sbAttachDrag.append('\'').append(component.getMarkupId()).append("String_Node_Str");
        if (hasDropEvent)         sbAttachDrop.append('\'').append(component.getMarkupId()).append("String_Node_Str");
        Iterator<? extends Component> dataRendererIte=((WebDataRenderer)component).iterator();
        Object dataRendererChild;
        while (dataRendererIte.hasNext()) {
          dataRendererChild=dataRendererIte.next();
          if (dataRendererChild instanceof WrapperContainer)           dataRendererChild=((WrapperContainer)dataRendererChild).getDelegate();
          if (dataRendererChild instanceof IComponent) {
            StringBuilder sb=null;
            if (hasDragEvent && (dataRendererChild instanceof WebBaseLabel || ((dataRendererChild instanceof IDisplay) && ((IDisplay)dataRendererChild).isReadOnly())))             sb=sbAttachDrag;
 else             if (hasDropEvent)             sb=sbAttachDrop;
            if (sb != null) {
              sb.append('\'');
              sb.append(((Component)dataRendererChild).getMarkupId());
              sb.append("String_Node_Str");
            }
          }
        }
      }
 else {
        StringBuilder sb=null;
        if (hasDragEvent && (component instanceof WebBaseLabel || ((component instanceof IDisplay) && ((IDisplay)component).isReadOnly())))         sb=sbAttachDrag;
 else         if (hasDropEvent)         sb=sbAttachDrop;
        if (sb != null) {
          sb.append('\'');
          sb.append(component.getMarkupId());
          sb.append("String_Node_Str");
        }
      }
    }
 else {
      final boolean hasDragEvent=((WebCellBasedView)behaviorComponent).getDragNDropController().getForm().getOnDragMethodID() > 0;
      final boolean hasDropEvent=((WebCellBasedView)behaviorComponent).getDragNDropController().getForm().getOnDropMethodID() > 0;
      if (component instanceof WebCellBasedView) {
        if (hasDragEvent)         sbAttachDrag.append('\'').append(component.getMarkupId()).append("String_Node_Str");
        if (hasDropEvent)         sbAttachDrop.append('\'').append(component.getMarkupId()).append("String_Node_Str");
        PageableListView<IRecordInternal> table=((WebCellBasedView)component).getTable();
        table.visitChildren(new IVisitor<Component>(){
          public Object component(          Component comp){
            if (comp instanceof IComponent) {
              StringBuilder sb=null;
              if (hasDragEvent && (comp instanceof WebBaseLabel || ((comp instanceof IDisplay) && ((IDisplay)comp).isReadOnly())))               sb=sbAttachDrag;
 else               if (hasDropEvent)               sb=sbAttachDrop;
              if (sb != null) {
                sb.append('\'');
                sb.append(comp.getMarkupId());
                sb.append("String_Node_Str");
              }
            }
            return null;
          }
        }
);
      }
 else {
        StringBuilder sb=null;
        if (hasDragEvent && (component instanceof WebBaseLabel || ((component instanceof IDisplay) && ((IDisplay)component).isReadOnly())))         sb=sbAttachDrag;
 else         if (hasDropEvent)         sb=sbAttachDrop;
        if (sb != null) {
          sb.append('\'');
          sb.append(component.getMarkupId());
          sb.append("String_Node_Str");
        }
      }
    }
    if (sbAttachDrag.length() > 25) {
      sbAttachDrag.setLength(sbAttachDrag.length() - 1);
      sbAttachDrag.append("String_Node_Str");
      sbAttachDrag.append(dragUrl);
      sbAttachDrag.append("String_Node_Str");
      sbAttachDrag.append(bUseProxy);
      sbAttachDrag.append("String_Node_Str");
      sbAttachDrag.append(bXConstraint);
      sbAttachDrag.append("String_Node_Str");
      sbAttachDrag.append(bYConstraint);
      sbAttachDrag.append("String_Node_Str");
      jsCode=sbAttachDrag.toString();
    }
    if (sbAttachDrop.length() > 25) {
      sbAttachDrop.setLength(sbAttachDrop.length() - 1);
      sbAttachDrop.append("String_Node_Str");
      sbAttachDrop.append(dragUrl);
      sbAttachDrop.append("String_Node_Str");
      if (jsCode != null)       jsCode+='\n' + sbAttachDrop.toString();
 else       jsCode=sbAttachDrop.toString();
    }
    if (jsCode != null) {
      if (response == null) {
        jsCode=(new StringBuilder().append("String_Node_Str").append(jsCode).append("String_Node_Str")).toString();
        Response cyleResponse=RequestCycle.get().getResponse();
        cyleResponse.write(jsCode);
      }
 else       response.renderOnDomReadyJavascript(jsCode);
    }
  }
 else {
    jsCode="String_Node_Str" + component.getMarkupId() + "String_Node_Str"+ dragUrl+ "String_Node_Str"+ bUseProxy+ "String_Node_Str"+ bXConstraint+ "String_Node_Str"+ bYConstraint+ "String_Node_Str";
    if (response == null) {
      jsCode=(new StringBuilder().append("String_Node_Str").append(jsCode).append("String_Node_Str")).toString();
      Response cyleResponse=RequestCycle.get().getResponse();
      cyleResponse.write(jsCode);
    }
 else     response.renderOnDomReadyJavascript(jsCode);
  }
}

Fixed version (ground truth):
/** 
 * @param component2
 * @param response
 */
@SuppressWarnings("String_Node_Str") public static void generateDragAttach(Component component,IHeaderResponse response){
  DraggableBehavior draggableBehavior=null;
  Component behaviorComponent=component;
  if ((behaviorComponent instanceof IComponent) && !(behaviorComponent instanceof IDataRenderer)) {
    behaviorComponent=(Component)component.findParent(IDataRenderer.class);
  }
  if (behaviorComponent != null) {
    Iterator<IBehavior> behaviors=behaviorComponent.getBehaviors().iterator();
    Object behavior;
    while (behaviors.hasNext()) {
      behavior=behaviors.next();
      if (behavior instanceof DraggableBehavior) {
        draggableBehavior=(DraggableBehavior)behavior;
        break;
      }
    }
  }
  if (draggableBehavior == null)   return;
  boolean bUseProxy=draggableBehavior.isUseProxy();
  boolean bXConstraint=draggableBehavior.isXConstraint();
  boolean bYConstraint=draggableBehavior.isYConstraint();
  CharSequence dragUrl=draggableBehavior.getCallbackUrl();
  String jsCode=null;
  if (behaviorComponent instanceof IDataRenderer) {
    final StringBuilder sbAttachDrag=new StringBuilder(100);
    sbAttachDrag.append("String_Node_Str");
    final StringBuilder sbAttachDrop=new StringBuilder(100);
    sbAttachDrop.append("String_Node_Str");
    if (behaviorComponent instanceof WebDataRenderer) {
      boolean hasDragEvent=((WebDataRenderer)behaviorComponent).getDragNDropController().getForm().getOnDragMethodID() > 0;
      boolean hasDropEvent=((WebDataRenderer)behaviorComponent).getDragNDropController().getForm().getOnDropMethodID() > 0;
      if (component instanceof WebDataRenderer) {
        if (hasDragEvent)         sbAttachDrag.append('\'').append(component.getMarkupId()).append("String_Node_Str");
        if (hasDropEvent)         sbAttachDrop.append('\'').append(component.getMarkupId()).append("String_Node_Str");
        Iterator<? extends Component> dataRendererIte=((WebDataRenderer)component).iterator();
        Object dataRendererChild;
        while (dataRendererIte.hasNext()) {
          dataRendererChild=dataRendererIte.next();
          if (dataRendererChild instanceof WrapperContainer)           dataRendererChild=((WrapperContainer)dataRendererChild).getDelegate();
          if (dataRendererChild instanceof IComponent) {
            StringBuilder sb=null;
            if (hasDragEvent && (dataRendererChild instanceof WebBaseLabel || dataRendererChild instanceof WebSplitPane || ((dataRendererChild instanceof IDisplay) && ((IDisplay)dataRendererChild).isReadOnly())))             sb=sbAttachDrag;
 else             if (hasDropEvent)             sb=sbAttachDrop;
            if (sb != null) {
              sb.append('\'');
              sb.append(((Component)dataRendererChild).getMarkupId());
              sb.append("String_Node_Str");
            }
          }
        }
      }
 else {
        StringBuilder sb=null;
        if (hasDragEvent && (component instanceof WebBaseLabel || ((component instanceof IDisplay) && ((IDisplay)component).isReadOnly())))         sb=sbAttachDrag;
 else         if (hasDropEvent)         sb=sbAttachDrop;
        if (sb != null) {
          sb.append('\'');
          sb.append(component.getMarkupId());
          sb.append("String_Node_Str");
        }
      }
    }
 else {
      final boolean hasDragEvent=((WebCellBasedView)behaviorComponent).getDragNDropController().getForm().getOnDragMethodID() > 0;
      final boolean hasDropEvent=((WebCellBasedView)behaviorComponent).getDragNDropController().getForm().getOnDropMethodID() > 0;
      if (component instanceof WebCellBasedView) {
        if (hasDragEvent)         sbAttachDrag.append('\'').append(component.getMarkupId()).append("String_Node_Str");
        if (hasDropEvent)         sbAttachDrop.append('\'').append(component.getMarkupId()).append("String_Node_Str");
        PageableListView<IRecordInternal> table=((WebCellBasedView)component).getTable();
        table.visitChildren(new IVisitor<Component>(){
          public Object component(          Component comp){
            if (comp instanceof IComponent) {
              StringBuilder sb=null;
              if (hasDragEvent && (comp instanceof WebBaseLabel || ((comp instanceof IDisplay) && ((IDisplay)comp).isReadOnly())))               sb=sbAttachDrag;
 else               if (hasDropEvent)               sb=sbAttachDrop;
              if (sb != null) {
                sb.append('\'');
                sb.append(comp.getMarkupId());
                sb.append("String_Node_Str");
              }
            }
            return null;
          }
        }
);
      }
 else {
        StringBuilder sb=null;
        if (hasDragEvent && (component instanceof WebBaseLabel || ((component instanceof IDisplay) && ((IDisplay)component).isReadOnly())))         sb=sbAttachDrag;
 else         if (hasDropEvent)         sb=sbAttachDrop;
        if (sb != null) {
          sb.append('\'');
          sb.append(component.getMarkupId());
          sb.append("String_Node_Str");
        }
      }
    }
    if (sbAttachDrag.length() > 25) {
      sbAttachDrag.setLength(sbAttachDrag.length() - 1);
      sbAttachDrag.append("String_Node_Str");
      sbAttachDrag.append(dragUrl);
      sbAttachDrag.append("String_Node_Str");
      sbAttachDrag.append(bUseProxy);
      sbAttachDrag.append("String_Node_Str");
      sbAttachDrag.append(bXConstraint);
      sbAttachDrag.append("String_Node_Str");
      sbAttachDrag.append(bYConstraint);
      sbAttachDrag.append("String_Node_Str");
      jsCode=sbAttachDrag.toString();
    }
    if (sbAttachDrop.length() > 25) {
      sbAttachDrop.setLength(sbAttachDrop.length() - 1);
      sbAttachDrop.append("String_Node_Str");
      sbAttachDrop.append(dragUrl);
      sbAttachDrop.append("String_Node_Str");
      if (jsCode != null)       jsCode+='\n' + sbAttachDrop.toString();
 else       jsCode=sbAttachDrop.toString();
    }
    if (jsCode != null) {
      if (response == null) {
        jsCode=(new StringBuilder().append("String_Node_Str").append(jsCode).append("String_Node_Str")).toString();
        Response cyleResponse=RequestCycle.get().getResponse();
        cyleResponse.write(jsCode);
      }
 else       response.renderOnDomReadyJavascript(jsCode);
    }
  }
 else {
    jsCode="String_Node_Str" + component.getMarkupId() + "String_Node_Str"+ dragUrl+ "String_Node_Str"+ bUseProxy+ "String_Node_Str"+ bXConstraint+ "String_Node_Str"+ bYConstraint+ "String_Node_Str";
    if (response == null) {
      jsCode=(new StringBuilder().append("String_Node_Str").append(jsCode).append("String_Node_Str")).toString();
      Response cyleResponse=RequestCycle.get().getResponse();
      cyleResponse.write(jsCode);
    }
 else     response.renderOnDomReadyJavascript(jsCode);
  }
}