nus-yam/ex-repair huggingface dataset:
Program: 53650
Project: 53650
Buggy source:
/** 
 * Gets the value of a named property.
 */
private native String getPropertyImpl(String name);

Fixed version (ground truth):
/** 
 * Gets the value of a named property.
 */
private String getPropertyImpl(String name){
  return DOMImpl.impl.getStyleProperty(this,name);
}
Program: 53651
Project: 53651
Buggy source:
/** 
 * Does all of the work necessary to do the dispatch to the appropriate variant of   {@link JavaScriptHost#invokeNativeVoid JavaScriptHost.invokeNative*}. And example output: <pre> return JavaScriptHost.invokeNativeInt( "@com.google.gwt.sample.hello.client.Hello::echo(I)", null, new Class[] {int.class,}, new Object[] {x,}); </pre>
 */
@Override public void visitCode(){
  super.visitCode();
  String jsniTarget=getJsniSignature(name,descriptor);
  visitLdcInsn(jsniTarget);
  if (isStatic) {
    visitInsn(Opcodes.ACONST_NULL);
  }
 else {
    loadThis();
    visitMethodInsn(Opcodes.INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
  loadClassArray();
  loadArgArray();
  Type returnType=Type.getReturnType(descriptor);
  JavaScriptHostInfo info=JavaScriptHostInfo.get(returnType.getSort());
  invokeStatic(JavaScriptHostInfo.TYPE,info.getMethod());
  if (info.requiresCast()) {
    checkCast(returnType);
  }
  returnValue();
}

Fixed version (ground truth):
/** 
 * Does all of the work necessary to do the dispatch to the appropriate variant of   {@link JavaScriptHost#invokeNativeVoid JavaScriptHost.invokeNative*}. And example output: <pre> return JavaScriptHost.invokeNativeInt( "@com.google.gwt.sample.hello.client.Hello::echo(I)", null, new Class[] {int.class,}, new Object[] {x,}); </pre>
 */
@Override public void visitCode(){
  super.visitCode();
  String jsniTarget=getJsniSignature(name,descriptor);
  visitLdcInsn(jsniTarget);
  if (isStatic) {
    visitInsn(Opcodes.ACONST_NULL);
  }
 else {
    loadThis();
  }
  loadClassArray();
  loadArgArray();
  Type returnType=Type.getReturnType(descriptor);
  JavaScriptHostInfo info=JavaScriptHostInfo.get(returnType.getSort());
  invokeStatic(JavaScriptHostInfo.TYPE,info.getMethod());
  if (info.requiresCast()) {
    checkCast(returnType);
  }
  returnValue();
}
Program: 53652
Project: 53652
Buggy source:
/** 
 * Verify that the given widget is not statically positioned on the page (relative to the document window), unless the widget is in fact directly attached to the document BODY. Note that the current use of this method is not comprehensive, since we can only verify the offsetParent if both parent (AbsolutePanel) and child widget are both visible and attached to the DOM when this test is executed.
 * @param child the widget whose position and placement should be tested
 */
private void verifyPositionNotStatic(Widget child){
  if (GWT.isProdMode()) {
    return;
  }
  if (child.getElement().getOffsetParent() == null) {
    return;
  }
  if (child.getElement().getOffsetParent() == getElement()) {
    return;
  }
  if ("String_Node_Str".equals(getElement().getNodeName().toLowerCase())) {
    return;
  }
  String className=getClass().getName();
  GWT.log("String_Node_Str" + className + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",new IllegalStateException(className + "String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Verify that the given widget is not statically positioned on the page (relative to the document window), unless the widget is in fact directly attached to the document BODY. Note that the current use of this method is not comprehensive, since we can only verify the offsetParent if both parent (AbsolutePanel) and child widget are both visible and attached to the DOM when this test is executed.
 * @param child the widget whose position and placement should be tested
 */
private void verifyPositionNotStatic(Widget child){
  if (GWT.isProdMode()) {
    return;
  }
  if (!isAttached()) {
    return;
  }
  if (child.getElement().getOffsetParent() == null) {
    return;
  }
  if (child.getElement().getOffsetParent() == getElement()) {
    return;
  }
  if ("String_Node_Str".equals(getElement().getNodeName().toLowerCase())) {
    return;
  }
  String className=getClass().getName();
  GWT.log("String_Node_Str" + className + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",new IllegalStateException(className + "String_Node_Str"));
}
Program: 53653
Project: 53653
Buggy source:
/** 
 * Does all of the work necessary to do the dispatch to the appropriate variant of   {@link JavaScriptHost#invokeNativeVoid JavaScriptHost.invokeNative*}. And example output: <pre> return JavaScriptHost.invokeNativeInt( "@com.google.gwt.sample.hello.client.Hello::echo(I)", null, new Class[] {int.class,}, new Object[] {x,}); </pre>
 */
@Override public void visitCode(){
  super.visitCode();
  String jsniTarget=getJsniSignature(name,descriptor);
  visitLdcInsn(jsniTarget);
  if (isStatic) {
    visitInsn(Opcodes.ACONST_NULL);
  }
 else {
    loadThis();
  }
  loadClassArray();
  loadArgArray();
  Type returnType=Type.getReturnType(descriptor);
  JavaScriptHostInfo info=JavaScriptHostInfo.get(returnType.getSort());
  invokeStatic(JavaScriptHostInfo.TYPE,info.getMethod());
  if (info.requiresCast()) {
    checkCast(returnType);
  }
  returnValue();
}

Fixed version (ground truth):
/** 
 * Does all of the work necessary to do the dispatch to the appropriate variant of   {@link JavaScriptHost#invokeNativeVoid JavaScriptHost.invokeNative*}. And example output: <pre> return JavaScriptHost.invokeNativeInt( "@com.google.gwt.sample.hello.client.Hello::echo(I)", null, new Class[] {int.class,}, new Object[] {x,}); </pre>
 */
@Override public void visitCode(){
  super.visitCode();
  String jsniTarget=getJsniSignature(name,descriptor);
  visitLdcInsn(jsniTarget);
  if (isStatic) {
    visitInsn(Opcodes.ACONST_NULL);
  }
 else {
    loadThis();
    visitMethodInsn(Opcodes.INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
  loadClassArray();
  loadArgArray();
  Type returnType=Type.getReturnType(descriptor);
  JavaScriptHostInfo info=JavaScriptHostInfo.get(returnType.getSort());
  invokeStatic(JavaScriptHostInfo.TYPE,info.getMethod());
  if (info.requiresCast()) {
    checkCast(returnType);
  }
  returnValue();
}
Program: 53654
Project: 53654
Buggy source:
/** 
 * Creates a   {@link CellWidget} with the specified cell, initial value, keyprovider, using the specified element as the wrapper around the cell.
 * @param cell the cell to wrap
 * @param initialValue the initial value of the Cell
 * @param keyProvider the key provider used to get keys from values
 * @param elem the browser element to use
 */
protected CellWidget(Cell<C> cell,C initialValue,ProvidesKey<C> keyProvider,Element elem){
  this.cell=cell;
  this.keyProvider=keyProvider;
  setElement(elem);
  CellBasedWidgetImpl.get().sinkEvents(this,cell.getConsumedEvents());
  setValue(initialValue);
}

Fixed version (ground truth):
/** 
 * Creates a   {@link CellWidget} with the specified cell, initial value, keyprovider, using the specified element as the wrapper around the cell.
 * @param cell the cell to wrap
 * @param initialValue the initial value of the Cell
 * @param keyProvider the key provider used to get keys from values
 * @param elem the browser element to use
 */
protected CellWidget(Cell<C> cell,C initialValue,ProvidesKey<C> keyProvider,Element elem){
  this.cell=cell;
  this.keyProvider=keyProvider;
  setElement(elem);
  CellBasedWidgetImpl.get().sinkEvents(this,cell.getConsumedEvents());
  this.value=initialValue;
  redraw();
}
Program: 53655
Project: 53655
Buggy source:
public ProvidesKey<C> getKeyProvider(){
  return keyProvider;
}

Fixed version (ground truth):
@Override public ProvidesKey<C> getKeyProvider(){
  return keyProvider;
}
Program: 53656
Project: 53656
Buggy source:
public void update(C value){
  setValue(value,true,false);
}

Fixed version (ground truth):
@Override public void update(C value){
  setValue(value,true,false);
}
Program: 53657
Project: 53657
Buggy source:
public LeafValueEditor<C> asEditor(){
  if (editor == null) {
    editor=TakesValueEditor.of(this);
  }
  return editor;
}

Fixed version (ground truth):
@Override public LeafValueEditor<C> asEditor(){
  if (editor == null) {
    editor=TakesValueEditor.of(this);
  }
  return editor;
}
Program: 53658
Project: 53658
Buggy source:
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<C> handler){
  return addHandler(handler,ValueChangeEvent.getType());
}

Fixed version (ground truth):
@Override public HandlerRegistration addValueChangeHandler(ValueChangeHandler<C> handler){
  return addHandler(handler,ValueChangeEvent.getType());
}
Program: 53659
Project: 53659
Buggy source:
public C getValue(){
  return value;
}

Fixed version (ground truth):
@Override public C getValue(){
  return value;
}
Program: 53660
Project: 53660
Buggy source:
public Object getKey(String item){
  return (item == null) ? null : item.substring(0,1);
}

Fixed version (ground truth):
@Override public Object getKey(String item){
  return (item == null) ? null : item.substring(0,1);
}
Program: 53661
Project: 53661
Buggy source:
public void onValueChange(ValueChangeEvent<C> event){
  assertFalse("String_Node_Str",onValueChangeCalled);
  onValueChangeCalled=true;
  lastValue=event.getValue();
}

Fixed version (ground truth):
@Override public void onValueChange(ValueChangeEvent<C> event){
  assertFalse("String_Node_Str",onValueChangeCalled);
  onValueChangeCalled=true;
  lastValue=event.getValue();
}
Program: 53662
Project: 53662
Buggy source:
public void testOnBrowserEventWithKeyProvider(){
  ProvidesKey<String> keyProvider=new ProvidesKey<String>(){
    public Object getKey(    String item){
      return (item == null) ? null : item.substring(0,1);
    }
  }
;
  CustomCell cell=new CustomCell();
  final CellWidget<String> cw=new CellWidget<String>(cell,"String_Node_Str",keyProvider);
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals(keyProvider,cw.getKeyProvider());
  Event event=Document.get().createChangeEvent().cast();
  cw.onBrowserEvent(event);
  cell.assertLastEventKey("String_Node_Str");
  cell.assertLastEventValue("String_Node_Str");
  assertEquals("String_Node_Str",cw.getValue());
}

Fixed version (ground truth):
public void testOnBrowserEventWithKeyProvider(){
  ProvidesKey<String> keyProvider=new ProvidesKey<String>(){
    @Override public Object getKey(    String item){
      return (item == null) ? null : item.substring(0,1);
    }
  }
;
  CustomCell cell=new CustomCell();
  final CellWidget<String> cw=new CellWidget<String>(cell,"String_Node_Str",keyProvider);
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals(keyProvider,cw.getKeyProvider());
  Event event=Document.get().createChangeEvent().cast();
  cw.onBrowserEvent(event);
  cell.assertLastEventKey("String_Node_Str");
  cell.assertLastEventValue("String_Node_Str");
  assertEquals("String_Node_Str",cw.getValue());
}
Program: 53663
Project: 53663
Buggy source:
public void testSetValue(){
  CustomCell cell=new CustomCell();
  CellWidget<String> cw=new CellWidget<String>(cell,"String_Node_Str");
  MockValueChangeHandler<String> handler=new MockValueChangeHandler<String>();
  cw.addValueChangeHandler(handler);
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  cw.setValue("String_Node_Str");
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  handler.assertOnValueChangeNotCalled();
  cw.setValue("String_Node_Str",true);
  handler.assertOnValueChangeNotCalled();
  cw.setValue("String_Node_Str",true);
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  handler.assertLastValue("String_Node_Str");
  cw.setValue("String_Node_Str",true,false);
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  handler.assertLastValue("String_Node_Str");
}

Fixed version (ground truth):
public void testSetValue(){
  CustomCell cell=new CustomCell();
  CellWidget<String> cw=new CellWidget<String>(cell,"String_Node_Str");
  MockValueChangeHandler<String> handler=new MockValueChangeHandler<String>();
  cw.addValueChangeHandler(handler);
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  cell.assertLastRenderedValue("String_Node_Str");
  cw.setValue("String_Node_Str");
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  cell.assertLastRenderedValue("String_Node_Str");
  handler.assertOnValueChangeNotCalled();
  cw.setValue("String_Node_Str",true);
  handler.assertOnValueChangeNotCalled();
  cw.setValue("String_Node_Str",true);
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  cell.assertLastRenderedValue("String_Node_Str");
  handler.assertLastValue("String_Node_Str");
  cw.setValue("String_Node_Str",true,false);
  assertEquals("String_Node_Str",cw.getValue());
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  handler.assertLastValue("String_Node_Str");
}
Program: 53664
Project: 53664
Buggy source:
@Override public void render(com.google.gwt.cell.client.Cell.Context context,String value,SafeHtmlBuilder sb){
  sb.appendHtmlConstant("String_Node_Str").appendEscaped(value).appendHtmlConstant("String_Node_Str");
  sb.appendHtmlConstant("String_Node_Str");
}

Fixed version (ground truth):
@Override public void render(com.google.gwt.cell.client.Cell.Context context,String value,SafeHtmlBuilder sb){
  if (value != null) {
    sb.appendHtmlConstant("String_Node_Str").appendEscaped(value).appendHtmlConstant("String_Node_Str");
    sb.appendHtmlConstant("String_Node_Str");
  }
}
Program: 53665
Project: 53665
Buggy source:
/** 
 * Test that a cell that defines an HTML elment can be rendered.
 */
public void testRedrawWithMultipleInnerChildren(){
  Cell<String> cell=new AbstractCell<String>(){
    @Override public void render(    com.google.gwt.cell.client.Cell.Context context,    String value,    SafeHtmlBuilder sb){
      sb.appendHtmlConstant("String_Node_Str").appendEscaped(value).appendHtmlConstant("String_Node_Str");
      sb.appendHtmlConstant("String_Node_Str");
    }
  }
;
  CellWidget<String> cw=new CellWidget<String>(cell);
  cw.setValue("String_Node_Str",false,false);
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  cw.redraw();
  assertTrue(cw.getElement().getInnerText().contains("String_Node_Str"));
  Style firstChildStyle=cw.getElement().getFirstChildElement().getStyle();
  assertFalse(firstChildStyle.getHeight().matches("String_Node_Str"));
  assertFalse(firstChildStyle.getWidth().matches("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Test that a cell that defines an HTML elment can be rendered.
 */
public void testRedrawWithMultipleInnerChildren(){
  Cell<String> cell=new AbstractCell<String>(){
    @Override public void render(    com.google.gwt.cell.client.Cell.Context context,    String value,    SafeHtmlBuilder sb){
      if (value != null) {
        sb.appendHtmlConstant("String_Node_Str").appendEscaped(value).appendHtmlConstant("String_Node_Str");
        sb.appendHtmlConstant("String_Node_Str");
      }
    }
  }
;
  CellWidget<String> cw=new CellWidget<String>(cell);
  cw.setValue("String_Node_Str",false,false);
  assertEquals("String_Node_Str",cw.getElement().getInnerText());
  cw.redraw();
  assertTrue(cw.getElement().getInnerText().contains("String_Node_Str"));
  Style firstChildStyle=cw.getElement().getFirstChildElement().getStyle();
  assertFalse(firstChildStyle.getHeight().matches("String_Node_Str"));
  assertFalse(firstChildStyle.getWidth().matches("String_Node_Str"));
}
Program: 53666
Project: 53666
Buggy source:
public static Test suite(){
  GWTTestSuite suite=new GWTTestSuite("String_Node_Str");
  suite.addTestSuite(AuthorTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  GWTTestSuite suite=new GWTTestSuite("String_Node_Str");
  suite.addTestSuite(AuthorTest.class);
  suite.addTestSuite(BookTest.class);
  return suite;
}
Program: 53667
Project: 53667
Buggy source:
private SourceMapping loadSourceMap(String permutationStrongName,int fragmentId){
  SourceMapping toReturn=sourceMaps.get(permutationStrongName + fragmentId);
  if (toReturn == null) {
    try {
      SourceMapConsumerV3 consumer=new SourceMapConsumerV3();
      String sourceMapString=loadStreamAsString(getSourceMapInputStream(permutationStrongName,fragmentId));
      JSONObject obj=new JSONObject(sourceMapString);
      toReturn=SourceMapConsumerFactory.parse(sourceMapString);
      sourceMaps.put(permutationStrongName + fragmentId,toReturn);
    }
 catch (    Exception e) {
    }
  }
  return toReturn;
}

Fixed version (ground truth):
private SourceMapping loadSourceMap(String permutationStrongName,int fragmentId){
  SourceMapping toReturn=sourceMaps.get(permutationStrongName + fragmentId);
  if (toReturn == null) {
    try {
      String sourceMapString=loadStreamAsString(getSourceMapInputStream(permutationStrongName,fragmentId));
      toReturn=SourceMapConsumerFactory.parse(sourceMapString);
      sourceMaps.put(permutationStrongName + fragmentId,toReturn);
    }
 catch (    Exception e) {
    }
  }
  return toReturn;
}
Program: 53669
Project: 53669
Buggy source:
public static void recordSourceMap(List<Map<Range,SourceInfo>> sourceInfoMaps,List<SyntheticArtifact> artifacts,int permutationId){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  SourceMapGenerator generator=SourceMapGeneratorFactory.getInstance(SourceMapFormat.V3);
  OutputStreamWriter out=new OutputStreamWriter(baos);
  int fragment=0;
  if (!sourceInfoMaps.isEmpty()) {
    for (    Map<Range,SourceInfo> sourceMap : sourceInfoMaps) {
      generator.reset();
      Set<Range> rangeSet=sourceMap.keySet();
      Range[] ranges=rangeSet.toArray(new Range[rangeSet.size()]);
      Arrays.sort(ranges,Range.DEPENDENCY_ORDER_COMPARATOR);
      for (      Range r : ranges) {
        SourceInfo si=sourceMap.get(r);
        if (si.getFileName() == null || si.getStartLine() < 0) {
          continue;
        }
        if (r.getStartLine() == 0 || r.getEndLine() == 0) {
          continue;
        }
        generator.addMapping(si.getFileName(),null,new FilePosition(si.getStartLine(),0),new FilePosition(r.getStartLine(),r.getStartColumn()),new FilePosition(r.getEndLine(),r.getEndColumn()));
      }
      try {
        baos.reset();
        generator.appendTo(out,"String_Node_Str" + fragment);
        out.flush();
        artifacts.add(new SymbolMapsLinker.SourceMapArtifact(permutationId,fragment,baos.toByteArray()));
        fragment++;
      }
 catch (      IOException e) {
        throw new InternalCompilerException(e.toString(),e);
      }
    }
  }
}

Fixed version (ground truth):
public static void recordSourceMap(List<Map<Range,SourceInfo>> sourceInfoMaps,List<SyntheticArtifact> artifacts,int permutationId){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  SourceMapGenerator generator=SourceMapGeneratorFactory.getInstance(SourceMapFormat.V3);
  OutputStreamWriter out=new OutputStreamWriter(baos);
  int fragment=0;
  if (!sourceInfoMaps.isEmpty()) {
    for (    Map<Range,SourceInfo> sourceMap : sourceInfoMaps) {
      generator.reset();
      Set<Range> rangeSet=sourceMap.keySet();
      Range[] ranges=rangeSet.toArray(new Range[rangeSet.size()]);
      Arrays.sort(ranges,Range.DEPENDENCY_ORDER_COMPARATOR);
      for (      Range r : ranges) {
        SourceInfo si=sourceMap.get(r);
        if (si.getFileName() == null || si.getStartLine() < 0) {
          continue;
        }
        if (r.getStartLine() == 0 || r.getEndLine() == 0) {
          continue;
        }
        generator.addMapping(si.getFileName(),null,new FilePosition(si.getStartLine() - 1,0),new FilePosition(r.getStartLine(),r.getStartColumn()),new FilePosition(r.getEndLine(),r.getEndColumn()));
      }
      try {
        baos.reset();
        generator.appendTo(out,"String_Node_Str" + fragment);
        out.flush();
        artifacts.add(new SymbolMapsLinker.SourceMapArtifact(permutationId,fragment,baos.toByteArray()));
        fragment++;
      }
 catch (      IOException e) {
        throw new InternalCompilerException(e.toString(),e);
      }
    }
  }
}
Program: 53670
Project: 53670
Buggy source:
public ImageResource cellListSelectedBackground(){
  return delegate.cellBrowserSelectedBackground();
}

Fixed version (ground truth):
@Override public ImageResource cellListSelectedBackground(){
  return delegate.cellBrowserSelectedBackground();
}
Program: 53671
Project: 53671
Buggy source:
public String getName(){
  return delegate.getName();
}

Fixed version (ground truth):
@Override public String getName(){
  return delegate.getName();
}
Program: 53672
Project: 53672
Buggy source:
public void onValueChange(ValueChangeEvent<List<C>> event){
  Object focusedKey=display.focusedKey;
  if (focusedKey != null) {
    boolean stillExists=false;
    List<C> displayValues=event.getValue();
    for (    C displayValue : displayValues) {
      if (focusedKey.equals(display.getValueKey(displayValue))) {
        stillExists=true;
        break;
      }
    }
    if (!stillExists) {
      trimToLevel(display.level);
    }
  }
}

Fixed version (ground truth):
@Override public void onValueChange(ValueChangeEvent<List<C>> event){
  Object focusedKey=display.focusedKey;
  if (focusedKey != null) {
    boolean stillExists=false;
    List<C> displayValues=event.getValue();
    for (    C displayValue : displayValues) {
      if (focusedKey.equals(display.getValueKey(displayValue))) {
        stillExists=true;
        break;
      }
    }
    if (!stillExists) {
      trimToLevel(display.level);
    }
  }
}
Program: 53673
Project: 53673
Buggy source:
public int getIndex(){
  assertNotDestroyed();
  TreeNodeImpl<?> parent=getParent();
  return (parent == null) ? 0 : parent.getOpenIndex();
}

Fixed version (ground truth):
@Override public int getIndex(){
  assertNotDestroyed();
  TreeNodeImpl<?> parent=getParent();
  return (parent == null) ? 0 : parent.getOpenIndex();
}
Program: 53674
Project: 53674
Buggy source:
public String cellListSelectedItem(){
  return delegate.cellBrowserSelectedItem();
}

Fixed version (ground truth):
@Override public String cellListSelectedItem(){
  return delegate.cellBrowserSelectedItem();
}
Program: 53675
Project: 53675
Buggy source:
public String cellListOddItem(){
  return delegate.cellBrowserOddItem();
}

Fixed version (ground truth):
@Override public String cellListOddItem(){
  return delegate.cellBrowserOddItem();
}
Program: 53676
Project: 53676
Buggy source:
public boolean isAnimationEnabled(){
  return isAnimationEnabled;
}

Fixed version (ground truth):
@Override public boolean isAnimationEnabled(){
  return isAnimationEnabled;
}
Program: 53677
Project: 53677
Buggy source:
public boolean isChildLeaf(int index){
  assertNotDestroyed();
  checkChildBounds(index);
  return isLeaf(getChildValue(index));
}

Fixed version (ground truth):
@Override public boolean isChildLeaf(int index){
  assertNotDestroyed();
  checkChildBounds(index);
  return isLeaf(getChildValue(index));
}
Program: 53678
Project: 53678
Buggy source:
public String cellListKeyboardSelectedItem(){
  return delegate.cellBrowserKeyboardSelectedItem();
}

Fixed version (ground truth):
@Override public String cellListKeyboardSelectedItem(){
  return delegate.cellBrowserKeyboardSelectedItem();
}
Program: 53679
Project: 53679
Buggy source:
public String getText(){
  return delegate.getText();
}

Fixed version (ground truth):
@Override public String getText(){
  return delegate.getText();
}
Program: 53680
Project: 53680
Buggy source:
public boolean isDestroyed(){
  if (nodeInfo != null) {
    TreeNodeImpl<?> parent=getParentImpl();
    if (parent != null && !parent.isDestroyed()) {
      parent.display.getPresenter().flush();
    }
  }
  return nodeInfo == null;
}

Fixed version (ground truth):
@Override public boolean isDestroyed(){
  if (nodeInfo != null) {
    TreeNodeImpl<?> parent=getParentImpl();
    if (parent != null && !parent.isDestroyed()) {
      parent.display.getPresenter().flush();
    }
  }
  return nodeInfo == null;
}
Program: 53681
Project: 53681
Buggy source:
/** 
 * Unregister the list view and remove it from the widget.
 */
private void destroy(){
  display.isDestroyed=true;
  valueChangeHandler.removeHandler();
  display.setSelectionModel(null);
  nodeInfo.unsetDataDisplay();
  getSplitLayoutPanel().remove(widget);
  nodeInfo=null;
}

Fixed version (ground truth):
/** 
 * Unregister the list view and remove it from the widget.
 */
private void destroy(){
  display.isDestroyed=true;
  valueChangeHandler.removeHandler();
  display.deselectValue();
  display.setSelectionModel(null);
  nodeInfo.unsetDataDisplay();
  getSplitLayoutPanel().remove(widget);
  nodeInfo=null;
}
Program: 53682
Project: 53682
Buggy source:
/** 
 * Create a   {@link HasData} that will display items. The {@link HasData} mustextend  {@link Widget}.
 * @param < C > the item type in the list view
 * @param nodeInfo the node info with child data
 * @param level the level of the list
 * @return the {@link HasData}
 */
private <C>BrowserCellList<C> createDisplay(NodeInfo<C> nodeInfo,int level){
  BrowserCellList<C> display=new BrowserCellList<C>(nodeInfo.getCell(),level,nodeInfo.getProvidesKey());
  display.setValueUpdater(nodeInfo.getValueUpdater());
  KeyboardSelectionPolicy keyboardPolicy=getKeyboardSelectionPolicyForLists();
  display.setKeyboardSelectionPolicy(keyboardPolicy);
  return display;
}

Fixed version (ground truth):
/** 
 * Create a   {@link HasData} that will display items. The {@link HasData} mustextend  {@link Widget}.
 * @param < C > the item type in the list view
 * @param nodeInfo the node info with child data
 * @param level the level of the list
 * @return the {@link HasData}
 */
private <C>BrowserCellList<C> createDisplay(NodeInfo<C> nodeInfo,int level){
  BrowserCellList<C> display=new BrowserCellList<C>(nodeInfo.getCell(),level,nodeInfo.getProvidesKey());
  display.setValueUpdater(nodeInfo.getValueUpdater());
  display.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
  return display;
}
Program: 53683
Project: 53683
Buggy source:
public String cellListWidget(){
  return null;
}

Fixed version (ground truth):
@Override public String cellListWidget(){
  return null;
}
Program: 53684
Project: 53684
Buggy source:
public int getChildCount(){
  assertNotDestroyed();
  return display.getPresenter().getVisibleItemCount();
}

Fixed version (ground truth):
@Override public int getChildCount(){
  assertNotDestroyed();
  return display.getPresenter().getVisibleItemCount();
}
Program: 53685
Project: 53685
Buggy source:
public void onResize(){
  getSplitLayoutPanel().onResize();
}

Fixed version (ground truth):
@Override public void onResize(){
  getSplitLayoutPanel().onResize();
}
Program: 53686
Project: 53686
Buggy source:
public String cellListEvenItem(){
  return delegate.cellBrowserEvenItem();
}

Fixed version (ground truth):
@Override public String cellListEvenItem(){
  return delegate.cellBrowserEvenItem();
}
Program: 53687
Project: 53687
Buggy source:
/** 
 * Construct a new   {@link TreeNodeImpl}.
 * @param nodeInfo the nodeInfo for the children nodes
 * @param value the value of the node
 * @param display the display associated with the node
 * @param widget the widget that wraps the display
 */
public TreeNodeImpl(final NodeInfo<C> nodeInfo,Object value,final BrowserCellList<C> display,Widget widget){
  this.display=display;
  this.nodeInfo=nodeInfo;
  this.value=value;
  this.widget=widget;
  valueChangeHandler=display.addValueChangeHandler(new ValueChangeHandler<List<C>>(){
    public void onValueChange(    ValueChangeEvent<List<C>> event){
      Object focusedKey=display.focusedKey;
      if (focusedKey != null) {
        boolean stillExists=false;
        List<C> displayValues=event.getValue();
        for (        C displayValue : displayValues) {
          if (focusedKey.equals(display.getValueKey(displayValue))) {
            stillExists=true;
            break;
          }
        }
        if (!stillExists) {
          trimToLevel(display.level);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Construct a new   {@link TreeNodeImpl}.
 * @param nodeInfo the nodeInfo for the children nodes
 * @param value the value of the node
 * @param display the display associated with the node
 * @param widget the widget that wraps the display
 */
public TreeNodeImpl(final NodeInfo<C> nodeInfo,Object value,final BrowserCellList<C> display,Widget widget){
  this.display=display;
  this.nodeInfo=nodeInfo;
  this.value=value;
  this.widget=widget;
  valueChangeHandler=display.addValueChangeHandler(new ValueChangeHandler<List<C>>(){
    @Override public void onValueChange(    ValueChangeEvent<List<C>> event){
      Object focusedKey=display.focusedKey;
      if (focusedKey != null) {
        boolean stillExists=false;
        List<C> displayValues=event.getValue();
        for (        C displayValue : displayValues) {
          if (focusedKey.equals(display.getValueKey(displayValue))) {
            stillExists=true;
            break;
          }
        }
        if (!stillExists) {
          trimToLevel(display.level);
        }
      }
    }
  }
);
}
Program: 53688
Project: 53688
Buggy source:
public C getChildValue(int index){
  assertNotDestroyed();
  checkChildBounds(index);
  return display.getVisibleItem(index);
}

Fixed version (ground truth):
@Override public C getChildValue(int index){
  assertNotDestroyed();
  checkChildBounds(index);
  return display.getVisibleItem(index);
}
Program: 53689
Project: 53689
Buggy source:
public TreeNode setChildOpen(int index,boolean open,boolean fireEvents){
  assertNotDestroyed();
  checkChildBounds(index);
  if (open) {
    display.getPresenter().setKeyboardSelectedRow(index,false,true);
    return updateChildState(display,fireEvents);
  }
 else {
    if (index == display.getKeyboardSelectedRow()) {
      display.getPresenter().clearKeyboardSelectedRowValue();
      updateChildState(display,fireEvents);
    }
    return null;
  }
}

Fixed version (ground truth):
@Override public TreeNode setChildOpen(int index,boolean open,boolean fireEvents){
  assertNotDestroyed();
  checkChildBounds(index);
  if (open) {
    display.getPresenter().setKeyboardSelectedRow(index,false,true);
    return updateChildState(display,fireEvents);
  }
 else {
    if (index == display.getKeyboardSelectedRow()) {
      display.getPresenter().clearKeyboardSelectedRowValue();
      updateChildState(display,fireEvents);
    }
    return null;
  }
}
Program: 53690
Project: 53690
Buggy source:
public boolean ensureInjected(){
  return delegate.ensureInjected();
}

Fixed version (ground truth):
@Override public boolean ensureInjected(){
  return delegate.ensureInjected();
}
Program: 53691
Project: 53691
Buggy source:
public TreeNodeImpl<?> getParent(){
  assertNotDestroyed();
  return getParentImpl();
}

Fixed version (ground truth):
@Override public TreeNodeImpl<?> getParent(){
  assertNotDestroyed();
  return getParentImpl();
}
Program: 53693
Project: 53693
Buggy source:
public Object getValue(){
  return value;
}

Fixed version (ground truth):
@Override public Object getValue(){
  return value;
}
Program: 53694
Project: 53694
Buggy source:
public boolean isChildOpen(int index){
  assertNotDestroyed();
  checkChildBounds(index);
  return (display.focusedKey == null || !display.isFocusedOpen) ? false : display.focusedKey.equals(display.getValueKey(getChildValue(index)));
}

Fixed version (ground truth):
@Override public boolean isChildOpen(int index){
  assertNotDestroyed();
  checkChildBounds(index);
  return (display.focusedKey == null || !display.isFocusedOpen) ? false : display.focusedKey.equals(display.getValueKey(getChildValue(index)));
}
Program: 53695
Project: 53695
Buggy source:
public void setAnimationEnabled(boolean enable){
  this.isAnimationEnabled=enable;
}

Fixed version (ground truth):
@Override public void setAnimationEnabled(boolean enable){
  this.isAnimationEnabled=enable;
}
Program: 53696
Project: 53696
Buggy source:
public CellList.Style cellListStyle(){
  return style;
}

Fixed version (ground truth):
@Override public CellList.Style cellListStyle(){
  return style;
}
Program: 53698
Project: 53698
Buggy source:
public void onSuggestionsReady(Request request,Response response){
  display.setMoreSuggestions(response.hasMoreSuggestions(),response.getMoreSuggestionsCount());
  display.showSuggestions(SuggestBox.this,response.getSuggestions(),oracle.isDisplayStringHTML(),isAutoSelectEnabled(),suggestionCallback);
}

Fixed version (ground truth):
public void onSuggestionsReady(Request request,Response response){
  if (!isEnabled()) {
    return;
  }
  display.setMoreSuggestions(response.hasMoreSuggestions(),response.getMoreSuggestionsCount());
  display.showSuggestions(SuggestBox.this,response.getSuggestions(),oracle.isDisplayStringHTML(),isAutoSelectEnabled(),suggestionCallback);
}
Program: 53701
Project: 53701
Buggy source:
public void testOutputCssMapArtifactReturnNullOutputString() throws UnableToCompleteException {
  UnitTestTreeLogger.Builder builder=new UnitTestTreeLogger.Builder();
  builder.expectError("String_Node_Str",null);
  UnitTestTreeLogger testLogger=builder.createLogger();
  ResourceContext mockResourceContext=EasyMock.createMock(ResourceContext.class);
  Map<JMethod,String> testMap=new HashMap<JMethod,String>();
  OutputStream mockOutputStream=EasyMock.createMock(OutputStream.class);
  GeneratorContext mockGeneratorContext=EasyMock.createMock(GeneratorContext.class);
  GeneratedResource mockGeneratedResource=EasyMock.createMock(GeneratedResource.class);
  EasyMock.expect(mockResourceContext.getGeneratorContext()).andReturn(mockGeneratorContext);
  EasyMock.expect(mockGeneratorContext.tryCreateResource(testLogger,"String_Node_Str")).andReturn(null);
  EasyMock.replay(mockResourceContext);
  EasyMock.replay(mockGeneratorContext);
  CssResourceGenerator crg=new CssResourceGenerator();
  crg.outputCssMapArtifact(testLogger,mockResourceContext,testMap,"String_Node_Str");
  testLogger.assertCorrectLogEntries();
  EasyMock.verify(mockResourceContext);
  EasyMock.verify(mockGeneratorContext);
}

Fixed version (ground truth):
public void testOutputCssMapArtifactReturnNullOutputString() throws UnableToCompleteException {
  UnitTestTreeLogger.Builder builder=new UnitTestTreeLogger.Builder();
  builder.expectWarn("String_Node_Str",null);
  UnitTestTreeLogger testLogger=builder.createLogger();
  ResourceContext mockResourceContext=EasyMock.createMock(ResourceContext.class);
  Map<JMethod,String> testMap=new HashMap<JMethod,String>();
  OutputStream mockOutputStream=EasyMock.createMock(OutputStream.class);
  GeneratorContext mockGeneratorContext=EasyMock.createMock(GeneratorContext.class);
  GeneratedResource mockGeneratedResource=EasyMock.createMock(GeneratedResource.class);
  EasyMock.expect(mockResourceContext.getGeneratorContext()).andReturn(mockGeneratorContext);
  EasyMock.expect(mockGeneratorContext.tryCreateResource(testLogger,"String_Node_Str")).andReturn(null);
  JMethod method=EasyMock.createMock(JMethod.class);
  JClassType bundleType=EasyMock.createMock(JClassType.class);
  EasyMock.expect(method.getEnclosingType()).andReturn(bundleType);
  EasyMock.expect(bundleType.getQualifiedSourceName()).andReturn("String_Node_Str");
  EasyMock.expect(method.getName()).andReturn("String_Node_Str");
  EasyMock.replay(mockResourceContext);
  EasyMock.replay(mockGeneratorContext);
  EasyMock.replay(method);
  EasyMock.replay(bundleType);
  CssResourceGenerator crg=new CssResourceGenerator();
  crg.outputCssMapArtifact(testLogger,mockResourceContext,method,testMap);
  testLogger.assertCorrectLogEntries();
  EasyMock.verify(mockResourceContext);
  EasyMock.verify(mockGeneratorContext);
  EasyMock.verify(method);
  EasyMock.verify(bundleType);
}
Program: 53703
Project: 53703
Buggy source:
public void testOutputCssMapArtifact() throws UnableToCompleteException {
  UnitTestTreeLogger testLogger=new UnitTestTreeLogger.Builder().createLogger();
  ResourceContext mockResourceContext=EasyMock.createMock(ResourceContext.class);
  Map<JMethod,String> testMap=new HashMap<JMethod,String>();
  OutputStream mockOutputStream=EasyMock.createMock(OutputStream.class);
  GeneratorContext mockGeneratorContext=EasyMock.createMock(GeneratorContext.class);
  GeneratedResource mockGeneratedResource=EasyMock.createMock(GeneratedResource.class);
  EasyMock.expect(mockResourceContext.getGeneratorContext()).andReturn(mockGeneratorContext);
  EasyMock.expectLastCall().times(2);
  EasyMock.expect(mockGeneratorContext.tryCreateResource(testLogger,"String_Node_Str")).andReturn(mockOutputStream);
  EasyMock.expect(mockGeneratorContext.commitResource(testLogger,mockOutputStream)).andReturn(mockGeneratedResource);
  EasyMock.replay(mockResourceContext);
  EasyMock.replay(mockGeneratorContext);
  CssResourceGenerator crg=new CssResourceGenerator();
  crg.outputCssMapArtifact(testLogger,mockResourceContext,testMap,"String_Node_Str");
  testLogger.assertCorrectLogEntries();
  EasyMock.verify(mockResourceContext);
  EasyMock.verify(mockGeneratorContext);
}

Fixed version (ground truth):
public void testOutputCssMapArtifact() throws UnableToCompleteException {
  UnitTestTreeLogger testLogger=new UnitTestTreeLogger.Builder().createLogger();
  ResourceContext mockResourceContext=EasyMock.createMock(ResourceContext.class);
  Map<JMethod,String> testMap=new HashMap<JMethod,String>();
  OutputStream mockOutputStream=EasyMock.createMock(OutputStream.class);
  GeneratorContext mockGeneratorContext=EasyMock.createMock(GeneratorContext.class);
  GeneratedResource mockGeneratedResource=EasyMock.createMock(GeneratedResource.class);
  EasyMock.expect(mockResourceContext.getGeneratorContext()).andReturn(mockGeneratorContext);
  EasyMock.expectLastCall().times(2);
  EasyMock.expect(mockGeneratorContext.tryCreateResource(testLogger,"String_Node_Str")).andReturn(mockOutputStream);
  EasyMock.expect(mockGeneratorContext.commitResource(testLogger,mockOutputStream)).andReturn(mockGeneratedResource);
  JMethod method=EasyMock.createMock(JMethod.class);
  JClassType bundleType=EasyMock.createMock(JClassType.class);
  EasyMock.expect(method.getEnclosingType()).andReturn(bundleType);
  EasyMock.expect(bundleType.getQualifiedSourceName()).andReturn("String_Node_Str");
  EasyMock.expect(method.getName()).andReturn("String_Node_Str");
  EasyMock.replay(mockResourceContext);
  EasyMock.replay(mockGeneratorContext);
  EasyMock.replay(method);
  EasyMock.replay(bundleType);
  CssResourceGenerator crg=new CssResourceGenerator();
  crg.outputCssMapArtifact(testLogger,mockResourceContext,method,testMap);
  testLogger.assertCorrectLogEntries();
  EasyMock.verify(mockResourceContext);
  EasyMock.verify(mockGeneratorContext);
  EasyMock.verify(method);
  EasyMock.verify(bundleType);
}
Program: 53704
Project: 53704
Buggy source:
public void testOutputCssMapArtifactThrowOnTryCreateResource() throws UnableToCompleteException {
  UnitTestTreeLogger.Builder builder=new UnitTestTreeLogger.Builder();
  builder.expectError("String_Node_Str",null);
  UnitTestTreeLogger testLogger=builder.createLogger();
  ResourceContext mockResourceContext=EasyMock.createMock(ResourceContext.class);
  Map<JMethod,String> testMap=new HashMap<JMethod,String>();
  OutputStream mockOutputStream=EasyMock.createMock(OutputStream.class);
  GeneratorContext mockGeneratorContext=EasyMock.createMock(GeneratorContext.class);
  GeneratedResource mockGeneratedResource=EasyMock.createMock(GeneratedResource.class);
  EasyMock.expect(mockResourceContext.getGeneratorContext()).andReturn(mockGeneratorContext);
  EasyMock.expect(mockGeneratorContext.tryCreateResource(testLogger,"String_Node_Str")).andThrow(new UnableToCompleteException());
  EasyMock.replay(mockResourceContext);
  EasyMock.replay(mockGeneratorContext);
  CssResourceGenerator crg=new CssResourceGenerator();
  crg.outputCssMapArtifact(testLogger,mockResourceContext,testMap,"String_Node_Str");
  testLogger.assertCorrectLogEntries();
  EasyMock.verify(mockResourceContext);
  EasyMock.verify(mockGeneratorContext);
}

Fixed version (ground truth):
public void testOutputCssMapArtifactThrowOnTryCreateResource() throws UnableToCompleteException {
  UnitTestTreeLogger.Builder builder=new UnitTestTreeLogger.Builder();
  builder.expectWarn("String_Node_Str",null);
  UnitTestTreeLogger testLogger=builder.createLogger();
  ResourceContext mockResourceContext=EasyMock.createMock(ResourceContext.class);
  Map<JMethod,String> testMap=new HashMap<JMethod,String>();
  OutputStream mockOutputStream=EasyMock.createMock(OutputStream.class);
  GeneratorContext mockGeneratorContext=EasyMock.createMock(GeneratorContext.class);
  GeneratedResource mockGeneratedResource=EasyMock.createMock(GeneratedResource.class);
  EasyMock.expect(mockResourceContext.getGeneratorContext()).andReturn(mockGeneratorContext);
  EasyMock.expect(mockGeneratorContext.tryCreateResource(testLogger,"String_Node_Str")).andThrow(new UnableToCompleteException());
  JMethod method=EasyMock.createMock(JMethod.class);
  JClassType bundleType=EasyMock.createMock(JClassType.class);
  EasyMock.expect(method.getEnclosingType()).andReturn(bundleType);
  EasyMock.expect(bundleType.getQualifiedSourceName()).andReturn("String_Node_Str");
  EasyMock.expect(method.getName()).andReturn("String_Node_Str");
  EasyMock.replay(mockResourceContext);
  EasyMock.replay(mockGeneratorContext);
  EasyMock.replay(method);
  EasyMock.replay(bundleType);
  CssResourceGenerator crg=new CssResourceGenerator();
  crg.outputCssMapArtifact(testLogger,mockResourceContext,method,testMap);
  testLogger.assertCorrectLogEntries();
  EasyMock.verify(mockResourceContext);
  EasyMock.verify(mockGeneratorContext);
  EasyMock.verify(method);
  EasyMock.verify(bundleType);
}
Program: 53707
Project: 53707
Buggy source:
/** 
 * Set a row's hovering style and fire a   {@link RowHoverEvent}
 * @param tr the row element
 * @param isHovering false if this is an unhover event
 */
private void setRowHover(TableRowElement tr,boolean isHovering){
  setRowStyleName(tr,style.hoveredRow(),style.hoveredRowCell(),isHovering);
  RowHoverEvent.fire(this,tr,isHovering);
}

Fixed version (ground truth):
/** 
 * Set a row's hovering style and fire a   {@link RowHoverEvent}
 * @param tr the row element
 * @param isHovering false if this is an unhover event
 */
private void setRowHover(TableRowElement tr,boolean isHovering){
  setRowStyleName(tr,style.hoveredRow(),style.hoveredRowCell(),isHovering);
  RowHoverEvent.fire(this,tr,!isHovering);
}
Program: 53711
Project: 53711
Buggy source:
@Override public LogRecord instantiateInstance(ServerSerializationStreamReader reader) throws SerializationException {
  return LogRecord_CustomFieldSerializer.instantiate(reader);
}

Fixed version (ground truth):
@Override public LogRecord instantiateInstance(ServerSerializationStreamReader reader,Class<?> instanceClass,DequeMap<Type,Type> resolvedTypes) throws SerializationException {
  return LogRecord_CustomFieldSerializer.instantiate(reader);
}
Program: 53712
Project: 53712
Buggy source:
@SuppressWarnings("String_Node_Str") public static void deserialize(ServerSerializationStreamReader streamReader,LogRecord instance,Class<?> instanceClass,DequeMap<Type,Type> resolvedTypes) throws SerializationException {
  String loggerName=streamReader.readString();
  Long millis=streamReader.readLong();
  Object throwable=streamReader.readObject(Throwable.class,resolvedTypes);
  instance.setLoggerName(loggerName);
  instance.setMillis(millis);
  if (throwable != null && throwable instanceof SerializableThrowable) {
    instance.setThrown(((SerializableThrowable)throwable).getThrowable());
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void deserialize(ServerSerializationStreamReader streamReader,LogRecord instance,Class<?> instanceClass,DequeMap<Type,Type> resolvedTypes) throws SerializationException {
  String loggerName=streamReader.readString();
  Long millis=streamReader.readLong();
  Object throwable=streamReader.readObject(SerializableThrowable.class,resolvedTypes);
  instance.setLoggerName(loggerName);
  instance.setMillis(millis);
  if (throwable != null && throwable instanceof SerializableThrowable) {
    instance.setThrown(((SerializableThrowable)throwable).getThrowable());
  }
}
Program: 53713
Project: 53713
Buggy source:
public void onFailure(Throwable caught){
  TestSetValidator.rethrowException(caught);
}

Fixed version (ground truth):
public void onFailure(Throwable caught){
  TestSetValidator.rethrowException(caught);
  fail(caught.getMessage());
}
Program: 53714
Project: 53714
Buggy source:
public void testLogRecord(){
  LoggingRPCTestServiceAsync service=getServiceAsync();
  delayTestFinish(15000);
  service.echoLogRecord(expectedLogRecord,new AsyncCallback<LogRecord>(){
    public void onFailure(    Throwable caught){
      TestSetValidator.rethrowException(caught);
    }
    public void onSuccess(    LogRecord result){
      assertNotNull(result);
      assertTrue(isValid(result));
      finishTest();
    }
  }
);
  finishTest();
}

Fixed version (ground truth):
public void testLogRecord(){
  LoggingRPCTestServiceAsync service=getServiceAsync();
  delayTestFinish(15000);
  service.echoLogRecord(expectedLogRecord,new AsyncCallback<LogRecord>(){
    public void onFailure(    Throwable caught){
      TestSetValidator.rethrowException(caught);
      fail(caught.getMessage());
    }
    public void onSuccess(    LogRecord result){
      assertNotNull(result);
      assertTrue(isValid(result));
      finishTest();
    }
  }
);
}
Program: 53715
Project: 53715
Buggy source:
@Override public void onCellPreview(CellPreviewEvent<T> event){
  NativeEvent nativeEvent=event.getNativeEvent();
  String eventType=event.getNativeEvent().getType();
  if ("String_Node_Str".equals(eventType) && !event.isCellEditing()) {
switch (nativeEvent.getKeyCode()) {
case KeyCodes.KEY_DOWN:
      nextRow();
    handledEvent(event);
  return;
case KeyCodes.KEY_UP:
prevRow();
handledEvent(event);
return;
case KeyCodes.KEY_PAGEDOWN:
nextPage();
handledEvent(event);
return;
case KeyCodes.KEY_PAGEUP:
prevPage();
handledEvent(event);
return;
case KeyCodes.KEY_HOME:
home();
handledEvent(event);
return;
case KeyCodes.KEY_END:
end();
handledEvent(event);
return;
case 32:
handledEvent(event);
return;
}
}
 else if ("String_Node_Str".equals(eventType)) {
int relRow=event.getIndex() - display.getPageStart();
if (display.getKeyboardSelectedRow() != relRow) {
boolean isFocusable=false;
Element target=Element.as(event.getNativeEvent().getEventTarget());
isFocusable=CellBasedWidgetImpl.get().isFocusable(target);
display.setKeyboardSelectedRow(relRow,!isFocusable);
}
}
 else if ("String_Node_Str".equals(eventType)) {
int relRow=event.getIndex() - display.getPageStart();
if (display.getKeyboardSelectedRow() != relRow) {
display.setKeyboardSelectedRow(event.getIndex(),false);
return;
}
}
}

Fixed version (ground truth):
@Override public void onCellPreview(CellPreviewEvent<T> event){
  NativeEvent nativeEvent=event.getNativeEvent();
  String eventType=event.getNativeEvent().getType();
  if ("String_Node_Str".equals(eventType) && !event.isCellEditing()) {
switch (nativeEvent.getKeyCode()) {
case KeyCodes.KEY_DOWN:
      nextRow();
    handledEvent(event);
  return;
case KeyCodes.KEY_UP:
prevRow();
handledEvent(event);
return;
case KeyCodes.KEY_PAGEDOWN:
nextPage();
handledEvent(event);
return;
case KeyCodes.KEY_PAGEUP:
prevPage();
handledEvent(event);
return;
case KeyCodes.KEY_HOME:
home();
handledEvent(event);
return;
case KeyCodes.KEY_END:
end();
handledEvent(event);
return;
case 32:
handledEvent(event);
return;
}
}
 else if ("String_Node_Str".equals(eventType)) {
int relRow=event.getIndex() - display.getPageStart();
boolean isFocusable=false;
Element target=Element.as(event.getNativeEvent().getEventTarget());
isFocusable=CellBasedWidgetImpl.get().isFocusable(target);
display.setKeyboardSelectedRow(relRow,!isFocusable);
}
 else if ("String_Node_Str".equals(eventType)) {
int relRow=event.getIndex() - display.getPageStart();
if (display.getKeyboardSelectedRow() != relRow) {
display.setKeyboardSelectedRow(event.getIndex(),false);
return;
}
}
}
Program: 53716
Project: 53716
Buggy source:
public Object getKey(String item){
  return Integer.parseInt(item.substring(5));
}

Fixed version (ground truth):
@Override public Object getKey(String item){
  return Integer.parseInt(item.substring(5));
}