Program: 16476
Project: 16476
Buggy source:
/** 
 * Redraws this component and all its decendants. <p>Default: It uses   {@link JsContentRenderer} to render all informationin JavaScript codes. For devices that don't support JavaScript, it must override this method. <p>To generate all information, it first invokes {@link #renderProperties} to render component'sproperties, and  then  {@link #redrawChildren} to redraw children (and descendants)(by calling their  {@link #redraw}). <p>If a dervied class wants to render more properties, it can override  {@link #renderProperties}. <p>If a derived class renders only a subset of its children (such as paging/cropping), it could override   {@link #redrawChildren}. <p>If a deriving class wants to do something before  {@link #renderProperties}, it has to override   {@link #redraw}. <p>If a deriving class doesn't want to render in JavaScript codes, it has to override   {@link #redraw} with the proper implementationof  {@link ContentRenderer}.
 */
public void redraw(final Writer out) throws IOException {
  final int order=ComponentRedraws.beforeRedraw(false);
  final boolean aupg=isAsyncUpdate();
  final String extra;
  try {
    if (order < 0) {
      if (aupg)       out.write('[');
 else {
        out.write(HtmlPageRenders.outSpecialJS(getDesktop()));
        out.write("String_Node_Str");
      }
    }
 else     if (order > 0)     out.write(',');
    final JsContentRenderer renderer=new JsContentRenderer();
    renderProperties(renderer);
    if (_page != null) {
      PropertiesRenderer[] prs=_page.getDesktop().getWebApp().getConfiguration().getPropertiesRenderers();
      for (int j=0; j < prs.length; j++)       prs[j].renderProperties(this,renderer);
    }
    final String wgtcls=getWidgetClass();
    if (wgtcls == null)     throw new UiException("String_Node_Str" + this + "String_Node_Str"+ getMold());
    out.write("String_Node_Str");
    out.write(wgtcls);
    out.write("String_Node_Str");
    out.write(getUuid());
    out.write("String_Node_Str");
    out.write(renderer.getBuffer().toString());
    out.write("String_Node_Str");
    redrawChildren(out);
    out.write(']');
    final String mold=getMold();
    if (!DEFAULT.equals(mold)) {
      out.write("String_Node_Str");
      out.write(mold);
      out.write('\'');
    }
    out.write(']');
  }
  finally {
    extra=ComponentRedraws.afterRedraw();
  }
  if (order < 0) {
    if (aupg) {
      if (extra.length() > 0) {
        out.write("String_Node_Str");
        out.write(Strings.escape(extra,Strings.ESCAPE_JAVASCRIPT));
        out.write('\'');
      }
      out.write(']');
    }
 else {
      if (extra.length() > 0)       out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.write(extra);
    }
  }
}

Fixed version (ground truth):
/** 
 * Redraws this component and all its descendants. <p>Default: It uses   {@link JsContentRenderer} to render all informationin JavaScript codes. For devices that don't support JavaScript, it must override this method. <p>To generate all information, it first invokes {@link #renderProperties} to render component'sproperties, and  then  {@link #redrawChildren} to redraw children (and descendants)(by calling their  {@link #redraw}). <p>If a derived class wants to render more properties, it can override  {@link #renderProperties}. <p>If a derived class renders only a subset of its children (such as paging/cropping), it could override   {@link #redrawChildren}. <p>If a deriving class wants to do something before  {@link #renderProperties}, it has to override   {@link #redraw}. <p>If a deriving class doesn't want to render in JavaScript codes, it has to override   {@link #redraw} with the proper implementationof  {@link ContentRenderer}.
 */
public void redraw(final Writer out) throws IOException {
  final int order=ComponentRedraws.beforeRedraw(false);
  final boolean aupg=isAsyncUpdate();
  final String extra;
  try {
    if (order < 0) {
      if (aupg)       out.write('[');
 else {
        out.write(HtmlPageRenders.outSpecialJS(getDesktop()));
        out.write("String_Node_Str");
      }
    }
 else     if (order > 0)     out.write(',');
    final JsContentRenderer renderer=new JsContentRenderer();
    renderProperties(renderer);
    if (_page != null) {
      PropertiesRenderer[] prs=_page.getDesktop().getWebApp().getConfiguration().getPropertiesRenderers();
      for (int j=0; j < prs.length; j++)       prs[j].renderProperties(this,renderer);
    }
    final String wgtcls=getWidgetClass();
    if (wgtcls == null)     throw new UiException("String_Node_Str" + this + "String_Node_Str"+ getMold());
    out.write("String_Node_Str");
    out.write(wgtcls);
    out.write("String_Node_Str");
    out.write(getUuid());
    out.write("String_Node_Str");
    out.write(renderer.getBuffer().toString());
    out.write("String_Node_Str");
    redrawChildren(out);
    out.write(']');
    final String mold=getMold();
    if (!DEFAULT.equals(mold)) {
      out.write("String_Node_Str");
      out.write(mold);
      out.write('\'');
    }
    out.write(']');
  }
  finally {
    extra=ComponentRedraws.afterRedraw();
  }
  if (order < 0) {
    if (aupg) {
      if (extra.length() > 0) {
        out.write("String_Node_Str");
        out.write(Strings.escape(extra,Strings.ESCAPE_JAVASCRIPT));
        out.write('\'');
      }
      out.write(']');
    }
 else {
      if (extra.length() > 0)       out.write("String_Node_Str");
      out.write("String_Node_Str");
      out.write(extra);
    }
  }
}