nus-yam/ex-repair huggingface dataset:
Program: 83209
Project: 83209
Buggy source:
public void onModuleReady(ModuleSpace readySpace) throws UnableToCompleteException {
  this.space=readySpace;
  SourceOracle srcOracle=new HostedModeSourceOracle(typeOracle,module.getName());
  ByteCodeCompiler compiler=getOrCreateByteCodeCompiler(srcOracle);
  ModuleSpacePropertyOracle propOracle=new ModuleSpacePropertyOracle(module.getProperties(),readySpace);
  Rules rules=module.getRules();
  rebindOracle=new StandardRebindOracle(typeOracle,propOracle,rules,genDir,outDir,module.getCacheManager());
  classLoader=new CompilingClassLoader(logger,compiler,typeOracle);
}

Fixed version (ground truth):
public void onModuleReady(ModuleSpace readySpace) throws UnableToCompleteException {
  this.space=readySpace;
  SourceOracle srcOracle=new HostedModeSourceOracle(typeOracle);
  ByteCodeCompiler compiler=getOrCreateByteCodeCompiler(srcOracle);
  ModuleSpacePropertyOracle propOracle=new ModuleSpacePropertyOracle(module.getProperties(),readySpace);
  Rules rules=module.getRules();
  rebindOracle=new StandardRebindOracle(typeOracle,propOracle,rules,genDir,outDir,module.getCacheManager());
  classLoader=new CompilingClassLoader(logger,compiler,typeOracle);
}
Program: 83210
Project: 83210
Buggy source:
/** 
 * Adds a widget to the specified edge of the dock.
 * @param widget the widget to be added
 * @param direction the widget's direction in the dock
 */
public void add(Widget widget,DockLayoutConstant direction){
  if (direction == CENTER) {
    if (center != null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    center=widget;
  }
  LayoutData layout=new LayoutData(direction);
  widget.setLayoutData(layout);
  setCellHorizontalAlignment(widget,horzAlign);
  setCellVerticalAlignment(widget,vertAlign);
  children.add(widget);
  realizeTable(widget);
}

Fixed version (ground truth):
/** 
 * Adds a widget to the specified edge of the dock. If the widget is already a child of this panel, this method behaves as though   {@link #remove(Widget)}had already been called.
 * @param widget the widget to be added
 * @param direction the widget's direction in the dock
 * @throws IllegalArgumentException when adding to the {@link #CENTER} andthere is already a different widget there
 */
public void add(Widget widget,DockLayoutConstant direction){
  if (widget.getParent() == this) {
    remove(widget);
  }
  if (direction == CENTER) {
    if (center != null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    center=widget;
  }
  LayoutData layout=new LayoutData(direction);
  widget.setLayoutData(layout);
  setCellHorizontalAlignment(widget,horzAlign);
  setCellVerticalAlignment(widget,vertAlign);
  children.add(widget);
  realizeTable(widget);
}
Program: 83211
Project: 83211
Buggy source:
public void testAddRemove(){
  final DockPanel dock=new DockPanel();
  OnLoadTestLabel l0=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l1=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l2=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l3=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l4=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l5=new OnLoadTestLabel("String_Node_Str");
  dock.add(l0,DockPanel.NORTH);
  dock.add(l1,DockPanel.NORTH);
  dock.add(l2,DockPanel.WEST);
  RootPanel.get().add(dock);
  dock.add(l3,DockPanel.EAST);
  dock.add(l5,DockPanel.CENTER);
  dock.add(l4,DockPanel.SOUTH);
  try {
    dock.add(new Label("String_Node_Str"),DockPanel.CENTER);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  Element table=dock.getElement();
  Element tbody=DOM.getFirstChild(table);
  assertEquals(DOM.getChildCount(tbody),4);
  Element tr0=DOM.getChild(tbody,0);
  Element tr1=DOM.getChild(tbody,1);
  Element tr2=DOM.getChild(tbody,2);
  Element tr3=DOM.getChild(tbody,3);
  assertEquals(DOM.getChildCount(tr0),1);
  assertEquals(DOM.getChildCount(tr1),1);
  assertEquals(DOM.getChildCount(tr2),3);
  assertEquals(DOM.getChildCount(tr3),1);
  assertTrue(l0.attachedWhenLoaded);
  assertTrue(l1.attachedWhenLoaded);
  assertTrue(l2.attachedWhenLoaded);
  assertTrue(l3.attachedWhenLoaded);
  assertTrue(l4.attachedWhenLoaded);
  assertTrue(l5.attachedWhenLoaded);
}

Fixed version (ground truth):
public void testAddRemove(){
  final DockPanel dock=new DockPanel();
  OnLoadTestLabel l0=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l1=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l2=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l3=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l4=new OnLoadTestLabel("String_Node_Str");
  OnLoadTestLabel l5=new OnLoadTestLabel("String_Node_Str");
  dock.add(l0,DockPanel.NORTH);
  dock.add(l1,DockPanel.NORTH);
  dock.add(l2,DockPanel.WEST);
  RootPanel.get().add(dock);
  dock.add(l3,DockPanel.EAST);
  dock.add(l5,DockPanel.CENTER);
  dock.add(l4,DockPanel.SOUTH);
  try {
    dock.add(new Label("String_Node_Str"),DockPanel.CENTER);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  Element table=dock.getElement();
  Element tbody=DOM.getFirstChild(table);
  assertEquals(DOM.getChildCount(tbody),4);
  Element tr0=DOM.getChild(tbody,0);
  Element tr1=DOM.getChild(tbody,1);
  Element tr2=DOM.getChild(tbody,2);
  Element tr3=DOM.getChild(tbody,3);
  assertEquals(DOM.getChildCount(tr0),1);
  assertEquals(DOM.getChildCount(tr1),1);
  assertEquals(DOM.getChildCount(tr2),3);
  assertEquals(DOM.getChildCount(tr3),1);
  assertTrue(l0.attachedWhenLoaded);
  assertTrue(l1.attachedWhenLoaded);
  assertTrue(l2.attachedWhenLoaded);
  assertTrue(l3.attachedWhenLoaded);
  assertTrue(l4.attachedWhenLoaded);
  assertTrue(l5.attachedWhenLoaded);
  dock.add(l4,DockPanel.NORTH);
  assertTrue(((DockPanel.LayoutData)l4.getLayoutData()).direction == DockPanel.NORTH);
}
Program: 83212
Project: 83212
Buggy source:
public void setText(String text){
  DOM.setElementProperty(getElement(),"String_Node_Str",text);
}

Fixed version (ground truth):
public void setText(String text){
  DOM.setElementProperty(getElement(),"String_Node_Str",text != null ? text : "String_Node_Str");
}
Program: 83213
Project: 83213
Buggy source:
public void disabledTestSelection(){
  TextArea area=new TextArea();
  assertEquals("String_Node_Str",area.getSelectedText());
  area.selectAll();
  assertEquals(0,area.getSelectionLength());
  try {
    area.setSelectionRange(0,1);
    fail("String_Node_Str");
  }
 catch (  IndexOutOfBoundsException e) {
  }
  RootPanel.get().add(area);
  area.setText("String_Node_Str");
  area.selectAll();
  assertEquals(1,area.getSelectionLength());
  area.setText("String_Node_Str");
  assertEquals(0,area.getSelectionLength());
  area.setText("String_Node_Str");
  area.setSelectionRange(2,2);
  assertEquals(2,area.getCursorPos());
  area.setSelectionRange(0,0);
}

Fixed version (ground truth):
/** 
 * Tests various text selection methods in text area.
 */
public void disabledTestSelection(){
  TextArea area=new TextArea();
  assertEquals("String_Node_Str",area.getSelectedText());
  area.selectAll();
  assertEquals(0,area.getSelectionLength());
  try {
    area.setSelectionRange(0,1);
    fail("String_Node_Str");
  }
 catch (  IndexOutOfBoundsException e) {
  }
  RootPanel.get().add(area);
  area.setText("String_Node_Str");
  area.selectAll();
  assertEquals(1,area.getSelectionLength());
  area.setText("String_Node_Str");
  assertEquals(0,area.getSelectionLength());
  area.setText("String_Node_Str");
  area.setSelectionRange(2,2);
  assertEquals(2,area.getCursorPos());
  area.setSelectionRange(0,0);
}
Program: 83214
Project: 83214
Buggy source:
public void testMovingCursor(){
  TextArea area=new TextArea();
  RootPanel.get().add(area);
  area.setText("String_Node_Str");
  for (int i=0; i < 4; i++) {
    area.setCursorPos(i);
    assertEquals(i,area.getCursorPos());
  }
}

Fixed version (ground truth):
/** 
 * Tests that   {@link TextArea#setCursorPos(int)} updates the cursor positioncorrectly.
 */
public void testMovingCursor(){
  TextArea area=new TextArea();
  RootPanel.get().add(area);
  area.setText("String_Node_Str");
  for (int i=0; i < 4; i++) {
    area.setCursorPos(i);
    assertEquals(i,area.getCursorPos());
  }
}
Program: 83215
Project: 83215
Buggy source:
/** 
 * This removes all state changed since the last time the typeOracle was run. Since the typeOracle information is not cached on disk, this is not needed the first time.
 * @param typeOracle
 */
void invalidateOnRefresh(TypeOracle typeOracle){
  if (!isTypeOracleBuilderFirstTime()) {
    addVolatileFiles(changedFiles);
    addDependentsToChangedFiles();
    for (Iterator iter=changedFiles.iterator(); iter.hasNext(); ) {
      String location=(String)iter.next();
      CompilationUnitProvider cup=(CompilationUnitProvider)getCupsByLocation().get(location);
      unitsByCup.remove(location);
      Util.invokeInaccessableMethod(TypeOracle.class,"String_Node_Str",new Class[]{CompilationUnitProvider.class},typeOracle,new Object[]{cup});
    }
    astCompiler.invalidateChangedFiles(changedFiles,invalidatedTypes);
  }
 else {
    becomeTypeOracleNotFirstTime();
  }
}

Fixed version (ground truth):
/** 
 * This removes all state changed since the last time the typeOracle was run. Since the typeOracle information is not cached on disk, this is not needed the first time.
 * @param typeOracle
 */
void invalidateOnRefresh(TypeOracle typeOracle){
  if (!isTypeOracleBuilderFirstTime()) {
    changedFiles.addAll(generatedCupLocations);
    addDependentsToChangedFiles();
    for (Iterator iter=changedFiles.iterator(); iter.hasNext(); ) {
      String location=(String)iter.next();
      CompilationUnitProvider cup=(CompilationUnitProvider)getCupsByLocation().get(location);
      unitsByCup.remove(location);
      Util.invokeInaccessableMethod(TypeOracle.class,"String_Node_Str",new Class[]{CompilationUnitProvider.class},typeOracle,new Object[]{cup});
    }
    astCompiler.invalidateChangedFiles(changedFiles,invalidatedTypes);
  }
 else {
    becomeTypeOracleNotFirstTime();
  }
}
Program: 83216
Project: 83216
Buggy source:
/** 
 * Ensures that all compilation units generated via generators are removed from the system so that they will be generated again, and thereby take into account input that may have changed since the last reload.
 */
public void invalidateVolatileFiles(){
  for (Iterator iter=addedCups.iterator(); iter.hasNext(); ) {
    CompilationUnitProvider cup=(CompilationUnitProvider)iter.next();
    if (isVolatileFile(cup.getLocation())) {
      iter.remove();
    }
  }
}

Fixed version (ground truth):
/** 
 * Ensures that all compilation units generated via generators are removed from the system so that they will be generated again, and thereby take into account input that may have changed since the last reload.
 */
public void invalidateVolatileFiles(){
  for (Iterator iter=addedCups.iterator(); iter.hasNext(); ) {
    CompilationUnitProvider cup=(CompilationUnitProvider)iter.next();
    if (isGeneratedCup(cup)) {
      iter.remove();
    }
  }
}
Program: 83218
Project: 83218
Buggy source:
/** 
 * Constructs an empty tree.
 */
public Tree(){
  setElement(DOM.createDiv());
  DOM.setStyleAttribute(getElement(),"String_Node_Str","String_Node_Str");
  focusable=FocusPanel.impl.createFocusable();
  DOM.setStyleAttribute(focusable,"String_Node_Str","String_Node_Str");
  DOM.setStyleAttribute(focusable,"String_Node_Str","String_Node_Str");
  DOM.setIntStyleAttribute(focusable,"String_Node_Str",-1);
  DOM.appendChild(getElement(),focusable);
  sinkEvents(Event.MOUSEEVENTS | Event.ONCLICK | Event.KEYEVENTS);
  DOM.sinkEvents(focusable,Event.FOCUSEVENTS);
  root=new TreeItem(){
    public void addItem(    TreeItem item){
      if ((item.getParentItem() != null) || (item.getTree() != null)) {
        item.remove();
      }
      item.setTree(this.getTree());
      item.setParentItem(null);
      getChildren().add(item);
      DOM.setIntStyleAttribute(item.getElement(),"String_Node_Str",0);
    }
    public void removeItem(    TreeItem item){
      if (!getChildren().contains(item)) {
        return;
      }
      item.setTree(null);
      item.setParentItem(null);
      getChildren().remove(item);
    }
  }
;
  root.setTree(this);
  setStyleName("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructs a tree that uses the specified image bundle for images.
 * @param images a bundle that provides tree specific images
 */
public Tree(TreeImages images){
  this.images=images;
  setElement(DOM.createDiv());
  DOM.setStyleAttribute(getElement(),"String_Node_Str","String_Node_Str");
  focusable=FocusPanel.impl.createFocusable();
  DOM.setStyleAttribute(focusable,"String_Node_Str","String_Node_Str");
  DOM.setStyleAttribute(focusable,"String_Node_Str","String_Node_Str");
  DOM.setIntStyleAttribute(focusable,"String_Node_Str",-1);
  DOM.appendChild(getElement(),focusable);
  sinkEvents(Event.MOUSEEVENTS | Event.ONCLICK | Event.KEYEVENTS);
  DOM.sinkEvents(focusable,Event.FOCUSEVENTS);
  root=new TreeItem(){
    public void addItem(    TreeItem item){
      if ((item.getParentItem() != null) || (item.getTree() != null)) {
        item.remove();
      }
      item.setTree(this.getTree());
      item.setParentItem(null);
      getChildren().add(item);
      DOM.setIntStyleAttribute(item.getElement(),"String_Node_Str",0);
    }
    public void removeItem(    TreeItem item){
      if (!getChildren().contains(item)) {
        return;
      }
      item.setTree(null);
      item.setParentItem(null);
      getChildren().remove(item);
    }
  }
;
  root.setTree(this);
  setStyleName("String_Node_Str");
}
Program: 83219
Project: 83219
Buggy source:
/** 
 * Gets this tree's default image package.
 * @return the tree's image package
 * @see #setImageBase
 */
public String getImageBase(){
  return imageBase;
}

Fixed version (ground truth):
/** 
 * Gets this tree's default image package.
 * @return the tree's image package
 * @see #setImageBase
 * @deprecated Use {@link #Tree(TreeImages)} as it provides a more efficentand manageable way to supply a set of images to be used within a tree.
 */
public String getImageBase(){
  return (images instanceof ImagesFromImageBase) ? ((ImagesFromImageBase)images).getBaseUrl() : GWT.getModuleBaseURL();
}
Program: 83220
Project: 83220
Buggy source:
private boolean elementClicked(TreeItem root,Element hElem){
  Vector chain=new Vector();
  collectElementChain(chain,getElement(),hElem);
  TreeItem item=findItemByChain(chain,0,root);
  if (item != null) {
    if (DOM.compare(item.getImageElement(),hElem)) {
      item.setState(!item.getState(),true);
      return true;
    }
 else     if (DOM.isOrHasChild(item.getElement(),hElem)) {
      onSelection(item,true,!shouldTreeDelegateFocusToElement(hElem));
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean elementClicked(TreeItem root,Element hElem){
  Vector chain=new Vector();
  collectElementChain(chain,getElement(),hElem);
  TreeItem item=findItemByChain(chain,0,root);
  if (item != null) {
    if (DOM.isOrHasChild(item.getImageElement(),hElem)) {
      item.setState(!item.getState(),true);
      return true;
    }
 else     if (DOM.isOrHasChild(item.getElement(),hElem)) {
      onSelection(item,true,!shouldTreeDelegateFocusToElement(hElem));
      return true;
    }
  }
  return false;
}
Program: 83221
Project: 83221
Buggy source:
/** 
 * Sets the base URL under which this tree will find its default images. These images must be named "tree_white.gif", "tree_open.gif", and "tree_closed.gif".
 */
public void setImageBase(String baseUrl){
  imageBase=baseUrl;
  root.updateStateRecursive();
}

Fixed version (ground truth):
/** 
 * Sets the base URL under which this tree will find its default images. These images must be named "tree_white.gif", "tree_open.gif", and "tree_closed.gif".
 * @param baseUrl
 * @deprecated Use {@link #Tree(TreeImages)} as it provides a more efficentand manageable way to supply a set of images to be used within a tree.
 */
public void setImageBase(String baseUrl){
  images=new ImagesFromImageBase(baseUrl);
  root.updateStateRecursive();
}
Program: 83222
Project: 83222
Buggy source:
/** 
 * Indicates if keyboard navigation is enabled for the Tree and for a given TreeItem.  Subclasses of Tree can override this function to selectively enable or disable keyboard navigation.
 * @param currentItem the currently selected TreeItem
 * @return <code>true</code> if the Tree will response to arrow keys bychanging the currently selected item
 */
protected boolean isKeyboardNavigationEnabled(TreeItem currentItem){
  return true;
}

Fixed version (ground truth):
/** 
 * Indicates if keyboard navigation is enabled for the Tree and for a given TreeItem. Subclasses of Tree can override this function to selectively enable or disable keyboard navigation.
 * @param currentItem the currently selected TreeItem
 * @return <code>true</code> if the Tree will response to arrow keys bychanging the currently selected item
 */
protected boolean isKeyboardNavigationEnabled(TreeItem currentItem){
  return true;
}
Program: 83223
Project: 83223
Buggy source:
void updateState(){
  if (children.size() == 0) {
    UIObject.setVisible(childSpanElem,false);
    DOM.setElementProperty(imgElem,"String_Node_Str",imgSrc("String_Node_Str"));
    return;
  }
  if (open) {
    UIObject.setVisible(childSpanElem,true);
    DOM.setElementProperty(imgElem,"String_Node_Str",imgSrc("String_Node_Str"));
  }
 else {
    UIObject.setVisible(childSpanElem,false);
    DOM.setElementProperty(imgElem,"String_Node_Str",imgSrc("String_Node_Str"));
  }
}

Fixed version (ground truth):
void updateState(){
  if (tree == null) {
    return;
  }
  TreeImages images=tree.getImages();
  if (children.size() == 0) {
    UIObject.setVisible(childSpanElem,false);
    images.treeLeaf().applyTo(statusImage);
    return;
  }
  if (open) {
    UIObject.setVisible(childSpanElem,true);
    images.treeOpen().applyTo(statusImage);
  }
 else {
    UIObject.setVisible(childSpanElem,false);
    images.treeClosed().applyTo(statusImage);
  }
}
Program: 83224
Project: 83224
Buggy source:
Element getImageElement(){
  return imgElem;
}

Fixed version (ground truth):
Element getImageElement(){
  return statusImage.getElement();
}
Program: 83225
Project: 83225
Buggy source:
Vector getChildren(){
  return children;
}

Fixed version (ground truth):
ArrayList getChildren(){
  return children;
}
Program: 83226
Project: 83226
Buggy source:
/** 
 * Gets the tree that contains this item.
 * @return the containing tree
 */
public Tree getTree(){
  return tree;
}

Fixed version (ground truth):
/** 
 * Gets the tree that contains this item.
 * @return the containing tree
 */
public final Tree getTree(){
  return tree;
}
Program: 83227
Project: 83227
Buggy source:
/** 
 * Sets whether this item's children are displayed.
 * @param open whether the item is open
 * @param fireEvents <code>true</code> to allow open/close events to befired
 */
public void setState(boolean open,boolean fireEvents){
  if (open && children.size() == 0) {
    return;
  }
  this.open=open;
  updateState();
  if (fireEvents) {
    tree.fireStateChanged(this);
  }
}

Fixed version (ground truth):
/** 
 * Sets whether this item's children are displayed.
 * @param open whether the item is open
 * @param fireEvents <code>true</code> to allow open/close events to befired
 */
public void setState(boolean open,boolean fireEvents){
  if (open && children.size() == 0) {
    return;
  }
  this.open=open;
  updateState();
  if (fireEvents && tree != null) {
    tree.fireStateChanged(this);
  }
}
Program: 83228
Project: 83228
Buggy source:
private void ensureContentPanel(){
  if (contentPanel == null) {
    DOM.setInnerHTML(contentElem,"String_Node_Str");
    contentPanel=new ContentPanel(contentElem);
    if (getTree() != null) {
      tree.adopt(contentPanel);
    }
  }
}

Fixed version (ground truth):
private void ensureContentPanel(){
  if (contentPanel == null) {
    DOM.setInnerHTML(contentElem,"String_Node_Str");
    contentPanel=new ContentPanel(contentElem);
    if (tree != null) {
      tree.adopt(contentPanel);
    }
  }
}
Program: 83229
Project: 83229
Buggy source:
ClippedState(Image image,String url,int left,int top,int width,int height){
  this.left=left;
  this.top=top;
  this.width=width;
  this.height=height;
  this.url=url;
  image.setElement(impl.createStructure(url,left,top,width,height));
  image.sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS);
  fireSyntheticLoadEvent(image);
}

Fixed version (ground truth):
ClippedState(Image image,String url,int left,int top,int width,int height){
  this.left=left;
  this.top=top;
  this.width=width;
  this.height=height;
  this.url=url;
  image.setElement(impl.createStructure(url,left,top,width,height));
  image.sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.ONMOUSEWHEEL);
  fireSyntheticLoadEvent(image);
}
Program: 83230
Project: 83230
Buggy source:
private String generateImpl(TreeLogger logger,GeneratorContext context,JClassType userType,JMethod[] imageMethods) throws UnableToCompleteException {
  String pkgName=userType.getPackage().getName();
  String subName=computeSubclassName(userType);
  ClassSourceFileComposerFactory f=new ClassSourceFileComposerFactory(pkgName,subName);
  f.addImport(ABSTRACTIMAGEPROTOTYPE_QNAME);
  f.addImport(CLIPPEDIMAGEPROTOTYPE_QNAME);
  f.addImplementedInterface(userType.getQualifiedSourceName());
  PrintWriter pw=context.tryCreate(logger,pkgName,subName);
  if (pw != null) {
    SourceWriter sw=f.createSourceWriter(context,pw);
    ImageBundleBuilder bulder=new ImageBundleBuilder();
    for (int i=0; i < imageMethods.length; i++) {
      JMethod method=imageMethods[i];
      String imageUrl=getImageUrlFromMetaDataOrMethodName(logger,method);
      assert(imageUrl != null);
      bulder.assimilate(logger,imageUrl);
    }
    String bundledImageUrl=bulder.writeBundledImage(logger,context);
    sw.print("String_Node_Str");
    sw.print(escape(bundledImageUrl));
    sw.println("String_Node_Str");
    for (int i=0; i < imageMethods.length; i++) {
      JMethod method=imageMethods[i];
      generateImageMethod(logger,bulder,sw,method);
    }
    sw.commit(logger);
  }
  return f.getCreatedClassName();
}

Fixed version (ground truth):
private String generateImpl(TreeLogger logger,GeneratorContext context,JClassType userType,JMethod[] imageMethods) throws UnableToCompleteException {
  String pkgName=userType.getPackage().getName();
  String subName=computeSubclassName(userType);
  ClassSourceFileComposerFactory f=new ClassSourceFileComposerFactory(pkgName,subName);
  f.addImport(ABSTRACTIMAGEPROTOTYPE_QNAME);
  f.addImport(CLIPPEDIMAGEPROTOTYPE_QNAME);
  f.addImport(GWT_QNAME);
  f.addImplementedInterface(userType.getQualifiedSourceName());
  PrintWriter pw=context.tryCreate(logger,pkgName,subName);
  if (pw != null) {
    SourceWriter sw=f.createSourceWriter(context,pw);
    ImageBundleBuilder bulder=new ImageBundleBuilder();
    for (int i=0; i < imageMethods.length; i++) {
      JMethod method=imageMethods[i];
      String imageUrl=getImageUrlFromMetaDataOrMethodName(logger,method);
      assert(imageUrl != null);
      bulder.assimilate(logger,imageUrl);
    }
    String bundledImageUrl=bulder.writeBundledImage(logger,context);
    sw.print("String_Node_Str");
    sw.print(escape(bundledImageUrl));
    sw.println("String_Node_Str");
    for (int i=0; i < imageMethods.length; i++) {
      JMethod method=imageMethods[i];
      generateImageMethod(logger,bulder,sw,method);
    }
    sw.commit(logger);
  }
  return f.getCreatedClassName();
}
Program: 83231
Project: 83231
Buggy source:
private void doGetModule(HttpServletRequest request,HttpServletResponse response,TreeLogger logger,RequestParts parts) throws IOException {
  if ("String_Node_Str".equalsIgnoreCase(parts.moduleName)) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str");
    return;
  }
  String msg="String_Node_Str" + parts.moduleName + "String_Node_Str";
  logger=logger.branch(TreeLogger.TRACE,msg,null);
  try {
    getModuleDef(logger,parts.moduleName);
  }
 catch (  UnableToCompleteException e) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str" + parts.moduleName + "String_Node_Str");
    return;
  }
  response.setContentType("String_Node_Str");
  PrintWriter writer=response.getWriter();
  writer.println("String_Node_Str");
  writer.print("String_Node_Str");
  writer.print(parts.moduleName);
  writer.println("String_Node_Str");
  Map params=request.getParameterMap();
  for (Iterator iter=params.entrySet().iterator(); iter.hasNext(); ) {
    Map.Entry entry=(Map.Entry)iter.next();
    String[] values=(String[])entry.getValue();
    if (values.length > 0) {
      writer.print("String_Node_Str");
      writer.print(entry.getKey());
      writer.print("String_Node_Str");
      writer.print(values[values.length - 1]);
      writer.println("String_Node_Str");
    }
  }
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
}

Fixed version (ground truth):
private void doGetModule(HttpServletRequest request,HttpServletResponse response,TreeLogger logger,RequestParts parts) throws IOException {
  if ("String_Node_Str".equalsIgnoreCase(parts.moduleName)) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str");
    return;
  }
  String msg="String_Node_Str" + parts.moduleName + "String_Node_Str";
  logger=logger.branch(TreeLogger.TRACE,msg,null);
  try {
    getModuleDef(logger,parts.moduleName);
  }
 catch (  UnableToCompleteException e) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str" + parts.moduleName + "String_Node_Str");
    return;
  }
  response.setContentType("String_Node_Str");
  PrintWriter writer=response.getWriter();
  writer.println("String_Node_Str");
  writer.print("String_Node_Str");
  writer.print(parts.moduleName);
  writer.println("String_Node_Str");
  Map params=request.getParameterMap();
  for (Iterator iter=params.entrySet().iterator(); iter.hasNext(); ) {
    Map.Entry entry=(Map.Entry)iter.next();
    String[] values=(String[])entry.getValue();
    if (values.length > 0) {
      writer.print("String_Node_Str");
      writer.print(entry.getKey());
      writer.print("String_Node_Str");
      writer.print(values[values.length - 1]);
      writer.println("String_Node_Str");
    }
  }
  writer.println("String_Node_Str");
  writer.println("String_Node_Str" + "String_Node_Str");
  writer.println("String_Node_Str");
}
Program: 83232
Project: 83232
Buggy source:
public static void sort(Object[] x,Comparator s){
  nativeSort(x,x.length,s != null ? s : natural);
}

Fixed version (ground truth):
public static void sort(Object[] x,Comparator s){
  nativeSort(x,x.length,s != null ? s : Comparators.natural());
}
Program: 83233
Project: 83233
Buggy source:
/** 
 * Test Arrays.binarySearch(Object[], Object, Comparator). Verify the following cases: empty array odd numbers of elements even numbers of elements not found value larger than all elements not found value smaller than all elements
 */
public void testBinarySearchObjectComparator(){
  Comparator inverseSort=new Comparator(){
    public int compare(    Object o1,    Object o2){
      return ((Comparable)o2).compareTo(o1);
    }
  }
;
  Object[] a1={};
  int ret=Arrays.binarySearch(a1,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  Object[] a2={"String_Node_Str","String_Node_Str","String_Node_Str"};
  ret=Arrays.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(-3,ret);
  ret=Arrays.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(2,ret);
  Object[] a3={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  ret=Arrays.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-5,ret);
  ret=Arrays.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  ret=Arrays.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(0,ret);
}

Fixed version (ground truth):
/** 
 * Test Arrays.binarySearch(Object[], Object, Comparator). Verify the following cases: empty array 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);
    }
  }
;
  Object[] a1={};
  int ret=Arrays.binarySearch(a1,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  Object[] a2={"String_Node_Str","String_Node_Str","String_Node_Str"};
  ret=Arrays.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(-3,ret);
  ret=Arrays.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(2,ret);
  Object[] a3={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  ret=Arrays.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-5,ret);
  ret=Arrays.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  ret=Arrays.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(0,ret);
  Object[] a4={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  ret=Arrays.binarySearch(a4,"String_Node_Str",null);
  assertEquals(3,ret);
}
Program: 83234
Project: 83234
Buggy source:
private void fireOnResponseReceivedImpl(RequestCallback callback){
  if (xmlHttpRequest == null) {
    return;
  }
  cancelTimer();
  final JavaScriptObject xmlHttp=xmlHttpRequest;
  xmlHttpRequest=null;
  if (XMLHTTPRequest.hasStatusCodeUndefinedBug(xmlHttp)) {
    Throwable exception=new RuntimeException("String_Node_Str");
    callback.onError(this,exception);
  }
 else {
    Response response=createResponse(xmlHttp);
    callback.onResponseReceived(this,response);
  }
}

Fixed version (ground truth):
private void fireOnResponseReceivedImpl(RequestCallback callback){
  if (xmlHttpRequest == null) {
    return;
  }
  cancelTimer();
  final JavaScriptObject xmlHttp=xmlHttpRequest;
  xmlHttpRequest=null;
  String errorMsg=XMLHTTPRequest.getBrowserSpecificFailure(xmlHttp);
  if (errorMsg != null) {
    Throwable exception=new RuntimeException(errorMsg);
    callback.onError(this,exception);
  }
 else {
    Response response=createResponse(xmlHttp);
    callback.onResponseReceived(this,response);
  }
}
Program: 83235
Project: 83235
Buggy source:
/** 
 * Adds a child widget to the panel.
 * @param w the widget to be added
 */
public void add(Widget w){
  insert(w,getWidgetCount());
}

Fixed version (ground truth):
/** 
 * Adds a child widget to the panel. If the Widget is already attached to the HorizontalPanel, it will be moved to the end of the panel.
 * @param w the widget to be added
 */
public void add(Widget w){
  insert(w,getWidgetCount());
}
Program: 83236
Project: 83236
Buggy source:
/** 
 * Inserts a widget before the specified index.
 * @param w the widget to be inserted
 * @param beforeIndex the index before which it will be inserted
 * @throws IndexOutOfBoundsException if <code>beforeIndex</code> is out ofrange
 */
public void insert(Widget w,int beforeIndex){
  w.removeFromParent();
  Element td=DOM.createTD();
  DOM.insertChild(tableRow,td,beforeIndex);
  super.insert(w,td,beforeIndex);
  setCellHorizontalAlignment(w,horzAlign);
  setCellVerticalAlignment(w,vertAlign);
}

Fixed version (ground truth):
/** 
 * Inserts a widget before the specified index. If the Widget is already attached to the HorizontalPanel, it will be moved to the specified index.
 * @param w the widget to be inserted
 * @param beforeIndex the index before which it will be inserted
 * @throws IndexOutOfBoundsException if <code>beforeIndex</code> is out ofrange
 */
public void insert(Widget w,int beforeIndex){
  int idx=getWidgetIndex(w);
  if (idx == -1) {
    w.removeFromParent();
  }
 else {
    remove(w);
    if (idx < beforeIndex) {
      beforeIndex--;
    }
  }
  Element td=DOM.createTD();
  DOM.insertChild(tableRow,td,beforeIndex);
  super.insert(w,td,beforeIndex);
  setCellHorizontalAlignment(w,horzAlign);
  setCellVerticalAlignment(w,vertAlign);
}
Program: 83237
Project: 83237
Buggy source:
/** 
 * Adds a child widget to the panel.
 * @param w the widget to be added
 */
public void add(Widget w){
  insert(w,getWidgetCount());
}

Fixed version (ground truth):
/** 
 * Adds a child widget to the panel. If the Widget is already attached to the VerticalPanel, it will be moved to the end of the panel.
 * @param w the widget to be added
 */
public void add(Widget w){
  insert(w,getWidgetCount());
}
Program: 83238
Project: 83238
Buggy source:
/** 
 * Inserts a widget before the specified index.
 * @param w the widget to be inserted
 * @param beforeIndex the index before which it will be inserted
 * @throws IndexOutOfBoundsException if <code>beforeIndex</code> is out ofrange
 */
public void insert(Widget w,int beforeIndex){
  w.removeFromParent();
  Element tr=DOM.createTR();
  Element td=DOM.createTD();
  DOM.insertChild(getBody(),tr,beforeIndex);
  DOM.appendChild(tr,td);
  super.insert(w,td,beforeIndex);
  setCellHorizontalAlignment(w,horzAlign);
  setCellVerticalAlignment(w,vertAlign);
}

Fixed version (ground truth):
/** 
 * Inserts a widget before the specified index. If the Widget is already attached to the VerticalPanel, it will be moved to the specified index.
 * @param w the widget to be inserted
 * @param beforeIndex the index before which it will be inserted
 * @throws IndexOutOfBoundsException if <code>beforeIndex</code> is out ofrange
 */
public void insert(Widget w,int beforeIndex){
  int idx=getWidgetIndex(w);
  if (idx == -1) {
    w.removeFromParent();
  }
 else {
    remove(w);
    if (idx < beforeIndex) {
      beforeIndex--;
    }
  }
  Element tr=DOM.createTR();
  Element td=DOM.createTD();
  DOM.insertChild(getBody(),tr,beforeIndex);
  DOM.appendChild(tr,td);
  super.insert(w,td,beforeIndex);
  setCellHorizontalAlignment(w,horzAlign);
  setCellVerticalAlignment(w,vertAlign);
}
Program: 83239
Project: 83239
Buggy source:
public boolean onEventPreview(Event event){
  Element target=DOM.eventGetTarget(event);
  boolean eventTargetsPopup=DOM.isOrHasChild(getElement(),target);
  int type=DOM.eventGetType(event);
switch (type) {
case Event.ONKEYDOWN:
{
      return onKeyDownPreview((char)DOM.eventGetKeyCode(event),KeyboardListenerCollection.getKeyboardModifiers(event));
    }
case Event.ONKEYUP:
{
    return onKeyUpPreview((char)DOM.eventGetKeyCode(event),KeyboardListenerCollection.getKeyboardModifiers(event));
  }
case Event.ONKEYPRESS:
{
  return onKeyPressPreview((char)DOM.eventGetKeyCode(event),KeyboardListenerCollection.getKeyboardModifiers(event));
}
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
case Event.ONMOUSEMOVE:
case Event.ONCLICK:
case Event.ONDBLCLICK:
{
if (DOM.getCaptureElement() != null) {
  return true;
}
if (!eventTargetsPopup && autoHide && (type == Event.ONCLICK)) {
  hide(true);
  return true;
}
break;
}
case Event.ONFOCUS:
{
if (modal && !eventTargetsPopup && (target != null)) {
blur(target);
return false;
}
}
}
return !modal || (modal && eventTargetsPopup);
}

Fixed version (ground truth):
public boolean onEventPreview(Event event){
  Element target=DOM.eventGetTarget(event);
  boolean eventTargetsPopup=DOM.isOrHasChild(getElement(),target);
  int type=DOM.eventGetType(event);
switch (type) {
case Event.ONKEYDOWN:
{
      return onKeyDownPreview((char)DOM.eventGetKeyCode(event),KeyboardListenerCollection.getKeyboardModifiers(event));
    }
case Event.ONKEYUP:
{
    return onKeyUpPreview((char)DOM.eventGetKeyCode(event),KeyboardListenerCollection.getKeyboardModifiers(event));
  }
case Event.ONKEYPRESS:
{
  return onKeyPressPreview((char)DOM.eventGetKeyCode(event),KeyboardListenerCollection.getKeyboardModifiers(event));
}
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
case Event.ONMOUSEMOVE:
case Event.ONCLICK:
case Event.ONDBLCLICK:
{
if (DOM.getCaptureElement() != null) {
  return true;
}
if (!eventTargetsPopup && autoHide && (type == Event.ONMOUSEDOWN)) {
  hide(true);
  return true;
}
break;
}
case Event.ONFOCUS:
{
if (modal && !eventTargetsPopup && (target != null)) {
blur(target);
return false;
}
}
}
return !modal || (modal && eventTargetsPopup);
}
Program: 83241
Project: 83241
Buggy source:
public static String getSourceRepresentation(Class type,String optArrayDim){
  if (type.equals(Integer.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Long.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Short.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Byte.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Character.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Boolean.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Float.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Double.TYPE)) {
    return "String_Node_Str";
  }
  if (type.isArray()) {
    Class componentType=type.getComponentType();
    return getSourceRepresentation(componentType,optArrayDim) + "String_Node_Str";
  }
  return type.getName().replace('$','.');
}

Fixed version (ground truth):
public static String getSourceRepresentation(Class type){
  if (type.equals(Integer.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Long.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Short.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Byte.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Character.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Boolean.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Float.TYPE)) {
    return "String_Node_Str";
  }
 else   if (type.equals(Double.TYPE)) {
    return "String_Node_Str";
  }
  if (type.isArray()) {
    Class componentType=type.getComponentType();
    return getSourceRepresentation(componentType) + "String_Node_Str";
  }
  return type.getName().replace('$','.');
}
Program: 83242
Project: 83242
Buggy source:
private static String formatMethodNotFoundErrorMessage(Class serviceIntf,String serviceMethodName,Class[] parameterTypes){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(serviceMethodName);
  sb.append("String_Node_Str");
  for (int i=0; i < parameterTypes.length; ++i) {
    if (i > 0) {
      sb.append("String_Node_Str");
    }
    sb.append(TypeInfo.getSourceRepresentation(parameterTypes[i],"String_Node_Str"));
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(TypeInfo.getSourceRepresentation(serviceIntf,"String_Node_Str"));
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
private static String formatMethodNotFoundErrorMessage(Class serviceIntf,String serviceMethodName,Class[] parameterTypes){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(serviceMethodName);
  sb.append("String_Node_Str");
  for (int i=0; i < parameterTypes.length; ++i) {
    if (i > 0) {
      sb.append("String_Node_Str");
    }
    sb.append(printTypeName(parameterTypes[i]));
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(printTypeName(serviceIntf));
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 83244
Project: 83244
Buggy source:
/** 
 * Returns a string that encodes the object. It is an error to try to encode an object that is not assignable to the service method's return type.
 * @param serviceMethod the method whose result we are encoding
 * @param object the instance that we wish to encode
 * @return a string that encodes the object, if the object is compatible withthe service method's declared return type
 * @throws IllegalArgumentException if the result is not assignable to theservice method's return type
 * @throws NullPointerException if the service method is <code>null</code>
 * @throws SerializationException if the result cannot be serialized
 */
public static String encodeResponseForSuccess(Method serviceMethod,Object object) throws SerializationException {
  if (serviceMethod == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Class methodReturnType=serviceMethod.getReturnType();
  if (methodReturnType != void.class && object != null) {
    Class actualReturnType;
    if (methodReturnType.isPrimitive()) {
      actualReturnType=getPrimitiveClassFromWrapper(object.getClass());
    }
 else {
      actualReturnType=object.getClass();
    }
    if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) {
      throw new IllegalArgumentException("String_Node_Str" + TypeInfo.getSourceRepresentation(object.getClass(),"String_Node_Str") + "String_Node_Str"+ getSourceRepresentation(serviceMethod)+ "String_Node_Str");
    }
  }
  return encodeResponse(methodReturnType,object,false);
}

Fixed version (ground truth):
/** 
 * Returns a string that encodes the object. It is an error to try to encode an object that is not assignable to the service method's return type.
 * @param serviceMethod the method whose result we are encoding
 * @param object the instance that we wish to encode
 * @return a string that encodes the object, if the object is compatible withthe service method's declared return type
 * @throws IllegalArgumentException if the result is not assignable to theservice method's return type
 * @throws NullPointerException if the service method is <code>null</code>
 * @throws SerializationException if the result cannot be serialized
 */
public static String encodeResponseForSuccess(Method serviceMethod,Object object) throws SerializationException {
  if (serviceMethod == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Class methodReturnType=serviceMethod.getReturnType();
  if (methodReturnType != void.class && object != null) {
    Class actualReturnType;
    if (methodReturnType.isPrimitive()) {
      actualReturnType=getPrimitiveClassFromWrapper(object.getClass());
    }
 else {
      actualReturnType=object.getClass();
    }
    if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) {
      throw new IllegalArgumentException("String_Node_Str" + printTypeName(object.getClass()) + "String_Node_Str"+ getSourceRepresentation(serviceMethod)+ "String_Node_Str");
    }
  }
  return encodeResponse(methodReturnType,object,false);
}
Program: 83245
Project: 83245
Buggy source:
private static String formatIllegalAccessErrorMessage(Object target,Method serviceMethod){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(getSourceRepresentation(serviceMethod));
  sb.append("String_Node_Str");
  if (target != null) {
    sb.append("String_Node_Str");
    sb.append(TypeInfo.getSourceRepresentation(target.getClass(),"String_Node_Str"));
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
private static String formatIllegalAccessErrorMessage(Object target,Method serviceMethod){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(getSourceRepresentation(serviceMethod));
  sb.append("String_Node_Str");
  if (target != null) {
    sb.append("String_Node_Str");
    sb.append(printTypeName(target.getClass()));
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 83246
Project: 83246
Buggy source:
private static String formatIllegalArgumentErrorMessage(Object target,Method serviceMethod,Object[] args){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(getSourceRepresentation(serviceMethod));
  sb.append("String_Node_Str");
  if (target != null) {
    sb.append("String_Node_Str");
    sb.append(TypeInfo.getSourceRepresentation(target.getClass(),"String_Node_Str"));
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  if (args != null && args.length > 0) {
    sb.append(Arrays.asList(args));
  }
  return sb.toString();
}

Fixed version (ground truth):
private static String formatIllegalArgumentErrorMessage(Object target,Method serviceMethod,Object[] args){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(getSourceRepresentation(serviceMethod));
  sb.append("String_Node_Str");
  if (target != null) {
    sb.append("String_Node_Str");
    sb.append(printTypeName(target.getClass()));
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  if (args != null && args.length > 0) {
    sb.append(Arrays.asList(args));
  }
  return sb.toString();
}
Program: 83247
Project: 83247
Buggy source:
private void hide(boolean autoClosed){
  if (!showing) {
    return;
  }
  showing=false;
  DOM.removeEventPreview(this);
  RootPanel.get().remove(this);
  impl.onHide(getElement());
  if (popupListeners != null) {
    popupListeners.firePopupClosed(this,autoClosed);
  }
}

Fixed version (ground truth):
private void hide(boolean autoClosed){
  if (!showing) {
    return;
  }
  showing=false;
  RootPanel.get().remove(this);
  impl.onHide(getElement());
  if (popupListeners != null) {
    popupListeners.firePopupClosed(this,autoClosed);
  }
}
Program: 83248
Project: 83248
Buggy source:
/** 
 * Creates an HTML SELECT element.
 * @return the newly-created element
 */
public static Element createSelect(){
  return impl.createElement("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Creates an HTML SELECT element.
 * @return the newly-created element
 */
public static Element createSelect(boolean multiple){
  return impl.createSelectElement(multiple);
}
Program: 83249
Project: 83249
Buggy source:
/** 
 * Gets the value associated with the item at a given index. 
 * @param index the index of the item to be retrieved
 * @return the item's associated value
 * @throws IndexOutOfBoundsException if the index is out of range
 */
public String getValue(int index){
  checkIndex(index);
  Element option=DOM.getChild(getElement(),index);
  return DOM.getElementProperty(option,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Gets the value associated with the item at a given index.
 * @param index the index of the item to be retrieved
 * @return the item's associated value
 * @throws IndexOutOfBoundsException if the index is out of range
 */
public String getValue(int index){
  checkIndex(index);
  Element option=DOM.getChild(getElement(),index);
  return DOM.getElementProperty(option,"String_Node_Str");
}
Program: 83250
Project: 83250
Buggy source:
/** 
 * Sets whether this list allows multiple selections.
 * @param multiple <code>true</code> to allow multiple selections
 */
public void setMultipleSelect(boolean multiple){
  DOM.setElementPropertyBoolean(getElement(),"String_Node_Str",multiple);
}

Fixed version (ground truth):
/** 
 * Sets whether this list allows multiple selections. <em>NOTE: The preferred way of enabling multiple selections in a list box is by using the  {@link #ListBox(boolean)} constructor. Using this method can spuriouslyfail on Internet Explorer 6.0.</em>
 * @param multiple <code>true</code> to allow multiple selections
 */
public void setMultipleSelect(boolean multiple){
  DOM.setElementPropertyBoolean(getElement(),"String_Node_Str",multiple);
}
Program: 83251
Project: 83251
Buggy source:
/** 
 * Creates an empty list box.
 */
public ListBox(){
  super(DOM.createSelect());
  sinkEvents(Event.ONCHANGE);
  setStyleName("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Creates an empty list box. The preferred way to enable multiple selections is to use this constructor rather than   {@link #setMultipleSelect(boolean)}.
 * @param isMultipleSelect specifies if multiple selection is enabled
 */
public ListBox(boolean isMultipleSelect){
  super(DOM.createSelect(isMultipleSelect));
  sinkEvents(Event.ONCHANGE);
  setStyleName("String_Node_Str");
}