Program: 143770
Project: 143770
Buggy source:
@SuppressWarnings("String_Node_Str") private void init(WebClient sc){
  setStatelessHint(false);
  client=sc;
  webForms=new ArrayList<IFormUIInternal<?>>();
  title=new Label("String_Node_Str",new Model<String>("String_Node_Str"));
  add(title);
  useAJAX=Utils.getAsBoolean(client.getRuntimeProperties().get("String_Node_Str"));
  int dataNotifyFrequency=Utils.getAsInteger(sc.getSettings().getProperty("String_Node_Str","String_Node_Str"));
  if (dataNotifyFrequency > 0 && useAJAX) {
    add(new AbstractAjaxTimerBehavior(Duration.seconds(dataNotifyFrequency)){
      private static final long serialVersionUID=1L;
      /** 
 * @see wicket.ajax.AbstractAjaxTimerBehavior#onTimer(wicket.ajax.AjaxRequestTarget)
 */
      @Override protected void onTimer(      AjaxRequestTarget target){
        WebEventExecutor.generateResponse(target,MainPage.this);
      }
      @Override public void renderHead(      IHeaderResponse response){
        super.renderHead(response);
        String jsTimerScript=getJsTimeoutCall(getUpdateInterval());
        response.renderJavascript("String_Node_Str" + jsTimerScript + "String_Node_Str","String_Node_Str");
      }
      @Override protected CharSequence getPreconditionScript(){
        return "String_Node_Str";
      }
      /** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getFailureScript()
 */
      @Override protected CharSequence getFailureScript(){
        return "String_Node_Str";
      }
      @Override protected CharSequence getCallbackScript(){
        return generateCallbackScript("String_Node_Str" + getCallbackUrl(onlyTargetActivePage()) + "String_Node_Str");
      }
      /** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#findIndicatorId()
 */
      @Override protected String findIndicatorId(){
        return null;
      }
      /** 
 * @see org.apache.wicket.behavior.AbstractBehavior#isEnabled(org.apache.wicket.Component)
 */
      @Override public boolean isEnabled(      Component component){
        return !client.getFlattenedSolution().isInDesign(null) && getController() != null && getController().isFormVisible();
      }
    }
);
    add(new TriggerResizeAjaxBehavior(){
      @Override public void renderHead(      IHeaderResponse response){
        super.renderHead(response);
        String jsCall="String_Node_Str" + getCallbackUrl() + "String_Node_Str";
        response.renderOnLoadJavascript(jsCall);
      }
      @Override public boolean isEnabled(      Component component){
        if (super.isEnabled(component)) {
          final boolean[] returnValue={false};
          MainPage page=(MainPage)findPage();
          if (page != null) {
            page.visitChildren(WebForm.class,new Component.IVisitor<WebForm>(){
              public Object component(              WebForm form){
                if (form.getFormWidth() == 0) {
                  returnValue[0]=true;
                  return IVisitor.STOP_TRAVERSAL;
                }
                return IVisitor.CONTINUE_TRAVERSAL;
              }
            }
);
          }
          return returnValue[0];
        }
        return false;
      }
    }
);
  }
  add(new AbstractServoyDefaultAjaxBehavior(){
    @Override protected void respond(    AjaxRequestTarget target){
      for (      ServoyDivDialog divDialog : divDialogs.values()) {
        if (!divDialog.isShown()) {
          divDialog.show(target);
        }
      }
      WebEventExecutor.generateResponse(target,MainPage.this);
    }
    @Override public void renderHead(    IHeaderResponse response){
      super.renderHead(response);
      response.renderOnDomReadyJavascript(getCallbackScript(true).toString());
    }
    @Override public boolean isEnabled(    Component component){
      return divDialogs.size() > 0 && super.isEnabled(component);
    }
  }
);
  body=new WebMarkupContainer("String_Node_Str"){
    private static final long serialVersionUID=1L;
    /** 
 * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
 */
    @Override protected void onComponentTag(    ComponentTag tag){
      super.onComponentTag(tag);
      tag.putAll(bodyAttributes);
    }
  }
;
  body.add(new AttributeModifier("String_Node_Str",true,new AbstractReadOnlyModel<String>(){
    @Override public String getObject(){
      String value=AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
      Locale l=client.getLocale();
      Solution solution=client.getSolution();
      if (solution != null && l != null) {
        value=OrientationApplier.getHTMLContainerOrientation(l,solution.getTextOrientation());
      }
      return value;
    }
  }
));
  add(body);
  pageContributor=new PageContributor(client,"String_Node_Str");
  body.add(pageContributor);
  Label loadingIndicator=new Label("String_Node_Str",sc.getI18NMessage("String_Node_Str"));
  loadingIndicator.add(new SimpleAttributeModifier("String_Node_Str","String_Node_Str"));
  body.add(loadingIndicator);
  divDialogsParent=new WebMarkupContainer(DIV_DIALOGS_REPEATER_PARENT_ID);
  divDialogsParent.setOutputMarkupPlaceholderTag(true);
  divDialogsParent.setVisible(false);
  body.add(divDialogsParent);
  if (useAJAX) {
    add(new TriggerUpdateAjaxBehavior());
    divDialogRepeater=new RepeatingView(DIV_DIALOG_REPEATER_ID);
    divDialogsParent.add(divDialogRepeater);
    fileUploadWindow=new ServoyDivDialog(FILE_UPLOAD_DIALOG_ID,isShowingInDialog());
    body.add(fileUploadWindow);
    fileUploadWindow.setModal(true);
    fileUploadWindow.setPageMapName(null);
    fileUploadWindow.setCookieName("String_Node_Str");
    fileUploadWindow.setResizable(true);
    fileUploadWindow.setInitialHeight(150);
    fileUploadWindow.setInitialWidth(400);
    fileUploadWindow.setMinimalHeight(130);
    fileUploadWindow.setMinimalWidth(400);
    fileUploadWindow.setUseInitialHeight(true);
    fileUploadWindow.setPageCreator(new ModalWindow.PageCreator(){
      private static final long serialVersionUID=1L;
      public Page createPage(){
        return new MediaUploadPage(PageMap.forName(FILE_UPLOAD_PAGEMAP),mediaUploadCallback,mediaUploadMultiSelect);
      }
    }
);
    fileUploadWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){
      private static final long serialVersionUID=1L;
      public void onClose(      AjaxRequestTarget target){
        fileUploadWindow.setPageMapName(null);
        fileUploadWindow.remove(fileUploadWindow.getContentId());
        WebEventExecutor.generateResponse(target,findPage());
      }
    }
);
  }
 else {
    divDialogsParent.add(new Label("String_Node_Str"));
    body.add(new Label("String_Node_Str"));
  }
  IModel<String> styleHrefModel=new AbstractReadOnlyModel<String>(){
    private static final long serialVersionUID=1L;
    @Override public String getObject(){
      if (main != null) {
        return "String_Node_Str" + client.getUIProperty(WEBCONSTANTS.WEBCLIENT_TEMPLATES_DIR) + "String_Node_Str";
      }
      return null;
    }
  }
;
  Label main_form_style=new Label("String_Node_Str");
  main_form_style.add(new AttributeModifier("String_Node_Str",true,styleHrefModel));
  add(main_form_style);
  IModel<List<IFormUIInternal<?>>> loopModel=new AbstractReadOnlyModel<List<IFormUIInternal<?>>>(){
    private static final long serialVersionUID=1L;
    @Override public List<IFormUIInternal<?>> getObject(){
      return webForms;
    }
  }
;
  listview=new ListView<IFormUIInternal<?>>("String_Node_Str",loopModel){
    private static final long serialVersionUID=1L;
    @Override protected void populateItem(    ListItem<IFormUIInternal<?>> item){
      final WebForm form=(WebForm)item.getModelObject();
      if (form.getParent() != null) {
        form.remove();
      }
      item.add(form);
      IFormLayoutProvider layoutProvider=FormLayoutProviderFactory.getFormLayoutProvider(client,client.getSolution(),form.getController().getForm(),form.getController().getName());
      TextualStyle styleToReturn=null;
      if ((navigator != null) && (form == navigator.getFormUI())) {
        styleToReturn=layoutProvider.getLayoutForForm(navigator.getForm().getSize().width,true,false);
      }
 else       if (form == main) {
        int customNavWidth=0;
        if (navigator != null)         customNavWidth=navigator.getForm().getSize().width;
        styleToReturn=layoutProvider.getLayoutForForm(customNavWidth,false,false);
      }
      if (styleToReturn != null) {
        form.add(new StyleAppendingModifier(styleToReturn){
          @Override public boolean isEnabled(          Component component){
            return (component.findParent(WebTabPanel.class) == null) && (component.findParent(WebSplitPane.class) == null);
          }
        }
);
      }
      TabIndexHelper.setUpTabIndexAttributeModifier(item,ISupportWebTabSeq.SKIP);
    }
    /** 
 * @see org.apache.wicket.markup.html.list.ListView#onBeforeRender()
 */
    @Override protected void onBeforeRender(){
      super.onBeforeRender();
      visitChildren(WebTabPanel.class,new IVisitor<WebTabPanel>(){
        public Object component(        WebTabPanel wtp){
          wtp.initalizeFirstTab();
          return IVisitor.CONTINUE_TRAVERSAL;
        }
      }
);
      addWebAnchoringInfoIfNeeded(false);
      if (useAJAX)       pageContributor.addFocusEventListeners(MainPage.this);
    }
  }
;
  listview.setReuseItems(true);
  Form form=new ServoyForm("String_Node_Str");
  form.add(new SimpleAttributeModifier("String_Node_Str","String_Node_Str"));
  form.add(listview);
  WebMarkupContainer defaultButton=new WebMarkupContainer("String_Node_Str",new Model());
  defaultButton.setVisible(!useAJAX);
  form.add(defaultButton);
  body.add(form);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void init(WebClient sc){
  setStatelessHint(false);
  client=sc;
  webForms=new ArrayList<IFormUIInternal<?>>();
  title=new Label("String_Node_Str",new Model<String>("String_Node_Str"));
  add(title);
  useAJAX=Utils.getAsBoolean(client.getRuntimeProperties().get("String_Node_Str"));
  int dataNotifyFrequency=Utils.getAsInteger(sc.getSettings().getProperty("String_Node_Str","String_Node_Str"));
  if (dataNotifyFrequency > 0 && useAJAX) {
    add(new AbstractAjaxTimerBehavior(Duration.seconds(dataNotifyFrequency)){
      private static final long serialVersionUID=1L;
      /** 
 * @see wicket.ajax.AbstractAjaxTimerBehavior#onTimer(wicket.ajax.AjaxRequestTarget)
 */
      @Override protected void onTimer(      AjaxRequestTarget target){
        WebEventExecutor.generateResponse(target,MainPage.this);
      }
      @Override public void renderHead(      IHeaderResponse response){
        super.renderHead(response);
        String jsTimerScript=getJsTimeoutCall(getUpdateInterval());
        response.renderJavascript("String_Node_Str" + jsTimerScript + "String_Node_Str","String_Node_Str");
      }
      @Override protected CharSequence getPreconditionScript(){
        return "String_Node_Str";
      }
      /** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getFailureScript()
 */
      @Override protected CharSequence getFailureScript(){
        return "String_Node_Str";
      }
      @Override protected CharSequence getCallbackScript(){
        return generateCallbackScript("String_Node_Str" + getCallbackUrl(onlyTargetActivePage()) + "String_Node_Str");
      }
      /** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#findIndicatorId()
 */
      @Override protected String findIndicatorId(){
        return null;
      }
      /** 
 * @see org.apache.wicket.behavior.AbstractBehavior#isEnabled(org.apache.wicket.Component)
 */
      @Override public boolean isEnabled(      Component component){
        return !client.getFlattenedSolution().isInDesign(null) && getController() != null && getController().isFormVisible();
      }
    }
);
    add(new TriggerResizeAjaxBehavior(){
      @Override public void renderHead(      IHeaderResponse response){
        super.renderHead(response);
        if (isFormWidthZero()) {
          String jsCall="String_Node_Str" + getCallbackUrl() + "String_Node_Str";
          response.renderOnLoadJavascript(jsCall);
        }
      }
      private boolean isFormWidthZero(){
        final boolean[] returnValue={false};
        MainPage page=(MainPage)findPage();
        if (page != null) {
          page.visitChildren(WebForm.class,new Component.IVisitor<WebForm>(){
            public Object component(            WebForm form){
              if (form.getFormWidth() == 0) {
                returnValue[0]=true;
                return IVisitor.STOP_TRAVERSAL;
              }
              return IVisitor.CONTINUE_TRAVERSAL;
            }
          }
);
        }
        return returnValue[0];
      }
    }
);
  }
  add(new AbstractServoyDefaultAjaxBehavior(){
    @Override protected void respond(    AjaxRequestTarget target){
      for (      ServoyDivDialog divDialog : divDialogs.values()) {
        if (!divDialog.isShown()) {
          divDialog.show(target);
        }
      }
      WebEventExecutor.generateResponse(target,MainPage.this);
    }
    @Override public void renderHead(    IHeaderResponse response){
      super.renderHead(response);
      response.renderOnDomReadyJavascript(getCallbackScript(true).toString());
    }
    @Override public boolean isEnabled(    Component component){
      return divDialogs.size() > 0 && super.isEnabled(component);
    }
  }
);
  body=new WebMarkupContainer("String_Node_Str"){
    private static final long serialVersionUID=1L;
    /** 
 * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
 */
    @Override protected void onComponentTag(    ComponentTag tag){
      super.onComponentTag(tag);
      tag.putAll(bodyAttributes);
    }
  }
;
  body.add(new AttributeModifier("String_Node_Str",true,new AbstractReadOnlyModel<String>(){
    @Override public String getObject(){
      String value=AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
      Locale l=client.getLocale();
      Solution solution=client.getSolution();
      if (solution != null && l != null) {
        value=OrientationApplier.getHTMLContainerOrientation(l,solution.getTextOrientation());
      }
      return value;
    }
  }
));
  add(body);
  pageContributor=new PageContributor(client,"String_Node_Str");
  body.add(pageContributor);
  Label loadingIndicator=new Label("String_Node_Str",sc.getI18NMessage("String_Node_Str"));
  loadingIndicator.add(new SimpleAttributeModifier("String_Node_Str","String_Node_Str"));
  body.add(loadingIndicator);
  divDialogsParent=new WebMarkupContainer(DIV_DIALOGS_REPEATER_PARENT_ID);
  divDialogsParent.setOutputMarkupPlaceholderTag(true);
  divDialogsParent.setVisible(false);
  body.add(divDialogsParent);
  if (useAJAX) {
    add(new TriggerUpdateAjaxBehavior());
    divDialogRepeater=new RepeatingView(DIV_DIALOG_REPEATER_ID);
    divDialogsParent.add(divDialogRepeater);
    fileUploadWindow=new ServoyDivDialog(FILE_UPLOAD_DIALOG_ID,isShowingInDialog());
    body.add(fileUploadWindow);
    fileUploadWindow.setModal(true);
    fileUploadWindow.setPageMapName(null);
    fileUploadWindow.setCookieName("String_Node_Str");
    fileUploadWindow.setResizable(true);
    fileUploadWindow.setInitialHeight(150);
    fileUploadWindow.setInitialWidth(400);
    fileUploadWindow.setMinimalHeight(130);
    fileUploadWindow.setMinimalWidth(400);
    fileUploadWindow.setUseInitialHeight(true);
    fileUploadWindow.setPageCreator(new ModalWindow.PageCreator(){
      private static final long serialVersionUID=1L;
      public Page createPage(){
        return new MediaUploadPage(PageMap.forName(FILE_UPLOAD_PAGEMAP),mediaUploadCallback,mediaUploadMultiSelect);
      }
    }
);
    fileUploadWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){
      private static final long serialVersionUID=1L;
      public void onClose(      AjaxRequestTarget target){
        fileUploadWindow.setPageMapName(null);
        fileUploadWindow.remove(fileUploadWindow.getContentId());
        WebEventExecutor.generateResponse(target,findPage());
      }
    }
);
  }
 else {
    divDialogsParent.add(new Label("String_Node_Str"));
    body.add(new Label("String_Node_Str"));
  }
  IModel<String> styleHrefModel=new AbstractReadOnlyModel<String>(){
    private static final long serialVersionUID=1L;
    @Override public String getObject(){
      if (main != null) {
        return "String_Node_Str" + client.getUIProperty(WEBCONSTANTS.WEBCLIENT_TEMPLATES_DIR) + "String_Node_Str";
      }
      return null;
    }
  }
;
  Label main_form_style=new Label("String_Node_Str");
  main_form_style.add(new AttributeModifier("String_Node_Str",true,styleHrefModel));
  add(main_form_style);
  IModel<List<IFormUIInternal<?>>> loopModel=new AbstractReadOnlyModel<List<IFormUIInternal<?>>>(){
    private static final long serialVersionUID=1L;
    @Override public List<IFormUIInternal<?>> getObject(){
      return webForms;
    }
  }
;
  listview=new ListView<IFormUIInternal<?>>("String_Node_Str",loopModel){
    private static final long serialVersionUID=1L;
    @Override protected void populateItem(    ListItem<IFormUIInternal<?>> item){
      final WebForm form=(WebForm)item.getModelObject();
      if (form.getParent() != null) {
        form.remove();
      }
      item.add(form);
      IFormLayoutProvider layoutProvider=FormLayoutProviderFactory.getFormLayoutProvider(client,client.getSolution(),form.getController().getForm(),form.getController().getName());
      TextualStyle styleToReturn=null;
      if ((navigator != null) && (form == navigator.getFormUI())) {
        styleToReturn=layoutProvider.getLayoutForForm(navigator.getForm().getSize().width,true,false);
      }
 else       if (form == main) {
        int customNavWidth=0;
        if (navigator != null)         customNavWidth=navigator.getForm().getSize().width;
        styleToReturn=layoutProvider.getLayoutForForm(customNavWidth,false,false);
      }
      if (styleToReturn != null) {
        form.add(new StyleAppendingModifier(styleToReturn){
          @Override public boolean isEnabled(          Component component){
            return (component.findParent(WebTabPanel.class) == null) && (component.findParent(WebSplitPane.class) == null);
          }
        }
);
      }
      TabIndexHelper.setUpTabIndexAttributeModifier(item,ISupportWebTabSeq.SKIP);
    }
    /** 
 * @see org.apache.wicket.markup.html.list.ListView#onBeforeRender()
 */
    @Override protected void onBeforeRender(){
      super.onBeforeRender();
      visitChildren(WebTabPanel.class,new IVisitor<WebTabPanel>(){
        public Object component(        WebTabPanel wtp){
          wtp.initalizeFirstTab();
          return IVisitor.CONTINUE_TRAVERSAL;
        }
      }
);
      addWebAnchoringInfoIfNeeded(false);
      if (useAJAX)       pageContributor.addFocusEventListeners(MainPage.this);
    }
  }
;
  listview.setReuseItems(true);
  Form form=new ServoyForm("String_Node_Str");
  form.add(new SimpleAttributeModifier("String_Node_Str","String_Node_Str"));
  form.add(listview);
  WebMarkupContainer defaultButton=new WebMarkupContainer("String_Node_Str",new Model());
  defaultButton.setVisible(!useAJAX);
  form.add(defaultButton);
  body.add(form);
}