nus-yam/ex-repair huggingface dataset:
Program: 54819
Project: 54819
Buggy source:
/** 
 * Test method for  {@link com.google.gwt.user.client.CommandExecutor#submit(com.google.gwt.user.client.IncrementalCommand)}. <p/> Cases: <ul> <li>Submit <code>null</code></li> <li>Submit   {@link IncrementalCommand} and make sure that it fires as manytimes as we want it to</li> </ul>
 */
public void testSubmitIncrementalCommand(){
  CommandExecutor ce=new CommandExecutor();
  ce.submit((Command)null);
  delayTestFinish(TEST_FINISH_DELAY_MILLIS);
  ce.submit(new IncrementalCommand(){
    private int executionCount=0;
    public boolean execute(){
      if (++executionCount >= 10) {
        fail("String_Node_Str");
      }
      if (executionCount == 9) {
        finishTest();
      }
      return executionCount < 10;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link com.google.gwt.user.client.CommandExecutor#submit(com.google.gwt.user.client.IncrementalCommand)}. <p/> Cases: <ul> <li>Submit <code>null</code></li> <li>Submit   {@link IncrementalCommand} and make sure that it fires as manytimes as we want it to</li> </ul>
 */
public void testSubmitIncrementalCommand(){
  CommandExecutor ce=new CommandExecutor();
  ce.submit((Command)null);
  delayTestFinish(TEST_FINISH_DELAY_MILLIS);
  ce.submit(new IncrementalCommand(){
    private int executionCount=0;
    public boolean execute(){
      if (++executionCount > 10) {
        fail("String_Node_Str");
      }
      if (executionCount == 10) {
        finishTest();
      }
      return executionCount < 10;
    }
  }
);
}
Program: 54820
Project: 54820
Buggy source:
/** 
 * Returns a pretty printed list of clients that have not retrieved the current test. Used for error reporting.
 * @return a string containing the list of clients that have not retrieved thecurrent test.
 */
String getUnretrievedClients(){
  StringBuilder buf=new StringBuilder();
synchronized (clientStatusesLock) {
    int lineCount=0;
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      if (!clientStatus.hasRequestedCurrentTest) {
        buf.append("String_Node_Str");
      }
 else {
        buf.append("String_Node_Str");
      }
      buf.append(clientStatus.clientId);
      lineCount++;
    }
    int difference=numClients - numClientsHaveRequestedTest;
    if (difference > 0) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      buf.append("String_Node_Str" + difference + "String_Node_Str");
    }
  }
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Returns a pretty printed list of clients that have not retrieved the current test. Used for error reporting.
 * @return a string containing the list of clients that have not retrieved thecurrent test.
 */
String getUnretrievedClients(){
synchronized (clientStatusesLock) {
    StringBuilder buf=new StringBuilder();
    int lineCount=0;
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      if (!clientStatus.hasRequestedCurrentTest) {
        buf.append("String_Node_Str");
      }
 else {
        buf.append("String_Node_Str");
      }
      buf.append(clientStatus.clientId);
      lineCount++;
    }
    int difference=numClients - numClientsHaveRequestedTest;
    if (difference > 0) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      buf.append("String_Node_Str" + difference + "String_Node_Str");
    }
    return buf.toString();
  }
}
Program: 54821
Project: 54821
Buggy source:
/** 
 * Called by the servlet to query for for the next method to test.
 * @param timeout how long to wait for an answer
 * @return the next test to run, or <code>null</code> if<code>timeout</code> is exceeded or the next test does not match <code>testClassName</code>
 */
public TestInfo getNextTestInfo(String clientId,long timeout) throws TimeoutException {
synchronized (clientStatusesLock) {
    ClientStatus clientStatus=clientStatuses.get(clientId);
    if (clientStatus == null) {
      clientStatus=new ClientStatus(clientId);
      clientStatuses.put(clientId,clientStatus);
    }
    long startTime=System.currentTimeMillis();
    long stopTime=startTime + timeout;
    while (clientStatus.hasRequestedCurrentTest == true) {
      long timeToWait=stopTime - System.currentTimeMillis();
      if (timeToWait < 1) {
        double elapsed=(System.currentTimeMillis() - startTime) / 1000.0;
        throw new TimeoutException("String_Node_Str" + "String_Node_Str" + timeout + "String_Node_Str"+ "String_Node_Str"+ clientId+ "String_Node_Str"+ "String_Node_Str"+ elapsed+ "String_Node_Str");
      }
      try {
        clientStatusesLock.wait(timeToWait);
      }
 catch (      InterruptedException e) {
        System.err.println("String_Node_Str");
        e.printStackTrace();
        return null;
      }
    }
    clientStatus.hasRequestedCurrentTest=true;
    ++numClientsHaveRequestedTest;
    return currentTest;
  }
}

Fixed version (ground truth):
/** 
 * Called by the servlet to query for for the next method to test.
 * @param timeout how long to wait for an answer
 * @return the next test to run, or <code>null</code> if<code>timeout</code> is exceeded or the next test does not match <code>testClassName</code>
 */
public TestInfo getNextTestInfo(String clientId,long timeout) throws TimeoutException {
synchronized (clientStatusesLock) {
    ClientStatus clientStatus=clientStatuses.get(clientId);
    if (clientStatus == null) {
      clientStatus=new ClientStatus(clientId);
      clientStatuses.put(clientId,clientStatus);
    }
    long startTime=System.currentTimeMillis();
    long stopTime=startTime + timeout;
    while (clientStatus.currentTestResults != null) {
      long timeToWait=stopTime - System.currentTimeMillis();
      if (timeToWait < 1) {
        double elapsed=(System.currentTimeMillis() - startTime) / 1000.0;
        throw new TimeoutException("String_Node_Str" + "String_Node_Str" + timeout + "String_Node_Str"+ "String_Node_Str"+ clientId+ "String_Node_Str"+ "String_Node_Str"+ elapsed+ "String_Node_Str");
      }
      try {
        clientStatusesLock.wait(timeToWait);
      }
 catch (      InterruptedException e) {
        System.err.println("String_Node_Str");
        e.printStackTrace();
        return null;
      }
    }
    clientStatus.hasRequestedCurrentTest=true;
    ++numClientsHaveRequestedTest;
    return currentTest;
  }
}
Program: 54822
Project: 54822
Buggy source:
/** 
 * Fetches the results of a completed test.
 * @return A map of results from all clients.
 */
Map<String,JUnitResult> getResults(){
  Map<String,JUnitResult> result=new HashMap<String,JUnitResult>();
synchronized (clientStatusesLock) {
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      result.put(clientStatus.clientId,clientStatus.currentTestResults);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Fetches the results of a completed test.
 * @return A map of results from all clients.
 */
Map<String,JUnitResult> getResults(){
synchronized (clientStatusesLock) {
    Map<String,JUnitResult> result=new HashMap<String,JUnitResult>();
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      result.put(clientStatus.clientId,clientStatus.currentTestResults);
    }
    return result;
  }
}
Program: 54823
Project: 54823
Buggy source:
/** 
 * Only instantiable within this package.
 * @param numClients The number of parallel clients being served by thisqueue.
 */
JUnitMessageQueue(int numClients){
  this.numClients=numClients;
}

Fixed version (ground truth):
/** 
 * Only instantiable within this package.
 * @param numClients The number of parallel clients being served by thisqueue.
 */
JUnitMessageQueue(int numClients){
synchronized (clientStatusesLock) {
    this.numClients=numClients;
  }
}
Program: 54824
Project: 54824
Buggy source:
public DefaultMuseum(){
  addIssue(new Issue1245());
  addIssue(new Issue1897());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
}

Fixed version (ground truth):
public DefaultMuseum(){
  addIssue(new Issue1245());
  addIssue(new Issue1897());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
}
Program: 54825
Project: 54825
Buggy source:
@Override public void onStart(){
  onUpdate(0.0);
  UIObject.setVisible(container1,true);
  UIObject.setVisible(container2,true);
}

Fixed version (ground truth):
@Override public void onStart(){
  com.google.gwt.dom.client.Element deckElem=container1.getParentElement();
  int deckHeight=deckElem.getOffsetHeight();
  if (growing) {
    fixedHeight=container2.getOffsetHeight();
    container2.getStyle().setPropertyPx("String_Node_Str",fixedHeight - 1);
  }
 else {
    fixedHeight=container1.getOffsetHeight();
    container1.getStyle().setPropertyPx("String_Node_Str",fixedHeight - 1);
  }
  if (deckElem.getOffsetHeight() != deckHeight) {
    fixedHeight=-1;
  }
  onUpdate(0.0);
  UIObject.setVisible(container1,true);
  UIObject.setVisible(container2,true);
}
Program: 54826
Project: 54826
Buggy source:
@Override public void onUpdate(double progress){
  if (!growing) {
    progress=1.0 - progress;
  }
  int height1;
  int height2;
  if (fixedHeight == -1) {
    height1=(int)(progress * DOM.getElementPropertyInt(container1,"String_Node_Str"));
    height2=(int)((1.0 - progress) * DOM.getElementPropertyInt(container2,"String_Node_Str"));
  }
 else {
    height1=(int)(progress * fixedHeight);
    height2=fixedHeight - height1;
  }
  DOM.setStyleAttribute(container1,"String_Node_Str",height1 + "String_Node_Str");
  DOM.setStyleAttribute(container2,"String_Node_Str",height2 + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onUpdate(double progress){
  if (!growing) {
    progress=1.0 - progress;
  }
  int height1;
  int height2;
  if (fixedHeight == -1) {
    height1=(int)(progress * DOM.getElementPropertyInt(container1,"String_Node_Str"));
    height2=(int)((1.0 - progress) * DOM.getElementPropertyInt(container2,"String_Node_Str"));
  }
 else {
    height1=(int)(progress * fixedHeight);
    height2=fixedHeight - height1;
  }
  if (height1 == 0) {
    height1=1;
    height2=Math.max(1,height2 - 1);
  }
 else   if (height2 == 0) {
    height2=1;
    height1=Math.max(1,height1 - 1);
  }
  DOM.setStyleAttribute(container1,"String_Node_Str",height1 + "String_Node_Str");
  DOM.setStyleAttribute(container2,"String_Node_Str",height2 + "String_Node_Str");
}
Program: 54827
Project: 54827
Buggy source:
public DefaultMuseum(){
  addIssue(new Issue1245());
  addIssue(new Issue1897());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
}

Fixed version (ground truth):
public DefaultMuseum(){
  addIssue(new Issue1245());
  addIssue(new Issue1897());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
}
Program: 54828
Project: 54828
Buggy source:
@Override public void onUpdate(double progress){
  int scrollHeight=DOM.getElementPropertyInt(curItem.childSpanElem,"String_Node_Str");
  int height=(int)(progress * scrollHeight);
  if (!opening) {
    height=scrollHeight - height;
  }
  DOM.setStyleAttribute(curItem.childSpanElem,"String_Node_Str",height + "String_Node_Str");
  int scrollWidth=DOM.getElementPropertyInt(curItem.childSpanElem,"String_Node_Str");
  DOM.setStyleAttribute(curItem.childSpanElem,"String_Node_Str",scrollWidth + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onUpdate(double progress){
  int scrollHeight=DOM.getElementPropertyInt(curItem.childSpanElem,"String_Node_Str");
  int height=(int)(progress * scrollHeight);
  if (!opening) {
    height=scrollHeight - height;
  }
  height=Math.max(height,1);
  DOM.setStyleAttribute(curItem.childSpanElem,"String_Node_Str",height + "String_Node_Str");
  int scrollWidth=DOM.getElementPropertyInt(curItem.childSpanElem,"String_Node_Str");
  DOM.setStyleAttribute(curItem.childSpanElem,"String_Node_Str",scrollWidth + "String_Node_Str");
}
Program: 54830
Project: 54830
Buggy source:
void clear(){
  weakJsoCache.clear();
  weakJavaWrapperCache.clear();
  dispClassInfoOracle.clear();
}

Fixed version (ground truth):
void clear(){
  shellJavaScriptHost=null;
  updateJavaScriptHost();
  weakJsoCache.clear();
  weakJavaWrapperCache.clear();
  dispClassInfoOracle.clear();
}
Program: 54831
Project: 54831
Buggy source:
@Override protected synchronized Class<?> findClass(String className) throws ClassNotFoundException {
  if (className == null) {
    throw new ClassNotFoundException("String_Node_Str",new NullPointerException());
  }
  if (isInStandardJavaPackage(className)) {
    throw new ClassNotFoundException(className);
  }
  if (className.equals(ShellJavaScriptHost.class.getName())) {
    return ShellJavaScriptHost.class;
  }
  byte[] classBytes;
  try {
    String lookupClassName=className;
    if (classRewriter != null && classRewriter.isJsoImpl(className)) {
      lookupClassName=className.substring(0,className.length() - 1);
    }
    classBytes=compiler.getClassBytes(logger,lookupClassName);
    if (classRewriter != null) {
      classBytes=classRewriter.rewrite(className,classBytes);
    }
    return defineClass(className,classBytes,0,classBytes.length);
  }
 catch (  UnableToCompleteException e) {
    throw new ClassNotFoundException(className);
  }
}

Fixed version (ground truth):
@Override protected synchronized Class<?> findClass(String className) throws ClassNotFoundException {
  if (className == null) {
    throw new ClassNotFoundException("String_Node_Str",new NullPointerException());
  }
  if (isInStandardJavaPackage(className)) {
    throw new ClassNotFoundException(className);
  }
  if (BRIDGE_CLASS_NAMES.containsKey(className)) {
    return BRIDGE_CLASS_NAMES.get(className);
  }
  byte[] classBytes;
  try {
    String lookupClassName=className;
    if (classRewriter != null && classRewriter.isJsoImpl(className)) {
      lookupClassName=className.substring(0,className.length() - 1);
    }
    classBytes=compiler.getClassBytes(logger,lookupClassName);
    if (classRewriter != null) {
      classBytes=classRewriter.rewrite(className,classBytes);
    }
    Class<?> newClass=defineClass(className,classBytes,0,classBytes.length);
    if (className.equals(JavaScriptHost.class.getName())) {
      javaScriptHostClass=newClass;
      updateJavaScriptHost();
    }
    JsniMethods jsniMethods=newClass.getAnnotation(JsniMethods.class);
    if (jsniMethods != null) {
      for (      JsniMethod jsniMethod : jsniMethods.value()) {
        shellJavaScriptHost.createNative(jsniMethod.file(),jsniMethod.line(),jsniMethod.name(),jsniMethod.paramNames(),jsniMethod.body());
      }
    }
    return newClass;
  }
 catch (  UnableToCompleteException e) {
    throw new ClassNotFoundException(className);
  }
}
Program: 54832
Project: 54832
Buggy source:
/** 
 * This method is called via reflection from the shell, providing the hosted mode application with all of the methods it needs to interface with the browser and the server (for deferred binding).
 */
public static void setHost(ShellJavaScriptHost host){
  sHost=host;
}

Fixed version (ground truth):
/** 
 * This method is called via reflection from the   {@link CompilingClassLoader}, providing the hosted mode application with all of the methods it needs to interface with the browser and the server (for deferred binding).
 */
public static void setHost(ShellJavaScriptHost host){
  sHost=host;
}
Program: 54833
Project: 54833
Buggy source:
@Override public void uninitElement(){
  unhookEvents();
  String html=getHTML();
  beforeInitPlaceholder=DOM.createDiv();
  DOM.setInnerHTML(beforeInitPlaceholder,html);
}

Fixed version (ground truth):
@Override public void uninitElement(){
  if (initializing) {
    initializing=false;
    return;
  }
  unhookEvents();
  String html=getHTML();
  beforeInitPlaceholder=DOM.createDiv();
  DOM.setInnerHTML(beforeInitPlaceholder,html);
}
Program: 54834
Project: 54834
Buggy source:
@Override protected void onElementInitialized(){
  super.onElementInitialized();
  if (beforeInitPlaceholder != null) {
    setHTMLImpl(DOM.getInnerHTML(beforeInitPlaceholder));
    beforeInitPlaceholder=null;
  }
}

Fixed version (ground truth):
@Override protected void onElementInitialized(){
  if (!initializing) {
    return;
  }
  initializing=false;
  super.onElementInitialized();
  if (beforeInitPlaceholder != null) {
    setHTMLImpl(DOM.getInnerHTML(beforeInitPlaceholder));
    beforeInitPlaceholder=null;
  }
}
Program: 54835
Project: 54835
Buggy source:
/** 
 * Test that an immediate set of text is reflected immediately and after a delay. Some platforms have timing subtleties that need to be tested.
 */
public void testSetTextBeforeInit(){
  final RichTextArea richTextArea=new RichTextArea();
  RootPanel.get().add(richTextArea);
  richTextArea.setText("String_Node_Str");
  assertEquals("String_Node_Str",richTextArea.getText());
  new Timer(){
    public void run(){
      assertEquals("String_Node_Str",richTextArea.getText());
      finishTest();
    }
  }
.schedule(200);
  delayTestFinish(1000);
}

Fixed version (ground truth):
/** 
 * Test that an immediate set of text is reflected immediately and after a delay. Some platforms have timing subtleties that need to be tested.
 */
public void testSetTextBeforeInit(){
  final RichTextArea richTextArea=new RichTextArea();
  RootPanel.get().add(richTextArea);
  richTextArea.setText("String_Node_Str");
  assertEquals("String_Node_Str",richTextArea.getText());
  new Timer(){
    @Override public void run(){
      assertEquals("String_Node_Str",richTextArea.getText());
      finishTest();
    }
  }
.schedule(200);
  delayTestFinish(1000);
}
Program: 54836
Project: 54836
Buggy source:
/** 
 * Test that a delayed set of HTML is reflected. Some platforms have timing subtleties that need to be tested.
 */
public void testSetHTMLAfterInit(){
  final RichTextArea richTextArea=new RichTextArea();
  RootPanel.get().add(richTextArea);
  new Timer(){
    public void run(){
      richTextArea.setHTML("String_Node_Str");
      assertEquals("String_Node_Str",richTextArea.getHTML().toLowerCase());
      finishTest();
    }
  }
.schedule(200);
  delayTestFinish(1000);
}

Fixed version (ground truth):
/** 
 * Test that a delayed set of HTML is reflected. Some platforms have timing subtleties that need to be tested.
 */
public void testSetHTMLAfterInit(){
  final RichTextArea richTextArea=new RichTextArea();
  RootPanel.get().add(richTextArea);
  new Timer(){
    @Override public void run(){
      richTextArea.setHTML("String_Node_Str");
      assertEquals("String_Node_Str",richTextArea.getHTML().toLowerCase());
      finishTest();
    }
  }
.schedule(200);
  delayTestFinish(1000);
}
Program: 54837
Project: 54837
Buggy source:
/** 
 * Test that delayed set of text is reflected. Some platforms have timing subtleties that need to be tested.
 */
public void testSetTextAfterInit(){
  final RichTextArea richTextArea=new RichTextArea();
  RootPanel.get().add(richTextArea);
  new Timer(){
    public void run(){
      richTextArea.setText("String_Node_Str");
      assertEquals("String_Node_Str",richTextArea.getText());
      finishTest();
    }
  }
.schedule(200);
  delayTestFinish(1000);
}

Fixed version (ground truth):
/** 
 * Test that delayed set of text is reflected. Some platforms have timing subtleties that need to be tested.
 */
public void testSetTextAfterInit(){
  final RichTextArea richTextArea=new RichTextArea();
  RootPanel.get().add(richTextArea);
  new Timer(){
    @Override public void run(){
      richTextArea.setText("String_Node_Str");
      assertEquals("String_Node_Str",richTextArea.getText());
      finishTest();
    }
  }
.schedule(200);
  delayTestFinish(1000);
}
Program: 54838
Project: 54838
Buggy source:
public void run(){
  assertEquals("String_Node_Str",richTextArea.getText());
  finishTest();
}

Fixed version (ground truth):
@Override public void run(){
  assertEquals("String_Node_Str",richTextArea.getText());
  finishTest();
}
Program: 54839
Project: 54839
Buggy source:
/** 
 * Test that an immediate set of HTML is reflected immediately and after a delay. Some platforms have timing subtleties that need to be tested.
 */
public void testSetHTMLBeforeInit(){
  final RichTextArea richTextArea=new RichTextArea();
  RootPanel.get().add(richTextArea);
  richTextArea.setHTML("String_Node_Str");
  assertEquals("String_Node_Str",richTextArea.getHTML().toLowerCase());
  new Timer(){
    public void run(){
      assertEquals("String_Node_Str",richTextArea.getHTML().toLowerCase());
      finishTest();
    }
  }
.schedule(200);
  delayTestFinish(1000);
}

Fixed version (ground truth):
/** 
 * Test that an immediate set of HTML is reflected immediately and after a delay. Some platforms have timing subtleties that need to be tested.
 */
public void testSetHTMLBeforeInit(){
  final RichTextArea richTextArea=new RichTextArea();
  RootPanel.get().add(richTextArea);
  richTextArea.setHTML("String_Node_Str");
  assertEquals("String_Node_Str",richTextArea.getHTML().toLowerCase());
  new Timer(){
    @Override public void run(){
      assertEquals("String_Node_Str",richTextArea.getHTML().toLowerCase());
      finishTest();
    }
  }
.schedule(200);
  delayTestFinish(1000);
}
Program: 54840
Project: 54840
Buggy source:
public String getModuleName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getModuleName(){
  return "String_Node_Str";
}
Program: 54841
Project: 54841
Buggy source:
/** 
 * Test that removing and re-adding an RTA doesn't destroy its contents (Only IE actually preserves dynamically-created iframe contents across DOM removal/re-adding).
 */
public void testAddEditRemoveAdd(){
  final RichTextArea area=new RichTextArea();
  RootPanel.get().add(area);
  area.setHTML("String_Node_Str");
  this.delayTestFinish(1000);
  new Timer(){
    public void run(){
      RootPanel.get().remove(area);
      RootPanel.get().add(area);
      assertEquals("String_Node_Str",area.getHTML());
      finishTest();
    }
  }
.schedule(500);
}

Fixed version (ground truth):
/** 
 * Test that removing and re-adding an RTA doesn't destroy its contents (Only IE actually preserves dynamically-created iframe contents across DOM removal/re-adding).
 */
public void testAddEditRemoveAdd(){
  final RichTextArea area=new RichTextArea();
  RootPanel.get().add(area);
  area.setHTML("String_Node_Str");
  this.delayTestFinish(1000);
  new Timer(){
    @Override public void run(){
      RootPanel.get().remove(area);
      RootPanel.get().add(area);
      assertEquals("String_Node_Str",area.getHTML());
      finishTest();
    }
  }
.schedule(500);
}
Program: 54842
Project: 54842
Buggy source:
/** 
 * @see HasAnimation#isAnimationEnabled()
 */
public boolean isAnimationEnabled(){
  return isAnimationEnabled;
}

Fixed version (ground truth):
public boolean isAnimationEnabled(){
  return isAnimationEnabled;
}
Program: 54843
Project: 54843
Buggy source:
/** 
 * @see HasAnimation#setAnimationEnabled(boolean)
 */
public void setAnimationEnabled(boolean enable){
  isAnimationEnabled=enable;
}

Fixed version (ground truth):
public void setAnimationEnabled(boolean enable){
  isAnimationEnabled=enable;
}
Program: 54844
Project: 54844
Buggy source:
@Override public void onUpdate(double progress){
  int scrollHeight=DOM.getElementPropertyInt(curPanel.contentWrapper.getElement(),"String_Node_Str");
  int height=(int)(progress * scrollHeight);
  if (!opening) {
    height=scrollHeight - height;
  }
  DOM.setStyleAttribute(curPanel.contentWrapper.getElement(),"String_Node_Str",height + "String_Node_Str");
  DOM.setStyleAttribute(curPanel.contentWrapper.getElement(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override public void onUpdate(double progress){
  int scrollHeight=DOM.getElementPropertyInt(curPanel.contentWrapper.getElement(),"String_Node_Str");
  int height=(int)(progress * scrollHeight);
  if (!opening) {
    height=scrollHeight - height;
  }
  height=Math.max(height,1);
  DOM.setStyleAttribute(curPanel.contentWrapper.getElement(),"String_Node_Str",height + "String_Node_Str");
  DOM.setStyleAttribute(curPanel.contentWrapper.getElement(),"String_Node_Str","String_Node_Str");
}
Program: 54845
Project: 54845
Buggy source:
public boolean removeAll(Collection<?> c){
  Iterator<?> iter=c.iterator();
  boolean changed=false;
  while (iter.hasNext()) {
    if (remove(iter.next())) {
      changed=true;
    }
  }
  return changed;
}

Fixed version (ground truth):
public boolean removeAll(Collection<?> c){
  Iterator<?> iter=iterator();
  boolean changed=false;
  while (iter.hasNext()) {
    if (c.contains(iter.next())) {
      iter.remove();
      changed=true;
    }
  }
  return changed;
}
Program: 54846
Project: 54846
Buggy source:
protected final void rememberDecodedObject(Object o){
  seenArray.add(o);
}

Fixed version (ground truth):
protected final void rememberDecodedObject(int index,Object o){
  seenArray.set(index - 1,o);
}
Program: 54847
Project: 54847
Buggy source:
@Override protected Object deserialize(String typeSignature) throws SerializationException {
  Object instance=serializer.instantiate(this,typeSignature);
  rememberDecodedObject(instance);
  serializer.deserialize(this,instance,typeSignature);
  return instance;
}

Fixed version (ground truth):
@Override protected Object deserialize(String typeSignature) throws SerializationException {
  int id=reserveDecodedObjectIndex();
  Object instance=serializer.instantiate(this,typeSignature);
  rememberDecodedObject(id,instance);
  serializer.deserialize(this,instance,typeSignature);
  return instance;
}
Program: 54848
Project: 54848
Buggy source:
@Override protected Object deserialize(String typeSignature) throws SerializationException {
  Object instance=null;
  SerializedInstanceReference serializedInstRef=SerializabilityUtil.decodeSerializedInstanceReference(typeSignature);
  try {
    Class<?> instanceClass=Class.forName(serializedInstRef.getName(),false,classLoader);
    assert(serializationPolicy != null);
    serializationPolicy.validateDeserialize(instanceClass);
    validateTypeVersions(instanceClass,serializedInstRef);
    Class<?> customSerializer=SerializabilityUtil.hasCustomFieldSerializer(instanceClass);
    instance=instantiate(customSerializer,instanceClass);
    rememberDecodedObject(instance);
    Object replacement=deserializeImpl(customSerializer,instanceClass,instance);
    if (instance != replacement) {
      replaceRememberedObject(instance,replacement);
      instance=replacement;
    }
    return instance;
  }
 catch (  ClassNotFoundException e) {
    throw new SerializationException(e);
  }
catch (  InstantiationException e) {
    throw new SerializationException(e);
  }
catch (  IllegalAccessException e) {
    throw new SerializationException(e);
  }
catch (  IllegalArgumentException e) {
    throw new SerializationException(e);
  }
catch (  InvocationTargetException e) {
    throw new SerializationException(e);
  }
catch (  NoSuchMethodException e) {
    throw new SerializationException(e);
  }
}

Fixed version (ground truth):
@Override protected Object deserialize(String typeSignature) throws SerializationException {
  Object instance=null;
  SerializedInstanceReference serializedInstRef=SerializabilityUtil.decodeSerializedInstanceReference(typeSignature);
  try {
    Class<?> instanceClass=Class.forName(serializedInstRef.getName(),false,classLoader);
    assert(serializationPolicy != null);
    serializationPolicy.validateDeserialize(instanceClass);
    validateTypeVersions(instanceClass,serializedInstRef);
    Class<?> customSerializer=SerializabilityUtil.hasCustomFieldSerializer(instanceClass);
    int index=reserveDecodedObjectIndex();
    instance=instantiate(customSerializer,instanceClass);
    rememberDecodedObject(index,instance);
    Object replacement=deserializeImpl(customSerializer,instanceClass,instance);
    if (instance != replacement) {
      rememberDecodedObject(index,replacement);
      instance=replacement;
    }
    return instance;
  }
 catch (  ClassNotFoundException e) {
    throw new SerializationException(e);
  }
catch (  InstantiationException e) {
    throw new SerializationException(e);
  }
catch (  IllegalAccessException e) {
    throw new SerializationException(e);
  }
catch (  IllegalArgumentException e) {
    throw new SerializationException(e);
  }
catch (  InvocationTargetException e) {
    throw new SerializationException(e);
  }
catch (  NoSuchMethodException e) {
    throw new SerializationException(e);
  }
}
Program: 54849
Project: 54849
Buggy source:
public void onFailure(Throwable caught){
  fail("String_Node_Str");
}

Fixed version (ground truth):
public void onFailure(Throwable caught){
  fail("String_Node_Str" + caught);
}
Program: 54850
Project: 54850
Buggy source:
public void onSuccess(Object result){
  assertNotNull(result);
  assertTrue(CustomFieldSerializerTestSetValidator.isValid((SerializableSubclass)result));
  finishTest();
}

Fixed version (ground truth):
public void onSuccess(Object result){
  assertNotNull(result);
  assertTrue(CustomFieldSerializerTestSetValidator.isValid((ManuallySerializedImmutableClass[])result));
  finishTest();
}
Program: 54851
Project: 54851
Buggy source:
public <T>T[] toArray(T[] a){
  int size=size();
  if (a.length < size) {
    a=Array.clonify(a,size);
  }
  Object[] result=a;
  Iterator<E> it=iterator();
  for (int i=0; i < size; ++i) {
    result[i]=it.next();
  }
  if (a.length > size) {
    a[size]=null;
  }
  return a;
}

Fixed version (ground truth):
public <T>T[] toArray(T[] a){
  int size=size();
  if (a.length < size) {
    a=Array.createFrom(a,size);
  }
  Object[] result=a;
  Iterator<E> it=iterator();
  for (int i=0; i < size; ++i) {
    result[i]=it.next();
  }
  if (a.length > size) {
    a[size]=null;
  }
  return a;
}
Program: 54852
Project: 54852
Buggy source:
@Override public <T>T[] toArray(T[] out){
  if (out.length < size) {
    out=Array.clonify(out,size);
  }
  for (int i=0; i < size; ++i) {
    out[i]=ArrayList.<T>getImpl(array,i);
  }
  if (out.length > size) {
    out[size]=null;
  }
  return out;
}

Fixed version (ground truth):
@Override public <T>T[] toArray(T[] out){
  if (out.length < size) {
    out=Array.createFrom(out,size);
  }
  for (int i=0; i < size; ++i) {
    out[i]=ArrayList.<T>getImpl(array,i);
  }
  if (out.length > size) {
    out[size]=null;
  }
  return out;
}
Program: 54853
Project: 54853
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public <T>T[] toArray(T[] out){
  int size=size();
  if (out.length < size) {
    out=Array.clonify(out,size);
  }
  for (int i=0; i < size; ++i) {
    out[i]=(T)array[i];
  }
  if (out.length > size) {
    out[size]=null;
  }
  return out;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public <T>T[] toArray(T[] out){
  int size=size();
  if (out.length < size) {
    out=Array.createFrom(out,size);
  }
  for (int i=0; i < size; ++i) {
    out[i]=(T)array[i];
  }
  if (out.length > size) {
    out[size]=null;
  }
  return out;
}
Program: 54854
Project: 54854
Buggy source:
public Entry<K,V> next(){
  key=it.next();
  return new MapEntryImpl<K,V>(key,values.get(key.ordinal()));
}

Fixed version (ground truth):
public Entry<K,V> next(){
  key=it.next();
  return new MapEntry(key);
}
Program: 54855
Project: 54855
Buggy source:
/** 
 * Returns <code>key</code> as <code>K</code>. Doesn't actually perform any runtime checks. Should only be called when you are sure <code>key</code> is of type <code>K</code>.
 */
@SuppressWarnings("String_Node_Str") private K asKey(Object key){
  return (K)key;
}

Fixed version (ground truth):
/** 
 * Returns <code>key</code> as <code>K</code>. Only runtime checks that key is an Enum, not that it's the particular Enum K. Should only be called when you are sure <code>key</code> is of type <code>K</code>.
 */
@SuppressWarnings("String_Node_Str") private K asKey(Object key){
  return (K)key;
}
Program: 54856
Project: 54856
Buggy source:
private void init(EnumMap<K,? extends V> m){
  allEnums=m.allEnums;
  keySet=m.keySet.clone();
  values=new ArrayList<V>(m.values);
}

Fixed version (ground truth):
private void init(EnumMap<K,? extends V> m){
  keySet=m.keySet.clone();
  values=Array.clone(m.values);
}
Program: 54857
Project: 54857
Buggy source:
@Override public void clear(){
  keySet.clear();
  Collections.fill(values,null);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void clear(){
  keySet.clear();
  values=(V[])new Object[values.length];
}
Program: 54858
Project: 54858
Buggy source:
@Override public V remove(Object key){
  return keySet.remove(key) ? values.set(asKey(key).ordinal(),null) : null;
}

Fixed version (ground truth):
@Override public V remove(Object key){
  return keySet.remove(key) ? set(asOrdinal(key),null) : null;
}
Program: 54859
Project: 54859
Buggy source:
@Override public boolean containsValue(Object value){
  if (value != null) {
    return values.contains(value);
  }
  for (int i=0, n=values.size(); i < n; ++i) {
    V v=values.get(i);
    if (v == null && keySet.contains(allEnums[i])) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean containsValue(Object value){
  for (  K key : keySet) {
    if (Utility.equalsWithNullCheck(value,values[key.ordinal()])) {
      return true;
    }
  }
  return false;
}
Program: 54860
Project: 54860
Buggy source:
@Override public V put(K key,V value){
  keySet.add(key);
  return values.set(key.ordinal(),value);
}

Fixed version (ground truth):
@Override public V put(K key,V value){
  keySet.add(key);
  return set(key.ordinal(),value);
}
Program: 54861
Project: 54861
Buggy source:
public Iterator<Map.Entry<K,V>> iterator(){
  return new Iterator<Entry<K,V>>(){
    Iterator<K> it=keySet.iterator();
    K key;
    public boolean hasNext(){
      return it.hasNext();
    }
    public Entry<K,V> next(){
      key=it.next();
      return new MapEntryImpl<K,V>(key,values.get(key.ordinal()));
    }
    public void remove(){
      if (key == null) {
        throw new IllegalStateException("String_Node_Str");
      }
      EnumMap.this.remove(key);
      key=null;
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<Entry<K,V>> iterator(){
  return new EntrySetIterator();
}
Program: 54862
Project: 54862
Buggy source:
@Override public V get(Object k){
  return keySet.contains(k) ? values.get(asKey(k).ordinal()) : null;
}

Fixed version (ground truth):
@Override public V get(Object k){
  return keySet.contains(k) ? values[asOrdinal(k)] : null;
}
Program: 54863
Project: 54863
Buggy source:
private static native void addAllStringEntries(JavaScriptObject stringMap,Collection<?> dest);

Fixed version (ground truth):
private native void addAllStringEntries(Collection<?> dest);
Program: 54864
Project: 54864
Buggy source:
private static native void addAllHashEntries(JavaScriptObject hashCodeMap,Collection<?> dest);

Fixed version (ground truth):
private native void addAllHashEntries(Collection<?> dest);
Program: 54865
Project: 54865
Buggy source:
/** 
 * Constructor for <code>EntrySetIterator</code>.
 */
public EntrySetIterator(){
  List<Map.Entry<K,V>> list=new ArrayList<Map.Entry<K,V>>();
  if (nullSlotLive) {
    MapEntryImpl<K,V> entryImpl=new MapEntryImpl<K,V>(null,nullSlot);
    list.add(entryImpl);
  }
  addAllStringEntries(stringMap,list);
  addAllHashEntries(hashCodeMap,list);
  this.iter=list.iterator();
}

Fixed version (ground truth):
/** 
 * Constructor for <code>EntrySetIterator</code>.
 */
public EntrySetIterator(){
  List<Map.Entry<K,V>> list=new ArrayList<Map.Entry<K,V>>();
  if (nullSlotLive) {
    list.add(new MapEntryNull());
  }
  addAllStringEntries(list);
  addAllHashEntries(list);
  this.iter=list.iterator();
}
Program: 54866
Project: 54866
Buggy source:
@Override public <T>T[] toArray(T[] a){
  if (a.length < size) {
    a=Array.clonify(a,size);
  }
  for (int i=0; i < size; ++i) {
    a[i]=ArrayList.<T>getImpl(array,i);
  }
  if (a.length > size) {
    a[size]=null;
  }
  return a;
}

Fixed version (ground truth):
@Override public <T>T[] toArray(T[] out){
  if (out.length < size) {
    out=Array.clonify(out,size);
  }
  for (int i=0; i < size; ++i) {
    out[i]=ArrayList.<T>getImpl(array,i);
  }
  if (out.length > size) {
    out[size]=null;
  }
  return out;
}
Program: 54867
Project: 54867
Buggy source:
public static <T>List<T> asList(T... array){
  List<T> accum=new ArrayList<T>();
  for (int i=0; i < array.length; i++) {
    accum.add(array[i]);
  }
  return accum;
}

Fixed version (ground truth):
public static <T>List<T> asList(T... array){
  return new ArrayList<T>(array);
}
Program: 54868
Project: 54868
Buggy source:
/** 
 * Tests   {@link Arrays#asList(Object[])}.
 */
public void testAsList(){
  Object[] test={};
  List result=Arrays.asList(test);
  assertEquals(test,result);
  Object[] test2={new Integer(0),new Integer(1),new Integer(2)};
  List result2=Arrays.asList(test2);
  assertEquals(test2,result2);
  Object[] test3={"String_Node_Str"};
  List result3=Arrays.asList(test3);
  assertEquals(test3,result3);
}

Fixed version (ground truth):
/** 
 * Tests   {@link Arrays#asList(Object[])}.
 */
@SuppressWarnings("String_Node_Str") public void testAsList(){
  Object[] test={};
  List result=Arrays.asList(test);
  assertEquals(test,result);
  Object[] test2={0,1,2};
  List result2=Arrays.asList(test2);
  assertEquals(test2,result2);
  Object[] test3={"String_Node_Str"};
  List result3=Arrays.asList(test3);
  assertEquals(test3,result3);
}
Program: 54869
Project: 54869
Buggy source:
/** 
 * Test Arrays.binarySearch(Object[], Object, Comparator). <pre> 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 Comparator uses natural ordering as a default </pre>
 */
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);
}

Fixed version (ground truth):
/** 
 * Test Arrays.binarySearch(Object[], Object, Comparator). <pre> 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 Comparator uses natural ordering as a default </pre>
 */
@SuppressWarnings("String_Node_Str") 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: 54870
Project: 54870
Buggy source:
/** 
 * Tests sorting a subrange of a primitive array.
 */
public void testPrimitiveSubrangeSort(){
  int[] x=new int[]{3,11,2,1,22,3};
  Arrays.sort(x,1,5);
  assertEquals(3,x[0]);
  assertEquals(1,x[1]);
  assertEquals(2,x[2]);
  assertEquals(11,x[3]);
  assertEquals(22,x[4]);
  assertEquals(3,x[5]);
}

Fixed version (ground truth):
/** 
 * Tests sorting a subrange of a primitive array.
 */
public void testPrimitiveSubrangeSort(){
  int[] x={3,11,2,1,22,3};
  Arrays.sort(x,1,5);
  assertEquals(3,x[0]);
  assertEquals(1,x[1]);
  assertEquals(2,x[2]);
  assertEquals(11,x[3]);
  assertEquals(22,x[4]);
  assertEquals(3,x[5]);
}
Program: 54871
Project: 54871
Buggy source:
/** 
 * Verifies that values are sorted numerically rather than as strings.
 */
public void testNumericSort(){
  Integer[] x=new Integer[]{new Integer(3),new Integer(11),new Integer(2),new Integer(1)};
  Arrays.sort(x);
  assertEquals(2,x[1].intValue());
  assertEquals(11,x[3].intValue());
}

Fixed version (ground truth):
/** 
 * Verifies that values are sorted numerically rather than as strings.
 */
public void testNumericSort(){
  Integer[] x={3,11,2,1};
  Arrays.sort(x);
  assertEquals(2,x[1].intValue());
  assertEquals(11,x[3].intValue());
}
Program: 54872
Project: 54872
Buggy source:
/** 
 * Tests sorting primitives.
 */
public void testPrimitiveSort(){
  int[] x=new int[]{3,11,2,1,22,3};
  Arrays.sort(x);
  assertEquals(1,x[0]);
  assertEquals(2,x[1]);
  assertEquals(3,x[2]);
  assertEquals(3,x[3]);
  assertEquals(11,x[4]);
  assertEquals(22,x[5]);
}

Fixed version (ground truth):
/** 
 * Tests sorting primitives.
 */
public void testPrimitiveSort(){
  int[] x={3,11,2,1,22,3};
  Arrays.sort(x);
  assertEquals(1,x[0]);
  assertEquals(2,x[1]);
  assertEquals(3,x[2]);
  assertEquals(3,x[3]);
  assertEquals(11,x[4]);
  assertEquals(22,x[5]);
}
Program: 54873
Project: 54873
Buggy source:
/** 
 * Tests   {@link Arrays#sort(Object[],Comparator)}.
 */
public void testSort(){
  Object[] x={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  int hash=x[1].hashCode();
  Arrays.sort(x);
  int hash2=x[1].hashCode();
  assertEquals(hash,hash2);
  Object[] sorted={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(x,sorted);
  Comparator<Object> t=new Comparator<Object>(){
    public int compare(    Object o1,    Object o2){
      return ((Comparable<Object>)o2).compareTo(o1);
    }
  }
;
  Arrays.sort(x,t);
  int hash3=x[1].hashCode();
  assertEquals(hash,hash3);
  Object[] reverseSorted={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(x,reverseSorted);
}

Fixed version (ground truth):
/** 
 * Tests   {@link Arrays#sort(Object[],Comparator)}.
 */
public void testSort(){
  Object[] x={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  int hash=x[1].hashCode();
  Arrays.sort(x);
  int hash2=x[1].hashCode();
  assertEquals(hash,hash2);
  Object[] sorted={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(x,sorted);
  Comparator<Object> t=new Comparator<Object>(){
    @SuppressWarnings("String_Node_Str") public int compare(    Object o1,    Object o2){
      return ((Comparable<Object>)o2).compareTo(o1);
    }
  }
;
  Arrays.sort(x,t);
  int hash3=x[1].hashCode();
  assertEquals(hash,hash3);
  Object[] reverseSorted={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(x,reverseSorted);
}
Program: 54874
Project: 54874
Buggy source:
/** 
 * Tests simple use cases for   {@link Arrays#sort(Object[])}.
 */
public void testSimpleSort(){
  Object[] test={};
  Arrays.sort(test);
  assertEquals(test.length,0);
  Integer[] test2={new Integer(1)};
  Arrays.sort(test2);
  assertEquals(1,test2[0].intValue());
  Number[] test3={new Integer(3),new Integer(0),new Integer(2),new Integer(4),new Integer(1)};
  Arrays.sort(test3);
  for (int i=0; i < test3.length; i++) {
    assertEquals(i,test3[i].intValue());
  }
}

Fixed version (ground truth):
/** 
 * Tests simple use cases for   {@link Arrays#sort(Object[])}.
 */
public void testSimpleSort(){
  Object[] test={};
  Arrays.sort(test);
  assertEquals(test.length,0);
  Integer[] test2={1};
  Arrays.sort(test2);
  assertEquals(1,test2[0].intValue());
  Number[] test3={3,0,2,4,1};
  Arrays.sort(test3);
  for (int i=0; i < test3.length; i++) {
    assertEquals(i,test3[i].intValue());
  }
}
Program: 54875
Project: 54875
Buggy source:
private void generateClassLiterals(JsVars vars){
  for (  JType type : classLits.keySet()) {
    JsName jsName=classLits.get(type);
    JsExpression classObjectAlloc=classObjects.get(jsName);
    JsVar var=new JsVar(jsName);
    var.setInitExpr(classObjectAlloc);
    vars.add(var);
  }
}

Fixed version (ground truth):
private void generateClassLiterals(JsVars vars){
  JClassType objType=program.getTypeJavaLangObject();
  if (classLits.containsKey(objType)) {
    generateClassLiteral(objType,vars);
  }
  for (  JType type : classLits.keySet()) {
    if (type != objType) {
      generateClassLiteral(type,vars);
    }
  }
}
Program: 54876
Project: 54876
Buggy source:
/** 
 * Adds the specified widget to the deck.
 * @param w the widget to be added
 */
@Override public void add(Widget w){
  Element container=DOM.createDiv();
  DOM.appendChild(getElement(),container);
  initChildWidget(w);
  initWidgetContainer(container);
  super.add(w,container);
}

Fixed version (ground truth):
/** 
 * Adds the specified widget to the deck.
 * @param w the widget to be added
 */
@Override public void add(Widget w){
  Element container=createWidgetContainer();
  DOM.appendChild(getElement(),container);
  super.add(w,container);
  finishWidgetInitialization(container,w);
}
Program: 54877
Project: 54877
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){
  Element container=DOM.createDiv();
  DOM.insertChild(getElement(),container,beforeIndex);
  initChildWidget(w);
  initWidgetContainer(container);
  super.insert(w,container,beforeIndex,true);
}

Fixed version (ground truth):
/** 
 * 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){
  Element container=createWidgetContainer();
  DOM.insertChild(getElement(),container,beforeIndex);
  super.insert(w,container,beforeIndex,true);
  finishWidgetInitialization(container,w);
}
Program: 54879
Project: 54879
Buggy source:
public boolean addAll(int index,Collection<? extends E> c){
  Iterator<? extends E> iter=c.iterator();
  while (iter.hasNext()) {
    add(index,iter.next());
    ++index;
  }
  return !c.isEmpty();
}

Fixed version (ground truth):
public boolean addAll(int index,Collection<? extends E> c){
  Iterator<? extends E> iter=c.iterator();
  while (iter.hasNext()) {
    add(index++,iter.next());
  }
  return !c.isEmpty();
}
Program: 54880
Project: 54880
Buggy source:
@Override public boolean addAll(Collection<? extends E> c){
  Iterator<? extends E> iter=c.iterator();
  boolean changed=iter.hasNext();
  while (iter.hasNext()) {
    setImpl(array,size++,iter.next());
  }
  return changed;
}

Fixed version (ground truth):
public boolean addAll(int index,Collection<? extends E> c){
  if (c.isEmpty()) {
    return false;
  }
  if (index < 0 || index > size) {
    indexOutOfBounds(index,size);
  }
  insertImpl(array,index,c.toArray());
  size+=c.size();
  return true;
}