Program: 143624
Project: 143624
Buggy source:
private void init(){
  add(new HeaderContributor(new IHeaderContributor(){
    private static final long serialVersionUID=1L;
    public void renderHead(    IHeaderResponse response){
      response.renderCSSReference(new CompressedResourceReference(WebDataLookupField.class,"String_Node_Str"));
    }
  }
){
    @Override public boolean isEnabled(    Component component){
      return !getScriptObject().isReadOnly() && getScriptObject().isEnabled();
    }
  }
);
  setOutputMarkupPlaceholderTag(true);
  AutoCompleteSettings behSettings=new AutoCompleteSettings();
  behSettings.setMaxHeightInPx(200);
  behSettings.setPreselect(true);
  behSettings.setShowCompleteListOnFocusGain(true);
  behSettings.setAdjustInputWidth(false);
  ClientProperties clp=(application.getApplicationType() != IApplication.HEADLESS_CLIENT ? ((WebClientInfo)Session.get().getClientInfo()).getProperties() : null);
  if (clp != null && (!clp.isBrowserInternetExplorer() || clp.getBrowserVersionMajor() >= 8)) {
    behSettings.setUseSmartPositioning(true);
    behSettings.setUseHideShowCoveredIEFix(false);
  }
 else {
    behSettings.setUseSmartPositioning(false);
    behSettings.setUseHideShowCoveredIEFix(true);
  }
  behSettings.setThrottleDelay(500);
  IAutoCompleteRenderer<Object> renderer=new IAutoCompleteRenderer<Object>(){
    protected String getTextValue(    Object object){
      String str=(object == null ? "String_Node_Str" : object.toString());
      if (str.trim().equals("String_Node_Str"))       str="String_Node_Str";
      return str;
    }
    protected void renderChoice(    Object object,    Response response,    String criteria){
      if (IValueList.SEPARATOR_DESIGN_VALUE.equals(object))       return;
      String renderedObject=(object == null) ? "String_Node_Str" : object.toString();
      if (!HtmlUtils.hasHtmlTag(renderedObject))       renderedObject=HtmlUtils.escapeMarkup(renderedObject,true,false).toString();
      response.write(getTextValue(object));
    }
    public void render(    Object object,    Response response,    String criteria){
      String textValue=getTextValue(object);
      if (textValue == null) {
        throw new IllegalStateException("String_Node_Str" + object.toString());
      }
      textValue=textValue.replaceAll("String_Node_Str","String_Node_Str");
      response.write("String_Node_Str" + textValue + "String_Node_Str");
      response.write("String_Node_Str");
      renderChoice(object,response,criteria);
      response.write("String_Node_Str");
    }
    @SuppressWarnings("String_Node_Str") public void renderHeader(    Response response){
      StringBuffer listStyle=new StringBuffer();
      listStyle.append("String_Node_Str");
      String fFamily="String_Node_Str";
      String bgColor="String_Node_Str";
      String fgColor="String_Node_Str";
      String fSize="String_Node_Str";
      String padding="String_Node_Str";
      String margin="String_Node_Str";
      if (getFont() != null) {
        Font f=getFont();
        if (f != null) {
          if (f.getFamily() != null) {
            fFamily=f.getFamily();
            if (fFamily.contains("String_Node_Str"))             fFamily="String_Node_Str" + fFamily + "String_Node_Str";
          }
          if (f.getName() != null) {
            String fName=f.getName();
            if (fName.contains("String_Node_Str"))             fName="String_Node_Str" + fName + "String_Node_Str";
            fFamily=fName + "String_Node_Str" + fFamily;
          }
          if (f.isBold())           listStyle.append("String_Node_Str");
          if (f.isItalic())           listStyle.append("String_Node_Str");
          fSize=Integer.toString(f.getSize()) + "String_Node_Str";
        }
      }
      if (getBackground() != null) {
        bgColor=Integer.toHexString(getBackground().getRGB());
        bgColor="String_Node_Str" + bgColor.substring(2,bgColor.length());
      }
      if (getForeground() != null) {
        fgColor=Integer.toHexString(getForeground().getRGB());
        fgColor="String_Node_Str" + fgColor.substring(2,fgColor.length());
      }
      Insets _padding=getPadding();
      if (getPadding() != null)       padding="String_Node_Str" + _padding.top + "String_Node_Str"+ _padding.right+ "String_Node_Str"+ _padding.bottom+ "String_Node_Str"+ _padding.left+ "String_Node_Str";
      Insets _margin=getMargin();
      if (_margin != null)       margin="String_Node_Str" + _margin.top + "String_Node_Str"+ _margin.right+ "String_Node_Str"+ _margin.bottom+ "String_Node_Str"+ _margin.left+ "String_Node_Str";
      listStyle.append("String_Node_Str" + fFamily + "String_Node_Str");
      listStyle.append("String_Node_Str" + bgColor + "String_Node_Str");
      listStyle.append("String_Node_Str" + fgColor + "String_Node_Str");
      listStyle.append("String_Node_Str" + fSize + "String_Node_Str");
      listStyle.append("String_Node_Str" + (getSize().width - 6) + "String_Node_Str");
      listStyle.append("String_Node_Str" + margin + "String_Node_Str");
      listStyle.append("String_Node_Str" + padding + "String_Node_Str");
      listStyle.append("String_Node_Str" + TemplateGenerator.getHorizontalAlignValue(getHorizontalAlignment()));
      listStyle.append("String_Node_Str");
      response.write("String_Node_Str" + listStyle + "String_Node_Str");
    }
    public void renderFooter(    Response response){
      response.write("String_Node_Str");
    }
  }
;
  AutoCompleteBehavior<Object> beh=new AutoCompleteBehavior<Object>(renderer,behSettings){
    private static final long serialVersionUID=1L;
    /** 
 * @see org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteBehavior#getChoices(java.lang.String)
 */
    @Override protected Iterator<Object> getChoices(    String input){
      try {
        dlm.fill(parentState,getDataProviderID(),input,false);
        return dlm.iterator();
      }
 catch (      Exception ex) {
        Debug.error(ex);
      }
      return Collections.emptyList().iterator();
    }
    /** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getFailureScript()
 */
    @Override protected CharSequence getFailureScript(){
      return "String_Node_Str";
    }
    /** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getPreconditionScript()
 */
    @Override protected CharSequence getPreconditionScript(){
      return "String_Node_Str" + super.getPreconditionScript();
    }
    @Override public void renderHead(    IHeaderResponse response){
      settings.setShowListOnEmptyInput(Boolean.TRUE.equals(UIUtils.getUIProperty(getScriptObject(),application,IApplication.TYPE_AHEAD_SHOW_POPUP_WHEN_EMPTY,Boolean.TRUE)));
      settings.setShowListOnFocusGain(Boolean.TRUE.equals(UIUtils.getUIProperty(getScriptObject(),application,IApplication.TYPE_AHEAD_SHOW_POPUP_ON_FOCUS_GAIN,Boolean.TRUE)));
      if (!getScriptObject().isReadOnly() && getScriptObject().isEnabled()) {
        super.renderHead(response);
        response.renderJavascript("String_Node_Str","String_Node_Str");
      }
    }
    /** 
 * @see org.apache.wicket.behavior.AbstractBehavior#isEnabled(org.apache.wicket.Component)
 */
    @Override public boolean isEnabled(    Component component){
      IFormUIInternal<?> formui=findParent(IFormUIInternal.class);
      if (formui != null && formui.isDesignMode()) {
        return false;
      }
      return super.isEnabled(component) && WebClientSession.get().useAjax();
    }
  }
;
  add(beh);
}

Fixed version (ground truth):
private void init(){
  add(new HeaderContributor(new IHeaderContributor(){
    private static final long serialVersionUID=1L;
    public void renderHead(    IHeaderResponse response){
      response.renderCSSReference(new CompressedResourceReference(WebDataLookupField.class,"String_Node_Str"));
    }
  }
){
    @Override public boolean isEnabled(    Component component){
      return !getScriptObject().isReadOnly() && getScriptObject().isEnabled();
    }
  }
);
  setOutputMarkupPlaceholderTag(true);
  AutoCompleteSettings behSettings=new AutoCompleteSettings();
  behSettings.setMaxHeightInPx(200);
  behSettings.setPreselect(true);
  behSettings.setShowCompleteListOnFocusGain(true);
  behSettings.setAdjustInputWidth(false);
  ClientProperties clp=(application.getApplicationType() != IApplication.HEADLESS_CLIENT ? ((WebClientInfo)Session.get().getClientInfo()).getProperties() : null);
  if (clp != null && (!clp.isBrowserInternetExplorer() || clp.getBrowserVersionMajor() >= 8)) {
    behSettings.setUseSmartPositioning(true);
    behSettings.setUseHideShowCoveredIEFix(false);
  }
 else {
    behSettings.setUseSmartPositioning(false);
    behSettings.setUseHideShowCoveredIEFix(true);
  }
  behSettings.setThrottleDelay(500);
  IAutoCompleteRenderer<Object> renderer=new IAutoCompleteRenderer<Object>(){
    protected String getTextValue(    Object object){
      String str=(object == null ? "String_Node_Str" : object.toString());
      if (str.trim().equals("String_Node_Str"))       str="String_Node_Str";
      return str;
    }
    protected void renderChoice(    Object object,    Response response,    String criteria){
      if (IValueList.SEPARATOR_DESIGN_VALUE.equals(object))       return;
      String renderedObject=(object == null) ? "String_Node_Str" : object.toString();
      if (!HtmlUtils.hasHtmlTag(renderedObject))       renderedObject=HtmlUtils.escapeMarkup(renderedObject,true,false).toString();
      response.write(getTextValue(object));
    }
    public void render(    Object object,    Response response,    String criteria){
      String textValue=getTextValue(object);
      if (textValue == null) {
        throw new IllegalStateException("String_Node_Str" + object.toString());
      }
      textValue=textValue.replaceAll("String_Node_Str","String_Node_Str");
      response.write("String_Node_Str" + textValue + "String_Node_Str");
      response.write("String_Node_Str");
      renderChoice(object,response,criteria);
      response.write("String_Node_Str");
    }
    @SuppressWarnings("String_Node_Str") public void renderHeader(    Response response){
      StringBuffer listStyle=new StringBuffer();
      listStyle.append("String_Node_Str");
      String fFamily="String_Node_Str";
      String bgColor="String_Node_Str";
      String fgColor="String_Node_Str";
      String fSize="String_Node_Str";
      String padding="String_Node_Str";
      String margin="String_Node_Str";
      if (getFont() != null) {
        Font f=getFont();
        if (f != null) {
          if (f.getFamily() != null) {
            fFamily=f.getFamily();
            if (fFamily.contains("String_Node_Str"))             fFamily="String_Node_Str" + fFamily + "String_Node_Str";
          }
          if (f.getName() != null) {
            String fName=f.getName();
            if (fName.contains("String_Node_Str"))             fName="String_Node_Str" + fName + "String_Node_Str";
            fFamily=fName + "String_Node_Str" + fFamily;
          }
          if (f.isBold())           listStyle.append("String_Node_Str");
          if (f.isItalic())           listStyle.append("String_Node_Str");
          fSize=Integer.toString(f.getSize()) + "String_Node_Str";
        }
      }
      if (getBackground() != null) {
        bgColor=getWebColor(getBackground().getRGB());
      }
      if (getForeground() != null) {
        fgColor=getWebColor(getForeground().getRGB());
      }
      Insets _padding=getPadding();
      if (getPadding() != null)       padding="String_Node_Str" + _padding.top + "String_Node_Str"+ _padding.right+ "String_Node_Str"+ _padding.bottom+ "String_Node_Str"+ _padding.left+ "String_Node_Str";
      Insets _margin=getMargin();
      if (_margin != null)       margin="String_Node_Str" + _margin.top + "String_Node_Str"+ _margin.right+ "String_Node_Str"+ _margin.bottom+ "String_Node_Str"+ _margin.left+ "String_Node_Str";
      listStyle.append("String_Node_Str" + fFamily + "String_Node_Str");
      listStyle.append("String_Node_Str" + bgColor + "String_Node_Str");
      listStyle.append("String_Node_Str" + fgColor + "String_Node_Str");
      listStyle.append("String_Node_Str" + fSize + "String_Node_Str");
      listStyle.append("String_Node_Str" + (getSize().width - 6) + "String_Node_Str");
      listStyle.append("String_Node_Str" + margin + "String_Node_Str");
      listStyle.append("String_Node_Str" + padding + "String_Node_Str");
      listStyle.append("String_Node_Str" + TemplateGenerator.getHorizontalAlignValue(getHorizontalAlignment()));
      listStyle.append("String_Node_Str");
      response.write("String_Node_Str" + listStyle + "String_Node_Str");
    }
    public void renderFooter(    Response response){
      response.write("String_Node_Str");
    }
    private String getWebColor(    int color){
      String webColor=Integer.toHexString(color);
      int startIdx=webColor.length() - 6;
      if (startIdx < 0)       startIdx=0;
      webColor=webColor.substring(startIdx);
      StringBuilder sb=new StringBuilder();
      sb.append('#');
      int nrMissing0=6 - webColor.length();
      for (int i=0; i < nrMissing0; i++) {
        sb.append('0');
      }
      sb.append(webColor);
      return sb.toString();
    }
  }
;
  AutoCompleteBehavior<Object> beh=new AutoCompleteBehavior<Object>(renderer,behSettings){
    private static final long serialVersionUID=1L;
    /** 
 * @see org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteBehavior#getChoices(java.lang.String)
 */
    @Override protected Iterator<Object> getChoices(    String input){
      try {
        dlm.fill(parentState,getDataProviderID(),input,false);
        return dlm.iterator();
      }
 catch (      Exception ex) {
        Debug.error(ex);
      }
      return Collections.emptyList().iterator();
    }
    /** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getFailureScript()
 */
    @Override protected CharSequence getFailureScript(){
      return "String_Node_Str";
    }
    /** 
 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getPreconditionScript()
 */
    @Override protected CharSequence getPreconditionScript(){
      return "String_Node_Str" + super.getPreconditionScript();
    }
    @Override public void renderHead(    IHeaderResponse response){
      settings.setShowListOnEmptyInput(Boolean.TRUE.equals(UIUtils.getUIProperty(getScriptObject(),application,IApplication.TYPE_AHEAD_SHOW_POPUP_WHEN_EMPTY,Boolean.TRUE)));
      settings.setShowListOnFocusGain(Boolean.TRUE.equals(UIUtils.getUIProperty(getScriptObject(),application,IApplication.TYPE_AHEAD_SHOW_POPUP_ON_FOCUS_GAIN,Boolean.TRUE)));
      if (!getScriptObject().isReadOnly() && getScriptObject().isEnabled()) {
        super.renderHead(response);
        response.renderJavascript("String_Node_Str","String_Node_Str");
      }
    }
    /** 
 * @see org.apache.wicket.behavior.AbstractBehavior#isEnabled(org.apache.wicket.Component)
 */
    @Override public boolean isEnabled(    Component component){
      IFormUIInternal<?> formui=findParent(IFormUIInternal.class);
      if (formui != null && formui.isDesignMode()) {
        return false;
      }
      return super.isEnabled(component) && WebClientSession.get().useAjax();
    }
  }
;
  add(beh);
}