nus-yam/ex-repair huggingface dataset:
Program: 82117
Project: 82117
Buggy source:
public void testEndToEndSmartDiff_SomeChange(){
  com.google.gwt.valuestore.server.SimpleFoo.reset();
  try {
    JSONObject foo=fetchVerifyAndGetInitialObject();
    SimpleFoo fooResult=SimpleFoo.getSingleton();
    fooResult.setUserName("String_Node_Str");
    fooResult.setIntId(45);
    foo.put("String_Node_Str","String_Node_Str");
    foo.put("String_Node_Str",45);
    Date now=new Date();
    foo.put("String_Node_Str","String_Node_Str" + now.getTime());
    JSONObject result=getResultFromServer(foo);
    assertTrue(result.getJSONObject("String_Node_Str").has("String_Node_Str"));
    fooResult=SimpleFoo.getSingleton();
    assertEquals((int)45,(int)fooResult.getIntId());
    assertEquals("String_Node_Str",fooResult.getUserName());
    assertEquals(now,fooResult.getCreated());
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail(e.toString());
  }
}

Fixed version (ground truth):
public void testEndToEndSmartDiff_SomeChange(){
  com.google.gwt.valuestore.server.SimpleFoo.reset();
  try {
    JSONObject foo=fetchVerifyAndGetInitialObject();
    SimpleFoo fooResult=SimpleFoo.getSingleton();
    fooResult.setUserName("String_Node_Str");
    fooResult.setIntId(45);
    foo.put("String_Node_Str","String_Node_Str");
    foo.put("String_Node_Str",45);
    Date now=new Date();
    long newTime=now.getTime() + 10000;
    foo.put("String_Node_Str","String_Node_Str" + newTime);
    JSONObject result=getResultFromServer(foo);
    assertTrue(result.getJSONObject("String_Node_Str").has("String_Node_Str"));
    fooResult=SimpleFoo.getSingleton();
    assertEquals((int)45,(int)fooResult.getIntId());
    assertEquals("String_Node_Str",fooResult.getUserName());
    assertEquals(newTime,fooResult.getCreated().getTime());
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail(e.toString());
  }
}
Program: 82118
Project: 82118
Buggy source:
/** 
 * Handle a keyboard event to move focus away from the current item.
 */
void keyboardExit(){
  if (keyboardSelection == null) {
    return;
  }
  Element child=keyboardSelection.getFirstChildElement().getFirstChildElement();
  child.removeAttribute("String_Node_Str");
  child.removeClassName(tree.getStyle().keyboardSelectedItem());
  keyboardSelection=null;
  keyboardSelectedIndex=-1;
  keyboardFocused=false;
}

Fixed version (ground truth):
/** 
 * Handle a keyboard event to move focus away from the current item.
 */
void keyboardExit(){
  if (keyboardSelection == null) {
    return;
  }
  Element child=keyboardSelection.getFirstChildElement().getFirstChildElement();
  child.removeAttribute("String_Node_Str");
  child.removeClassName(tree.getStyle().keyboardSelectedItem());
  keyboardSelection=null;
  keyboardFocused=false;
}
Program: 82119
Project: 82119
Buggy source:
@SuppressWarnings("String_Node_Str") public <P extends Record>P edit(P record){
  P returnRecordImpl=(P)((RecordImpl)record).getSchema().create(((RecordImpl)record).asJso());
  ((RecordImpl)returnRecordImpl).setDeltaValueStore(deltaValueStore);
  return returnRecordImpl;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <P extends Record>P edit(P record){
  P returnRecordImpl=(P)((RecordImpl)record).getSchema().create(((RecordImpl)record).asJso(),((RecordImpl)record).isFuture());
  ((RecordImpl)returnRecordImpl).setDeltaValueStore(deltaValueStore);
  return returnRecordImpl;
}
Program: 82120
Project: 82120
Buggy source:
public String toJson(){
  used=true;
  if (operations.size() > 1) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  StringBuffer jsonData=new StringBuffer("String_Node_Str");
  for (  WriteOperation writeOperation : WriteOperation.values()) {
    String jsonDataForOperation=getJsonForOperation(writeOperation);
    if (jsonDataForOperation.equals("String_Node_Str")) {
      continue;
    }
    if (jsonData.length() > 1) {
      jsonData.append("String_Node_Str");
    }
    jsonData.append(jsonDataForOperation);
  }
  jsonData.append("String_Node_Str");
  return jsonData.toString();
}

Fixed version (ground truth):
String toJson(){
  if (operations.size() > 1) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  return toJsonWithoutChecks();
}
Program: 82121
Project: 82121
Buggy source:
protected RecordKey(Long id,RecordSchema<?> schema){
}

Fixed version (ground truth):
protected RecordKey(Long id,RecordSchema<?> schema,boolean isFuture){
}
Program: 82122
Project: 82122
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((id == null) ? 0 : id.hashCode());
  result=prime * result + ((schema == null) ? 0 : schema.hashCode());
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=(isFuture ? 0 : 1);
  result=prime * result + ((id == null) ? 0 : id.hashCode());
  result=prime * result + ((schema == null) ? 0 : schema.hashCode());
  return result;
}
Program: 82123
Project: 82123
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + schema.getClass().getName() + "String_Node_Str"+ id+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + schema.getClass().getName() + "String_Node_Str"+ id+ "String_Node_Str"+ (isFuture ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str";
}
Program: 82124
Project: 82124
Buggy source:
private Record createFuture(RecordSchema<? extends Record> schema){
  Long futureId=futureIdGenerator.getFutureId();
  RecordJsoImpl newRecord=RecordJsoImpl.create(futureId,INITIAL_VERSION,schema);
  RecordKey recordKey=new RecordKey(newRecord);
  creates.put(recordKey,newRecord);
  return schema.create(newRecord);
}

Fixed version (ground truth):
private Record createFuture(RecordSchema<? extends Record> schema){
  Long futureId=++currentFutureId;
  RecordJsoImpl newRecord=RecordJsoImpl.create(futureId,INITIAL_VERSION,schema);
  RecordKey recordKey=new RecordKey(newRecord,IS_FUTURE);
  creates.put(recordKey,newRecord);
  return schema.create(newRecord,IS_FUTURE);
}
Program: 82126
Project: 82126
Buggy source:
/** 
 * @param newRecord
 * @param i
 * @param array
 */
private void setRecordInList(RecordJsoImpl newRecord,int i,JsArray<RecordJsoImpl> array){
  RecordKey recordKey=new RecordKey(newRecord);
  RecordJsoImpl oldRecord=records.get(recordKey);
  if (oldRecord == null) {
    records.put(recordKey,newRecord);
  }
 else {
    boolean changed=oldRecord.merge(newRecord);
    newRecord=oldRecord.cast();
    if (array != null) {
      array.set(i,newRecord);
    }
    if (changed) {
      eventBus.fireEvent(newRecord.getSchema().createChangeEvent(newRecord,WriteOperation.UPDATE));
    }
  }
}

Fixed version (ground truth):
/** 
 * @param newRecord
 * @param i
 * @param array
 */
private void setRecordInList(RecordJsoImpl newRecord,int i,JsArray<RecordJsoImpl> array){
  RecordKey recordKey=new RecordKey(newRecord,RequestFactoryJsonImpl.NOT_FUTURE);
  RecordJsoImpl oldRecord=records.get(recordKey);
  if (oldRecord == null) {
    records.put(recordKey,newRecord);
  }
 else {
    boolean changed=oldRecord.merge(newRecord);
    newRecord=oldRecord.cast();
    if (array != null) {
      array.set(i,newRecord);
    }
    if (changed) {
      eventBus.fireEvent(newRecord.getSchema().createChangeEvent(newRecord,WriteOperation.UPDATE));
    }
  }
}
Program: 82127
Project: 82127
Buggy source:
public void init(HandlerManager eventBus){
}

Fixed version (ground truth):
@Override public void init(HandlerManager eventBus){
}
Program: 82128
Project: 82128
Buggy source:
@Override public void gwtSetUp(){
  valueStore=new ValueStoreJsonImpl(null);
  requestFactory=new RequestFactoryJsonImpl(){
    public Record create(    Class token){
      return create(token,typeMap);
    }
    public void init(    HandlerManager eventBus){
    }
    public LoggingRequest loggingRequest(){
      return null;
    }
  }
;
  jso=RecordJsoImpl.fromJson("String_Node_Str");
  jso.set(SimpleFooRecord.id,42L);
  jso.set(SimpleFooRecord.version,1);
  jso.set(SimpleFooRecord.userName,"String_Node_Str");
  jso.set(SimpleFooRecord.password,"String_Node_Str");
  jso.set(SimpleFooRecord.intId,4);
  jso.set(SimpleFooRecord.created,new Date());
  jso.setSchema(SimpleFooRecordImpl.SCHEMA);
  valueStore.setRecord(jso);
}

Fixed version (ground truth):
@Override public void gwtSetUp(){
  valueStore=new ValueStoreJsonImpl(null);
  requestFactory=new RequestFactoryJsonImpl(){
    public Record create(    Class token){
      return create(token,typeMap);
    }
    @Override public void init(    HandlerManager eventBus){
    }
    public LoggingRequest loggingRequest(){
      return null;
    }
  }
;
  jso=RecordJsoImpl.fromJson("String_Node_Str");
  jso.set(SimpleFooRecord.id,42L);
  jso.set(SimpleFooRecord.version,1);
  jso.set(SimpleFooRecord.userName,"String_Node_Str");
  jso.set(SimpleFooRecord.password,"String_Node_Str");
  jso.set(SimpleFooRecord.intId,4);
  jso.set(SimpleFooRecord.created,new Date());
  jso.setSchema(SimpleFooRecordImpl.SCHEMA);
  valueStore.setRecord(jso);
}
Program: 82129
Project: 82129
Buggy source:
public String getModuleName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getModuleName(){
  return "String_Node_Str";
}
Program: 82130
Project: 82130
Buggy source:
public void testDeleteUpdate(){
  DeltaValueStoreJsonImpl deltaValueStore=new DeltaValueStoreJsonImpl(valueStore,requestFactory);
  deltaValueStore.delete(new MyRecordImpl(jso));
  assertTrue(deltaValueStore.isChanged());
  deltaValueStore.set(SimpleFooRecord.userName,new MyRecordImpl(jso),"String_Node_Str");
  assertTrue(deltaValueStore.isChanged());
  JSONObject changeRecord=testAndGetChangeRecord(deltaValueStore.toJson(),WriteOperation.UPDATE);
  changeRecord.get(SimpleFooRecord.userName.getName());
}

Fixed version (ground truth):
public void testDeleteUpdate(){
  DeltaValueStoreJsonImpl deltaValueStore=new DeltaValueStoreJsonImpl(valueStore,requestFactory);
  deltaValueStore.delete(new MyRecordImpl(jso));
  assertTrue(deltaValueStore.isChanged());
  deltaValueStore.set(SimpleFooRecord.userName,new MyRecordImpl(jso),"String_Node_Str");
  assertTrue(deltaValueStore.isChanged());
  JSONObject changeRecord=testAndGetChangeRecord(deltaValueStore.toJson(),WriteOperation.UPDATE);
  assertEquals("String_Node_Str",changeRecord.get(SimpleFooRecord.userName.getName()).isString().stringValue());
}
Program: 82131
Project: 82131
Buggy source:
public void testCreateUpdate(){
  Record created=requestFactory.create(SimpleFooRecord.class);
  DeltaValueStoreJsonImpl deltaValueStore=new DeltaValueStoreJsonImpl(valueStore,requestFactory);
  assertFalse(deltaValueStore.isChanged());
  deltaValueStore.set(SimpleFooRecord.userName,created,"String_Node_Str");
  assertTrue(deltaValueStore.isChanged());
  JSONObject changeRecord=testAndGetChangeRecord(deltaValueStore.toJson(),WriteOperation.CREATE);
  changeRecord.get(SimpleFooRecord.userName.getName());
}

Fixed version (ground truth):
public void testCreateUpdate(){
  Record created=requestFactory.create(SimpleFooRecord.class);
  DeltaValueStoreJsonImpl deltaValueStore=new DeltaValueStoreJsonImpl(valueStore,requestFactory);
  assertFalse(deltaValueStore.isChanged());
  deltaValueStore.set(SimpleFooRecord.userName,created,"String_Node_Str");
  assertTrue(deltaValueStore.isChanged());
  JSONObject changeRecord=testAndGetChangeRecord(deltaValueStore.toJson(),WriteOperation.CREATE);
  assertEquals("String_Node_Str",changeRecord.get(SimpleFooRecord.userName.getName()).isString().stringValue());
}
Program: 82132
Project: 82132
Buggy source:
public void testUpdate(){
  DeltaValueStoreJsonImpl deltaValueStore=new DeltaValueStoreJsonImpl(valueStore,requestFactory);
  deltaValueStore.set(SimpleFooRecord.userName,new MyRecordImpl(jso),"String_Node_Str");
  assertTrue(deltaValueStore.isChanged());
  JSONObject changeRecord=testAndGetChangeRecord(deltaValueStore.toJson(),WriteOperation.UPDATE);
  changeRecord.get(SimpleFooRecord.userName.getName());
}

Fixed version (ground truth):
public void testUpdate(){
  DeltaValueStoreJsonImpl deltaValueStore=new DeltaValueStoreJsonImpl(valueStore,requestFactory);
  deltaValueStore.set(SimpleFooRecord.userName,new MyRecordImpl(jso),"String_Node_Str");
  assertTrue(deltaValueStore.isChanged());
  JSONObject changeRecord=testAndGetChangeRecord(deltaValueStore.toJson(),WriteOperation.UPDATE);
  assertEquals("String_Node_Str",changeRecord.get(SimpleFooRecord.userName.getName()).isString().stringValue());
}
Program: 82133
Project: 82133
Buggy source:
/** 
 * Returns the propertyValue in the right type, from the DataStore. The value is sent into the response.
 */
public Object encodePropertyValueFromDataStore(Object entityElement,Class<?> propertyType,String propertyName,RequestProperty propertyContext) throws SecurityException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, JSONException {
  String methodName=getMethodNameFromPropertyName(propertyName,"String_Node_Str");
  Method method=entityElement.getClass().getMethod(methodName);
  Object returnValue=method.invoke(entityElement);
  if (returnValue != null && Record.class.isAssignableFrom(propertyType)) {
    Method idMethod=entityElement.getClass().getMethod("String_Node_Str");
    Long id=(Long)idMethod.invoke(entityElement);
    String keyRef=operationRegistry.getSecurityProvider().encodeClassType(propertyType) + "String_Node_Str" + id;
    addRelatedObject(keyRef,returnValue,(Class<? extends Record>)propertyType,propertyContext.getProperty(propertyName));
    return keyRef;
  }
  return encodePropertyValue(returnValue);
}

Fixed version (ground truth):
/** 
 * Returns the propertyValue in the right type, from the DataStore. The value is sent into the response.
 */
public Object encodePropertyValueFromDataStore(Object entityElement,Class<?> propertyType,String propertyName,RequestProperty propertyContext) throws SecurityException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, JSONException {
  String methodName=getMethodNameFromPropertyName(propertyName,"String_Node_Str");
  Method method=entityElement.getClass().getMethod(methodName);
  Object returnValue=method.invoke(entityElement);
  if (returnValue != null && Record.class.isAssignableFrom(propertyType)) {
    Method idMethod=returnValue.getClass().getMethod("String_Node_Str");
    Long id=(Long)idMethod.invoke(returnValue);
    String keyRef=operationRegistry.getSecurityProvider().encodeClassType(propertyType) + "String_Node_Str" + id;
    addRelatedObject(keyRef,returnValue,(Class<? extends Record>)propertyType,propertyContext.getProperty(propertyName));
    return keyRef;
  }
  return encodePropertyValue(returnValue);
}
Program: 82134
Project: 82134
Buggy source:
public void onWindowResized(int width,int height){
  if (width == windowWidth || width < 1) {
    return;
  }
  windowWidth=width;
  onWindowResizedImpl(width);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void onWindowResized(int width,int height){
  if (width == windowWidth || width < 1) {
    return;
  }
  windowWidth=width;
  onWindowResizedImpl(width);
}
Program: 82135
Project: 82135
Buggy source:
/** 
 * Load the contents of a remote file into the specified widget.
 * @param url a partial path relative to the module base URL
 * @param target the target Widget to place the contents
 * @param callback the callback when the call completes
 */
private void requestSourceContents(String url,final HTML target,final RequestCallback callback){
  if (loadingImage == null) {
    loadingImage="String_Node_Str" + GWT.getModuleBaseURL() + "String_Node_Str";
  }
  target.setDirection(HasDirection.Direction.LTR);
  DOM.setStyleAttribute(target.getElement(),"String_Node_Str","String_Node_Str");
  target.setHTML("String_Node_Str" + loadingImage);
  RequestBuilder builder=new RequestBuilder(RequestBuilder.GET,GWT.getModuleBaseURL() + url);
  RequestCallback realCallback=new RequestCallback(){
    public void onError(    Request request,    Throwable exception){
      target.setHTML("String_Node_Str");
      if (callback != null) {
        callback.onError(request,exception);
      }
    }
    public void onResponseReceived(    Request request,    Response response){
      target.setHTML(response.getText());
      if (callback != null) {
        callback.onResponseReceived(request,response);
      }
    }
  }
;
  builder.setCallback(realCallback);
  try {
    builder.send();
  }
 catch (  RequestException e) {
    realCallback.onError(null,e);
  }
}

Fixed version (ground truth):
/** 
 * Load the contents of a remote file into the specified widget.
 * @param url a partial path relative to the module base URL
 * @param target the target Widget to place the contents
 * @param callback the callback when the call completes
 */
@SuppressWarnings("String_Node_Str") private void requestSourceContents(String url,final HTML target,final RequestCallback callback){
  if (loadingImage == null) {
    loadingImage="String_Node_Str" + GWT.getModuleBaseURL() + "String_Node_Str";
  }
  target.setDirection(HasDirection.Direction.LTR);
  DOM.setStyleAttribute(target.getElement(),"String_Node_Str","String_Node_Str");
  target.setHTML("String_Node_Str" + loadingImage);
  RequestBuilder builder=new RequestBuilder(RequestBuilder.GET,GWT.getModuleBaseURL() + url);
  RequestCallback realCallback=new RequestCallback(){
    public void onError(    Request request,    Throwable exception){
      target.setHTML("String_Node_Str");
      if (callback != null) {
        callback.onError(request,exception);
      }
    }
    public void onResponseReceived(    Request request,    Response response){
      target.setHTML(response.getText());
      if (callback != null) {
        callback.onResponseReceived(request,response);
      }
    }
  }
;
  builder.setCallback(realCallback);
  try {
    builder.send();
  }
 catch (  RequestException e) {
    realCallback.onError(null,e);
  }
}
Program: 82136
Project: 82136
Buggy source:
/** 
 * Initialize this example.
 */
@ShowcaseSource @Override public Widget onInitialize(){
  DecoratedTabPanel tabPanel=new DecoratedTabPanel();
  tabPanel.setWidth("String_Node_Str");
  tabPanel.setAnimationEnabled(true);
  String[] tabTitles=constants.cwTabPanelTabs();
  HTML homeText=new HTML(constants.cwTabPanelTab0());
  tabPanel.add(homeText,tabTitles[0]);
  VerticalPanel vPanel=new VerticalPanel();
  vPanel.add(new Image(Showcase.images.gwtLogo()));
  tabPanel.add(vPanel,tabTitles[1]);
  HTML moreInfo=new HTML(constants.cwTabPanelTab2());
  tabPanel.add(moreInfo,tabTitles[2]);
  tabPanel.selectTab(0);
  tabPanel.ensureDebugId("String_Node_Str");
  return tabPanel;
}

Fixed version (ground truth):
/** 
 * Initialize this example.
 */
@SuppressWarnings("String_Node_Str") @ShowcaseSource @Override public Widget onInitialize(){
  DecoratedTabPanel tabPanel=new DecoratedTabPanel();
  tabPanel.setWidth("String_Node_Str");
  tabPanel.setAnimationEnabled(true);
  String[] tabTitles=constants.cwTabPanelTabs();
  HTML homeText=new HTML(constants.cwTabPanelTab0());
  tabPanel.add(homeText,tabTitles[0]);
  VerticalPanel vPanel=new VerticalPanel();
  vPanel.add(new Image(Showcase.images.gwtLogo()));
  tabPanel.add(vPanel,tabTitles[1]);
  HTML moreInfo=new HTML(constants.cwTabPanelTab2());
  tabPanel.add(moreInfo,tabTitles[2]);
  tabPanel.selectTab(0);
  tabPanel.ensureDebugId("String_Node_Str");
  return tabPanel;
}
Program: 82137
Project: 82137
Buggy source:
/** 
 * Initialize this example.
 */
@ShowcaseSource @Override public Widget onInitialize(){
  DatePicker datePicker=new DatePicker();
  final Label text=new Label();
  datePicker.addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Date date=event.getValue();
      String dateString=DateTimeFormat.getMediumDateFormat().format(date);
      text.setText(dateString);
    }
  }
);
  datePicker.setValue(new Date(),true);
  DateTimeFormat dateFormat=DateTimeFormat.getLongDateFormat();
  DateBox dateBox=new DateBox();
  dateBox.setFormat(new DateBox.DefaultFormat(dateFormat));
  VerticalPanel vPanel=new VerticalPanel();
  vPanel.add(new HTML(constants.cwDatePickerLabel()));
  vPanel.add(text);
  vPanel.add(datePicker);
  vPanel.add(new HTML(constants.cwDatePickerBoxLabel()));
  vPanel.add(dateBox);
  return vPanel;
}

Fixed version (ground truth):
/** 
 * Initialize this example.
 */
@SuppressWarnings("String_Node_Str") @ShowcaseSource @Override public Widget onInitialize(){
  DatePicker datePicker=new DatePicker();
  final Label text=new Label();
  datePicker.addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Date date=event.getValue();
      String dateString=DateTimeFormat.getMediumDateFormat().format(date);
      text.setText(dateString);
    }
  }
);
  datePicker.setValue(new Date(),true);
  DateTimeFormat dateFormat=DateTimeFormat.getLongDateFormat();
  DateBox dateBox=new DateBox();
  dateBox.setFormat(new DateBox.DefaultFormat(dateFormat));
  VerticalPanel vPanel=new VerticalPanel();
  vPanel.add(new HTML(constants.cwDatePickerLabel()));
  vPanel.add(text);
  vPanel.add(datePicker);
  vPanel.add(new HTML(constants.cwDatePickerBoxLabel()));
  vPanel.add(dateBox);
  return vPanel;
}
Program: 82138
Project: 82138
Buggy source:
/** 
 * Adds a widget to the panel at the specified position. Setting a position of <code>(-1, -1)</code> will cause the child widget to be positioned statically.
 * @param w the widget to be added
 * @param left the widget's left position
 * @param top the widget's top position
 */
public void add(Widget w,int left,int top){
  w.removeFromParent();
  int beforeIndex=getWidgetCount();
  setWidgetPositionImpl(w,left,top);
  insert(w,beforeIndex);
}

Fixed version (ground truth):
/** 
 * Adds a widget to the panel at the specified position. Setting a position of <code>(-1, -1)</code> will cause the child widget to be positioned statically.
 * @param w the widget to be added
 * @param left the widget's left position
 * @param top the widget's top position
 */
public void add(Widget w,int left,int top){
  w.removeFromParent();
  int beforeIndex=getWidgetCount();
  setWidgetPositionImpl(w,left,top);
  insert(w,beforeIndex);
  verifyPositionNotStatic(w);
}
Program: 82139
Project: 82139
Buggy source:
/** 
 * Inserts a child widget at the specified position before the specified index. Setting a position of <code>(-1, -1)</code> will cause the child widget to be positioned statically. If the widget is already a child of this panel, it will be moved to the specified index.
 * @param w the child widget to be inserted
 * @param left the widget's left position
 * @param top the widget's top position
 * @param beforeIndex the index before which it will be inserted
 * @throws IndexOutOfBoundsException if <code>beforeIndex</code> is out ofrange
 */
public void insert(Widget w,int left,int top,int beforeIndex){
  w.removeFromParent();
  setWidgetPositionImpl(w,left,top);
  insert(w,beforeIndex);
}

Fixed version (ground truth):
/** 
 * Inserts a child widget at the specified position before the specified index. Setting a position of <code>(-1, -1)</code> will cause the child widget to be positioned statically. If the widget is already a child of this panel, it will be moved to the specified index.
 * @param w the child widget to be inserted
 * @param left the widget's left position
 * @param top the widget's top position
 * @param beforeIndex the index before which it will be inserted
 * @throws IndexOutOfBoundsException if <code>beforeIndex</code> is out ofrange
 */
public void insert(Widget w,int left,int top,int beforeIndex){
  w.removeFromParent();
  setWidgetPositionImpl(w,left,top);
  insert(w,beforeIndex);
  verifyPositionNotStatic(w);
}
Program: 82140
Project: 82140
Buggy source:
/** 
 * Sets the position of the specified child widget. Setting a position of <code>(-1, -1)</code> will cause the child widget to be positioned statically.
 * @param w the child widget to be positioned
 * @param left the widget's left position
 * @param top the widget's top position
 */
public void setWidgetPosition(Widget w,int left,int top){
  checkWidgetParent(w);
  setWidgetPositionImpl(w,left,top);
}

Fixed version (ground truth):
/** 
 * Sets the position of the specified child widget. Setting a position of <code>(-1, -1)</code> will cause the child widget to be positioned statically.
 * @param w the child widget to be positioned
 * @param left the widget's left position
 * @param top the widget's top position
 */
public void setWidgetPosition(Widget w,int left,int top){
  checkWidgetParent(w);
  setWidgetPositionImpl(w,left,top);
  verifyPositionNotStatic(w);
}
Program: 82141
Project: 82141
Buggy source:
/** 
 * Called to fetch the string token needed to get a new record via  {@link DeltaValueStore#create}.
 */
protected abstract Class getRecordClass();

Fixed version (ground truth):
/** 
 * Called to fetch the string token needed to get a new record via  {@link DeltaValueStore#create}.
 */
protected abstract Class<? extends Record> getRecordClass();
Program: 82142
Project: 82142
Buggy source:
/** 
 * Ignore DevMode's normal WEB-INF classloader rules and just allow the system classloader to dominate. This makes JUnitHostImpl live in the right classloader (mine).
 */
@SuppressWarnings("String_Node_Str") @Override protected WebAppContext createWebAppContext(TreeLogger logger,File appRootDir){
  return new WebAppContext(appRootDir.getAbsolutePath(),"String_Node_Str"){
{
      getInitParams().put("String_Node_Str","String_Node_Str");
      setParentLoaderPriority(true);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Ignore DevMode's normal WEB-INF classloader rules and just allow the system classloader to dominate. This makes JUnitHostImpl live in the right classloader (mine).
 */
@Override protected WebAppContext createWebAppContext(TreeLogger logger,File appRootDir){
  return new WebAppContext(appRootDir.getAbsolutePath(),"String_Node_Str"){
{
      getInitParams().put("String_Node_Str","String_Node_Str");
      setParentLoaderPriority(true);
    }
  }
;
}
Program: 82143
Project: 82143
Buggy source:
@Override public void flush(){
  if (!closed) {
    for (    LogRecord record : records) {
      Receiver<Long> loggingReciever=new LoggingReceiver();
      requestFactory.loggingRequest().logMessage(record.getLevel().toString(),record.getLoggerName(),record.getMessage()).fire(loggingReciever);
    }
  }
}

Fixed version (ground truth):
@Override public void flush(){
  if (!closed) {
    for (    LogRecord record : records) {
      Receiver<Long> loggingReceiver=new LoggingReceiver();
      requestFactory.loggingRequest().logMessage(record.getLevel().toString(),record.getLoggerName(),record.getMessage()).fire(loggingReceiver);
    }
  }
}
Program: 82144
Project: 82144
Buggy source:
/** 
 * Generate an ID for a new record. The default behavior is to return null and let the data store generate the ID automatically.
 * @param key the key of the record field
 * @return the ID of the new record, or null to auto generate
 */
protected Long generateIdForCreate(@SuppressWarnings("String_Node_Str") String key){
  return null;
}

Fixed version (ground truth):
/** 
 * Generate an ID for a new record. The default behavior is to return null and let the data store generate the ID automatically.
 * @param key the key of the record field
 * @return the ID of the new record, or null to auto generate
 */
protected Long generateIdForCreate(String key){
  return null;
}
Program: 82145
Project: 82145
Buggy source:
/** 
 * Failed in all modes due to HtmlUnit bug:
 */
@DoNotRunWith({Platform.HtmlUnitBug}) public void testValueChangeEvent(){
  TextBoxBase tb=createTextBoxBase();
  RootPanel.get().add(tb);
  Handler h=new Handler();
  tb.addValueChangeHandler(h);
  tb.setValue(null);
  assertEquals("String_Node_Str",tb.getValue());
  assertNull(h.received);
  tb.setText("String_Node_Str");
  assertEquals("String_Node_Str",tb.getValue());
  assertNull(h.received);
  tb.setValue("String_Node_Str");
  assertEquals("String_Node_Str",tb.getValue());
  assertNull(h.received);
  tb.setValue("String_Node_Str");
  assertNull(h.received);
  tb.setValue("String_Node_Str",true);
  assertEquals("String_Node_Str",tb.getValue());
  assertNull(h.received);
  tb.setValue("String_Node_Str",true);
  assertEquals("String_Node_Str",h.received);
  tb.setValue("String_Node_Str",true);
  assertEquals("String_Node_Str",h.received);
}

Fixed version (ground truth):
/** 
 * Failed in all modes due to HtmlUnit bug.
 */
@DoNotRunWith({Platform.HtmlUnitBug}) public void testValueChangeEvent(){
  TextBoxBase tb=createTextBoxBase();
  RootPanel.get().add(tb);
  Handler h=new Handler();
  tb.addValueChangeHandler(h);
  tb.setValue(null);
  assertEquals("String_Node_Str",tb.getValue());
  assertNull(h.received);
  tb.setText("String_Node_Str");
  assertEquals("String_Node_Str",tb.getValue());
  assertNull(h.received);
  tb.setValue("String_Node_Str");
  assertEquals("String_Node_Str",tb.getValue());
  assertNull(h.received);
  tb.setValue("String_Node_Str");
  assertNull(h.received);
  tb.setValue("String_Node_Str",true);
  assertEquals("String_Node_Str",tb.getValue());
  assertNull(h.received);
  tb.setValue("String_Node_Str",true);
  assertEquals("String_Node_Str",h.received);
  tb.setValue("String_Node_Str",true);
  assertEquals("String_Node_Str",h.received);
}
Program: 82146
Project: 82146
Buggy source:
public void removeView(ListView<T> view){
  if (!views.contains(view)) {
    throw new IllegalStateException("String_Node_Str");
  }
  views.remove(view);
  view.setDelegate(null);
}

Fixed version (ground truth):
public void removeView(ListView<T> view){
  if (!views.contains(view)) {
    throw new IllegalStateException("String_Node_Str");
  }
  views.remove(view);
  view.setDataProvider(null);
}
Program: 82147
Project: 82147
Buggy source:
/** 
 * Inform the views of the total number of items that are available.
 * @param size the new size
 * @param exact true if the size is exact, false if it is a guess
 */
protected void updateDataSize(int size,boolean exact){
  for (  ListView<T> view : views) {
    view.setDataSize(size,exact);
  }
}

Fixed version (ground truth):
/** 
 * Inform the views of the total number of items that are available.
 * @param size the new size
 * @param exact true if the size is exact, false if it is a guess
 */
protected void updateDataSize(int size,boolean exact){
  lastDataSize=size;
  lastDataSizeExact=exact;
  for (  ListView<T> view : views) {
    view.setDataSize(size,exact);
  }
}
Program: 82148
Project: 82148
Buggy source:
/** 
 * Adds a view to this adapter. The current range of interest of the view will be populated with data.
 * @param view a {@link ListView}.
 */
public void addView(ListView<T> view){
  if (views.contains(view)) {
    throw new IllegalStateException("String_Node_Str");
  }
  views.add(view);
  view.setDelegate(delegate);
  delegate.onRangeChanged(view);
}

Fixed version (ground truth):
/** 
 * Adds a view to this adapter. The current range of interest of the view will be populated with data.
 * @param view a {@link ListView}.
 */
public void addView(ListView<T> view){
  if (views.contains(view)) {
    throw new IllegalStateException("String_Node_Str");
  }
  views.add(view);
  view.setDataProvider(dataProvider,false);
  if (lastDataSize >= 0) {
    view.setDataSize(lastDataSize,lastDataSizeExact);
  }
  dataProvider.onRangeChanged(view);
}
Program: 82149
Project: 82149
Buggy source:
/** 
 * Formats Fractional seconds field according to pattern specified.
 * @param buf where formatted string will be appended to
 * @param count number of time pattern char repeats; this controls how a fieldshould be formatted
 * @param date hold the date object to be formatted
 */
private void formatFractionalSeconds(StringBuffer buf,int count,Date date){
  long time=date.getTime();
  int value;
  if (time < 0) {
    value=1000 - (int)(-time % 1000);
  }
 else {
    value=(int)(time % 1000);
  }
  if (count == 1) {
    value=Math.min((value + 50) / 100,9);
    buf.append((char)('0' + value));
  }
 else   if (count == 2) {
    value=Math.min((value + 5) / 10,99);
    zeroPaddingNumber(buf,value,2);
  }
 else {
    zeroPaddingNumber(buf,value,3);
    if (count > 3) {
      zeroPaddingNumber(buf,0,count - 3);
    }
  }
}

Fixed version (ground truth):
/** 
 * Formats Fractional seconds field according to pattern specified.
 * @param buf where formatted string will be appended to
 * @param count number of time pattern char repeats; this controls how a fieldshould be formatted
 * @param date hold the date object to be formatted
 */
private void formatFractionalSeconds(StringBuffer buf,int count,Date date){
  long time=date.getTime();
  int value;
  if (time < 0) {
    value=1000 - (int)(-time % 1000);
    if (value == 1000) {
      value=0;
    }
  }
 else {
    value=(int)(time % 1000);
  }
  if (count == 1) {
    value=Math.min((value + 50) / 100,9);
    buf.append((char)('0' + value));
  }
 else   if (count == 2) {
    value=Math.min((value + 5) / 10,99);
    zeroPaddingNumber(buf,value,2);
  }
 else {
    zeroPaddingNumber(buf,value,3);
    if (count > 3) {
      zeroPaddingNumber(buf,0,count - 3);
    }
  }
}
Program: 82150
Project: 82150
Buggy source:
public void testPre1970Milliseconds(){
  Date date=new Date(-631151998945L);
  long midnight=Date.UTC(1950 - 1900,0,1,0,0,1);
  assertEquals(-631151998945L,midnight + 55);
  TimeZone utc=TimeZone.createTimeZone(0);
  assertEquals("String_Node_Str",DateTimeFormat.getFormat("String_Node_Str").format(date,utc));
  assertEquals("String_Node_Str",DateTimeFormat.getFormat("String_Node_Str").format(date,utc));
  assertEquals("String_Node_Str",DateTimeFormat.getFormat("String_Node_Str").format(date,utc));
}

Fixed version (ground truth):
public void testPre1970Milliseconds(){
  Date date=new Date(-631151998945L);
  long midnight=Date.UTC(1950 - 1900,0,1,0,0,1);
  assertEquals(-631151998945L,midnight + 55);
  TimeZone utc=TimeZone.createTimeZone(0);
  assertEquals("String_Node_Str",DateTimeFormat.getFormat("String_Node_Str").format(date,utc));
  assertEquals("String_Node_Str",DateTimeFormat.getFormat("String_Node_Str").format(date,utc));
  assertEquals("String_Node_Str",DateTimeFormat.getFormat("String_Node_Str").format(date,utc));
  date=new Date(midnight);
  assertEquals("String_Node_Str",DateTimeFormat.getFormat("String_Node_Str").format(date,utc));
}
Program: 82151
Project: 82151
Buggy source:
/** 
 * Create an ActivityManager. Next call   {@link #setDisplay} and{@link #activate}.
 * @param mapper finds the {@link Activity} for a given {@link Place}
 * @param eventBus source of {@link PlaceChangeEvent} and{@link PlaceChangeRequestedEvent} events.
 */
public ActivityManager(ActivityMapper<P> mapper,HandlerManager eventBus){
  this.mapper=mapper;
  this.eventBus=eventBus;
}

Fixed version (ground truth):
/** 
 * Create an ActivityManager. Next call   {@link #setDisplay}.
 * @param mapper finds the {@link Activity} for a given {@link Place}
 * @param eventBus source of {@link PlaceChangeEvent} and{@link PlaceChangeRequestedEvent} events.
 */
public ActivityManager(ActivityMapper<P> mapper,HandlerManager eventBus){
  this.mapper=mapper;
  this.eventBus=eventBus;
}
Program: 82153
Project: 82153
Buggy source:
public void configureClientSideLogging(){
  Logger root=Logger.getLogger("String_Node_Str");
  setLevels(root);
  setDefaultHandlers(root);
}

Fixed version (ground truth):
public void configureClientSideLogging(){
  root=Logger.getLogger("String_Node_Str");
  setLevels(root);
  setDefaultHandlers(root);
}
Program: 82154
Project: 82154
Buggy source:
/** 
 * Evaluates a JSON expression. This method does not validate the JSON text and should only be used on JSON from trusted sources.
 * @param < T > The type of JavaScriptObject that should be returned
 * @param json The source JSON text
 * @return The evaluated object
 */
public static native <T extends JavaScriptObject>T unsafeEval(String json);

Fixed version (ground truth):
/** 
 * Evaluates a JSON expression using   {@code eval()}. This method does not validate the JSON text and should only be used on JSON from trusted sources. The payload must evaluate to an Object or an Array (not a primitive or a String).
 * @param < T > The type of JavaScriptObject that should be returned
 * @param json The source JSON text
 * @return The evaluated object
 */
public static native <T extends JavaScriptObject>T unsafeEval(String json);
Program: 82155
Project: 82155
Buggy source:
/** 
 * Evaluates a trusted JSON string and returns its JSONValue representation. CAUTION! For efficiency, this method is implemented using the JavaScript <code>eval()</code> function, which can execute arbitrary script. DO NOT pass an untrusted string into this method.
 * @param jsonString a JSON object to parse
 * @return a JSONValue that has been built by parsing the JSON string
 * @throws NullPointerException if <code>jsonString</code> is<code>null</code>
 * @throws IllegalArgumentException if <code>jsonString</code> is empty
 */
public static JSONValue parse(String jsonString){
  if (jsonString == null) {
    throw new NullPointerException();
  }
  if (jsonString.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return evaluate(jsonString);
  }
 catch (  JavaScriptException ex) {
    throw new JSONException(ex);
  }
}

Fixed version (ground truth):
private static JSONValue parse(String jsonString,boolean strict){
  if (jsonString == null) {
    throw new NullPointerException();
  }
  if (jsonString.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return evaluate(jsonString,strict);
  }
 catch (  JavaScriptException ex) {
    throw new JSONException(ex);
  }
}
Program: 82156
Project: 82156
Buggy source:
/** 
 * This method converts <code>jsonString</code> into a JSONValue.
 */
private static native JSONValue evaluate(String jsonString);

Fixed version (ground truth):
/** 
 * This method converts <code>jsonString</code> into a JSONValue. In strict mode (strict == true), one of two code paths is taken: 1) Call JSON.parse if available, or 2) Validate the input and call eval() In lenient mode (strict == false), eval() is called without validation.
 * @param strict if true, parse in strict mode. 
 */
private static native JSONValue evaluate(String json,boolean strict);
Program: 82157
Project: 82157
Buggy source:
/** 
 * Return the parsed value, or null if the field is empty.
 * @throws ParseFailedException if the value cannot be parsed
 */
public T getValueOrThrow() throws ParseException {
  String text=getText().trim();
  if ("String_Node_Str".equals(text)) {
    return null;
  }
  return parser.parse(text);
}

Fixed version (ground truth):
/** 
 * Return the parsed value, or null if the field is empty.
 * @throws ParseException if the value cannot be parsed
 */
public T getValueOrThrow() throws ParseException {
  String text=getText().trim();
  if ("String_Node_Str".equals(text)) {
    return null;
  }
  return parser.parse(text);
}
Program: 82159
Project: 82159
Buggy source:
public void testParse(){
  assertEquals(0f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(-1.5f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(3.0f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(0.5f,Float.parseFloat("String_Node_Str"),0.0);
}

Fixed version (ground truth):
public void testParse(){
  assertEquals(0f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(-1.5f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(3.0f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(0.5f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(1.0f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(1.0f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(1.0f,Float.parseFloat("String_Node_Str"),0.0);
  assertEquals(1.0f,Float.parseFloat("String_Node_Str"),0.0);
}
Program: 82160
Project: 82160
Buggy source:
public int compare(JMethod m1,JMethod m2){
  String name1=m1.getName();
  String name2=m2.getName();
  return name1.compareTo(name2);
}

Fixed version (ground truth):
public int compare(JClassType o1,JClassType o2){
  return o1.getQualifiedSourceName().compareTo(o2.getQualifiedSourceName());
}
Program: 82161
Project: 82161
Buggy source:
/** 
 * Gets all types, both top-level and nested.
 * @return an array of types, possibly of zero length
 */
public JClassType[] getTypes(){
  Collection<JRealClassType> values=allTypes.values();
  return values.toArray(new JClassType[values.size()]);
}

Fixed version (ground truth):
/** 
 * Gets all types, both top-level and nested.
 * @return an array of types, possibly of zero length
 */
public JClassType[] getTypes(){
  Collection<JRealClassType> values=allTypes.values();
  JClassType[] result=values.toArray(new JClassType[values.size()]);
  Arrays.sort(result,new Comparator<JClassType>(){
    public int compare(    JClassType o1,    JClassType o2){
      return o1.getQualifiedSourceName().compareTo(o2.getQualifiedSourceName());
    }
  }
);
  return result;
}
Program: 82163
Project: 82163
Buggy source:
@Override public void finalizeLayout(Element parent){
  if (!isIE6()) {
    super.finalizeLayout(parent);
    return;
  }
  resizeRelativeToParent(parent);
  resizeHandler(parent,true);
}

Fixed version (ground truth):
@Override public void finalizeLayout(Element parent){
  resizeRelativeToParent(parent);
  resizeHandler(parent,true);
}
Program: 82164
Project: 82164
Buggy source:
@Override public void fillParent(Element elem){
  if (!isIE6()) {
    super.fillParent(elem);
    return;
  }
  fillParentImpl(elem);
}

Fixed version (ground truth):
@Override public void fillParent(Element elem){
  fillParentImpl(elem);
}
Program: 82165
Project: 82165
Buggy source:
@Override public void onDetach(Element parent){
  if (isIE6()) {
    removeLayerRefs(parent);
    removeResizeHandler(parent);
    removeUnitChangeHandler(relativeRuler);
  }
}

Fixed version (ground truth):
@Override public void onDetach(Element parent){
  removeLayerRefs(parent);
  removeResizeHandler(parent);
  removeUnitChangeHandler(relativeRuler);
}
Program: 82166
Project: 82166
Buggy source:
@Override public void layout(Layer layer){
  if (!isIE6()) {
    super.layout(layer);
    return;
  }
  Element elem=layer.getContainerElement();
  setLayer(elem,layer);
}

Fixed version (ground truth):
@Override public void layout(Layer layer){
  Element elem=layer.getContainerElement();
  setLayer(elem,layer);
}
Program: 82167
Project: 82167
Buggy source:
@Override public void onAttach(Element parent){
  if (isIE6()) {
    initResizeHandler(parent);
    initUnitChangeHandler(parent,relativeRuler);
  }
}

Fixed version (ground truth):
@Override public void onAttach(Element parent){
  initResizeHandler(parent);
  initUnitChangeHandler(parent,relativeRuler);
}
Program: 82168
Project: 82168
Buggy source:
@Override public void initParent(Element parent){
  super.initParent(parent);
  if (isIE6()) {
    setPropertyElement(parent,"String_Node_Str",createStyleRuler(parent));
  }
}

Fixed version (ground truth):
@Override public void initParent(Element parent){
  super.initParent(parent);
  setPropertyElement(parent,"String_Node_Str",createStyleRuler(parent));
}
Program: 82169
Project: 82169
Buggy source:
public void layout(Layer layer){
  Style style=layer.container.getStyle();
  if (layer.setLeft) {
    setValue(layer,"String_Node_Str",layer.left,layer.leftUnit,false,false);
  }
 else {
    style.clearLeft();
  }
  if (layer.setRight) {
    setValue(layer,"String_Node_Str",layer.right,layer.rightUnit,false,false);
  }
 else {
    style.clearRight();
  }
  if (layer.setTop) {
    setValue(layer,"String_Node_Str",layer.top,layer.topUnit,true,false);
  }
 else {
    style.clearTop();
  }
  if (layer.setBottom) {
    setValue(layer,"String_Node_Str",layer.bottom,layer.bottomUnit,true,false);
  }
 else {
    style.clearBottom();
  }
  if (layer.setWidth) {
    setValue(layer,"String_Node_Str",layer.width,layer.widthUnit,false,true);
  }
 else {
    style.clearWidth();
  }
  if (layer.setHeight) {
    setValue(layer,"String_Node_Str",layer.height,layer.heightUnit,true,true);
  }
 else {
    style.clearHeight();
  }
  style=layer.child.getStyle();
switch (layer.hPos) {
case BEGIN:
    style.setLeft(0,Unit.PX);
  style.clearRight();
break;
case END:
style.clearLeft();
style.setRight(0,Unit.PX);
break;
case STRETCH:
style.setLeft(0,Unit.PX);
style.setRight(0,Unit.PX);
break;
}
switch (layer.vPos) {
case BEGIN:
style.setTop(0,Unit.PX);
style.clearBottom();
break;
case END:
style.clearTop();
style.setBottom(0,Unit.PX);
break;
case STRETCH:
style.setTop(0,Unit.PX);
style.setBottom(0,Unit.PX);
break;
}
}

Fixed version (ground truth):
@Override public void layout(Layer layer){
  Style style=layer.container.getStyle();
  if (layer.setLeft) {
    setValue(layer,"String_Node_Str",layer.left,layer.leftUnit,false,false);
  }
 else {
    style.clearLeft();
  }
  if (layer.setRight) {
    setValue(layer,"String_Node_Str",layer.right,layer.rightUnit,false,false);
  }
 else {
    style.clearRight();
  }
  if (layer.setTop) {
    setValue(layer,"String_Node_Str",layer.top,layer.topUnit,true,false);
  }
 else {
    style.clearTop();
  }
  if (layer.setBottom) {
    setValue(layer,"String_Node_Str",layer.bottom,layer.bottomUnit,true,false);
  }
 else {
    style.clearBottom();
  }
  if (layer.setWidth) {
    setValue(layer,"String_Node_Str",layer.width,layer.widthUnit,false,true);
  }
 else {
    style.clearWidth();
  }
  if (layer.setHeight) {
    setValue(layer,"String_Node_Str",layer.height,layer.heightUnit,true,true);
  }
 else {
    style.clearHeight();
  }
  style=layer.child.getStyle();
switch (layer.hPos) {
case BEGIN:
    style.setLeft(0,Unit.PX);
  style.clearRight();
break;
case END:
style.clearLeft();
style.setRight(0,Unit.PX);
break;
case STRETCH:
style.setLeft(0,Unit.PX);
style.setRight(0,Unit.PX);
break;
}
switch (layer.vPos) {
case BEGIN:
style.setTop(0,Unit.PX);
style.clearBottom();
break;
case END:
style.clearTop();
style.setBottom(0,Unit.PX);
break;
case STRETCH:
style.setTop(0,Unit.PX);
style.setBottom(0,Unit.PX);
break;
}
}
Program: 82170
Project: 82170
Buggy source:
public void traverse(JVisitor visitor,Context ctx){
  if (visitor.visit(this,ctx)) {
    lhs=visitor.accept(lhs);
    rhs=visitor.accept(rhs);
  }
  visitor.endVisit(this,ctx);
}

Fixed version (ground truth):
public void traverse(JVisitor visitor,Context ctx){
  if (visitor.visit(this,ctx)) {
    if (isAssignment()) {
      lhs=visitor.acceptLvalue(lhs);
    }
 else {
      lhs=visitor.accept(lhs);
    }
    rhs=visitor.accept(rhs);
  }
  visitor.endVisit(this,ctx);
}
Program: 82171
Project: 82171
Buggy source:
public void traverse(JVisitor visitor,Context ctx){
  if (visitor.visit(this,ctx)) {
    variableRef=(JVariableRef)visitor.accept(variableRef);
    if (initializer != null) {
      initializer=visitor.accept(initializer);
    }
  }
  visitor.endVisit(this,ctx);
}

Fixed version (ground truth):
public void traverse(JVisitor visitor,Context ctx){
  if (visitor.visit(this,ctx)) {
    variableRef=(JVariableRef)visitor.acceptLvalue(variableRef);
    if (initializer != null) {
      initializer=visitor.accept(initializer);
    }
  }
  visitor.endVisit(this,ctx);
}
Program: 82172
Project: 82172
Buggy source:
public void traverse(JVisitor visitor,Context ctx){
  arg=visitor.accept(arg);
}

Fixed version (ground truth):
public void traverse(JVisitor visitor,Context ctx){
  if (getOp().isModifying()) {
    arg=visitor.acceptLvalue(arg);
  }
 else {
    arg=visitor.accept(arg);
  }
}
Program: 82173
Project: 82173
Buggy source:
@Override public final boolean visit(JStatement x,Context ctx){
  if (ctx.canInsert()) {
    insertionStack.push(ctx);
  }
  return super.visit(x,ctx);
}

Fixed version (ground truth):
@Override public final boolean visit(JStatement x,Context ctx){
  if (ctx.canInsert() && !banList.contains(x)) {
    insertionStack.push(ctx);
  }
  if (x instanceof JForStatement) {
    JForStatement forStmt=(JForStatement)x;
    banList.addAll(forStmt.getIncrements());
  }
  return super.visit(x,ctx);
}