nus-yam/ex-repair huggingface dataset:
Program: 53948
Project: 53948
Buggy source:
/** 
 * Constructs a new DatePickerCell that uses the given date/time format and  {@link SafeHtmlRenderer}.
 */
public DatePickerCell(DateTimeFormat format,SafeHtmlRenderer<String> renderer){
  super("String_Node_Str","String_Node_Str");
  if (format == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (renderer == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.format=format;
  this.renderer=renderer;
  this.datePicker=new DatePicker();
  this.panel=new PopupPanel(true,true){
    @Override protected void onPreviewNativeEvent(    NativePreviewEvent event){
      if (Event.ONKEYUP == event.getTypeInt()) {
        if (event.getNativeEvent().getKeyCode() == ESCAPE) {
          panel.hide();
        }
      }
    }
  }
;
  panel.addCloseHandler(new CloseHandler<PopupPanel>(){
    public void onClose(    CloseEvent<PopupPanel> event){
      lastKey=null;
      lastValue=null;
      if (lastParent != null && !event.isAutoClosed()) {
        lastParent.focus();
      }
      lastParent=null;
    }
  }
);
  panel.add(datePicker);
  datePicker.addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      panel.hide();
      Date date=event.getValue();
      setViewData(lastKey,date);
      setValue(lastParent,lastValue,lastKey);
      if (valueUpdater != null) {
        valueUpdater.update(date);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructs a new DatePickerCell that uses the given date/time format and  {@link SafeHtmlRenderer}.
 */
public DatePickerCell(DateTimeFormat format,SafeHtmlRenderer<String> renderer){
  super("String_Node_Str","String_Node_Str");
  if (format == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (renderer == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.format=format;
  this.renderer=renderer;
  this.datePicker=new DatePicker();
  this.panel=new PopupPanel(true,true){
    @Override protected void onPreviewNativeEvent(    NativePreviewEvent event){
      if (Event.ONKEYUP == event.getTypeInt()) {
        if (event.getNativeEvent().getKeyCode() == ESCAPE) {
          panel.hide();
        }
      }
    }
  }
;
  panel.addCloseHandler(new CloseHandler<PopupPanel>(){
    public void onClose(    CloseEvent<PopupPanel> event){
      lastKey=null;
      lastValue=null;
      if (lastParent != null && !event.isAutoClosed()) {
        lastParent.focus();
      }
      lastParent=null;
    }
  }
);
  panel.add(datePicker);
  datePicker.addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Element cellParent=lastParent;
      Date oldValue=lastValue;
      Object key=lastKey;
      panel.hide();
      Date date=event.getValue();
      setViewData(key,date);
      setValue(cellParent,oldValue,key);
      if (valueUpdater != null) {
        valueUpdater.update(date);
      }
    }
  }
);
}
Program: 53949
Project: 53949
Buggy source:
public void onValueChange(ValueChangeEvent<Date> event){
  panel.hide();
  Date date=event.getValue();
  setViewData(lastKey,date);
  setValue(lastParent,lastValue,lastKey);
  if (valueUpdater != null) {
    valueUpdater.update(date);
  }
}

Fixed version (ground truth):
public void onValueChange(ValueChangeEvent<Date> event){
  Element cellParent=lastParent;
  Date oldValue=lastValue;
  Object key=lastKey;
  panel.hide();
  Date date=event.getValue();
  setViewData(key,date);
  setValue(cellParent,oldValue,key);
  if (valueUpdater != null) {
    valueUpdater.update(date);
  }
}
Program: 53952
Project: 53952
Buggy source:
private AutoBeanType getAutoBeanType(JClassType beanType){
  beanType=ensureBaseType(beanType);
  AutoBeanType toReturn=peers.get(beanType);
  if (toReturn == null) {
    AutoBeanType.Builder builder=new AutoBeanType.Builder();
    builder.setPeerType(beanType);
    builder.setMethods(computeMethods(beanType));
    builder.setInterceptor(findInterceptor(beanType));
    if (noWrapTypes != null) {
      for (      JClassType noWrap : noWrapTypes) {
        if (noWrap.isAssignableFrom(beanType)) {
          builder.setNoWrap(true);
          break;
        }
      }
    }
    toReturn=builder.build();
    peers.put(beanType,toReturn);
  }
  return toReturn;
}

Fixed version (ground truth):
private AutoBeanType getAutoBeanType(JClassType beanType){
  beanType=ModelUtils.ensureBaseType(beanType);
  AutoBeanType toReturn=peers.get(beanType);
  if (toReturn == null) {
    AutoBeanType.Builder builder=new AutoBeanType.Builder();
    builder.setPeerType(beanType);
    builder.setMethods(computeMethods(beanType));
    builder.setInterceptor(findInterceptor(beanType));
    if (noWrapTypes != null) {
      for (      JClassType noWrap : noWrapTypes) {
        if (noWrap.isAssignableFrom(beanType)) {
          builder.setNoWrap(true);
          break;
        }
      }
    }
    toReturn=builder.build();
    peers.put(beanType,toReturn);
  }
  return toReturn;
}
Program: 53953
Project: 53953
Buggy source:
private boolean methodAcceptsAutoBeanAsFirstParam(JClassType beanType,JMethod method){
  JParameter[] params=method.getParameters();
  if (params.length == 0) {
    return false;
  }
  JClassType paramAsClass=params[0].getType().isClassOrInterface();
  if (paramAsClass == null) {
    return false;
  }
  JParameterizedType expectedFirst=oracle.getParameterizedType(autoBeanInterface,new JClassType[]{ensureBaseType(beanType)});
  return expectedFirst.isAssignableTo(paramAsClass);
}

Fixed version (ground truth):
private boolean methodAcceptsAutoBeanAsFirstParam(JClassType beanType,JMethod method){
  JParameter[] params=method.getParameters();
  if (params.length == 0) {
    return false;
  }
  JClassType paramAsClass=params[0].getType().isClassOrInterface();
  if (paramAsClass == null) {
    return false;
  }
  JParameterizedType expectedFirst=oracle.getParameterizedType(autoBeanInterface,new JClassType[]{ModelUtils.ensureBaseType(beanType)});
  return expectedFirst.isAssignableTo(paramAsClass);
}
Program: 53954
Project: 53954
Buggy source:
public AutoBeanType getPeer(JClassType beanType){
  beanType=ensureBaseType(beanType);
  return peers.get(beanType);
}

Fixed version (ground truth):
public AutoBeanType getPeer(JClassType beanType){
  beanType=ModelUtils.ensureBaseType(beanType);
  return peers.get(beanType);
}
Program: 53956
Project: 53956
Buggy source:
public void setQualifiedSourceName(String name){
  toReturn.qualifiedSourceName=name;
}

Fixed version (ground truth):
public void setQualifiedSourceName(String name){
}
Program: 53958
Project: 53958
Buggy source:
public void testFetchEntityWithStringId(){
  delayTestFinish(TEST_DELAY);
  req.simpleBarRequest().findSimpleBarById("String_Node_Str").fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    SimpleBarProxy response){
      final EntityProxyId<SimpleBarProxy> stableId=response.stableId();
      req.find(stableId).fire(new Receiver<SimpleBarProxy>(){
        @Override public void onSuccess(        SimpleBarProxy returnedProxy){
          assertEquals(stableId,returnedProxy.stableId());
          assertEquals("String_Node_Str",returnedProxy.getId());
          finishTestAndReset();
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
public void testFetchEntityWithStringId(){
  delayTestFinish(TEST_DELAY);
  req.simpleBarRequest().findSimpleBarById("String_Node_Str").fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    SimpleBarProxy response){
      final EntityProxyId<SimpleBarProxy> stableId=response.stableId();
      req.find(stableId).fire(new Receiver<SimpleBarProxy>(){
        @Override public void onSuccess(        SimpleBarProxy returnedProxy){
          assertEquals(stableId,returnedProxy.stableId());
          finishTestAndReset();
        }
      }
);
    }
  }
);
}
Program: 53959
Project: 53959
Buggy source:
public void testDummyCreateBar(){
  delayTestFinish(5000);
  SimpleBarRequest context=req.simpleBarRequest();
  final SimpleBarProxy foo=context.create(SimpleBarProxy.class);
  Object futureId=foo.getId();
  assertEquals(futureId,foo.getId());
  Request<SimpleBarProxy> fooReq=context.persistAndReturnSelf().using(foo);
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      Object futureId=foo.getId();
      assertEquals(futureId,foo.getId());
      checkStableIdEquals(foo,returned);
      finishTestAndReset();
    }
  }
);
}

Fixed version (ground truth):
public void testDummyCreateBar(){
  delayTestFinish(5000);
  SimpleBarRequest context=req.simpleBarRequest();
  final SimpleBarProxy foo=context.create(SimpleBarProxy.class);
  Request<SimpleBarProxy> fooReq=context.persistAndReturnSelf().using(foo);
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      checkStableIdEquals(foo,returned);
      finishTestAndReset();
    }
  }
);
}
Program: 53960
Project: 53960
Buggy source:
public void testDummyCreateList(){
  delayTestFinish(DELAY_TEST_FINISH);
  SimpleBarRequest context=simpleBarRequest();
  final SimpleBarProxy bar=context.create(SimpleBarProxy.class);
  Object futureId=bar.getId();
  assertEquals(futureId,bar.getId());
  assertTrue(((SimpleEntityProxyId<?>)bar.stableId()).isEphemeral());
  Request<SimpleBarProxy> fooReq=context.returnFirst(Collections.singletonList(bar));
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      Object futureId=bar.getId();
      assertEquals(futureId,bar.getId());
      assertFalse(((SimpleEntityProxyId<?>)bar.stableId()).isEphemeral());
      assertFalse(((SimpleEntityProxyId<?>)returned.stableId()).isEphemeral());
      checkStableIdEquals(bar,returned);
      finishTestAndReset();
    }
  }
);
}

Fixed version (ground truth):
public void testDummyCreateList(){
  delayTestFinish(DELAY_TEST_FINISH);
  SimpleBarRequest context=simpleBarRequest();
  final SimpleBarProxy bar=context.create(SimpleBarProxy.class);
  assertTrue(((SimpleEntityProxyId<?>)bar.stableId()).isEphemeral());
  Request<SimpleBarProxy> fooReq=context.returnFirst(Collections.singletonList(bar));
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      assertFalse(((SimpleEntityProxyId<?>)bar.stableId()).isEphemeral());
      assertFalse(((SimpleEntityProxyId<?>)returned.stableId()).isEphemeral());
      checkStableIdEquals(bar,returned);
      finishTestAndReset();
    }
  }
);
}
Program: 53961
Project: 53961
Buggy source:
public void testDummyCreateBar(){
  delayTestFinish(DELAY_TEST_FINISH);
  SimpleBarRequest context=simpleBarRequest();
  final SimpleBarProxy foo=context.create(SimpleBarProxy.class);
  Object futureId=foo.getId();
  assertEquals(futureId,foo.getId());
  assertTrue(((SimpleEntityProxyId<?>)foo.stableId()).isEphemeral());
  Request<SimpleBarProxy> fooReq=context.persistAndReturnSelf().using(foo);
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      Object futureId=foo.getId();
      assertEquals(futureId,foo.getId());
      assertFalse(((SimpleEntityProxyId<?>)foo.stableId()).isEphemeral());
      checkStableIdEquals(foo,returned);
      finishTestAndReset();
    }
  }
);
}

Fixed version (ground truth):
public void testDummyCreateBar(){
  delayTestFinish(DELAY_TEST_FINISH);
  SimpleBarRequest context=simpleBarRequest();
  final SimpleBarProxy foo=context.create(SimpleBarProxy.class);
  assertTrue(((SimpleEntityProxyId<?>)foo.stableId()).isEphemeral());
  Request<SimpleBarProxy> fooReq=context.persistAndReturnSelf().using(foo);
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      assertFalse(((SimpleEntityProxyId<?>)foo.stableId()).isEphemeral());
      checkStableIdEquals(foo,returned);
      finishTestAndReset();
    }
  }
);
}
Program: 53962
Project: 53962
Buggy source:
public String getSchedule(boolean[] daysFilter){
  return classSchedule.getDescription(daysFilter);
}

Fixed version (ground truth):
public String getSchedule(){
  return getScheduleWithFilter(daysFilters);
}
Program: 53963
Project: 53963
Buggy source:
private Object getPropertyValueFromRequestCached(JSONArray recordArray,int index,Property<?> dtoProperty) throws JSONException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, InstantiationException {
  Object propertyValue;
  Class<?> leafType=dtoProperty instanceof CollectionProperty<?,?> ? ((CollectionProperty<?,?>)dtoProperty).getLeafType() : dtoProperty.getType();
  if (EntityProxy.class.isAssignableFrom(leafType)) {
    EntityKey propKey=getEntityKey(recordArray.getString(index));
    Object cacheValue=cachedEntityLookup.get(propKey);
    if (cachedEntityLookup.containsKey(propKey)) {
      propertyValue=cacheValue;
    }
 else {
      propertyValue=getPropertyValueFromRequest(recordArray,index,leafType);
    }
  }
 else {
    propertyValue=getPropertyValueFromRequest(recordArray,index,leafType);
  }
  return propertyValue;
}

Fixed version (ground truth):
private Object getPropertyValueFromRequestCached(JSONObject recordObject,Map<String,Property<?>> propertiesInProxy,String key,Property<?> dtoProperty) throws JSONException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, InstantiationException {
  Object propertyValue;
  if (!recordObject.isNull(key) && EntityProxy.class.isAssignableFrom(dtoProperty.getType())) {
    EntityKey propKey=getEntityKey(recordObject.getString(key));
    Object cacheValue=cachedEntityLookup.get(propKey);
    if (cachedEntityLookup.containsKey(propKey)) {
      propertyValue=cacheValue;
    }
 else {
      propertyValue=getPropertyValueFromRequest(recordObject,key,propertiesInProxy.get(key).getType());
    }
  }
 else {
    propertyValue=getPropertyValueFromRequest(recordObject,key,propertiesInProxy.get(key).getType());
  }
  return propertyValue;
}
Program: 53964
Project: 53964
Buggy source:
/** 
 * Returns a JSONObject with at most three keys: CREATE, UPDATE, DELETE. Each value is a JSONArray of JSONObjects.
 */
private JSONObject getSideEffects() throws SecurityException, JSONException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, IllegalArgumentException, InstantiationException {
  JSONObject sideEffects=new JSONObject();
  JSONArray createArray=new JSONArray();
  JSONArray deleteArray=new JSONArray();
  JSONArray updateArray=new JSONArray();
  for (  EntityKey entityKey : involvedKeys) {
    EntityData entityData=afterDvsDataMap.get(entityKey);
    if (entityData == null) {
      continue;
    }
    if (entityKey.isFuture) {
      JSONObject createRecord=getCreateReturnRecord(entityKey,entityData);
      if (createRecord != null) {
        createArray.put(createRecord);
      }
      continue;
    }
    WriteOperation writeOperation=detectDeleteOrUpdate(entityKey,entityData);
    if (writeOperation == WriteOperation.DELETE) {
      JSONObject deleteRecord=new JSONObject();
      deleteRecord.put(Constants.ENCODED_ID_PROPERTY,getSchemaAndId(entityKey.proxyType,entityKey.encodedId));
      deleteArray.put(deleteRecord);
    }
    if (writeOperation == WriteOperation.UPDATE) {
      JSONObject updateRecord=new JSONObject();
      updateRecord.put(Constants.ENCODED_ID_PROPERTY,getSchemaAndId(entityKey.proxyType,entityKey.encodedId));
      updateArray.put(updateRecord);
    }
  }
  if (createArray.length() > 0) {
    sideEffects.put(WriteOperation.PERSIST.name(),createArray);
  }
  if (deleteArray.length() > 0) {
    sideEffects.put(WriteOperation.DELETE.name(),deleteArray);
  }
  if (updateArray.length() > 0) {
    sideEffects.put(WriteOperation.UPDATE.name(),updateArray);
  }
  return sideEffects;
}

Fixed version (ground truth):
/** 
 * Returns a JSONObject with at most three keys: CREATE, UPDATE, DELETE. Each value is a JSONArray of JSONObjects.
 */
private JSONObject getSideEffects() throws SecurityException, JSONException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, IllegalArgumentException, InstantiationException {
}
Program: 53965
Project: 53965
Buggy source:
public Object getJsonObject(Object entityElement,Class<? extends EntityProxy> entityKeyClass,RequestProperty propertyContext) throws JSONException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  JSONObject jsonObject=new JSONObject();
  if (entityElement == null || !EntityProxy.class.isAssignableFrom(entityKeyClass)) {
    return JSONObject.NULL;
  }
  jsonObject.put(Constants.ENCODED_ID_PROPERTY,isEntityReference(entityElement,entityKeyClass));
  jsonObject.put(Constants.ENCODED_VERSION_PROPERTY,encodePropertyValueFromDataStore(entityElement,Constants.ENTITY_VERSION_PROPERTY,Constants.ENTITY_VERSION_PROPERTY.getName(),propertyContext));
  for (  Property<?> p : allProperties(entityKeyClass)) {
    if (requestedProperty(p,propertyContext)) {
      String propertyName=p.getName();
      jsonObject.put(propertyName,encodePropertyValueFromDataStore(entityElement,p,propertyName,propertyContext));
    }
  }
  return jsonObject;
}

Fixed version (ground truth):
public Object getJsonObject(Object entityElement,Class<? extends EntityProxy> entityKeyClass,RequestProperty propertyContext) throws JSONException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  if (entityElement == null || !EntityProxy.class.isAssignableFrom(entityKeyClass)) {
    return JSONObject.NULL;
  }
  JSONObject jsonObject=getJsonObjectWithIdAndVersion(isEntityReference(entityElement,entityKeyClass),entityElement,propertyContext);
  for (  Property<?> p : allProperties(entityKeyClass)) {
    if (requestedProperty(p,propertyContext)) {
      String propertyName=p.getName();
      jsonObject.put(propertyName,encodePropertyValueFromDataStore(entityElement,p,propertyName,propertyContext));
    }
  }
  return jsonObject;
}
Program: 53968
Project: 53968
Buggy source:
public void testEndToEnd() throws Exception {
  com.google.gwt.requestfactory.server.SimpleFoo.reset();
  JSONObject foo=fetchVerifyAndGetInitialObject();
  foo.put("String_Node_Str",45);
  foo.put("String_Node_Str","String_Node_Str");
  foo.put("String_Node_Str","String_Node_Str" + 9L);
  foo.put("String_Node_Str",SimpleEnum.BAR.ordinal());
  foo.put("String_Node_Str",false);
  Date now=new Date();
  foo.put("String_Node_Str","String_Node_Str" + now.getTime());
  JSONObject result=getResultFromServer(foo);
  SimpleFoo fooResult=SimpleFoo.findSimpleFooById(999L);
  JSONArray updateArray=result.getJSONObject("String_Node_Str").getJSONArray("String_Node_Str");
  assertEquals(1,updateArray.length());
  assertEquals(1,updateArray.getJSONObject(0).length());
  assertTrue(updateArray.getJSONObject(0).has(Constants.ENCODED_ID_PROPERTY));
  assertFalse(updateArray.getJSONObject(0).has("String_Node_Str"));
  assertEquals(45,(int)fooResult.getIntId());
  assertEquals("String_Node_Str",fooResult.getUserName());
  assertEquals(now,fooResult.getCreated());
  assertEquals(9L,(long)fooResult.getLongField());
  assertEquals(com.google.gwt.requestfactory.shared.SimpleEnum.BAR,fooResult.getEnumField());
  assertEquals(false,(boolean)fooResult.getBoolField());
}

Fixed version (ground truth):
public void testEndToEnd() throws Exception {
  com.google.gwt.requestfactory.server.SimpleFoo.reset();
  JSONObject foo=fetchVerifyAndGetInitialObject();
  foo.put("String_Node_Str",45);
  foo.put("String_Node_Str","String_Node_Str");
  foo.put("String_Node_Str","String_Node_Str" + 9L);
  foo.put("String_Node_Str",SimpleEnum.BAR.ordinal());
  foo.put("String_Node_Str",false);
  Date now=new Date();
  foo.put("String_Node_Str","String_Node_Str" + now.getTime());
  JSONObject result=getResultFromServer(foo);
  SimpleFoo fooResult=SimpleFoo.findSimpleFooById(999L);
  JSONArray updateArray=result.getJSONObject("String_Node_Str").getJSONArray("String_Node_Str");
  assertEquals(1,updateArray.length());
  assertEquals(2,updateArray.getJSONObject(0).length());
  assertTrue(updateArray.getJSONObject(0).has(Constants.ENCODED_ID_PROPERTY));
  assertTrue(updateArray.getJSONObject(0).has(Constants.ENCODED_VERSION_PROPERTY));
  assertFalse(updateArray.getJSONObject(0).has("String_Node_Str"));
  assertEquals(45,(int)fooResult.getIntId());
  assertEquals("String_Node_Str",fooResult.getUserName());
  assertEquals(now,fooResult.getCreated());
  assertEquals(9L,(long)fooResult.getLongField());
  assertEquals(com.google.gwt.requestfactory.shared.SimpleEnum.BAR,fooResult.getEnumField());
  assertEquals(false,(boolean)fooResult.getBoolField());
}
Program: 53969
Project: 53969
Buggy source:
public void persist(){
  if (isNew) {
    setId(Long.toString(nextId++));
    isNew=false;
    get().put(getId(),this);
  }
}

Fixed version (ground truth):
public void persist(){
  if (isNew) {
    setId(Long.toString(nextId++));
    isNew=false;
    get().put(getId(),this);
  }
  version++;
}
Program: 53970
Project: 53970
Buggy source:
public Long countSimpleFooWithUserNameSideEffect(){
  findSimpleFoo(1L).setUserName(userName);
  return countSimpleFoo();
}

Fixed version (ground truth):
public Long countSimpleFooWithUserNameSideEffect(){
  findSimpleFoo(1L).setUserName(userName);
  version++;
  return countSimpleFoo();
}
Program: 53971
Project: 53971
Buggy source:
public void persist(){
  if (isNew) {
    setId(nextId++);
    isNew=false;
    get().put(getId(),this);
  }
}

Fixed version (ground truth):
public void persist(){
  if (isNew) {
    setId(nextId++);
    isNew=false;
    get().put(getId(),this);
  }
  version++;
}
Program: 53972
Project: 53972
Buggy source:
public Long countSimpleFooWithUserNameSideEffect(){
  get().setUserName(userName);
  return 1L;
}

Fixed version (ground truth):
public Long countSimpleFooWithUserNameSideEffect(){
  get().setUserName(userName);
  version++;
  return 1L;
}
Program: 53973
Project: 53973
Buggy source:
public void persist(){
  setId(nextId++ + "String_Node_Str");
}

Fixed version (ground truth):
public void persist(){
  setId(nextId++ + "String_Node_Str");
  version++;
}
Program: 53974
Project: 53974
Buggy source:
/** 
 * Get the HTML representation of an image. Visible for testing.
 * @param res the {@link ImageResource} to render as HTML
 * @param valign the vertical alignment
 * @param isPlaceholder if true, do not include the background image
 * @return the rendered HTML
 */
SafeHtml getImageHtml(ImageResource res,VerticalAlignmentConstant valign,boolean isPlaceholder){
  if (isPlaceholder) {
    return template.imagePlaceholder(direction,res.getWidth());
  }
 else {
    String vert=valign == HasVerticalAlignment.ALIGN_MIDDLE ? "String_Node_Str" : valign.getVerticalAlignString();
    return SafeHtmlUtils.fromTrustedString("String_Node_Str" + direction + "String_Node_Str"+ res.getWidth()+ "String_Node_Str"+ res.getURL()+ "String_Node_Str"+ SafeHtmlUtils.htmlEscape(vert)+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Get the HTML representation of an image. Visible for testing.
 * @param res the {@link ImageResource} to render as HTML
 * @param valign the vertical alignment
 * @param isPlaceholder if true, do not include the background image
 * @return the rendered HTML
 */
SafeHtml getImageHtml(ImageResource res,VerticalAlignmentConstant valign,boolean isPlaceholder){
  SafeHtml image;
  if (isPlaceholder) {
    image=SafeHtmlUtils.fromTrustedString("String_Node_Str");
  }
 else {
    AbstractImagePrototype proto=AbstractImagePrototype.create(res);
    image=SafeHtmlUtils.fromTrustedString(proto.getHTML());
  }
  if (HasVerticalAlignment.ALIGN_TOP == valign) {
    return template.imageWrapperTop(direction,image);
  }
 else   if (HasVerticalAlignment.ALIGN_BOTTOM == valign) {
    return template.imageWrapperBottom(direction,image);
  }
 else {
    int halfHeight=1 + (int)Math.round(res.getHeight() / 2.0);
    return template.imageWrapperMiddle(direction,halfHeight,image);
  }
}
Program: 53975
Project: 53975
Buggy source:
/** 
 * Construct a new   {@link IconCellDecorator}.
 * @param icon the icon to use
 * @param cell the cell to decorate
 * @param valign the vertical alignment attribute of the contents
 * @param spacing the pixel space between the icon and the cell
 */
public IconCellDecorator(ImageResource icon,Cell<C> cell,VerticalAlignmentConstant valign,int spacing){
  if (template == null) {
    template=GWT.create(Template.class);
  }
  this.cell=cell;
  this.iconHtml=getImageHtml(icon,valign,false);
  this.imageWidth=icon.getWidth() + 6;
  this.placeHolderHtml=getImageHtml(icon,valign,true);
}

Fixed version (ground truth):
/** 
 * Construct a new   {@link IconCellDecorator}.
 * @param icon the icon to use
 * @param cell the cell to decorate
 * @param valign the vertical alignment attribute of the contents
 * @param spacing the pixel space between the icon and the cell
 */
public IconCellDecorator(ImageResource icon,Cell<C> cell,VerticalAlignmentConstant valign,int spacing){
  if (template == null) {
    template=GWT.create(Template.class);
  }
  this.cell=cell;
  this.iconHtml=getImageHtml(icon,valign,false);
  this.imageWidth=icon.getWidth() + spacing;
  this.placeHolderHtml=getImageHtml(icon,valign,true);
}
Program: 53976
Project: 53976
Buggy source:
/** 
 * Get the HTML representation of an image.
 * @param res the {@link ImageResource} to render as HTML
 * @return the rendered HTML
 */
private SafeHtml getImageHtml(ImageResource res){
  return SafeHtmlUtils.fromTrustedString("String_Node_Str" + (LocaleInfo.getCurrentLocale().isRTL() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ res.getWidth()+ "String_Node_Str"+ res.getURL()+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get the HTML representation of an image.
 * @param res the {@link ImageResource} to render as HTML
 * @return the rendered HTML
 */
private SafeHtml getImageHtml(ImageResource res){
  AbstractImagePrototype proto=AbstractImagePrototype.create(res);
  SafeHtml image=SafeHtmlUtils.fromTrustedString(proto.getHTML());
  return template.imageWrapper((LocaleInfo.getCurrentLocale().isRTL() ? "String_Node_Str" : "String_Node_Str"),res.getWidth(),res.getHeight(),image);
}
Program: 53977
Project: 53977
Buggy source:
/** 
 * Get the HTML representation of an image.
 * @param res the {@link ImageResource} to render as HTML
 * @param isTop true if the image is for a top level element.
 * @return the rendered HTML
 */
private SafeHtml getImageHtml(ImageResource res,boolean isTop){
  StringBuilder classesBuilder=new StringBuilder(style.cellTreeItemImage());
  if (isTop) {
    classesBuilder.append("String_Node_Str").append(style.cellTreeTopItemImage());
  }
  String direction;
  if (LocaleInfo.getCurrentLocale().isRTL()) {
    direction="String_Node_Str";
  }
 else {
    direction="String_Node_Str";
  }
  return template.image(classesBuilder.toString(),direction,res.getHeight(),res.getWidth(),res.getURL());
}

Fixed version (ground truth):
/** 
 * Get the HTML representation of an image.
 * @param res the {@link ImageResource} to render as HTML
 * @param isTop true if the image is for a top level element.
 * @return the rendered HTML
 */
private SafeHtml getImageHtml(ImageResource res,boolean isTop){
  StringBuilder classesBuilder=new StringBuilder(style.cellTreeItemImage());
  if (isTop) {
    classesBuilder.append("String_Node_Str").append(style.cellTreeTopItemImage());
  }
  String direction;
  if (LocaleInfo.getCurrentLocale().isRTL()) {
    direction="String_Node_Str";
  }
 else {
    direction="String_Node_Str";
  }
  AbstractImagePrototype proto=AbstractImagePrototype.create(res);
  SafeHtml image=SafeHtmlUtils.fromTrustedString(proto.getHTML());
  return template.imageWrapper(classesBuilder.toString(),direction,res.getWidth(),res.getHeight(),image);
}
Program: 53978
Project: 53978
Buggy source:
protected List<PropertyColumn<EmployeeProxy,?>> getColumns(){
  List<PropertyColumn<EmployeeProxy,?>> columns=new ArrayList<PropertyColumn<EmployeeProxy,?>>();
  columns.add(PropertyColumn.<EmployeeProxy>getStringPropertyColumn("String_Node_Str","String_Node_Str"));
  columns.add(PropertyColumn.<EmployeeProxy>getStringPropertyColumn("String_Node_Str","String_Node_Str"));
  columns.add(PropertyColumn.<EmployeeProxy>getStringPropertyColumn("String_Node_Str","String_Node_Str"));
  columns.add(new PropertyColumn<EmployeeProxy,EmployeeProxy>("String_Node_Str","String_Node_Str",EmployeeRenderer.instance()));
  return columns;
}

Fixed version (ground truth):
protected List<PropertyColumn<EmployeeProxy,?>> getColumns(){
  List<PropertyColumn<EmployeeProxy,?>> columns=new ArrayList<PropertyColumn<EmployeeProxy,?>>();
  columns.add(PropertyColumn.<EmployeeProxy>getStringPropertyColumn("String_Node_Str","String_Node_Str"));
  columns.add(PropertyColumn.<EmployeeProxy>getStringPropertyColumn("String_Node_Str","String_Node_Str"));
  columns.add(PropertyColumn.<EmployeeProxy>getStringPropertyColumn("String_Node_Str","String_Node_Str"));
  columns.add(new PropertyColumn<EmployeeProxy,EmployeeProxy>("String_Node_Str","String_Node_Str",EmployeeProxy.class,EmployeeRenderer.instance()));
  return columns;
}
Program: 53979
Project: 53979
Buggy source:
protected List<PropertyColumn<ReportProxy,?>> getColumns(){
  List<PropertyColumn<ReportProxy,?>> columns=new ArrayList<PropertyColumn<ReportProxy,?>>();
  columns.add(new PropertyColumn<ReportProxy,Date>("String_Node_Str","String_Node_Str",new DateTimeFormatRenderer(DateTimeFormat.getShortDateFormat())));
  columns.add(PropertyColumn.<ReportProxy>getStringPropertyColumn("String_Node_Str","String_Node_Str"));
  columns.add(new PropertyColumn<ReportProxy,EmployeeProxy>("String_Node_Str","String_Node_Str",EmployeeRenderer.instance()));
  columns.add(new PropertyColumn<ReportProxy,EmployeeProxy>("String_Node_Str","String_Node_Str",EmployeeRenderer.instance()));
  return columns;
}

Fixed version (ground truth):
protected List<PropertyColumn<ReportProxy,?>> getColumns(){
  List<PropertyColumn<ReportProxy,?>> columns=new ArrayList<PropertyColumn<ReportProxy,?>>();
  columns.add(new PropertyColumn<ReportProxy,Date>("String_Node_Str","String_Node_Str",Date.class,new DateTimeFormatRenderer(DateTimeFormat.getShortDateFormat())));
  columns.add(PropertyColumn.<ReportProxy>getStringPropertyColumn("String_Node_Str","String_Node_Str"));
  columns.add(new PropertyColumn<ReportProxy,EmployeeProxy>("String_Node_Str","String_Node_Str",EmployeeProxy.class,EmployeeRenderer.instance()));
  columns.add(new PropertyColumn<ReportProxy,EmployeeProxy>("String_Node_Str","String_Node_Str",EmployeeProxy.class,EmployeeRenderer.instance()));
  return columns;
}
Program: 53980
Project: 53980
Buggy source:
@Override public String getValue(R object){
  ProxyImpl proxyImpl=(ProxyImpl)object;
  return renderer.render(proxyImpl.<T>get(property,String.class));
}

Fixed version (ground truth):
@Override public String getValue(R object){
  ProxyImpl proxyImpl=(ProxyImpl)object;
  return renderer.render(proxyImpl.<T>get(property,clazz));
}
Program: 53981
Project: 53981
Buggy source:
public PropertyColumn(String property,String displayName,Renderer<T> renderer){
  this.displayName=displayName;
  this.property=property;
  this.renderer=renderer;
  this.paths=new String[]{property};
}

Fixed version (ground truth):
public PropertyColumn(String property,String displayName,Class<T> clazz,Renderer<T> renderer){
  this.displayName=displayName;
  this.property=property;
  this.clazz=clazz;
  this.renderer=renderer;
  this.paths=new String[]{property};
}
Program: 53982
Project: 53982
Buggy source:
public static <R extends EntityProxy>PropertyColumn<R,String> getStringPropertyColumn(String property,String displayName){
  return new PropertyColumn<R,String>(property,displayName,PassthroughRenderer.instance());
}

Fixed version (ground truth):
public static <R extends EntityProxy>PropertyColumn<R,String> getStringPropertyColumn(String property,String displayName){
  return new PropertyColumn<R,String>(property,displayName,String.class,PassthroughRenderer.instance());
}
Program: 53984
Project: 53984
Buggy source:
/** 
 * Returns the string representation of the parameters to be passed to the server side method.
 */
private String getParametersAsString(JMethod method,TypeOracle typeOracle){
  StringBuilder sb=new StringBuilder();
  for (  JParameter parameter : method.getParameters()) {
    if (sb.length() > 0) {
      sb.append("String_Node_Str");
    }
    JClassType classType=parameter.getType().isClassOrInterface();
    JType paramType=parameter.getType();
    JParameterizedType params=paramType.isParameterized();
    if (params != null) {
      classType=params.getTypeArgs()[0];
    }
    if (classType != null && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
      sb.append("String_Node_Str" + classType.getQualifiedBinaryName() + "String_Node_Str"+ "String_Node_Str");
    }
    sb.append(parameter.getName());
    if (classType != null && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
      sb.append("String_Node_Str");
    }
  }
  return "String_Node_Str" + sb.toString() + "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Returns the string representation of the parameters to be passed to the server side method.
 */
private String getParametersAsString(JMethod method,TypeOracle typeOracle){
  StringBuilder sb=new StringBuilder();
  for (  JParameter parameter : method.getParameters()) {
    if (sb.length() > 0) {
      sb.append("String_Node_Str");
    }
    JClassType classType=parameter.getType().isClassOrInterface();
    JType paramType=parameter.getType();
    if (paramType.getQualifiedSourceName().equals(EntityProxyId.class.getName())) {
      sb.append("String_Node_Str" + parameter.getName() + "String_Node_Str");
      continue;
    }
    JParameterizedType params=paramType.isParameterized();
    if (params != null) {
      classType=params.getTypeArgs()[0];
    }
    if (classType != null && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
      sb.append("String_Node_Str" + classType.getQualifiedBinaryName() + "String_Node_Str"+ "String_Node_Str");
    }
    sb.append(parameter.getName());
    if (classType != null && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
      sb.append("String_Node_Str");
    }
  }
  return "String_Node_Str" + sb.toString() + "String_Node_Str";
}
Program: 53988
Project: 53988
Buggy source:
public void onSuccess(UserInformationProxy userInformationRecord,Set<SyncResult> syncResults){
  login.setUserInformation(userInformationRecord);
}

Fixed version (ground truth):
@Override public void onSuccess(UserInformationProxy userInformationRecord,Set<SyncResult> syncResults){
  login.setUserInformation(userInformationRecord);
}
Program: 53990
Project: 53990
Buggy source:
public void onSuccess(UserInformationProxy userInformationRecord,Set<SyncResult> syncResults){
  login.setUserInformation(userInformationRecord);
}

Fixed version (ground truth):
@Override public void onSuccess(UserInformationProxy userInformationRecord,Set<SyncResult> syncResults){
  login.setUserInformation(userInformationRecord);
}
Program: 53991
Project: 53991
Buggy source:
public Widget asWidget(){
  return this;
}

Fixed version (ground truth):
@Override public Widget asWidget(){
  return this;
}
Program: 53992
Project: 53992
Buggy source:
@SuppressWarnings("String_Node_Str") public void onCustom(){
  ExpenseProxy editableExpense=requestObject.edit(expense);
  editableExpense.setDescription(nameText.getText());
  editableExpense.setCategory(categoryText.getText());
  String amountText=priceText.getText();
  double amount=Double.parseDouble(amountText);
  editableExpense.setAmount(amount);
  Date date=new Date(dateYear.getSelectedIndex() + 100,dateMonth.getSelectedIndex(),dateDay.getSelectedIndex() + 1);
  editableExpense.setCreated(date);
  requestObject.fire(new Receiver<Void>(){
    public void onSuccess(    Void ignore,    Set<SyncResult> response){
      String errorMessage="String_Node_Str";
      if (errorMessage.length() > 0) {
        errorText.setInnerText(errorMessage);
      }
 else {
        listener.onExpenseUpdated();
      }
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void onCustom(){
  ExpenseProxy editableExpense=requestObject.edit(expense);
  editableExpense.setDescription(nameText.getText());
  editableExpense.setCategory(categoryText.getText());
  String amountText=priceText.getText();
  double amount=Double.parseDouble(amountText);
  editableExpense.setAmount(amount);
  Date date=new Date(dateYear.getSelectedIndex() + 100,dateMonth.getSelectedIndex(),dateDay.getSelectedIndex() + 1);
  editableExpense.setCreated(date);
  requestObject.fire(new Receiver<Void>(){
    @Override public void onSuccess(    Void ignore,    Set<SyncResult> response){
      String errorMessage="String_Node_Str";
      if (errorMessage.length() > 0) {
        errorText.setInnerText(errorMessage);
      }
 else {
        listener.onExpenseUpdated();
      }
    }
  }
);
}
Program: 53993
Project: 53993
Buggy source:
public Widget asWidget(){
  return this;
}

Fixed version (ground truth):
@Override public Widget asWidget(){
  return this;
}
Program: 53994
Project: 53994
Buggy source:
public void onSuccess(Void ignore,Set<SyncResult> response){
  String errorMessage="String_Node_Str";
  if (errorMessage.length() > 0) {
    errorText.setInnerText(errorMessage);
  }
 else {
    listener.onExpenseUpdated();
  }
}

Fixed version (ground truth):
@Override public void onSuccess(Void ignore,Set<SyncResult> response){
  String errorMessage="String_Node_Str";
  if (errorMessage.length() > 0) {
    errorText.setInnerText(errorMessage);
  }
 else {
    listener.onExpenseUpdated();
  }
}
Program: 53995
Project: 53995
Buggy source:
@SuppressWarnings("String_Node_Str") public void onCustom(){
  ReportProxy editableReport=requestObject.edit(report);
  editableReport.setPurpose(purposeText.getText());
  editableReport.setNotes(notesText.getText());
  editableReport.setDepartment(departmentList.getValue(departmentList.getSelectedIndex()));
  Date date=new Date(dateYear.getSelectedIndex() + 100,dateMonth.getSelectedIndex(),dateDay.getSelectedIndex() + 1);
  editableReport.setCreated(date);
  requestObject.fire(new Receiver<Void>(){
    public void onSuccess(    Void ignore,    Set<SyncResult> response){
      String errorMessage="String_Node_Str";
      if (errorMessage.length() > 0) {
        errorText.setInnerText(errorMessage);
      }
 else {
        listener.onReportUpdated();
      }
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void onCustom(){
  ReportProxy editableReport=requestObject.edit(report);
  editableReport.setPurpose(purposeText.getText());
  editableReport.setNotes(notesText.getText());
  editableReport.setDepartment(departmentList.getValue(departmentList.getSelectedIndex()));
  Date date=new Date(dateYear.getSelectedIndex() + 100,dateMonth.getSelectedIndex(),dateDay.getSelectedIndex() + 1);
  editableReport.setCreated(date);
  requestObject.fire(new Receiver<Void>(){
    @Override public void onSuccess(    Void ignore,    Set<SyncResult> response){
      String errorMessage="String_Node_Str";
      if (errorMessage.length() > 0) {
        errorText.setInnerText(errorMessage);
      }
 else {
        listener.onReportUpdated();
      }
    }
  }
);
}
Program: 53996
Project: 53996
Buggy source:
public Widget asWidget(){
  return this;
}

Fixed version (ground truth):
@Override public Widget asWidget(){
  return this;
}
Program: 53997
Project: 53997
Buggy source:
public void onSuccess(Void ignore,Set<SyncResult> response){
  String errorMessage="String_Node_Str";
  if (errorMessage.length() > 0) {
    errorText.setInnerText(errorMessage);
  }
 else {
    listener.onReportUpdated();
  }
}

Fixed version (ground truth):
@Override public void onSuccess(Void ignore,Set<SyncResult> response){
  String errorMessage="String_Node_Str";
  if (errorMessage.length() > 0) {
    errorText.setInnerText(errorMessage);
  }
 else {
    listener.onReportUpdated();
  }
}
Program: 53998
Project: 53998
Buggy source:
public Widget asWidget(){
  return this;
}

Fixed version (ground truth):
@Override public Widget asWidget(){
  return this;
}
Program: 53999
Project: 53999
Buggy source:
public EmployeeEditView asWidget(){
  return this;
}

Fixed version (ground truth):
@Override public EmployeeEditView asWidget(){
  return this;
}
Program: 54000
Project: 54000
Buggy source:
public Widget asWidget(){
  return this;
}

Fixed version (ground truth):
@Override public Widget asWidget(){
  return this;
}
Program: 54001
Project: 54001
Buggy source:
public ReportEditView asWidget(){
  return this;
}

Fixed version (ground truth):
@Override public ReportEditView asWidget(){
  return this;
}
Program: 54002
Project: 54002
Buggy source:
public void start(AcceptsOneWidget display,EventBus eventBus){
  this.display=display;
  view.setDelegate(this);
  view.setCreating(creating);
  if (creating) {
    P tempRecord=requests.create(proxyType);
    stableId=tempRecord.stableId();
    doStart(display,tempRecord);
  }
 else {
    ProxyRequest<P> findRequest=getFindRequest(getRecord().getId());
    findRequest.with(getView().getPaths()).fire(new Receiver<P>(){
      public void onSuccess(      P record,      Set<SyncResult> syncResults){
        if (AbstractProxyEditActivity.this.display != null) {
          doStart(AbstractProxyEditActivity.this.display,record);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public void start(AcceptsOneWidget display,EventBus eventBus){
  this.display=display;
  view.setDelegate(this);
  view.setCreating(creating);
  if (creating) {
    P tempRecord=requests.create(proxyType);
    stableId=tempRecord.stableId();
    doStart(display,tempRecord);
  }
 else {
    ProxyRequest<P> findRequest=getFindRequest(getRecord().getId());
    findRequest.with(getView().getPaths()).fire(new Receiver<P>(){
      @Override public void onSuccess(      P record,      Set<SyncResult> syncResults){
        if (AbstractProxyEditActivity.this.display != null) {
          doStart(AbstractProxyEditActivity.this.display,record);
        }
      }
    }
);
  }
}
Program: 54003
Project: 54003
Buggy source:
public void onSuccess(P record,Set<SyncResult> syncResults){
  if (AbstractProxyEditActivity.this.display != null) {
    doStart(AbstractProxyEditActivity.this.display,record);
  }
}

Fixed version (ground truth):
@Override public void onSuccess(P record,Set<SyncResult> syncResults){
  if (AbstractProxyEditActivity.this.display != null) {
    doStart(AbstractProxyEditActivity.this.display,record);
  }
}
Program: 54004
Project: 54004
Buggy source:
public AbstractProxyListView<P> asWidget(){
  return this;
}

Fixed version (ground truth):
@Override public AbstractProxyListView<P> asWidget(){
  return this;
}
Program: 54005
Project: 54005
Buggy source:
/** 
 * Calls   {@link ValueBoxBase#getValueOrThrow()}. If a   {@link ParseException}is thrown, it will be available through  {@link com.google.gwt.editor.client.EditorError#getUserData() EditorError.getUserData()}.
 */
public T getValue(){
  try {
    value=peer.getValueOrThrow();
  }
 catch (  ParseException e) {
    getDelegate().recordError("String_Node_Str" + peer.getText() + "String_Node_Str",peer.getText(),e);
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Calls   {@link ValueBoxBase#getValueOrThrow()}. If a   {@link ParseException}is thrown, it will be available through  {@link com.google.gwt.editor.client.EditorError#getUserData() EditorError.getUserData()}.
 */
@Override public T getValue(){
  try {
    value=peer.getValueOrThrow();
  }
 catch (  ParseException e) {
    getDelegate().recordError("String_Node_Str" + peer.getText() + "String_Node_Str",peer.getText(),e);
  }
  return value;
}
Program: 54006
Project: 54006
Buggy source:
public void setValue(T value){
  peer.setValue(this.value=value);
}

Fixed version (ground truth):
@Override public void setValue(T value){
  peer.setValue(this.value=value);
}
Program: 54007
Project: 54007
Buggy source:
/** 
 * For debugging use only.
 */
public String toString(){
  return path + "String_Node_Str" + type.getParameterizedQualifiedSourceName();
}

Fixed version (ground truth):
/** 
 * For debugging use only.
 */
@Override public String toString(){
  return path + "String_Node_Str" + type.getParameterizedQualifiedSourceName();
}
Program: 54008
Project: 54008
Buggy source:
/** 
 * Process a child element that should be added using a   {@link UiChild} method
 */
private void handleChild(XMLElement child) throws UnableToCompleteException {
  String tag=child.getLocalName();
  Pair<JMethod,Integer> methodPair=uiChildMethods.get(tag);
  JMethod method=methodPair.left;
  int limit=methodPair.right;
  Iterator<XMLElement> children=child.consumeChildElements().iterator();
  if (!children.hasNext()) {
    return;
  }
  XMLElement toAdd=children.next();
  if (!writer.isWidgetElement(toAdd)) {
    writer.die(child,"String_Node_Str",child);
  }
  if (children.hasNext()) {
    writer.die(toAdd,"String_Node_Str");
  }
  checkLimit(limit,tag,toAdd);
  String[] parameters=makeArgsList(child,method,toAdd);
  writer.addStatement("String_Node_Str",fieldName,method.getName(),UiBinderWriter.asCommaSeparatedList(parameters));
}

Fixed version (ground truth):
/** 
 * Process a child element that should be added using a   {@link UiChild} method.
 */
private void handleChild(XMLElement child) throws UnableToCompleteException {
  String tag=child.getLocalName();
  Pair<JMethod,Integer> methodPair=uiChildMethods.get(tag);
  JMethod method=methodPair.left;
  int limit=methodPair.right;
  Iterator<XMLElement> children=child.consumeChildElements().iterator();
  if (!children.hasNext()) {
    return;
  }
  XMLElement toAdd=children.next();
  if (!writer.isWidgetElement(toAdd)) {
    writer.die(child,"String_Node_Str",child);
  }
  if (children.hasNext()) {
    writer.die(toAdd,"String_Node_Str");
  }
  checkLimit(limit,tag,toAdd);
  String[] parameters=makeArgsList(child,method,toAdd);
  writer.addStatement("String_Node_Str",fieldName,method.getName(),UiBinderWriter.asCommaSeparatedList(parameters));
}
Program: 54009
Project: 54009
Buggy source:
/** 
 * Scans the class to find all methods annotated with @UiChild
 * @param ownerType the type of the owner class
 * @throws UnableToCompleteException
 */
private void findUiChildren(JClassType ownerType) throws UnableToCompleteException {
  JMethod[] methods=ownerType.getMethods();
  while (ownerType != null) {
    for (    JMethod method : methods) {
      UiChild annotation=method.getAnnotation(UiChild.class);
      if (annotation != null) {
        String tag=annotation.tagname();
        int limit=annotation.limit();
        if (tag.equals("String_Node_Str")) {
          String name=method.getName();
          if (name.startsWith("String_Node_Str")) {
            tag=name.substring(3).toLowerCase();
          }
 else {
            logger.die(method.getName() + "String_Node_Str" + "String_Node_Str");
          }
        }
        uiChildren.put(tag,Pair.create(method,limit));
      }
    }
    ownerType=ownerType.getSuperclass();
  }
}

Fixed version (ground truth):
/** 
 * Scans the class to find all methods annotated with @UiChild.
 * @param ownerType the type of the owner class
 * @throws UnableToCompleteException
 */
private void findUiChildren(JClassType ownerType) throws UnableToCompleteException {
  JMethod[] methods=ownerType.getMethods();
  while (ownerType != null) {
    for (    JMethod method : methods) {
      UiChild annotation=method.getAnnotation(UiChild.class);
      if (annotation != null) {
        String tag=annotation.tagname();
        int limit=annotation.limit();
        if (tag.equals("String_Node_Str")) {
          String name=method.getName();
          if (name.startsWith("String_Node_Str")) {
            tag=name.substring(3).toLowerCase();
          }
 else {
            logger.die(method.getName() + "String_Node_Str" + "String_Node_Str");
          }
        }
        uiChildren.put(tag,Pair.create(method,limit));
      }
    }
    ownerType=ownerType.getSuperclass();
  }
}
Program: 54010
Project: 54010
Buggy source:
/** 
 * Gets the panel's child widget.
 * @return the child widget, or <code>null</code> if none is present
 */
public Widget getWidget();

Fixed version (ground truth):
/** 
 * Gets the panel's child widget.
 * @return the child widget, or <code>null</code> if none is present
 */
Widget getWidget();