nus-yam/ex-repair huggingface dataset:
Program: 16468
Project: 16468
Buggy source:
protected Set<? extends Component> getAvailableAtClient(int offset,int limit){
  if (!isCropper())   return null;
  final Set<Component> avail=new LinkedHashSet<Component>(32);
  avail.addAll(_listbox.getHeads());
  final Listfoot listfoot=_listbox.getListfoot();
  if (listfoot != null)   avail.add(listfoot);
  final Paging paging=_listbox.getPagingChild();
  if (paging != null)   avail.add(paging);
  final Frozen frozen=_listbox.getFrozen();
  if (frozen != null)   avail.add(frozen);
  int pgsz=limit;
  int ofs=offset;
  if (_listbox.getItemCount() > 0) {
    Component item=_listbox.getItems().get(0);
    while (item != null) {
      if (pgsz == 0)       break;
      if (item.isVisible() && item instanceof Listitem) {
        if (--ofs < 0) {
          --pgsz;
          avail.add(item);
        }
      }
      if (item instanceof Listgroup) {
        final Listgroup g=(Listgroup)item;
        if (!g.isOpen()) {
          for (int j=0, len=g.getItemCount(); j < len; j++)           item=(Listitem)item.getNextSibling();
        }
      }
      if (item != null) {
        final Component c=item.getNextSibling();
        if (c instanceof Listitem)         item=(Listitem)c;
        break;
      }
    }
  }
  return avail;
}

Fixed version (ground truth):
protected Set<? extends Component> getAvailableAtClient(int offset,int limit){
  if (!isCropper())   return null;
  final Set<Component> avail=new LinkedHashSet<Component>(32);
  avail.addAll(_listbox.getHeads());
  final Listfoot listfoot=_listbox.getListfoot();
  if (listfoot != null)   avail.add(listfoot);
  final Paging paging=_listbox.getPagingChild();
  if (paging != null)   avail.add(paging);
  final Frozen frozen=_listbox.getFrozen();
  if (frozen != null)   avail.add(frozen);
  int pgsz=limit;
  int ofs=offset;
  if (_listbox.getItemCount() > 0) {
    Component item=_listbox.getItems().get(0);
    while (item != null) {
      if (pgsz == 0)       break;
      if (item.isVisible() && item instanceof Listitem) {
        if (--ofs < 0) {
          --pgsz;
          avail.add(item);
        }
      }
      if (item instanceof Listgroup) {
        final Listgroup g=(Listgroup)item;
        if (!g.isOpen()) {
          for (int j=0, len=g.getItemCount(); j < len; j++)           item=(Listitem)item.getNextSibling();
        }
      }
      if (item != null)       item=item.getNextSibling();
    }
  }
  return avail;
}
Program: 16469
Project: 16469
Buggy source:
/** 
 * Pops the current namespce (pushed by   {@link #push}).
 */
private static final void pop(){
  ((List)_scopes.get()).remove(0);
}

Fixed version (ground truth):
/** 
 * Pops the current namespace (pushed by   {@link #push}).
 */
private static final void pop(){
  ((List)_scopes.get()).remove(0);
}
Program: 16470
Project: 16470
Buggy source:
public Object getValue(){
  return _scope.getAttributes();
}

Fixed version (ground truth):
/** 
 * Returns the real value. 
 */
public Object getValue();
Program: 16471
Project: 16471
Buggy source:
/** 
 * Prepares implicit variable before calling   {@link Page#interpret}. <p>Typical use: <pre><code> final Scope scope = Scopes.beforeInterpret(comp); try { Scopes.setImplicit("some", value); page.interpret(zslang, zscript, scope); //it will push scope as the current scope } finally { Scopes.afterInterpret(); } </code></pre> <p>Another example: <pre><code> Scopes.beforeInterpret(comp); try { constr.validate(comp); //if constr might be an instance of a class implemented in zscript } finally { Scopess.afterInterpret(); } </code></pre> <p>If you need to set some implicit variables, you can invoke  {@link #setImplicit} between {@link #beforeInterpret}and   {@link #afterInterpret}.
 * @param scope the scope, never null.
 * @return the scope used for interpretation. It is the same as the scopeparameter if it is not null. Otherwise, a temporary scope is created.
 */
public static final Scope beforeInterpret(Scope scope){
  if (scope == null)   scope=new SimpleScope(null);
  final Implicit impl=beforeInterpret0(scope);
  impl.setImplicit("String_Node_Str",scope);
  if (scope instanceof Component)   impl.setImplicit("String_Node_Str",new DeferredScope(scope));
  return scope;
}

Fixed version (ground truth):
/** 
 * Prepares implicit variable before calling   {@link Page#interpret}. <p>Typical use: <pre><code> final Scope scope = Scopes.beforeInterpret(comp); try { Scopes.setImplicit("some", value); page.interpret(zslang, zscript, scope); //it will push scope as the current scope } finally { Scopes.afterInterpret(); } </code></pre> <p>Another example: <pre><code> Scopes.beforeInterpret(comp); try { constr.validate(comp); //if constr might be an instance of a class implemented in zscript } finally { Scopess.afterInterpret(); } </code></pre> <p>If you need to set some implicit variables, you can invoke  {@link #setImplicit} between {@link #beforeInterpret}and   {@link #afterInterpret}.
 * @param scope the scope, never null.
 * @return the scope used for interpretation. It is the same as the scopeparameter if it is not null. Otherwise, a temporary scope is created.
 */
public static final Scope beforeInterpret(Scope scope){
  if (scope == null)   scope=new SimpleScope(null);
  final Implicit impl=beforeInterpret0(scope);
  impl.setImplicit("String_Node_Str",scope);
  if (scope instanceof Component)   impl.setImplicit("String_Node_Str",new DeferredAttributes(scope));
  return scope;
}
Program: 16472
Project: 16472
Buggy source:
public int hashCode(){
  return _scope.hashCode();
}

Fixed version (ground truth):
public int hashCode(){
  return _scope.getAttributes().hashCode();
}
Program: 16473
Project: 16473
Buggy source:
public boolean equals(Object o){
  return _scope.equals(o instanceof DeferredScope ? ((DeferredScope)o)._scope : o);
}

Fixed version (ground truth):
public boolean equals(Object o){
  return _scope.getAttributes().equals(o instanceof DeferredAttributes ? ((DeferredAttributes)o)._scope.getAttributes() : o);
}
Program: 16474
Project: 16474
Buggy source:
public void setBookmark(String name,boolean replace){
  if (_exec == null)   throw new IllegalStateException("String_Node_Str" + this);
  if (name.indexOf('#') >= 0 || name.indexOf('?') >= 0)   throw new IllegalArgumentException("String_Node_Str");
  _bookmark=name;
  addResponse(new AuBookmark(name,replace));
}

Fixed version (ground truth):
public void setBookmark(String name,boolean replace){
  if (_exec == null)   throw new IllegalStateException("String_Node_Str" + this);
  _bookmark=name;
  addResponse(new AuBookmark(name,replace));
}
Program: 16477
Project: 16477
Buggy source:
/** 
 * Causes a response to be sent to the client by overriding the key returned by   {@link AuResponse#getOverrideKey}). <p>If   {@link AuResponse#getDepends} is not null, the responsedepends on the existence of the componet returned by {@link AuResponse#getDepends}. In other words, the response is removed if the component is removed. If it is null, the response is component-independent and it is always sent to the client. <p>Unlike   {@link #smartUpdate}, responses are sent even if  {@link Component#invalidate()} was called.Typical examples include setting the focus, selecting the text and so on. <p>It can be called only in the request-processing and event-processing phases; excluding the redrawing phase.
 * @param key could be anything.The second invocation of this method in the same execution with the same key and the same depends ( {@link AuResponse#getDepends}) will override the previous one. However, if key is null, it won't override any other. All responses with key == null will be sent.<br/> Notice that if   {@link AuResponse#getDepends} is null, then be carefulof the key you used since it is shared in the same execution (rather than a particular component).
 * @since 5.0.0 (become protected)
 */
protected void response(String key,AuResponse response){
  if (_page != null) {
    getAttachedUiEngine().addResponse(key,response);
  }
 else   if (response.getDepends() != this) {
    final UiEngine uieng=getCurrentUiEngine();
    if (uieng != null)     uieng.addResponse(key,response);
  }
}

Fixed version (ground truth):
/** 
 * Causes a response to be sent to the client by overriding the key returned by   {@link AuResponse#getOverrideKey}). <p>If   {@link AuResponse#getDepends} is not null, the responsedepends on the existence of the component returned by {@link AuResponse#getDepends}. In other words, the response is removed if the component is removed. If it is null, the response is component-independent and it is always sent to the client. <p>Unlike   {@link #smartUpdate}, responses are sent even if  {@link Component#invalidate()} was called.Typical examples include setting the focus, selecting the text and so on. <p>It can be called only in the request-processing and event-processing phases; excluding the redrawing phase.
 * @param key could be anything.The second invocation of this method in the same execution with the same key and the same depends ( {@link AuResponse#getDepends}) will override the previous one. However, if key is null, it won't override any other. All responses with key == null will be sent.<br/> Notice that if   {@link AuResponse#getDepends} is null, then be carefulof the key you used since it is shared in the same execution (rather than a particular component).
 * @since 5.0.0 (become protected)
 */
protected void response(String key,AuResponse response){
  if (_page != null) {
    getAttachedUiEngine().addResponse(key,response);
  }
 else   if (response.getDepends() != this) {
    final UiEngine uieng=getCurrentUiEngine();
    if (uieng != null)     uieng.addResponse(key,response);
  }
}
Program: 16478
Project: 16478
Buggy source:
public boolean shallBlock(AuRequest request){
  String cmd=request.getCommand();
  if (isReadonly() && (Events.ON_CHANGE.equals(cmd) || Events.ON_SELECT.equals(cmd)))   return false;
  return super.shallBlock(request);
}

Fixed version (ground truth):
public boolean shallBlock(AuRequest request){
  final String cmd=request.getCommand();
  if (Events.ON_OPEN.equals(cmd))   return false;
  return !Components.isRealVisible(Combobox.this) || isDisabled() || (isReadonly() && Events.ON_CHANGING.equals(cmd));
}
Program: 16479
Project: 16479
Buggy source:
public boolean shallBlock(AuRequest request){
  String cmd=request.getCommand();
  if (isReadonly() && Events.ON_CHANGE.equals(cmd))   return false;
  return super.shallBlock(request);
}

Fixed version (ground truth):
public boolean shallBlock(AuRequest request){
  final String cmd=request.getCommand();
  if (Events.ON_OPEN.equals(cmd))   return false;
  return !Components.isRealVisible(Datebox.this) || isDisabled() || (isReadonly() && Events.ON_CHANGING.equals(cmd));
}
Program: 16480
Project: 16480
Buggy source:
public Object getExtraCtrl(){
  return new Blockable(){
    public boolean shallBlock(    AuRequest request){
      final String cmd=request.getCommand();
      if (Events.ON_OPEN.equals(cmd))       return false;
      return !Components.isRealVisible(Combobox.this) || isDisabled() || (isReadonly() && Events.ON_CHANGING.equals(cmd));
    }
  }
;
}

Fixed version (ground truth):
public Object getExtraCtrl(){
  return new ExtraCtrl();
}
Program: 16481
Project: 16481
Buggy source:
public Object getExtraCtrl(){
  return new Blockable(){
    public boolean shallBlock(    AuRequest request){
      final String cmd=request.getCommand();
      if (Events.ON_OPEN.equals(cmd))       return false;
      return !Components.isRealVisible(Datebox.this) || isDisabled() || (isReadonly() && Events.ON_CHANGING.equals(cmd));
    }
  }
;
}

Fixed version (ground truth):
public Object getExtraCtrl(){
  return new ExtraCtrl();
}
Program: 16482
Project: 16482
Buggy source:
public Collection getThemeURIs(Execution exec,List uris){
  String suffix=getThemeFileSuffix();
  String fsc=Themes.getFontSizeCookie(exec);
  boolean isSilvergray=Themes.isSilvergray() && Themes.hasSilvergrayLib();
  processSilverAndFontURI(isSilvergray,uris,fsc);
  if ("String_Node_Str".equals(fsc)) {
    uris.add("String_Node_Str");
    if (isSilvergray)     uris.add("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(fsc)) {
    uris.add("String_Node_Str");
    if (isSilvergray)     uris.add("String_Node_Str");
  }
  if (Strings.isEmpty(suffix)) {
    Messagebox.setTemplate(DEFAULT_MSGBOX_TEMPLATE_URI);
    return uris;
  }
  if (isUsingDefaultTemplate(suffix))   Messagebox.setTemplate(getThemeMsgBoxURI(suffix));
  if (isSilvergray) {
    uris.add("String_Node_Str");
    uris.add("String_Node_Str");
  }
 else {
    uris.add(getNormCSS(suffix));
  }
  bypassURI(uris,suffix);
  return uris;
}

Fixed version (ground truth):
public Collection getThemeURIs(Execution exec,List uris){
  String suffix=getThemeFileSuffix();
  String fsc=Themes.getFontSizeCookie(exec);
  boolean isSilvergray=Themes.isSilvergray() && Themes.hasSilvergrayLib();
  processSilverAndFontURI(isSilvergray,uris,fsc);
  if ("String_Node_Str".equals(fsc)) {
    uris.add("String_Node_Str");
    if (isSilvergray)     uris.add("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(fsc)) {
    uris.add("String_Node_Str");
    if (isSilvergray)     uris.add("String_Node_Str");
  }
  if (Strings.isEmpty(suffix)) {
    Messagebox.setTemplate(DEFAULT_MSGBOX_TEMPLATE_URI);
    return uris;
  }
  if (isUsingDefaultTemplate(suffix))   Messagebox.setTemplate(getThemeMsgBoxURI(suffix));
  if (isSilvergray) {
    uris.add("String_Node_Str");
    uris.add("String_Node_Str");
  }
  bypassURI(uris,suffix);
  return uris;
}
Program: 16483
Project: 16483
Buggy source:
public Collection getThemeURIs(Execution exec,List uris){
  String suffix=getThemeFileSuffix();
  String fsc=Themes.getFontSizeCookie(exec);
  boolean isSilvergray=Themes.isSilvergray() && Themes.hasSilvergrayLib();
  processSilverAndFontURI(isSilvergray,uris,fsc);
  if ("String_Node_Str".equals(fsc)) {
    uris.add("String_Node_Str");
    if (isSilvergray)     uris.add("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(fsc)) {
    uris.add("String_Node_Str");
    if (isSilvergray)     uris.add("String_Node_Str");
  }
  if (Strings.isEmpty(suffix)) {
    Messagebox.setTemplate(DEFAULT_MSGBOX_TEMPLATE_URI);
    return uris;
  }
  if (isUsingDefaultTemplate(suffix))   Messagebox.setTemplate(getThemeMsgBoxURI(suffix));
  if (isSilvergray) {
    uris.add("String_Node_Str");
    uris.add("String_Node_Str");
  }
 else {
    uris.add(getExtCSS(suffix));
    uris.add(getNormCSS(suffix));
  }
  bypassURI(uris,suffix);
  return uris;
}

Fixed version (ground truth):
public Collection getThemeURIs(Execution exec,List uris){
  String suffix=getThemeFileSuffix();
  String fsc=Themes.getFontSizeCookie(exec);
  boolean isSilvergray=Themes.isSilvergray() && Themes.hasSilvergrayLib();
  processSilverAndFontURI(isSilvergray,uris,fsc);
  if ("String_Node_Str".equals(fsc)) {
    uris.add("String_Node_Str");
    if (isSilvergray)     uris.add("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(fsc)) {
    uris.add("String_Node_Str");
    if (isSilvergray)     uris.add("String_Node_Str");
  }
  if (Strings.isEmpty(suffix)) {
    Messagebox.setTemplate(DEFAULT_MSGBOX_TEMPLATE_URI);
    return uris;
  }
  if (isUsingDefaultTemplate(suffix))   Messagebox.setTemplate(getThemeMsgBoxURI(suffix));
  if (isSilvergray) {
    uris.add("String_Node_Str");
    uris.add("String_Node_Str");
  }
 else {
    uris.add(getNormCSS(suffix));
  }
  bypassURI(uris,suffix);
  return uris;
}
Program: 16485
Project: 16485
Buggy source:
protected Object marshall(Object value){
  if (value == null || _tzone == null)   return value;
  return new Date(((Date)value).getTime() - TimeZones.getCurrent().getRawOffset() + _tzone.getRawOffset() + _tzone.getDSTSavings());
}

Fixed version (ground truth):
protected Object marshall(Object value){
  if (value == null || _tzone == null)   return value;
  Date date=(Date)value;
  return new Date((date).getTime() - getTimeOffset(TimeZones.getCurrent(),date) + getTimeOffset(_tzone,date));
}
Program: 16486
Project: 16486
Buggy source:
protected Object unmarshall(Object value){
  if (value == null || _tzone == null)   return value;
  return new Date(((Date)value).getTime() + TimeZones.getCurrent().getRawOffset() - _tzone.getRawOffset() - _tzone.getDSTSavings());
}

Fixed version (ground truth):
protected Object unmarshall(Object value){
  if (value == null || _tzone == null)   return value;
  Date date=(Date)value;
  return new Date((date).getTime() + getTimeOffset(TimeZones.getCurrent(),date) - getTimeOffset(_tzone,date));
}
Program: 16487
Project: 16487
Buggy source:
protected Object unmarshall(Object value){
  if (value == null || _tzone == null)   return value;
  return new Date(((Date)value).getTime() + TimeZones.getCurrent().getRawOffset() - _tzone.getRawOffset());
}

Fixed version (ground truth):
protected Object unmarshall(Object value){
  if (value == null || _tzone == null)   return value;
  Date date=(Date)value;
  return new Date((date).getTime() + Dates.getTimezoneOffset(TimeZones.getCurrent(),date) - Dates.getTimezoneOffset(_tzone,date));
}
Program: 16488
Project: 16488
Buggy source:
protected Object marshall(Object value){
  if (value == null || _tzone == null)   return value;
  return new Date(((Date)value).getTime() - TimeZones.getCurrent().getRawOffset() + _tzone.getRawOffset());
}

Fixed version (ground truth):
protected Object marshall(Object value){
  if (value == null || _tzone == null)   return value;
  Date date=(Date)value;
  return new Date((date).getTime() - Dates.getTimezoneOffset(TimeZones.getCurrent(),date) + Dates.getTimezoneOffset(_tzone,date));
}
Program: 16489
Project: 16489
Buggy source:
protected Object marshall(Object value){
  if (value == null || _tzone == null)   return value;
  Date date=(Date)value;
  return new Date((date).getTime() - getTimeOffset(TimeZones.getCurrent(),date) + getTimeOffset(_tzone,date));
}

Fixed version (ground truth):
protected Object marshall(Object value){
  if (value == null || _tzone == null)   return value;
  Date date=(Date)value;
  return new Date((date).getTime() - Dates.getTimezoneOffset(TimeZones.getCurrent(),date) + Dates.getTimezoneOffset(_tzone,date));
}
Program: 16490
Project: 16490
Buggy source:
protected Object unmarshall(Object value){
  if (value == null || _tzone == null)   return value;
  Date date=(Date)value;
  return new Date((date).getTime() + getTimeOffset(TimeZones.getCurrent(),date) - getTimeOffset(_tzone,date));
}

Fixed version (ground truth):
protected Object unmarshall(Object value){
  if (value == null || _tzone == null)   return value;
  Date date=(Date)value;
  return new Date((date).getTime() + Dates.getTimezoneOffset(TimeZones.getCurrent(),date) - Dates.getTimezoneOffset(_tzone,date));
}
Program: 16492
Project: 16492
Buggy source:
public void init(final Desktop desktop,Object request) throws Exception {
  desktop.addListener(new AuService(){
    public boolean service(    AuRequest request,    boolean everError){
      final String cmd=request.getCommand();
      if (cmd.equals("String_Node_Str")) {
        String zscript=(String)request.getData().get("String_Node_Str");
        Component cmp=Executions.createComponentsDirectly(zscript,"String_Node_Str",null,null);
        if (cmp != null)         cmp.setPage((Page)desktop.getPages().iterator().next());
        return true;
      }
 else       return false;
    }
  }
);
}

Fixed version (ground truth):
public void init(final Desktop desktop,Object request) throws Exception {
  desktop.addListener(new AuService(){
    public boolean service(    AuRequest request,    boolean everError){
      final String cmd=request.getCommand();
      if (cmd.equals("String_Node_Str")) {
        Page p=(Page)desktop.getPages().iterator().next();
        try {
          Component o=(Component)p.getDesktop().getComponents().toArray()[0];
          o.detach();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
        String zscript=(String)request.getData().get("String_Node_Str");
        Component cmp=Executions.createComponentsDirectly(zscript,"String_Node_Str",null,null);
        if (cmp != null)         cmp.setPage(p);
        return true;
      }
 else       return false;
    }
  }
);
}
Program: 16493
Project: 16493
Buggy source:
public boolean service(AuRequest request,boolean everError){
  final String cmd=request.getCommand();
  if (cmd.equals("String_Node_Str")) {
    String zscript=(String)request.getData().get("String_Node_Str");
    Component cmp=Executions.createComponentsDirectly(zscript,"String_Node_Str",null,null);
    if (cmp != null)     cmp.setPage((Page)desktop.getPages().iterator().next());
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public boolean service(AuRequest request,boolean everError){
  final String cmd=request.getCommand();
  if (cmd.equals("String_Node_Str")) {
    Page p=(Page)desktop.getPages().iterator().next();
    try {
      Component o=(Component)p.getDesktop().getComponents().toArray()[0];
      o.detach();
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
    String zscript=(String)request.getData().get("String_Node_Str");
    Component cmp=Executions.createComponentsDirectly(zscript,"String_Node_Str",null,null);
    if (cmp != null)     cmp.setPage(p);
    return true;
  }
 else   return false;
}
Program: 16494
Project: 16494
Buggy source:
/** 
 * Processes an AU request.
 * @since 5.0.0
 */
public void service(org.zkoss.zk.au.AuRequest request,boolean everError){
  final String cmd=request.getCommand();
  if (cmd.equals(Events.ON_CHECK)) {
    CheckEvent evt=CheckEvent.getCheckEvent(request);
    _checked=evt.isChecked();
    fixSiblings(_checked,true);
    Events.postEvent(evt);
    final Radiogroup rg=getRadiogroup();
    if (rg != null)     Events.sendEvent(rg,evt);
  }
 else   super.service(request,everError);
}

Fixed version (ground truth):
/** 
 * Processes an AU request.
 * @since 5.0.0
 */
public void service(org.zkoss.zk.au.AuRequest request,boolean everError){
  final String cmd=request.getCommand();
  if (cmd.equals(Events.ON_CHECK)) {
    CheckEvent evt=CheckEvent.getCheckEvent(request);
    _checked=evt.isChecked();
    fixSiblings(_checked,true);
    Events.postEvent(evt);
    final Radiogroup rg=getRadiogroup();
    if (rg != null)     Events.postEvent(Events.ON_CHECK,rg,evt.getData());
  }
 else   super.service(request,everError);
}
Program: 16495
Project: 16495
Buggy source:
/** 
 * Sets the theme style in cookie
 */
public static void setThemeStyle(Execution exe,String theme){
  Cookie cookie=new Cookie(THEME_COOKIE_KEY,theme);
  cookie.setMaxAge(60 * 60 * 24* 30);
  String cp=exe.getContextPath();
  cookie.setPath(cp);
  ((HttpServletResponse)exe.getNativeResponse()).addCookie(cookie);
}

Fixed version (ground truth):
/** 
 * Sets the theme style in cookie
 */
public static void setThemeStyle(Execution exe,String theme){
  Cookie cookie=new Cookie(THEME_COOKIE_KEY,theme);
  cookie.setMaxAge(60 * 60 * 24* 30);
  String cp=exe.getContextPath();
  if (cp.isEmpty())   cp="String_Node_Str";
  cookie.setPath(cp);
  ((HttpServletResponse)exe.getNativeResponse()).addCookie(cookie);
}
Program: 16496
Project: 16496
Buggy source:
/** 
 * Returns the theme specified in cookies
 * @param exe Execution
 * @return the name of the theme or "" for default theme.
 */
public static String getThemeStyle(Execution exe){
  Cookie[] cookies=((HttpServletRequest)exe.getNativeRequest()).getCookies();
  if (cookies == null)   return "String_Node_Str";
  String candidate=null;
  for (int i=0; i < cookies.length; i++) {
    Cookie c=cookies[i];
    if (!THEME_COOKIE_KEY.equals(c.getName()))     continue;
    String theme=c.getValue();
    if (theme == null)     continue;
    String path=c.getPath();
    if (path != null && path.equals(exe.getContextPath()))     return theme;
    if (candidate == null)     candidate=theme;
  }
  return candidate == null ? "String_Node_Str" : candidate;
}

Fixed version (ground truth):
/** 
 * Returns the theme specified in cookies
 * @param exe Execution
 * @return the name of the theme or "" for default theme.
 */
public static String getThemeStyle(Execution exe){
  Cookie[] cookies=((HttpServletRequest)exe.getNativeRequest()).getCookies();
  if (cookies == null)   return "String_Node_Str";
  for (int i=0; i < cookies.length; i++) {
    Cookie c=cookies[i];
    if (!THEME_COOKIE_KEY.equals(c.getName()))     continue;
    String theme=c.getValue();
    if (theme != null)     return theme;
  }
  return "String_Node_Str";
}
Program: 16497
Project: 16497
Buggy source:
/** 
 * @param wapp the Web application (or null if not available yet)
 */
private void sessionTimeout(HttpServletRequest request,HttpServletResponse response,WebApp wapp,String dtid) throws ServletException, IOException {
  final String sid=request.getHeader("String_Node_Str");
  if (sid != null)   response.setHeader("String_Node_Str",sid);
  final AuWriter out=AuWriters.newInstance().open(request,response,0);
  if (!getAuDecoder(wapp).isIgnorable(request,wapp)) {
    final String deviceType=getDeviceType(request);
    URIInfo ui=wapp != null ? (URIInfo)wapp.getConfiguration().getTimeoutURI(deviceType) : null;
    String uri=ui != null ? ui.uri : null;
    final AuResponse resp;
    if (uri != null) {
      if (uri.length() != 0)       uri=Encodes.encodeURL(_ctx,request,response,uri);
      resp=new AuSendRedirect(uri,null);
    }
 else {
      String msg=wapp.getConfiguration().getTimeoutMessage(deviceType);
      if (msg != null && msg.startsWith("String_Node_Str")) {
        final String key;
        msg=Labels.getLabel(key=msg.substring(6),new Object[]{dtid});
        if (msg == null)         log.warning("String_Node_Str" + key);
      }
      if (msg == null)       msg=Messages.get(MZk.UPDATE_OBSOLETE_PAGE,dtid);
      resp=new AuObsolete(dtid,msg);
    }
    out.write(resp);
  }
  out.close(request,response);
}

Fixed version (ground truth):
/** 
 * @param wapp the Web application (or null if not available yet)
 */
private void sessionTimeout(HttpServletRequest request,HttpServletResponse response,WebApp wapp,String dtid) throws ServletException, IOException {
  final String sid=request.getHeader("String_Node_Str");
  if (sid != null)   response.setHeader("String_Node_Str",sid);
  final AuWriter out=AuWriters.newInstance().open(request,response,0);
  if (!getAuDecoder(wapp).isIgnorable(request,wapp)) {
    final String deviceType=getDeviceType(request);
    URIInfo ui=wapp != null ? (URIInfo)wapp.getConfiguration().getTimeoutURI(deviceType) : null;
    String uri=ui != null ? ui.uri : null;
    out.write(new AuConfirmClose(null));
    final AuResponse resp;
    if (uri != null) {
      if (uri.length() != 0)       uri=Encodes.encodeURL(_ctx,request,response,uri);
      resp=new AuSendRedirect(uri,null);
    }
 else {
      String msg=wapp.getConfiguration().getTimeoutMessage(deviceType);
      if (msg != null && msg.startsWith("String_Node_Str")) {
        final String key;
        msg=Labels.getLabel(key=msg.substring(6),new Object[]{dtid});
        if (msg == null)         log.warning("String_Node_Str" + key);
      }
      if (msg == null)       msg=Messages.get(MZk.UPDATE_OBSOLETE_PAGE,dtid);
      resp=new AuObsolete(dtid,msg);
    }
    out.write(resp);
  }
  out.close(request,response);
}
Program: 16498
Project: 16498
Buggy source:
private void doSmartDraw(){
  if (Strings.isBlank(getType()))   throw new UiException("String_Node_Str");
  if (_model == null)   _model=createDefaultModel();
  if (Strings.isBlank(getWidth()))   throw new UiException("String_Node_Str");
  if (Strings.isBlank(getHeight()))   throw new UiException("String_Node_Str");
  try {
    _paintIndex=0;
    response(new AuSetAttribute(this,"String_Node_Str",getChartImpl().createChartXML()));
  }
  finally {
    _smartDrawChart=false;
  }
}

Fixed version (ground truth):
private void doSmartDraw(){
  if (Strings.isBlank(getType()))   throw new UiException("String_Node_Str");
  if (_model == null)   _model=createDefaultModel();
  if (Strings.isBlank(getWidth()))   throw new UiException("String_Node_Str");
  if (Strings.isBlank(getHeight()))   throw new UiException("String_Node_Str");
  try {
    _paintIndex=0;
    response(new AuSetAttribute(this,"String_Node_Str",getChartImpl().createChartXML()));
    System.out.println(getChartImpl().createChartXML());
  }
  finally {
    _smartDrawChart=false;
  }
}
Program: 16499
Project: 16499
Buggy source:
public void afterCompose(){
  _afterComposed=true;
  fixModeOnly();
  if (_instantMode) {
    final Execution exec=getExecution();
    final Map old=setupDynams(exec);
    final String oldSrc=(String)exec.getAttribute(ATTR_RENDERED);
    if (!Objects.equals(oldSrc,_src)) {
      try {
        getChildren().clear();
        final int j=_src.indexOf('?');
        exec.createComponents(j >= 0 ? _src.substring(0,j) : _src,this,_dynams);
        exec.setAttribute(ATTR_RENDERED,_src);
      }
  finally {
        restoreDynams(exec,old);
      }
    }
  }
 else {
    getChildren().clear();
  }
}

Fixed version (ground truth):
public void afterCompose(){
  _afterComposed=true;
  fixModeOnly();
  if (_instantMode) {
    final Execution exec=getExecution();
    final Map old=setupDynams(exec);
    final String attrRenderedKey=ATTR_RENDERED + '$' + getUuid();
    final String oldSrc=(String)exec.getAttribute(attrRenderedKey);
    if (!Objects.equals(oldSrc,_src)) {
      try {
        getChildren().clear();
        final int j=_src.indexOf('?');
        exec.createComponents(j >= 0 ? _src.substring(0,j) : _src,this,_dynams);
        exec.setAttribute(attrRenderedKey,_src);
      }
  finally {
        restoreDynams(exec,old);
      }
    }
  }
 else {
    getChildren().clear();
  }
}
Program: 16500
Project: 16500
Buggy source:
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
  super.renderProperties(renderer);
  render(renderer,"String_Node_Str",_format);
}

Fixed version (ground truth):
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
  render(renderer,"String_Node_Str",_format);
  super.renderProperties(renderer);
}
Program: 16501
Project: 16501
Buggy source:
/** 
 * Returns whether to grow and shrink vertical to fit their given space, so called vertical flexibility. <p>Default: false.
 * @since 3.5.0
 */
public boolean isVflex(){
  final String vflex=getVflex();
  if ("String_Node_Str".equals(vflex)) {
    return true;
  }
  if (Strings.isBlank(vflex) || "String_Node_Str".equals(vflex)) {
    return false;
  }
  return Integer.parseInt(vflex) > 0;
}

Fixed version (ground truth):
/** 
 * Returns whether to grow and shrink vertical to fit their given space, so called vertical flexibility. <p>Default: false.
 * @since 3.5.0
 */
public boolean isVflex(){
  final String vflex=getVflex();
  if ("String_Node_Str".equals(vflex)) {
    return true;
  }
  if (Strings.isBlank(vflex) || "String_Node_Str".equals(vflex) || "String_Node_Str".equals(vflex)) {
    return false;
  }
  return Integer.parseInt(vflex) > 0;
}
Program: 16502
Project: 16502
Buggy source:
/** 
 * Sets whether to grow and shrink vertical to fit their given space, so called vertical flexibility.
 * @since 3.5.0
 */
public void setVflex(boolean vflex){
  if (isVflex() != vflex) {
    setVflex("String_Node_Str" + vflex);
  }
}

Fixed version (ground truth):
/** 
 * Sets whether to grow and shrink vertical to fit their given space, so called vertical flexibility.
 * @since 3.5.0
 */
public void setVflex(boolean vflex){
  if (isVflex() != vflex) {
    setVflex(String.valueOf(vflex));
  }
}
Program: 16503
Project: 16503
Buggy source:
/** 
 * Returns whether to grow and shrink vertical to fit their given space, so called vertial flexibility. <p> Note: this attribute is ignored if   {@link #setRows} is specified<p> Default: false.
 */
public boolean isVflex(){
  final String vflex=getVflex();
  if ("String_Node_Str".equals(vflex)) {
    return true;
  }
  if (Strings.isBlank(vflex) || "String_Node_Str".equals(vflex)) {
    return false;
  }
  return Integer.parseInt(vflex) > 0;
}

Fixed version (ground truth):
/** 
 * Returns whether to grow and shrink vertical to fit their given space, so called vertial flexibility. <p> Note: this attribute is ignored if   {@link #setRows} is specified<p> Default: false.
 */
public boolean isVflex(){
  final String vflex=getVflex();
  if ("String_Node_Str".equals(vflex)) {
    return true;
  }
  if (Strings.isBlank(vflex) || "String_Node_Str".equals(vflex) || "String_Node_Str".equals(vflex)) {
    return false;
  }
  return Integer.parseInt(vflex) > 0;
}
Program: 16504
Project: 16504
Buggy source:
/** 
 * Sets whether to grow and shrink vertical to fit their given space, so called vertial flexibility. <p> Note: this attribute is ignored if   {@link #setRows} is specified
 */
public void setVflex(boolean vflex){
  if (isVflex() != vflex) {
    setVflex("String_Node_Str" + vflex);
  }
}

Fixed version (ground truth):
/** 
 * Sets whether to grow and shrink vertical to fit their given space, so called vertial flexibility. <p> Note: this attribute is ignored if   {@link #setRows} is specified
 */
public void setVflex(boolean vflex){
  if (isVflex() != vflex) {
    setVflex(String.valueOf(vflex));
  }
}
Program: 16505
Project: 16505
Buggy source:
/** 
 * Sets the direction.
 * @param dir either "normal" or "reverse".
 */
public void setDir(String dir) throws WrongValueException {
  if (!"String_Node_Str".equals(dir) && !"String_Node_Str".equals(dir))   throw new WrongValueException(dir);
  if (!Objects.equals(_auxinf != null ? _auxinf.dir : null,dir)) {
    initAuxInfo().dir=dir;
    smartUpdate("String_Node_Str",getDir());
  }
}

Fixed version (ground truth):
/** 
 * Sets the direction.
 * @param dir either "normal" or "reverse".
 */
public void setDir(String dir) throws WrongValueException {
  if (!"String_Node_Str".equals(dir) && !"String_Node_Str".equals(dir))   throw new WrongValueException(dir);
  if (!Objects.equals(_auxinf != null ? _auxinf.dir : NORMAL,dir)) {
    initAuxInfo().dir=dir;
    smartUpdate("String_Node_Str",getDir());
  }
}
Program: 16506
Project: 16506
Buggy source:
/** 
 * Returns the direction. <p>Default: "normal".
 */
public String getDir(){
  return _auxinf != null ? _auxinf.dir : null;
}

Fixed version (ground truth):
/** 
 * Returns the direction. <p>Default: "normal".
 */
public String getDir(){
  return _auxinf != null ? _auxinf.dir : NORMAL;
}
Program: 16507
Project: 16507
Buggy source:
public void setMold(String mold){
  if (mold != null && (DEFAULT.equals(mold) || mold.length() == 0))   mold=null;
  if (!Objects.equals(_auxinf != null ? _auxinf.mold : mold,mold)) {
    if (!_def.hasMold(mold != null ? mold : DEFAULT))     throw new UiException("String_Node_Str" + mold + "String_Node_Str"+ _def.getMoldNames());
    final String oldtype=getWidgetClass();
    initAuxInfo().mold=mold;
    if (Objects.equals(oldtype,getWidgetClass()))     smartUpdate("String_Node_Str",getMold());
 else     invalidate();
  }
}

Fixed version (ground truth):
public void setMold(String mold){
  if (mold != null && (DEFAULT.equals(mold) || mold.length() == 0))   mold=null;
  if (!Objects.equals(_auxinf != null ? _auxinf.mold : DEFAULT,mold)) {
    if (!_def.hasMold(mold != null ? mold : DEFAULT))     throw new UiException("String_Node_Str" + mold + "String_Node_Str"+ _def.getMoldNames());
    final String oldtype=getWidgetClass();
    initAuxInfo().mold=mold;
    if (Objects.equals(oldtype,getWidgetClass()))     smartUpdate("String_Node_Str",getMold());
 else     invalidate();
  }
}
Program: 16508
Project: 16508
Buggy source:
public void init(PageConfig config){
  final Execution exec=Executions.getCurrent();
  if (((ExecutionCtrl)exec).isRecovering()) {
    final String uuid=config.getUuid(), id=config.getId();
    if (uuid == null || id == null)     throw new IllegalArgumentException("String_Node_Str");
    _uuid=uuid;
    _id=id;
  }
 else {
    _uuid=((DesktopCtrl)_desktop).getNextUuid(this);
    if (_id == null || _id.length() == 0)     _id=config.getId();
    if (_id == null || _id.length() == 0)     _id=(String)exec.evaluate(this,_id,String.class);
    if (_id == null) {
      _id="String_Node_Str";
    }
 else     if (_id.length() != 0) {
      final String INVALID="String_Node_Str";
      if (Strings.anyOf(_id,INVALID,0) < _id.length())       throw new IllegalArgumentException("String_Node_Str" + _id + "String_Node_Str"+ INVALID);
    }
  }
  ((DesktopCtrl)_desktop).addPage(this);
  String s;
  if (_title.length() == 0) {
    s=config.getTitle();
    if (s != null)     setTitle(s);
  }
  if (_style.length() == 0) {
    s=config.getStyle();
    if (s != null)     setStyle(s);
  }
  s=config.getHeaders(true);
  if (s != null)   _hdbfr=s;
  s=config.getHeaders(false);
  if (s != null)   _hdaft=s;
  _hdres=config.getResponseHeaders();
  if (_hdres.isEmpty())   _hdres=null;
}

Fixed version (ground truth):
public void init(PageConfig config){
  final Execution exec=Executions.getCurrent();
  if (((ExecutionCtrl)exec).isRecovering()) {
    final String uuid=config.getUuid(), id=config.getId();
    if (uuid == null || id == null)     throw new IllegalArgumentException("String_Node_Str");
    _uuid=uuid;
    _id=id;
  }
 else {
    _uuid=((DesktopCtrl)_desktop).getNextUuid(this);
    if (_id == null || _id.length() == 0)     _id=config.getId();
    if (_id != null)     _id=(String)exec.evaluate(this,_id,String.class);
    if (_id == null) {
      _id="String_Node_Str";
    }
 else     if (_id.length() != 0) {
      final String INVALID="String_Node_Str";
      if (Strings.anyOf(_id,INVALID,0) < _id.length())       throw new IllegalArgumentException("String_Node_Str" + _id + "String_Node_Str"+ INVALID);
    }
  }
  ((DesktopCtrl)_desktop).addPage(this);
  String s;
  if (_title.length() == 0) {
    s=config.getTitle();
    if (s != null)     setTitle(s);
  }
  if (_style.length() == 0) {
    s=config.getStyle();
    if (s != null)     setStyle(s);
  }
  s=config.getHeaders(true);
  if (s != null)   _hdbfr=s;
  s=config.getHeaders(false);
  if (s != null)   _hdaft=s;
  _hdres=config.getResponseHeaders();
  if (_hdres.isEmpty())   _hdres=null;
}
Program: 16509
Project: 16509
Buggy source:
private static final boolean shallEncodeUnicode(char cc,String specials){
  return specials == ESCAPE_JAVASCRIPT && cc > (char)127 && !Character.isLetter(cc);
}

Fixed version (ground truth):
private static final boolean shallEncodeUnicode(char cc,String specials){
  return specials == ESCAPE_JAVASCRIPT && cc > (char)255 && !Character.isLetterOrDigit(cc);
}
Program: 16510
Project: 16510
Buggy source:
/** 
 * Escapes (aka. quote) the special characters with backslash and appends it the specified string buffer.
 * @param dst the destination buffer to append to.
 * @param src the source to escape from.
 * @param specials a string of characters that shall be escaped/quotedTo escape a string in JavaScript code snippet, you can use  {@link #ESCAPE_JAVASCRIPT}.
 * @since 5.0.0
 */
public static final StringBuffer escape(StringBuffer dst,CharSequence src,String specials){
  if (src == null)   return dst;
  for (int j=0, j2=0, len=src.length(); ; ) {
    String enc=null;
    char cc;
    int k=j2;
    for (; ; ++k) {
      if (k >= len)       return dst.append((Object)src.subSequence(j,src.length()));
      cc=src.charAt(k);
      if (shallEncodeUnicode(cc,specials)) {
        enc="String_Node_Str" + Integer.toHexString(cc);
        break;
      }
      if (specials.indexOf(cc) >= 0)       break;
    }
    if (enc == null) switch (cc) {
case '\n':
      cc='n';
    break;
case '\t':
  cc='t';
break;
case '\r':
cc='r';
break;
case '\f':
cc='f';
break;
case '/':
if (specials == ESCAPE_JAVASCRIPT && (k <= 0 || src.charAt(k - 1) != '<' || k + 8 > len || !"String_Node_Str".equalsIgnoreCase(src.subSequence(k + 1,k + 8).toString()))) {
j2=k + 1;
continue;
}
}
dst.append((Object)src.subSequence(j,k)).append('\\');
if (enc != null) dst.append(enc);
 else dst.append(cc);
j2=j=k + 1;
}
}

Fixed version (ground truth):
/** 
 * Escapes (aka. quote) the special characters with backslash and appends it the specified string buffer.
 * @param dst the destination buffer to append to.
 * @param src the source to escape from.
 * @param specials a string of characters that shall be escaped/quotedTo escape a string in JavaScript code snippet, you can use  {@link #ESCAPE_JAVASCRIPT}.
 * @since 5.0.0
 */
public static final StringBuffer escape(StringBuffer dst,CharSequence src,String specials){
  if (src == null)   return dst;
  for (int j=0, j2=0, len=src.length(); ; ) {
    String enc=null;
    char cc;
    int k=j2;
    for (; ; ++k) {
      if (k >= len)       return dst.append((Object)src.subSequence(j,src.length()));
      cc=src.charAt(k);
      if (shallEncodeUnicode(cc,specials)) {
        enc=encodeUnicode(cc);
        break;
      }
      if (specials.indexOf(cc) >= 0)       break;
    }
    if (enc == null) switch (cc) {
case '\n':
      cc='n';
    break;
case '\t':
  cc='t';
break;
case '\r':
cc='r';
break;
case '\f':
cc='f';
break;
case '/':
if (specials == ESCAPE_JAVASCRIPT && (k <= 0 || src.charAt(k - 1) != '<' || k + 8 > len || !"String_Node_Str".equalsIgnoreCase(src.subSequence(k + 1,k + 8).toString()))) {
j2=k + 1;
continue;
}
}
dst.append((Object)src.subSequence(j,k)).append('\\');
if (enc != null) dst.append(enc);
 else dst.append(cc);
j2=j=k + 1;
}
}
Program: 16513
Project: 16513
Buggy source:
/** 
 * Adds the event listener for the onPaging event. 
 */
private void addPagingListener(Paginal pgi){
  if (_pgListener == null)   _pgListener=new EventListener(){
    public void onEvent(    Event event){
      final PagingEvent evt=(PagingEvent)event;
      Events.postEvent(new PagingEvent(evt.getName(),Grid.this,evt.getPageable(),evt.getActivePage()));
    }
  }
;
  pgi.addEventListener(ZulEvents.ON_PAGING,_pgListener);
  if (_pgImpListener == null)   _pgImpListener=new EventListener(){
    public void onEvent(    Event event){
      if (_rows != null && _model != null && inPagingMold()) {
        final Paginal pgi=getPaginal();
        int pgsz=pgi.getPageSize();
        final int ofs=pgi.getActivePage() * pgsz;
        getDataLoader().syncModel(ofs,pgsz);
        postOnInitRender();
      }
      if (getModel() != null || getPagingPosition().equals("String_Node_Str"))       invalidate();
 else       if (_rows != null)       _rows.invalidate();
    }
  }
;
  pgi.addEventListener("String_Node_Str",_pgImpListener);
}

Fixed version (ground truth):
/** 
 * Adds the event listener for the onPaging event. 
 */
private void addPagingListener(Paginal pgi){
  if (_pgListener == null)   _pgListener=new EventListener(){
    public void onEvent(    Event event){
      final PagingEvent evt=(PagingEvent)event;
      Events.postEvent(new PagingEvent(evt.getName(),Grid.this,evt.getPageable(),evt.getActivePage()));
    }
  }
;
  pgi.addEventListener(ZulEvents.ON_PAGING,_pgListener);
  if (_pgImpListener == null)   _pgImpListener=new EventListener(){
    public void onEvent(    Event event){
      if (_rows != null && _model != null && inPagingMold()) {
        final Paginal pgi=getPaginal();
        int pgsz=pgi.getPageSize();
        final int ofs=pgi.getActivePage() * pgsz;
        if (_rod) {
          getDataLoader().syncModel(ofs,pgsz);
        }
        postOnInitRender();
      }
      if (getModel() != null || getPagingPosition().equals("String_Node_Str"))       invalidate();
 else       if (_rows != null)       _rows.invalidate();
    }
  }
;
  pgi.addEventListener("String_Node_Str",_pgImpListener);
}
Program: 16514
Project: 16514
Buggy source:
public void onEvent(Event event){
  if (_rows != null && _model != null && inPagingMold()) {
    final Paginal pgi=getPaginal();
    int pgsz=pgi.getPageSize();
    final int ofs=pgi.getActivePage() * pgsz;
    getDataLoader().syncModel(ofs,pgsz);
    postOnInitRender();
  }
  if (getModel() != null || getPagingPosition().equals("String_Node_Str"))   invalidate();
 else   if (_rows != null)   _rows.invalidate();
}

Fixed version (ground truth):
public void onEvent(Event event){
  if (_rows != null && _model != null && inPagingMold()) {
    final Paginal pgi=getPaginal();
    int pgsz=pgi.getPageSize();
    final int ofs=pgi.getActivePage() * pgsz;
    if (_rod) {
      getDataLoader().syncModel(ofs,pgsz);
    }
    postOnInitRender();
  }
  if (getModel() != null || getPagingPosition().equals("String_Node_Str"))   invalidate();
 else   if (_rows != null)   _rows.invalidate();
}
Program: 16515
Project: 16515
Buggy source:
/** 
 * Adds the event listener for the onPaging event. 
 */
private void addPagingListener(Paginal pgi){
  if (_pgListener == null)   _pgListener=new EventListener(){
    public void onEvent(    Event event){
      final PagingEvent evt=(PagingEvent)event;
      Events.postEvent(new PagingEvent(evt.getName(),Listbox.this,evt.getPageable(),evt.getActivePage()));
    }
  }
;
  pgi.addEventListener(ZulEvents.ON_PAGING,_pgListener);
  if (_pgImpListener == null)   _pgImpListener=new EventListener(){
    public void onEvent(    Event event){
      if (_model != null && inPagingMold()) {
        final Paginal pgi=getPaginal();
        int pgsz=pgi.getPageSize();
        final int ofs=pgi.getActivePage() * pgsz;
        getDataLoader().syncModel(ofs,pgsz);
        postOnInitRender();
      }
      invalidate();
    }
  }
;
  pgi.addEventListener("String_Node_Str",_pgImpListener);
}

Fixed version (ground truth):
/** 
 * Adds the event listener for the onPaging event. 
 */
private void addPagingListener(Paginal pgi){
  if (_pgListener == null)   _pgListener=new EventListener(){
    public void onEvent(    Event event){
      final PagingEvent evt=(PagingEvent)event;
      Events.postEvent(new PagingEvent(evt.getName(),Listbox.this,evt.getPageable(),evt.getActivePage()));
    }
  }
;
  pgi.addEventListener(ZulEvents.ON_PAGING,_pgListener);
  if (_pgImpListener == null)   _pgImpListener=new EventListener(){
    public void onEvent(    Event event){
      if (_model != null && inPagingMold()) {
        final Paginal pgi=getPaginal();
        int pgsz=pgi.getPageSize();
        final int ofs=pgi.getActivePage() * pgsz;
        if (_rod) {
          getDataLoader().syncModel(ofs,pgsz);
        }
        postOnInitRender();
      }
      invalidate();
    }
  }
;
  pgi.addEventListener("String_Node_Str",_pgImpListener);
}
Program: 16516
Project: 16516
Buggy source:
public int getTotalSize(){
  final Rows rows=_grid.getRows();
  final ListModel model=_grid.getModel();
  return model != null ? model.getSize() : rows != null ? rows.getVisibleItemCount() : 40;
}

Fixed version (ground truth):
public int getTotalSize(){
  final Rows rows=_grid.getRows();
  final ListModel model=_grid.getModel();
  return model != null ? model.getSize() : rows != null ? rows.getVisibleItemCount() : 0;
}
Program: 16517
Project: 16517
Buggy source:
/** 
 * Sets the value (in Date).
 * @exception WrongValueException if value is wrong
 */
public void setValue(Date value) throws WrongValueException {
  if (value == null)   value=Dates.today();
  validate(value);
  setRawValue(value);
}

Fixed version (ground truth):
/** 
 * Sets the value (in Date).
 * @exception WrongValueException if value is wrong
 */
public void setValue(Date value) throws WrongValueException {
  validate(value);
  setRawValue(value);
}