nus-yam/ex-repair huggingface dataset:
Program: 54218
Project: 54218
Buggy source:
private void record(JsExpression x,JsContext<JsExpression> ctx){
  if (ctx.isLvalue()) {
    return;
  }
 else   if (x.getSourceInfo().getStartLine() == lastLine && (!recordFileNames || x.getSourceInfo().getFileName().equals(lastFile))) {
    return;
  }
  SourceInfo info=x.getSourceInfo().makeChild(JsStackEmulator.class,"String_Node_Str");
  JsExpression location=program.getStringLiteral(info,String.valueOf(lastLine=info.getStartLine()));
  if (recordFileNames) {
    JsStringLiteral stringLit=program.getStringLiteral(info,baseName(lastFile=info.getFileName()) + "String_Node_Str");
    location=new JsBinaryOperation(info,JsBinaryOperator.ADD,stringLit,location);
  }
  JsArrayAccess access=new JsArrayAccess(info,lineNumbers.makeRef(info),stackIndexRef(info));
  JsBinaryOperation asg=new JsBinaryOperation(info,JsBinaryOperator.ASG,access,location);
  JsBinaryOperation comma=new JsBinaryOperation(info,JsBinaryOperator.COMMA,asg,x);
  ctx.replaceMe(comma);
}

Fixed version (ground truth):
private void record(JsExpression x,JsContext<JsExpression> ctx){
  if (ctx.isLvalue()) {
    return;
  }
 else   if (nodesInRefContext.contains(x)) {
    return;
  }
 else   if (x.getSourceInfo().getStartLine() == lastLine && (!recordFileNames || x.getSourceInfo().getFileName().equals(lastFile))) {
    return;
  }
  SourceInfo info=x.getSourceInfo().makeChild(JsStackEmulator.class,"String_Node_Str");
  JsExpression location=program.getStringLiteral(info,String.valueOf(lastLine=info.getStartLine()));
  if (recordFileNames) {
    JsStringLiteral stringLit=program.getStringLiteral(info,baseName(lastFile=info.getFileName()) + "String_Node_Str");
    location=new JsBinaryOperation(info,JsBinaryOperator.ADD,stringLit,location);
  }
  JsArrayAccess access=new JsArrayAccess(info,lineNumbers.makeRef(info),stackIndexRef(info));
  JsBinaryOperation asg=new JsBinaryOperation(info,JsBinaryOperator.ASG,access,location);
  JsBinaryOperation comma=new JsBinaryOperation(info,JsBinaryOperator.COMMA,asg,x);
  ctx.replaceMe(comma);
}
Program: 54219
Project: 54219
Buggy source:
public void traverse(JsVisitor v,JsContext<JsStatement> ctx){
  if (v.visit(this,ctx)) {
    if (iterExpr != null) {
      iterExpr=v.accept(iterExpr);
    }
    objExpr=v.accept(objExpr);
    body=v.accept(body);
  }
  v.endVisit(this,ctx);
}

Fixed version (ground truth):
public void traverse(JsVisitor v,JsContext<JsStatement> ctx){
  if (v.visit(this,ctx)) {
    if (iterExpr != null) {
      iterExpr=v.acceptLvalue(iterExpr);
    }
    objExpr=v.accept(objExpr);
    body=v.accept(body);
  }
  v.endVisit(this,ctx);
}
Program: 54220
Project: 54220
Buggy source:
/** 
 * Closes the menu bar.
 * @deprecated Use {@link #addCloseHandler(CloseHandler)} instead
 */
@Deprecated public void onPopupClosed(PopupPanel sender,boolean autoClosed){
  if (autoClosed) {
    closeAllParents();
  }
  onHide(autoClosed);
  CloseEvent.fire(MenuBar.this,sender);
  shownChildMenu=null;
  popup=null;
  if (parentMenu != null && parentMenu.popup != null) {
    parentMenu.popup.setPreviewingAllNativeEvents(true);
  }
}

Fixed version (ground truth):
/** 
 * Closes the menu bar.
 * @deprecated Use {@link #addCloseHandler(CloseHandler)} instead
 */
@Deprecated public void onPopupClosed(PopupPanel sender,boolean autoClosed){
  if (autoClosed) {
    closeAllParents();
  }
  onHide(!autoClosed);
  CloseEvent.fire(MenuBar.this,sender);
  shownChildMenu=null;
  popup=null;
  if (parentMenu != null && parentMenu.popup != null) {
    parentMenu.popup.setPreviewingAllNativeEvents(true);
  }
}
Program: 54221
Project: 54221
Buggy source:
/** 
 * Set the bind address for the web server socket. <p> Will be called before   {@link #start(TreeLogger,int,File)}, if at all. If not called, the SCL should listen on all addresses.
 * @param bindAddress host name or IP address, suitable for use with{@link InetAddress#getByName(String)}
 */
public void setBindAddress(String bindAddress){
}

Fixed version (ground truth):
/** 
 * Set the bind address for the web server socket. <p> Will be called before   {@link #start(TreeLogger,int,File)}, if at all. If not called, the SCL should listen on all addresses.
 * @param bindAddress host name or IP address, suitable for use with{@link java.net.InetAddress#getByName(String)}
 */
public void setBindAddress(String bindAddress){
}
Program: 54222
Project: 54222
Buggy source:
/** 
 * Extract the module's base path from the current request.
 * @return the module's base path, modulo protocol and host, as reported by{@link com.google.gwt.core.client.GWT#getModuleBaseURL()} or<code>null</code> if the request did not contain the {@value com.google.gwt.user.client.rpc.RpcRequestBuilder#MODULE_BASE_HEADER} header
 */
protected final String getRequestModuleBasePath(){
  try {
    String header=getThreadLocalRequest().getHeader(MODULE_BASE_HEADER);
    if (header == null) {
      return null;
    }
    return new URL(header).getPath();
  }
 catch (  MalformedURLException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Extract the module's base path from the current request.
 * @return the module's base path, modulo protocol and host, as reported by{@link com.google.gwt.core.client.GWT#getModuleBaseURL()} or<code>null</code> if the request did not contain the {@value com.google.gwt.user.client.rpc.RpcRequestBuilder#MODULE_BASE_HEADER} header
 */
protected final String getRequestModuleBasePath(){
  try {
    String header=getThreadLocalRequest().getHeader(MODULE_BASE_HEADER);
    if (header == null) {
      return null;
    }
    String path=new URL(header).getPath();
    String contextPath=getThreadLocalRequest().getContextPath();
    if (!path.startsWith(contextPath)) {
      return null;
    }
    return path.substring(contextPath.length());
  }
 catch (  MalformedURLException e) {
    return null;
  }
}
Program: 54223
Project: 54223
Buggy source:
/** 
 * This method treats arrays in a special way.
 */
private static Class<?> computeHasCustomFieldSerializer(Class<?> instanceType){
  assert(instanceType != null);
  String qualifiedTypeName=instanceType.getName();
  ClassLoader classLoader=SerializabilityUtil.class.getClassLoader();
  String simpleSerializerName=qualifiedTypeName + "String_Node_Str";
  Class<?> customSerializer=getCustomFieldSerializer(classLoader,simpleSerializerName);
  if (customSerializer != null) {
    return customSerializer;
  }
  Class<?> customSerializerClass=getCustomFieldSerializer(classLoader,JRE_SERIALIZER_PACKAGE + "String_Node_Str" + simpleSerializerName);
  if (customSerializerClass != null) {
    return customSerializerClass;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This method treats arrays in a special way.
 */
private static Class<?> computeHasCustomFieldSerializer(Class<?> instanceType){
  assert(instanceType != null);
  String qualifiedTypeName=instanceType.getName();
  ClassLoader classLoader=GWT.isClient() ? SerializabilityUtil.class.getClassLoader() : Thread.currentThread().getContextClassLoader();
  String simpleSerializerName=qualifiedTypeName + "String_Node_Str";
  Class<?> customSerializer=getCustomFieldSerializer(classLoader,simpleSerializerName);
  if (customSerializer != null) {
    return customSerializer;
  }
  Class<?> customSerializerClass=getCustomFieldSerializer(classLoader,JRE_SERIALIZER_PACKAGE + "String_Node_Str" + simpleSerializerName);
  if (customSerializerClass != null) {
    return customSerializerClass;
  }
  return null;
}
Program: 54225
Project: 54225
Buggy source:
public GeneratedCompilationUnit(GeneratedUnit generatedUnit,List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,CategorizedProblem[] problems){
  super(compiledClasses,dependencies,jsniMethods,problems);
  this.generatedUnit=generatedUnit;
}

Fixed version (ground truth):
public GeneratedCompilationUnit(GeneratedUnit generatedUnit,List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,MethodArgNamesLookup methodArgs,CategorizedProblem[] problems){
  super(compiledClasses,dependencies,jsniMethods,methodArgs,problems);
  this.generatedUnit=generatedUnit;
}
Program: 54226
Project: 54226
Buggy source:
@Override public boolean isSuperSource(){
  return false;
}

Fixed version (ground truth):
@Deprecated @Override public boolean isSuperSource(){
  return false;
}
Program: 54227
Project: 54227
Buggy source:
public CompilationUnit build(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,CategorizedProblem[] problems){
  source=null;
  return makeUnit(compiledClasses,dependencies,jsniMethods,problems);
}

Fixed version (ground truth):
public CompilationUnit build(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,MethodArgNamesLookup methodArgs,CategorizedProblem[] problems){
  source=null;
  return makeUnit(compiledClasses,dependencies,jsniMethods,methodArgs,problems);
}
Program: 54228
Project: 54228
Buggy source:
protected abstract CompilationUnit makeUnit(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,CategorizedProblem[] errors);

Fixed version (ground truth):
protected abstract CompilationUnit makeUnit(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,MethodArgNamesLookup methodArgs,CategorizedProblem[] errors);
Program: 54229
Project: 54229
Buggy source:
public CompilationUnitImpl(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,CategorizedProblem[] problems){
  this.exposedCompiledClasses=Lists.normalizeUnmodifiable(compiledClasses);
  this.dependencies=dependencies;
  this.jsniMethods=Lists.create(jsniMethods.toArray(new JsniMethod[jsniMethods.size()]));
  this.problems=problems;
  for (  CompiledClass cc : compiledClasses) {
    cc.initUnit(this);
  }
}

Fixed version (ground truth):
public CompilationUnitImpl(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,MethodArgNamesLookup methodArgs,CategorizedProblem[] problems){
  this.exposedCompiledClasses=Lists.normalizeUnmodifiable(compiledClasses);
  this.dependencies=dependencies;
  this.jsniMethods=Lists.create(jsniMethods.toArray(new JsniMethod[jsniMethods.size()]));
  this.methodArgs=methodArgs;
  this.problems=problems;
  for (  CompiledClass cc : compiledClasses) {
    cc.initUnit(this);
  }
}
Program: 54230
Project: 54230
Buggy source:
Set<ContentId> getDependencies(){
  return dependencies;
}

Fixed version (ground truth):
@Override Set<ContentId> getDependencies(){
  return dependencies;
}
Program: 54231
Project: 54231
Buggy source:
public List<JsniMethod> getJsniMethods(){
  return jsniMethods;
}

Fixed version (ground truth):
@Override public List<JsniMethod> getJsniMethods(){
  return jsniMethods;
}
Program: 54232
Project: 54232
Buggy source:
/** 
 * Returns all contained classes.
 */
Collection<CompiledClass> getCompiledClasses(){
  return exposedCompiledClasses;
}

Fixed version (ground truth):
/** 
 * Returns all contained classes.
 */
@Override Collection<CompiledClass> getCompiledClasses(){
  return exposedCompiledClasses;
}
Program: 54233
Project: 54233
Buggy source:
CategorizedProblem[] getProblems(){
  return problems;
}

Fixed version (ground truth):
@Override CategorizedProblem[] getProblems(){
  return problems;
}
Program: 54234
Project: 54234
Buggy source:
public boolean isCompiled(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isCompiled(){
  return false;
}
Program: 54235
Project: 54235
Buggy source:
public long getLastModified(){
  return unit.getLastModified();
}

Fixed version (ground truth):
@Override public long getLastModified(){
  return unit.getLastModified();
}
Program: 54236
Project: 54236
Buggy source:
public boolean isSuperSource(){
  return unit.isSuperSource();
}

Fixed version (ground truth):
@Override @Deprecated public boolean isSuperSource(){
  return unit.isSuperSource();
}
Program: 54237
Project: 54237
Buggy source:
public List<JsniMethod> getJsniMethods(){
  return unit.getJsniMethods();
}

Fixed version (ground truth):
@Override public List<JsniMethod> getJsniMethods(){
  return unit.getJsniMethods();
}
Program: 54238
Project: 54238
Buggy source:
public boolean isGenerated(){
  return unit.isGenerated();
}

Fixed version (ground truth):
@Override @Deprecated public boolean isGenerated(){
  return unit.isGenerated();
}
Program: 54239
Project: 54239
Buggy source:
public boolean isError(){
  return true;
}

Fixed version (ground truth):
@Override public boolean isError(){
  return true;
}
Program: 54240
Project: 54240
Buggy source:
public String getDisplayLocation(){
  return unit.getDisplayLocation();
}

Fixed version (ground truth):
@Override public String getDisplayLocation(){
  return unit.getDisplayLocation();
}
Program: 54241
Project: 54241
Buggy source:
public String getSource(){
  return unit.getSource();
}

Fixed version (ground truth):
@Override @Deprecated public String getSource(){
  return unit.getSource();
}
Program: 54242
Project: 54242
Buggy source:
public String getTypeName(){
  return unit.getTypeName();
}

Fixed version (ground truth):
@Override public String getTypeName(){
  return unit.getTypeName();
}
Program: 54243
Project: 54243
Buggy source:
public boolean isCompiled(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isCompiled(){
  return false;
}
Program: 54244
Project: 54244
Buggy source:
public long getLastModified(){
  return unit.getLastModified();
}

Fixed version (ground truth):
@Override public long getLastModified(){
  return unit.getLastModified();
}
Program: 54245
Project: 54245
Buggy source:
public boolean isSuperSource(){
  return unit.isSuperSource();
}

Fixed version (ground truth):
@Override @Deprecated public boolean isSuperSource(){
  return unit.isSuperSource();
}
Program: 54246
Project: 54246
Buggy source:
public List<JsniMethod> getJsniMethods(){
  return unit.getJsniMethods();
}

Fixed version (ground truth):
@Override public List<JsniMethod> getJsniMethods(){
  return unit.getJsniMethods();
}
Program: 54247
Project: 54247
Buggy source:
public boolean isGenerated(){
  return unit.isGenerated();
}

Fixed version (ground truth):
@Override @Deprecated public boolean isGenerated(){
  return unit.isGenerated();
}
Program: 54248
Project: 54248
Buggy source:
public boolean isError(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isError(){
  return false;
}
Program: 54249
Project: 54249
Buggy source:
public String getDisplayLocation(){
  return unit.getDisplayLocation();
}

Fixed version (ground truth):
@Override public String getDisplayLocation(){
  return unit.getDisplayLocation();
}
Program: 54250
Project: 54250
Buggy source:
public String getSource(){
  return unit.getSource();
}

Fixed version (ground truth):
@Override @Deprecated public String getSource(){
  return unit.getSource();
}
Program: 54251
Project: 54251
Buggy source:
public String getTypeName(){
  return unit.getTypeName();
}

Fixed version (ground truth):
@Override public String getTypeName(){
  return unit.getTypeName();
}
Program: 54252
Project: 54252
Buggy source:
public final void execute(){
  if (canceled) {
    return;
  }
  scheduled=false;
  doBeforeLayout();
  layout.layout(duration,new Layout.AnimationCallback(){
    public void onAnimationComplete(){
      if (callback != null) {
        callback.onAnimationComplete();
      }
    }
    public void onLayout(    Layer layer,    double progress){
      Widget child=(Widget)layer.getUserObject();
      if (child instanceof RequiresResize) {
        ((RequiresResize)child).onResize();
      }
      if (callback != null) {
        callback.onLayout(layer,progress);
      }
    }
  }
);
}

Fixed version (ground truth):
public final void execute(){
  scheduled=false;
  if (canceled) {
    return;
  }
  doBeforeLayout();
  layout.layout(duration,new Layout.AnimationCallback(){
    public void onAnimationComplete(){
      if (callback != null) {
        callback.onAnimationComplete();
      }
    }
    public void onLayout(    Layer layer,    double progress){
      Widget child=(Widget)layer.getUserObject();
      if (child instanceof RequiresResize) {
        ((RequiresResize)child).onResize();
      }
      if (callback != null) {
        callback.onLayout(layer,progress);
      }
    }
  }
);
}
Program: 54254
Project: 54254
Buggy source:
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}

Fixed version (ground truth):
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}
Program: 54255
Project: 54255
Buggy source:
/** 
 * Instructs the writer to initialize the field with a specific contructor invocaction, instead of the default GWT.create call.
 */
public void setFieldInitializerAsConstructor(String fieldName,JClassType type,String... args){
  setFieldInitializer(fieldName,formatCode("String_Node_Str",type.getQualifiedSourceName(),asCommaSeparatedList(args)));
}

Fixed version (ground truth):
/** 
 * Instructs the writer to initialize the field with a specific contructor invocaction, instead of the default GWT.create call.
 * @param fieldName the field to intialize
 * @param type the type of the field
 * @param arguments to the constructor call
 */
public void setFieldInitializerAsConstructor(String fieldName,JClassType type,String... args){
  setFieldInitializer(fieldName,formatCode("String_Node_Str",type.getQualifiedSourceName(),asCommaSeparatedList(args)));
}
Program: 54256
Project: 54256
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(FieldWriterOfGeneratedCssResourceTest.class);
  suite.addTestSuite(GwtResourceEntityResolverTest.class);
  suite.addTestSuite(HandlerEvaluatorTest.class);
  suite.addTestSuite(TokenatorTest.class);
  suite.addTestSuite(XMLElementTest.class);
  suite.addTestSuite(OwnerClassTest.class);
  suite.addTestSuite(OwnerFieldClassTest.class);
  suite.addTestSuite(OwnerFieldTest.class);
  suite.addTestSuite(CssNameConverterTest.class);
  suite.addTestSuite(IntAttributeParserTest.class);
  suite.addTestSuite(FieldReferenceConverterTest.class);
  suite.addTestSuite(StrictAttributeParserTest.class);
  suite.addTestSuite(StringAttributeParserTest.class);
  suite.addTestSuite(LengthAttributeParserTest.class);
  suite.addTestSuite(DialogBoxParserTest.class);
  suite.addTestSuite(DockLayoutPanelParserTest.class);
  suite.addTestSuite(IsEmptyParserTest.class);
  suite.addTestSuite(LayoutPanelParserTest.class);
  suite.addTestSuite(StackLayoutPanelParserTest.class);
  suite.addTestSuite(TabLayoutPanelParserTest.class);
  suite.addTestSuite(UIObjectParserTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(FieldWriterOfGeneratedCssResourceTest.class);
  suite.addTestSuite(GwtResourceEntityResolverTest.class);
  suite.addTestSuite(HandlerEvaluatorTest.class);
  suite.addTestSuite(TokenatorTest.class);
  suite.addTestSuite(XMLElementTest.class);
  suite.addTestSuite(OwnerClassTest.class);
  suite.addTestSuite(OwnerFieldClassTest.class);
  suite.addTestSuite(OwnerFieldTest.class);
  suite.addTestSuite(CssNameConverterTest.class);
  suite.addTestSuite(IntAttributeParserTest.class);
  suite.addTestSuite(FieldReferenceConverterTest.class);
  suite.addTestSuite(StrictAttributeParserTest.class);
  suite.addTestSuite(StringAttributeParserTest.class);
  suite.addTestSuite(LengthAttributeParserTest.class);
  suite.addTestSuite(DialogBoxParserTest.class);
  suite.addTestSuite(DockLayoutPanelParserTest.class);
  suite.addTestSuite(ImageParserTest.class);
  suite.addTestSuite(IsEmptyParserTest.class);
  suite.addTestSuite(LayoutPanelParserTest.class);
  suite.addTestSuite(StackLayoutPanelParserTest.class);
  suite.addTestSuite(TabLayoutPanelParserTest.class);
  suite.addTestSuite(UIObjectParserTest.class);
  return suite;
}
Program: 54257
Project: 54257
Buggy source:
/** 
 * @return a pale reflection of com.google.gwt.user.ui, plus{@link JavaResourceBase#getStandardResources}
 */
public static Set<Resource> getUiResources(){
  Set<Resource> rtn=new HashSet<Resource>(Arrays.asList(JavaResourceBase.getStandardResources()));
  rtn.add(BUTTON);
  rtn.add(CLICK_EVENT);
  rtn.add(CLICK_HANDLER);
  rtn.add(DIALOG_BOX);
  rtn.add(DOCK_LAYOUT_PANEL);
  rtn.add(EVENT_HANDLER);
  rtn.add(GWT_EVENT);
  rtn.add(HANDLER_REGISTRATION);
  rtn.add(HAS_CLICK_HANDLERS);
  rtn.add(HAS_HORIZONTAL_ALIGNMENT);
  rtn.add(HAS_VERTICAL_ALIGNMENT);
  rtn.add(LABEL);
  rtn.add(LAYOUT_PANEL);
  rtn.add(MOUSE_OVER_EVENT);
  rtn.add(MOUSE_OVER_HANDLER);
  rtn.add(SPLIT_LAYOUT_PANEL);
  rtn.add(STACK_LAYOUT_PANEL);
  rtn.add(STYLE);
  rtn.add(TAB_LAYOUT_PANEL);
  rtn.add(UI_OBJECT);
  rtn.add(UI_BINDER);
  rtn.add(UI_FACTORY);
  rtn.add(WIDGET);
  return rtn;
}

Fixed version (ground truth):
/** 
 * @return a pale reflection of com.google.gwt.user.ui, plus{@link JavaResourceBase#getStandardResources}
 */
public static Set<Resource> getUiResources(){
  Set<Resource> rtn=new HashSet<Resource>(Arrays.asList(JavaResourceBase.getStandardResources()));
  rtn.add(BUTTON);
  rtn.add(CLICK_EVENT);
  rtn.add(CLICK_HANDLER);
  rtn.add(DIALOG_BOX);
  rtn.add(DOCK_LAYOUT_PANEL);
  rtn.add(EVENT_HANDLER);
  rtn.add(GWT_EVENT);
  rtn.add(IMAGE);
  rtn.add(IMAGE_RESOURCE);
  rtn.add(HANDLER_REGISTRATION);
  rtn.add(HAS_CLICK_HANDLERS);
  rtn.add(HAS_HORIZONTAL_ALIGNMENT);
  rtn.add(HAS_VERTICAL_ALIGNMENT);
  rtn.add(LABEL);
  rtn.add(LAYOUT_PANEL);
  rtn.add(MOUSE_OVER_EVENT);
  rtn.add(MOUSE_OVER_HANDLER);
  rtn.add(SPLIT_LAYOUT_PANEL);
  rtn.add(STACK_LAYOUT_PANEL);
  rtn.add(STYLE);
  rtn.add(TAB_LAYOUT_PANEL);
  rtn.add(UI_OBJECT);
  rtn.add(UI_BINDER);
  rtn.add(UI_FACTORY);
  rtn.add(WIDGET);
  return rtn;
}
Program: 54258
Project: 54258
Buggy source:
public void testImageResourceInImageWidget(){
  assertEquals(widgetUi.prettyImage.getWidth(),widgetUi.babyWidget.getOffsetWidth());
  assertEquals(widgetUi.prettyImage.getHeight(),widgetUi.babyWidget.getOffsetHeight());
  assertEquals(widgetUi.prettyImage.getTop(),widgetUi.babyWidget.getOriginTop());
  assertEquals(widgetUi.prettyImage.getLeft(),widgetUi.babyWidget.getOriginLeft());
}

Fixed version (ground truth):
public void testImageResourceInImageWidget(){
  ImageResource resource=widgetUi.prettyImage;
  Image widget=widgetUi.babyWidget;
  assertEquals(resource.getWidth(),widget.getOffsetWidth());
  assertEquals(resource.getHeight(),widget.getOffsetHeight());
  assertEquals(resource.getTop(),widget.getOriginTop());
  assertEquals(resource.getLeft(),widget.getOriginLeft());
  assertEquals("String_Node_Str",widget.getAltText());
  assertEquals("String_Node_Str",widget.getStyleName());
}
Program: 54259
Project: 54259
Buggy source:
public void parse(XMLElement elem,String fieldName,JClassType type,UiBinderWriter writer) throws UnableToCompleteException {
  String debugId=elem.consumeStringAttribute("String_Node_Str",null);
  if (null != debugId) {
    writer.addStatement("String_Node_Str",fieldName,debugId);
  }
  String[] styleNames=elem.consumeStringArrayAttribute("String_Node_Str");
  for (  String s : styleNames) {
    writer.addStatement("String_Node_Str",fieldName,s);
  }
  styleNames=elem.consumeStringArrayAttribute("String_Node_Str");
  for (  String s : styleNames) {
    writer.addStatement("String_Node_Str",fieldName,s);
  }
}

Fixed version (ground truth):
public void parse(XMLElement elem,String fieldName,JClassType type,UiBinderWriter writer) throws UnableToCompleteException {
  String debugId=elem.consumeStringAttribute("String_Node_Str",null);
  if (null != debugId) {
    writer.addStatement("String_Node_Str",fieldName,debugId);
  }
  String styleName=elem.consumeStringAttribute("String_Node_Str",null);
  String stylePrimaryName=elem.consumeStringAttribute("String_Node_Str",null);
  if (null != styleName && null != stylePrimaryName) {
    writer.die("String_Node_Str" + "String_Node_Str",elem);
  }
  if (null != styleName) {
    writer.addStatement("String_Node_Str",fieldName,styleName);
  }
  if (null != stylePrimaryName) {
    writer.addStatement("String_Node_Str",fieldName,stylePrimaryName);
  }
  String[] extraStyleNames=elem.consumeStringArrayAttribute("String_Node_Str");
  for (  String s : extraStyleNames) {
    writer.addStatement("String_Node_Str",fieldName,s);
  }
  extraStyleNames=elem.consumeStringArrayAttribute("String_Node_Str");
  for (  String s : extraStyleNames) {
    writer.addStatement("String_Node_Str",fieldName,s);
  }
}
Program: 54260
Project: 54260
Buggy source:
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}

Fixed version (ground truth):
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}
Program: 54261
Project: 54261
Buggy source:
public void testHappy() throws UnableToCompleteException, SAXException, IOException {
  StringBuffer b=new StringBuffer();
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  String[] expected={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  tester.parse(b.toString());
  Iterator<String> i=tester.writer.statements.iterator();
  for (  String e : expected) {
    assertEquals(e,i.next());
  }
  assertFalse(i.hasNext());
  assertNull(tester.logger.died);
}

Fixed version (ground truth):
public void testHappy() throws UnableToCompleteException, SAXException, IOException {
  StringBuffer b=new StringBuffer();
  b.append("String_Node_Str" + "String_Node_Str");
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  String[] expected={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  tester.parse(b.toString());
  Iterator<String> i=tester.writer.statements.iterator();
  for (  String e : expected) {
    assertEquals(e,i.next());
  }
  assertFalse(i.hasNext());
  assertNull(tester.logger.died);
}
Program: 54262
Project: 54262
Buggy source:
@Override public void gwtTearDown() throws Exception {
  RootPanel.get().clear();
  super.gwtTearDown();
}

Fixed version (ground truth):
@Override public void gwtTearDown() throws Exception {
  domUi.root.getParentElement().removeChild(domUi.root);
  RootPanel.get().clear();
  super.gwtTearDown();
}
Program: 54263
Project: 54263
Buggy source:
public void testAddStyleNamesAndDebugId(){
  Label l=widgetUi.lblDebugId;
  assertEquals("String_Node_Str",l.getElement().getId());
  WidgetBasedUiExternalResources resources=GWT.create(WidgetBasedUiExternalResources.class);
  assertTrue(l.getStyleName().contains("String_Node_Str"));
  assertTrue(l.getStyleName().contains("String_Node_Str"));
  assertTrue(l.getStyleName().contains("String_Node_Str"));
  assertTrue(l.getStyleName().contains("String_Node_Str"));
  assertTrue(l.getStyleName().contains(resources.style().prettyText()));
}

Fixed version (ground truth):
public void testAddStyleNamesAndDebugId(){
  Label l=widgetUi.lblDebugId;
  assertEquals("String_Node_Str",l.getElement().getId());
  assertEquals("String_Node_Str",l.getStylePrimaryName());
  WidgetBasedUiExternalResources resources=GWT.create(WidgetBasedUiExternalResources.class);
  assertTrue(l.getStyleName().contains("String_Node_Str"));
  assertTrue(l.getStyleName().contains("String_Node_Str"));
  assertTrue(l.getStyleName().contains("String_Node_Str"));
  assertTrue(l.getStyleName().contains("String_Node_Str"));
  assertTrue(l.getStyleName().contains("String_Node_Str" + resources.style().prettyText()));
}
Program: 54264
Project: 54264
Buggy source:
private void writeClassOpen(IndentedWriter w){
  w.write("String_Node_Str",implClassName,uiRootType.getName(),uiOwnerType.getName(),baseClass.getName());
  w.indent();
}

Fixed version (ground truth):
private void writeClassOpen(IndentedWriter w){
  w.write("String_Node_Str",implClassName,uiRootType.getParameterizedQualifiedSourceName(),uiOwnerType.getParameterizedQualifiedSourceName(),baseClass.getParameterizedQualifiedSourceName());
  w.indent();
}
Program: 54265
Project: 54265
Buggy source:
/** 
 * Writes the UiBinder's source.
 */
private void writeBinder(IndentedWriter w,String rootField) throws UnableToCompleteException {
  writePackage(w);
  writeImports(w);
  w.newline();
  writeClassOpen(w);
  writeStatics(w);
  w.newline();
  w.write("String_Node_Str",uiRootType.getName(),uiOwnerType.getName());
  w.indent();
  w.newline();
  writeGwtFields(w);
  w.newline();
  writeAddedStatements(w);
  w.newline();
  writeInitStatements(w);
  w.newline();
  writeHandlers(w);
  w.newline();
  writeOwnerFieldSetters(w);
  writeCssInjectors(w);
  w.write("String_Node_Str",rootField);
  w.outdent();
  w.write("String_Node_Str");
  w.outdent();
  w.write("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Writes the UiBinder's source.
 */
private void writeBinder(IndentedWriter w,String rootField) throws UnableToCompleteException {
  writePackage(w);
  writeImports(w);
  w.newline();
  writeClassOpen(w);
  writeStatics(w);
  w.newline();
  w.write("String_Node_Str",uiRootType.getParameterizedQualifiedSourceName(),uiOwnerType.getParameterizedQualifiedSourceName());
  w.indent();
  w.newline();
  writeGwtFields(w);
  w.newline();
  writeAddedStatements(w);
  w.newline();
  writeInitStatements(w);
  w.newline();
  writeHandlers(w);
  w.newline();
  writeOwnerFieldSetters(w);
  writeCssInjectors(w);
  w.write("String_Node_Str",rootField);
  w.outdent();
  w.write("String_Node_Str");
  w.outdent();
  w.write("String_Node_Str");
}
Program: 54266
Project: 54266
Buggy source:
private void doLayout(){
  int left=0, top=0, right=0, bottom=0;
  for (  Widget child : getChildren()) {
    LayoutData data=(LayoutData)child.getLayoutData();
    Layer layer=data.layer;
switch (data.direction) {
case NORTH:
      layer.setLeftRight(left,unit,right,unit);
    layer.setTopHeight(top,unit,data.size,unit);
  top+=data.size;
break;
case SOUTH:
layer.setLeftRight(left,unit,right,unit);
layer.setBottomHeight(bottom,unit,data.size,unit);
bottom+=data.size;
break;
case WEST:
layer.setTopBottom(top,unit,bottom,unit);
layer.setLeftWidth(left,unit,data.size,unit);
left+=data.size;
break;
case EAST:
layer.setTopBottom(top,unit,bottom,unit);
layer.setRightWidth(right,unit,data.size,unit);
right+=data.size;
break;
case CENTER:
layer.setLeftRight(left,unit,right,unit);
layer.setTopBottom(top,unit,bottom,unit);
break;
}
}
}

Fixed version (ground truth):
private void doLayout(){
  double left=0, top=0, right=0, bottom=0;
  for (  Widget child : getChildren()) {
    LayoutData data=(LayoutData)child.getLayoutData();
    Layer layer=data.layer;
switch (data.direction) {
case NORTH:
      layer.setLeftRight(left,unit,right,unit);
    layer.setTopHeight(top,unit,data.size,unit);
  top+=data.size;
break;
case SOUTH:
layer.setLeftRight(left,unit,right,unit);
layer.setBottomHeight(bottom,unit,data.size,unit);
bottom+=data.size;
break;
case WEST:
layer.setTopBottom(top,unit,bottom,unit);
layer.setLeftWidth(left,unit,data.size,unit);
left+=data.size;
break;
case EAST:
layer.setTopBottom(top,unit,bottom,unit);
layer.setRightWidth(right,unit,data.size,unit);
right+=data.size;
break;
case CENTER:
layer.setLeftRight(left,unit,right,unit);
layer.setTopBottom(top,unit,bottom,unit);
break;
}
}
}
Program: 54267
Project: 54267
Buggy source:
/** 
 * Clear the opacity css property.
 */
public final void clearOpacity(){
  clearProperty(STYLE_OPACITY);
}

Fixed version (ground truth):
/** 
 * Clear the opacity css property.
 */
public final void clearOpacity(){
  DOMImpl.impl.cssClearOpacity(this);
}
Program: 54268
Project: 54268
Buggy source:
/** 
 * Set the opacity css property.
 */
public final void setOpacity(double value){
  setProperty(STYLE_OPACITY,value + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Set the opacity css property.
 */
public final void setOpacity(double value){
  DOMImpl.impl.cssSetOpacity(this,value);
}
Program: 54269
Project: 54269
Buggy source:
public Tab(Widget child){
  super(Document.get().createDivElement());
  getElement().appendChild(inner=Document.get().createDivElement());
  setWidget(child);
  setStyleName("String_Node_Str");
  inner.setClassName("String_Node_Str");
  getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public Tab(Widget child){
  super(Document.get().createDivElement());
  getElement().appendChild(inner=Document.get().createDivElement());
  setWidget(child);
  setStyleName("String_Node_Str");
  inner.setClassName("String_Node_Str");
  getElement().getStyle().setFloat(Style.Float.LEFT);
}
Program: 54270
Project: 54270
Buggy source:
/** 
 * Checks whether the given method qualifies as a setter. This looks at the method qualifiers, name and return type, but not at the parameter types.
 * @param method the method to look at
 * @return whether it's a setter
 */
private boolean isSetterMethod(JMethod method){
  return method.isPublic() && !method.isStatic() && method.getName().startsWith("String_Node_Str")&& method.getReturnType() == JPrimitiveType.VOID;
}

Fixed version (ground truth):
/** 
 * Checks whether the given method qualifies as a setter. This looks at the method qualifiers, name and return type, but not at the parameter types.
 * @param method the method to look at
 * @return whether it's a setter
 */
private boolean isSetterMethod(JMethod method){
  return method.isPublic() && !method.isStatic() && method.getName().startsWith("String_Node_Str")&& method.getName().length() > 3 && method.getReturnType() == JPrimitiveType.VOID;
}
Program: 54272
Project: 54272
Buggy source:
private static String escapeXml(String unescaped){
  String escaped=unescaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  return escaped;
}

Fixed version (ground truth):
private static String escapeXml(String unescaped){
  return SizeMapRecorder.escapeXml(unescaped);
}
Program: 54273
Project: 54273
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>T[] toArray(T[] a){
  Object[] result=super.toArray(a);
  for (int i=0, c=result.length; i < c; ++i) {
    result[i]=new UnmodifiableEntry<K,V>((Map.Entry<K,V>)result[i]);
  }
  return (T[])result;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>T[] toArray(T[] a){
  Object[] result=super.toArray(a);
  wrap(result,coll.size());
  return (T[])result;
}
Program: 54274
Project: 54274
Buggy source:
public int compare(Object o1,Object o2){
  String s1=(String)o1;
  String s2=(String)o2;
  return s2.compareTo(s1);
}

Fixed version (ground truth):
public int compare(String s1,String s2){
  return s2.compareTo(s1);
}
Program: 54275
Project: 54275
Buggy source:
public void testSort(){
  List a=createSortedList();
  Collections.reverse(a);
  Collections.sort(a);
  assertEquals(createSortedList(),a);
}

Fixed version (ground truth):
public void testSort(){
  List<String> a=createSortedList();
  Collections.reverse(a);
  Collections.sort(a);
  assertEquals(createSortedList(),a);
}
Program: 54276
Project: 54276
Buggy source:
public static List createSortedList(){
  ArrayList l=new ArrayList();
  l.add("String_Node_Str");
  l.add("String_Node_Str");
  l.add("String_Node_Str");
  return l;
}

Fixed version (ground truth):
public static List<String> createSortedList(){
  ArrayList<String> l=new ArrayList<String>();
  l.add("String_Node_Str");
  l.add("String_Node_Str");
  l.add("String_Node_Str");
  return l;
}
Program: 54277
Project: 54277
Buggy source:
/** 
 * Test Collections.binarySearch(List, Object, Comparator). Verify the following cases: empty List odd numbers of elements even numbers of elements not found value larger than all elements not found value smaller than all elements null Comparator uses natural ordering
 */
public void testBinarySearchObjectComparator(){
  Comparator inverseSort=new Comparator(){
    public int compare(    Object o1,    Object o2){
      return ((Comparable)o2).compareTo(o1);
    }
  }
;
  List a1=new ArrayList();
  int ret=Collections.binarySearch(a1,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  List a2=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(-3,ret);
  ret=Collections.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(2,ret);
  List a3=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-5,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(0,ret);
  List a4=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a4,"String_Node_Str",null);
  assertEquals(3,ret);
}

Fixed version (ground truth):
/** 
 * Test Collections.binarySearch(List, Object, Comparator). Verify the following cases: empty List odd numbers of elements even numbers of elements not found value larger than all elements not found value smaller than all elements null Comparator uses natural ordering
 */
public void testBinarySearchObjectComparator(){
  Comparator<String> inverseSort=new Comparator<String>(){
    public int compare(    String o1,    String o2){
      return o2.compareTo(o1);
    }
  }
;
  List<String> a1=new ArrayList<String>();
  int ret=Collections.binarySearch(a1,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  List<String> a2=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(-3,ret);
  ret=Collections.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(2,ret);
  List<String> a3=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-5,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(0,ret);
  List<String> a4=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a4,"String_Node_Str",null);
  assertEquals(3,ret);
}
Program: 54278
Project: 54278
Buggy source:
public void testReverse(){
  List a=createSortedList();
  Collections.reverse(a);
  Object[] x={"String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(x,a);
  List b=createRandomList();
  Collections.reverse(b);
  Collections.reverse(b);
  assertEquals(b,createRandomList());
}

Fixed version (ground truth):
public void testReverse(){
  List<String> a=createSortedList();
  Collections.reverse(a);
  Object[] x={"String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(x,a);
  List<Integer> b=createRandomList();
  Collections.reverse(b);
  Collections.reverse(b);
  assertEquals(b,createRandomList());
}
Program: 54279
Project: 54279
Buggy source:
public void testSortWithComparator(){
  Comparator x=new Comparator(){
    public int compare(    Object o1,    Object o2){
      String s1=(String)o1;
      String s2=(String)o2;
      return s2.compareTo(s1);
    }
  }
;
  List a=createSortedList();
  Collections.sort(a,x);
  Object[] expected={"String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(expected,a);
}

Fixed version (ground truth):
public void testSortWithComparator(){
  Comparator<String> x=new Comparator<String>(){
    public int compare(    String s1,    String s2){
      return s2.compareTo(s1);
    }
  }
;
  List<String> a=createSortedList();
  Collections.sort(a,x);
  Object[] expected={"String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(expected,a);
}
Program: 54280
Project: 54280
Buggy source:
public void testFill(){
  List a=createSortedList();
  Collections.fill(a,null);
  assertEquals(new Object[a.size()],a);
  List b=createRandomList();
  Collections.fill(b,null);
  assertEquals(new Object[b.size()],b);
}

Fixed version (ground truth):
public void testFill(){
  List<String> a=createSortedList();
  Collections.fill(a,null);
  assertEquals(new Object[a.size()],a);
  List<Integer> b=createRandomList();
  Collections.fill(b,null);
  assertEquals(new Object[b.size()],b);
}
Program: 54281
Project: 54281
Buggy source:
/** 
 * Test Collections.binarySearch(List, Object). Verify the following cases: empty List odd numbers of elements even numbers of elements not found value larger than all elements not found value smaller than all elements
 */
public void testBinarySearchObject(){
  List a1=new ArrayList();
  int ret=Collections.binarySearch(a1,"String_Node_Str");
  assertEquals(-1,ret);
  List a2=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a2,"String_Node_Str");
  assertEquals(-2,ret);
  ret=Collections.binarySearch(a2,"String_Node_Str");
  assertEquals(2,ret);
  List a3=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(-5,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(-1,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(0,ret);
}

Fixed version (ground truth):
/** 
 * Test Collections.binarySearch(List, Object). Verify the following cases: empty List odd numbers of elements even numbers of elements not found value larger than all elements not found value smaller than all elements
 */
public void testBinarySearchObject(){
  List<String> a1=new ArrayList<String>();
  int ret=Collections.binarySearch(a1,"String_Node_Str");
  assertEquals(-1,ret);
  List<String> a2=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a2,"String_Node_Str");
  assertEquals(-2,ret);
  ret=Collections.binarySearch(a2,"String_Node_Str");
  assertEquals(2,ret);
  List<String> a3=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(-5,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(-1,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(0,ret);
}
Program: 54282
Project: 54282
Buggy source:
public static List createRandomList(){
  ArrayList l=new ArrayList();
  l.add(new Integer(5));
  l.add(new Integer(2));
  l.add(new Integer(3));
  l.add(new Integer(1));
  l.add(new Integer(4));
  return l;
}

Fixed version (ground truth):
public static List<Integer> createRandomList(){
  ArrayList<Integer> l=new ArrayList<Integer>();
  l.add(new Integer(5));
  l.add(new Integer(2));
  l.add(new Integer(3));
  l.add(new Integer(1));
  l.add(new Integer(4));
  return l;
}
Program: 54283
Project: 54283
Buggy source:
/** 
 * Formats Year field according to pattern specified. Javascript Date object seems incapable handling 1BC and year before. It can show you year 0 which does not exists. following we just keep consistent with javascript's toString method. But keep in mind those things should be unsupported.
 * @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 formatYear(StringBuffer buf,int count,Date date){
  int value=date.getYear() + JS_START_YEAR;
  if (value < 0) {
    value=-value;
  }
  if (count == 2) {
    zeroPaddingNumber(buf,value % 100,2);
  }
 else {
    buf.append(Integer.toString(value));
  }
}

Fixed version (ground truth):
/** 
 * Formats Year field according to pattern specified. Javascript Date object seems incapable handling 1BC and year before. It can show you year 0 which does not exists. following we just keep consistent with javascript's toString method. But keep in mind those things should be unsupported.
 * @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 formatYear(StringBuffer buf,int count,Date date){
  int value=date.getYear() + JS_START_YEAR;
  if (value < 0) {
    value=-value;
  }
  if (count == 2) {
    zeroPaddingNumber(buf,value % 100,2);
  }
 else {
    buf.append(value);
  }
}