nus-yam/ex-repair huggingface dataset:
Program: 54433
Project: 54433
Buggy source:
/** 
 * Gets the container element associated with the given child widget. <p> The container element is created by the   {@link Layout} class. This shouldbe used with certain styles, such as  {@link Style#setZIndex(int)}, that must be applied to the container, rather than directly to the child widget. </p> TODO(jgw): Is this really the best way to do this?
 * @param widget the widget whose container element is to be retrieved
 * @return the widget's container element
 */
public Element getContainerElementFor(Widget widget){
  assertIsChild(widget);
  return ((LayoutData)widget.getLayoutData()).layer.getContainerElement();
}

Fixed version (ground truth):
/** 
 * Gets the container element associated with the given child widget. <p> The container element is created by the   {@link Layout} class. This shouldbe used with certain styles, such as {@link com.google.gwt.dom.client.Style#setZIndex(int)}, that must be applied to the container, rather than directly to the child widget. </p> TODO(jgw): Is this really the best way to do this?
 * @param widget the widget whose container element is to be retrieved
 * @return the widget's container element
 */
public Element getContainerElementFor(Widget widget){
  assertIsChild(widget);
  return ((LayoutData)widget.getLayoutData()).layer.getContainerElement();
}
Program: 54435
Project: 54435
Buggy source:
/** 
 * Interprets <ui:with> elements.
 */
private void createResource(XMLElement elem) throws UnableToCompleteException {
  String resourceName=elem.consumeRequiredAttribute("String_Node_Str");
  JClassType resourceType=consumeTypeAttribute(elem);
  if (elem.getAttributeCount() > 0) {
    writer.die("String_Node_Str");
  }
  FieldWriter fieldWriter=fieldManager.registerField(resourceType,resourceName);
  OwnerField ownerField=writer.getOwnerClass().getUiField(resourceName);
  if (ownerField != null) {
    if (!resourceType.equals(ownerField.getType().getRawType())) {
      writer.die("String_Node_Str",ownerField);
    }
    if (ownerField.isProvided()) {
      fieldWriter.setInitializer("String_Node_Str" + ownerField.getName());
      return;
    }
  }
  JMethod factoryMethod=writer.getOwnerClass().getUiFactoryMethod(resourceType);
  if (factoryMethod != null) {
    fieldWriter.setInitializer(String.format("String_Node_Str",factoryMethod.getName()));
  }
}

Fixed version (ground truth):
/** 
 * Interprets <ui:with> elements.
 */
private void createResource(XMLElement elem) throws UnableToCompleteException {
  String resourceName=elem.consumeRequiredAttribute("String_Node_Str");
  JClassType resourceType=consumeTypeAttribute(elem);
  if (elem.getAttributeCount() > 0) {
    writer.die("String_Node_Str",elem);
  }
  FieldWriter fieldWriter=fieldManager.registerField(resourceType,resourceName);
  OwnerField ownerField=writer.getOwnerClass().getUiField(resourceName);
  if (ownerField != null) {
    if (!resourceType.equals(ownerField.getType().getRawType())) {
      writer.die("String_Node_Str",elem,ownerField);
    }
    if (ownerField.isProvided()) {
      fieldWriter.setInitializer("String_Node_Str" + ownerField.getName());
      return;
    }
  }
  JMethod factoryMethod=writer.getOwnerClass().getUiFactoryMethod(resourceType);
  if (factoryMethod != null) {
    fieldWriter.setInitializer(String.format("String_Node_Str",factoryMethod.getName()));
  }
}
Program: 54436
Project: 54436
Buggy source:
/** 
 * Dependency information is normally recorded during code splitting, and it results in multiple dependency graphs. If the code splitter doesn't run, then this method can be used instead to record a single dependency graph for the whole program.
 */
private static void recordNonSplitDependencies(JProgram program,OutputStream out){
  DependencyRecorder deps=new DependencyRecorder(out);
  deps.open();
  deps.startDependencyGraph("String_Node_Str",null);
  ControlFlowAnalyzer cfa=new ControlFlowAnalyzer(program);
  cfa.setDependencyRecorder(deps);
  for (  List<JMethod> entryList : program.entryMethods) {
    for (    JMethod entry : entryList)     cfa.traverseFrom(entry);
  }
  deps.endDependencyGraph();
  deps.close();
}

Fixed version (ground truth):
/** 
 * Dependency information is normally recorded during code splitting, and it results in multiple dependency graphs. If the code splitter doesn't run, then this method can be used instead to record a single dependency graph for the whole program.
 */
private static void recordNonSplitDependencies(JProgram program,OutputStream out){
  DependencyRecorder deps=new DependencyRecorder(out);
  deps.open();
  deps.startDependencyGraph("String_Node_Str",null);
  ControlFlowAnalyzer cfa=new ControlFlowAnalyzer(program);
  cfa.setDependencyRecorder(deps);
  for (  List<JMethod> entryList : program.entryMethods) {
    for (    JMethod entry : entryList) {
      cfa.traverseFrom(entry);
    }
  }
  deps.endDependencyGraph();
  deps.close();
}
Program: 54437
Project: 54437
Buggy source:
int getPortHosted();

Fixed version (ground truth):
public int getPortHosted(){
  return portHosted;
}
Program: 54438
Project: 54438
Buggy source:
void setPortHosted(int portHosted);

Fixed version (ground truth):
public void setPortHosted(int port){
  portHosted=port;
}
Program: 54439
Project: 54439
Buggy source:
@Override public String getTagName(Element elem){
  String tagName=getTagNameInternal(elem);
  String scopeName=getScopeNameInternal(elem);
  if ("String_Node_Str".equalsIgnoreCase(scopeName) || "String_Node_Str".equalsIgnoreCase(scopeName)) {
    return tagName;
  }
  return scopeName + "String_Node_Str" + tagName;
}

Fixed version (ground truth):
@Override public String getTagName(Element elem){
  String tagName=getTagNameInternal(elem);
  String scopeName=getScopeNameInternal(elem);
  if ((scopeName == null) || "String_Node_Str".equalsIgnoreCase(scopeName)) {
    return tagName;
  }
  return scopeName + "String_Node_Str" + tagName;
}
Program: 54440
Project: 54440
Buggy source:
/** 
 * Create a method call whose type is overridden to the specified type, ignoring the return type of the target method. This constructor is used during normalizing transformations to preserve type semantics when calling externally-defined compiler implementation methods. For example, Cast.dynamicCast() returns Object but that method is used to implement the cast operation. Using a stronger type on the call expression allows us to preserve type information during the latter phases of compilation.
 */
public JMethodCall(SourceInfo info,JExpression instance,JMethod method,JType overrideReturnType){
  super(info);
  this.instance=instance;
  this.method=method;
  assert(overrideReturnType != null);
  this.overrideReturnType=overrideReturnType;
}

Fixed version (ground truth):
/** 
 * Create a method call whose type is overridden to the specified type, ignoring the return type of the target method. This constructor is used during normalizing transformations to preserve type semantics when calling externally-defined compiler implementation methods. For example, Cast.dynamicCast() returns Object but that method is used to implement the cast operation. Using a stronger type on the call expression allows us to preserve type information during the latter phases of compilation.
 */
public JMethodCall(SourceInfo info,JExpression instance,JMethod method,JType overrideReturnType){
  super(info);
  assert(method != null);
  assert(instance != null || method.isStatic());
  this.instance=instance;
  this.method=method;
  assert(overrideReturnType != null);
  this.overrideReturnType=overrideReturnType;
}
Program: 54441
Project: 54441
Buggy source:
public void testExpires(){
  Date expiresEarly=new Date(new Date().getTime() + (5 * 1000));
  Date expiresLate=new Date(new Date().getTime() + (60 * 1000));
  Cookies.setCookie("String_Node_Str","String_Node_Str",expiresEarly);
  Cookies.setCookie("String_Node_Str","String_Node_Str",expiresLate);
  Cookies.setCookie("String_Node_Str","String_Node_Str",null);
  Timer timer=new Timer(){
    public void run(){
      assertNull(Cookies.getCookie("String_Node_Str"));
      assertEquals(Cookies.getCookie("String_Node_Str"),"String_Node_Str");
      assertEquals(Cookies.getCookie("String_Node_Str"),"String_Node_Str");
      Cookies.removeCookie("String_Node_Str");
      assertNull(Cookies.getCookie("String_Node_Str"));
      finishTest();
    }
  }
;
  timer.schedule(5010);
  delayTestFinish(6 * 1000);
}

Fixed version (ground truth):
public void testExpires(){
  int uniqueId=Random.nextInt(9000000) + 1000000;
  final String earlyCookie="String_Node_Str" + uniqueId;
  final String lateCookie="String_Node_Str" + uniqueId;
  final String sessionCookie="String_Node_Str" + uniqueId;
  Date expiresEarly=new Date(new Date().getTime() + (5 * 1000));
  Date expiresLate=new Date(new Date().getTime() + (60 * 1000));
  Cookies.setCookie(earlyCookie,"String_Node_Str",expiresEarly);
  Cookies.setCookie(lateCookie,"String_Node_Str",expiresLate);
  Cookies.setCookie(sessionCookie,"String_Node_Str",null);
  Timer timer=new Timer(){
    @Override public void run(){
      assertNull(Cookies.getCookie(earlyCookie));
      assertEquals(Cookies.getCookie(lateCookie),"String_Node_Str");
      assertEquals(Cookies.getCookie(sessionCookie),"String_Node_Str");
      Cookies.removeCookie(sessionCookie);
      assertNull(Cookies.getCookie(sessionCookie));
      finishTest();
    }
  }
;
  timer.schedule(5010);
  delayTestFinish(6 * 1000);
}
Program: 54442
Project: 54442
Buggy source:
/** 
 * Clear out all existing cookies.
 */
private void clearCookies(){
  Collection<String> cookies=Cookies.getCookieNames();
  for (  String cookie : cookies) {
    Cookies.removeCookie(cookie);
  }
}

Fixed version (ground truth):
/** 
 * Clear out all existing cookies, except the ones used in  {@link #testExpires()}.
 */
private void clearCookies(){
  Collection<String> cookies=Cookies.getCookieNames();
  for (  String cookie : cookies) {
    if (!cookie.startsWith("String_Node_Str")) {
      Cookies.removeCookie(cookie);
    }
  }
}
Program: 54444
Project: 54444
Buggy source:
public void run(){
  assertNull(Cookies.getCookie("String_Node_Str"));
  assertEquals(Cookies.getCookie("String_Node_Str"),"String_Node_Str");
  assertEquals(Cookies.getCookie("String_Node_Str"),"String_Node_Str");
  Cookies.removeCookie("String_Node_Str");
  assertNull(Cookies.getCookie("String_Node_Str"));
  finishTest();
}

Fixed version (ground truth):
@Override public void run(){
  assertNull(Cookies.getCookie(earlyCookie));
  assertEquals(Cookies.getCookie(lateCookie),"String_Node_Str");
  assertEquals(Cookies.getCookie(sessionCookie),"String_Node_Str");
  Cookies.removeCookie(sessionCookie);
  assertNull(Cookies.getCookie(sessionCookie));
  finishTest();
}
Program: 54446
Project: 54446
Buggy source:
public String getModuleName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getModuleName(){
  return "String_Node_Str";
}
Program: 54447
Project: 54447
Buggy source:
private void doGetModule(HttpServletRequest request,HttpServletResponse response,TreeLogger logger,RequestParts parts) throws IOException {
  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" + Util.escapeXml(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<String,String[]> params=getParameterMap(request);
  for (  Map.Entry<String,String[]> entry : params.entrySet()) {
    String[] values=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");
  writer.println("String_Node_Str");
  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 {
  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" + Util.escapeXml(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<String,String[]> params=getParameterMap(request);
  for (  Map.Entry<String,String[]> entry : params.entrySet()) {
    String[] values=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");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
}
Program: 54448
Project: 54448
Buggy source:
public void addBugs(){
  addIssue(new Issue1245());
  addIssue(new Issue1772());
  addIssue(new Issue1897());
  addIssue(new Issue1932());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2318());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2390());
  addIssue(new Issue1169());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new Issue2553());
  addIssue(new Issue2855());
  addIssue(new Issue3172());
}

Fixed version (ground truth):
public void addBugs(){
  addIssue(new Issue1245());
  addIssue(new Issue1772());
  addIssue(new Issue1897());
  addIssue(new Issue1932());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2318());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2390());
  addIssue(new Issue1169());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new Issue2553());
  addIssue(new Issue2855());
  addIssue(new Issue3172());
  addIssue(new Issue3973());
}
Program: 54449
Project: 54449
Buggy source:
@Override protected void onDetach(){
  super.onDetach();
  if (synthesizedFrame != null) {
    impl.unhookEvents(synthesizedFrame,getElement());
    Document.get().getBody().removeChild(synthesizedFrame);
    synthesizedFrame=null;
  }
}

Fixed version (ground truth):
@Override protected void onDetach(){
  super.onDetach();
  impl.unhookEvents(synthesizedFrame,getElement());
  if (synthesizedFrame != null) {
    Document.get().getBody().removeChild(synthesizedFrame);
    synthesizedFrame=null;
  }
}
Program: 54450
Project: 54450
Buggy source:
@Override protected void onAttach(){
  super.onAttach();
  if (frameName != null) {
    createFrame();
    Document.get().getBody().appendChild(synthesizedFrame);
    impl.hookEvents(synthesizedFrame,getElement(),this);
  }
}

Fixed version (ground truth):
@Override protected void onAttach(){
  super.onAttach();
  if (frameName != null) {
    createFrame();
    Document.get().getBody().appendChild(synthesizedFrame);
  }
  impl.hookEvents(synthesizedFrame,getElement(),this);
}
Program: 54452
Project: 54452
Buggy source:
public void addBugs(){
  addIssue(new Issue1245());
  addIssue(new Issue1772());
  addIssue(new Issue1897());
  addIssue(new Issue1932());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2318());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2390());
  addIssue(new Issue1169());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new Issue2553());
  addIssue(new Issue2855());
  addIssue(new Issue3172());
  addIssue(new Issue3973());
}

Fixed version (ground truth):
public void addBugs(){
  addIssue(new Issue1245());
  addIssue(new Issue1772());
  addIssue(new Issue1897());
  addIssue(new Issue1932());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2318());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2390());
  addIssue(new Issue1169());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new Issue2553());
  addIssue(new Issue2855());
  addIssue(new Issue3172());
  addIssue(new Issue3962());
  addIssue(new Issue3973());
}
Program: 54453
Project: 54453
Buggy source:
/** 
 * IE returns a numeric type for some attributes that are really properties, such as offsetWidth.  We need to coerce these to strings to prevent a runtime JS exception.
 */
@Override public native String getAttribute(Element elem,String name);

Fixed version (ground truth):
/** 
 * IE returns a numeric type for some attributes that are really properties, such as offsetWidth. We need to coerce these to strings to prevent a runtime JS exception.
 */
@Override public native String getAttribute(Element elem,String name);
Program: 54454
Project: 54454
Buggy source:
public String getTagName(Element elem){
  String tagName=getTagNameInternal(elem);
  String scopeName=getScopeNameInternal(elem);
  if ("String_Node_Str".equalsIgnoreCase(scopeName) || "String_Node_Str".equalsIgnoreCase(scopeName)) {
    return tagName;
  }
  return scopeName + "String_Node_Str" + tagName;
}

Fixed version (ground truth):
@Override public String getTagName(Element elem){
  String tagName=getTagNameInternal(elem);
  String scopeName=getScopeNameInternal(elem);
  if ("String_Node_Str".equalsIgnoreCase(scopeName) || "String_Node_Str".equalsIgnoreCase(scopeName)) {
    return tagName;
  }
  return scopeName + "String_Node_Str" + tagName;
}
Program: 54455
Project: 54455
Buggy source:
public void execute(){
  unregisterCallbacks(CALLBACKS);
  Node script=Document.get().getElementById(callbackId);
  getDocumentElement().getFirstChild().removeChild(script);
}

Fixed version (ground truth):
public void execute(){
  unregisterCallbacks(CALLBACKS);
  Node script=Document.get().getElementById(callbackId);
  getHeadElement().removeChild(script);
}
Program: 54456
Project: 54456
Buggy source:
/** 
 * Cleans everything once the response has been received: deletes the script tag and unregisters the callback.
 */
private void unload(){
  DeferredCommand.addCommand(new Command(){
    public void execute(){
      unregisterCallbacks(CALLBACKS);
      Node script=Document.get().getElementById(callbackId);
      getDocumentElement().getFirstChild().removeChild(script);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Cleans everything once the response has been received: deletes the script tag and unregisters the callback.
 */
private void unload(){
  DeferredCommand.addCommand(new Command(){
    public void execute(){
      unregisterCallbacks(CALLBACKS);
      Node script=Document.get().getElementById(callbackId);
      getHeadElement().removeChild(script);
    }
  }
);
}
Program: 54457
Project: 54457
Buggy source:
/** 
 * Sends a request using the JSONP mechanism.
 * @param baseUri To be sent to the server.
 */
void send(final String baseUri){
  registerCallbacks(CALLBACKS);
  StringBuffer uri=new StringBuffer(baseUri);
  uri.append(baseUri.contains("String_Node_Str") ? "String_Node_Str" : "String_Node_Str");
  String prefix=CALLBACKS_NAME + "String_Node_Str" + callbackId;
  uri.append(callbackParam).append("String_Node_Str").append(prefix).append("String_Node_Str");
  if (failureCallbackParam != null) {
    uri.append("String_Node_Str");
    uri.append(failureCallbackParam).append("String_Node_Str").append(prefix).append("String_Node_Str");
  }
  ScriptElement script=Document.get().createScriptElement();
  script.setType("String_Node_Str");
  script.setId(callbackId);
  script.setSrc(uri.toString());
  getDocumentElement().getFirstChild().appendChild(script);
  timer=new Timer(){
    @Override public void run(){
      onFailure(new TimeoutException("String_Node_Str" + baseUri));
    }
  }
;
  timer.schedule(timeout);
}

Fixed version (ground truth):
/** 
 * Sends a request using the JSONP mechanism.
 * @param baseUri To be sent to the server.
 */
void send(final String baseUri){
  registerCallbacks(CALLBACKS);
  StringBuffer uri=new StringBuffer(baseUri);
  uri.append(baseUri.contains("String_Node_Str") ? "String_Node_Str" : "String_Node_Str");
  String prefix=CALLBACKS_NAME + "String_Node_Str" + callbackId;
  uri.append(callbackParam).append("String_Node_Str").append(prefix).append("String_Node_Str");
  if (failureCallbackParam != null) {
    uri.append("String_Node_Str");
    uri.append(failureCallbackParam).append("String_Node_Str").append(prefix).append("String_Node_Str");
  }
  ScriptElement script=Document.get().createScriptElement();
  script.setType("String_Node_Str");
  script.setId(callbackId);
  script.setSrc(uri.toString());
  getHeadElement().appendChild(script);
  timer=new Timer(){
    @Override public void run(){
      onFailure(new TimeoutException("String_Node_Str" + baseUri));
    }
  }
;
  timer.schedule(timeout);
}
Program: 54458
Project: 54458
Buggy source:
/** 
 * Adds a widget to the panel at the specified position. Setting a position of <code>(-1, -1)</code> will cause the child widget to be positioned statically.
 * @param w the widget to be added
 * @param left the widget's left position
 * @param top the widget's top position
 */
public void add(Widget w,int left,int top){
  w.removeFromParent();
  setWidgetPositionImpl(w,left,top);
  add(w);
}

Fixed version (ground truth):
/** 
 * Adds a widget to the panel at the specified position. Setting a position of <code>(-1, -1)</code> will cause the child widget to be positioned statically.
 * @param w the widget to be added
 * @param left the widget's left position
 * @param top the widget's top position
 */
public void add(Widget w,int left,int top){
  w.removeFromParent();
  int beforeIndex=getWidgetCount();
  setWidgetPositionImpl(w,left,top);
  insert(w,beforeIndex);
}
Program: 54459
Project: 54459
Buggy source:
/** 
 * 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);
}

Fixed version (ground truth):
@Override public void add(Widget w){
  Element container=createWidgetContainer();
  DOM.appendChild(getElement(),container);
  super.add(w,container);
  finishWidgetInitialization(container,w);
}
Program: 54460
Project: 54460
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=createWidgetContainer();
  DOM.insertChild(getElement(),container,beforeIndex);
  insert(w,container,beforeIndex,true);
  finishWidgetInitialization(container,w);
}

Fixed version (ground truth):
public void insert(Widget w,int beforeIndex){
  Element container=createWidgetContainer();
  DOM.insertChild(getElement(),container,beforeIndex);
  insert(w,container,beforeIndex,true);
  finishWidgetInitialization(container,w);
}
Program: 54461
Project: 54461
Buggy source:
/** 
 * 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
 */
@Override public void add(Widget w){
  Element td=createAlignedTd();
  DOM.appendChild(tableRow,td);
  add(w,td);
}

Fixed version (ground truth):
@Override public void add(Widget w){
  Element td=createAlignedTd();
  DOM.appendChild(tableRow,td);
  add(w,td);
}
Program: 54462
Project: 54462
Buggy source:
/** 
 * 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){
  checkIndexBoundsForInsertion(beforeIndex);
  Element td=createAlignedTd();
  DOM.insertChild(tableRow,td,beforeIndex);
  insert(w,td,beforeIndex,false);
}

Fixed version (ground truth):
public void insert(Widget w,int beforeIndex){
  checkIndexBoundsForInsertion(beforeIndex);
  Element td=createAlignedTd();
  DOM.insertChild(tableRow,td,beforeIndex);
  insert(w,td,beforeIndex,false);
}
Program: 54463
Project: 54463
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 trh=DOM.createTR();
  Element tdh=DOM.createTD();
  DOM.appendChild(trh,tdh);
  DOM.appendChild(tdh,createHeaderElem());
  Element trb=DOM.createTR();
  Element tdb=DOM.createTD();
  DOM.appendChild(trb,tdb);
  beforeIndex=adjustIndex(w,beforeIndex);
  int effectiveIndex=beforeIndex * 2;
  DOM.insertChild(body,trb,effectiveIndex);
  DOM.insertChild(body,trh,effectiveIndex);
  setStyleName(tdh,DEFAULT_ITEM_STYLENAME,true);
  DOM.setElementPropertyInt(tdh,"String_Node_Str",hashCode());
  DOM.setElementProperty(tdh,"String_Node_Str","String_Node_Str");
  setStyleName(tdb,DEFAULT_STYLENAME + "String_Node_Str",true);
  DOM.setElementProperty(tdb,"String_Node_Str","String_Node_Str");
  DOM.setElementProperty(tdb,"String_Node_Str","String_Node_Str");
  insert(w,tdb,beforeIndex,false);
  updateIndicesFrom(beforeIndex);
  if (visibleStack == -1) {
    showStack(0);
  }
 else {
    setStackVisible(beforeIndex,false);
    if (visibleStack >= beforeIndex) {
      ++visibleStack;
    }
    setStackVisible(visibleStack,true);
  }
}

Fixed version (ground truth):
public void insert(Widget w,int beforeIndex){
  Element trh=DOM.createTR();
  Element tdh=DOM.createTD();
  DOM.appendChild(trh,tdh);
  DOM.appendChild(tdh,createHeaderElem());
  Element trb=DOM.createTR();
  Element tdb=DOM.createTD();
  DOM.appendChild(trb,tdb);
  beforeIndex=adjustIndex(w,beforeIndex);
  int effectiveIndex=beforeIndex * 2;
  DOM.insertChild(body,trb,effectiveIndex);
  DOM.insertChild(body,trh,effectiveIndex);
  setStyleName(tdh,DEFAULT_ITEM_STYLENAME,true);
  DOM.setElementPropertyInt(tdh,"String_Node_Str",hashCode());
  DOM.setElementProperty(tdh,"String_Node_Str","String_Node_Str");
  setStyleName(tdb,DEFAULT_STYLENAME + "String_Node_Str",true);
  DOM.setElementProperty(tdb,"String_Node_Str","String_Node_Str");
  DOM.setElementProperty(tdb,"String_Node_Str","String_Node_Str");
  insert(w,tdb,beforeIndex,false);
  updateIndicesFrom(beforeIndex);
  if (visibleStack == -1) {
    showStack(0);
  }
 else {
    setStackVisible(beforeIndex,false);
    if (visibleStack >= beforeIndex) {
      ++visibleStack;
    }
    setStackVisible(visibleStack,true);
  }
}
Program: 54464
Project: 54464
Buggy source:
/** 
 * 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
 */
@Override public void add(Widget w){
  Element tr=DOM.createTR();
  Element td=createAlignedTd();
  DOM.appendChild(tr,td);
  DOM.appendChild(getBody(),tr);
  add(w,td);
}

Fixed version (ground truth):
@Override public void add(Widget w){
  Element tr=DOM.createTR();
  Element td=createAlignedTd();
  DOM.appendChild(tr,td);
  DOM.appendChild(getBody(),tr);
  add(w,td);
}
Program: 54465
Project: 54465
Buggy source:
/** 
 * 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){
  checkIndexBoundsForInsertion(beforeIndex);
  Element tr=DOM.createTR();
  Element td=createAlignedTd();
  DOM.appendChild(tr,td);
  DOM.insertChild(getBody(),tr,beforeIndex);
  insert(w,td,beforeIndex,false);
}

Fixed version (ground truth):
public void insert(Widget w,int beforeIndex){
  checkIndexBoundsForInsertion(beforeIndex);
  Element tr=DOM.createTR();
  Element td=createAlignedTd();
  DOM.appendChild(tr,td);
  DOM.insertChild(getBody(),tr,beforeIndex);
  insert(w,td,beforeIndex,false);
}
Program: 54466
Project: 54466
Buggy source:
public boolean hasInstantiableSubtypes(){
  return isInstantiable() || instantiableSubtypes;
}

Fixed version (ground truth):
public boolean hasInstantiableSubtypes(){
  return isInstantiable() || instantiableSubtypes || isPendingInstantiable();
}
Program: 54467
Project: 54467
Buggy source:
/** 
 * Remove serializable types that were visited due to speculative paths but are not really needed for serialization. NOTE: This is currently much more limited than it should be. For example, a path sensitive prune could remove instantiable types also.
 */
private void pruneUnreachableTypes(){
  Set<JType> supersOfInstantiableTypes=new LinkedHashSet<JType>();
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (tic.isInstantiable()) {
      JClassType type=tic.getType().getErasedType();
      JClassType sup=type;
      while (sup != null) {
        supersOfInstantiableTypes.add(sup.getErasedType());
        sup=sup.getErasedType().getSuperclass();
      }
    }
  }
  Set<JType> toKill=new LinkedHashSet<JType>();
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (tic.isFieldSerializable() && !supersOfInstantiableTypes.contains(tic.getType().getErasedType())) {
      toKill.add(tic.getType());
    }
  }
  for (  JType type : toKill) {
    typeToTypeInfoComputed.remove(type);
  }
}

Fixed version (ground truth):
/** 
 * Remove serializable types that were visited due to speculative paths but are not really needed for serialization. NOTE: This is currently much more limited than it should be. For example, a path sensitive prune could remove instantiable types also.
 */
private void pruneUnreachableTypes(){
  Set<JType> supersOfInstantiableTypes=new LinkedHashSet<JType>();
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (tic.isInstantiable() && tic.getType() instanceof JClassType) {
      JClassType type=(JClassType)tic.getType().getErasedType();
      JClassType sup=type;
      while (sup != null) {
        supersOfInstantiableTypes.add(sup.getErasedType());
        sup=sup.getErasedType().getSuperclass();
      }
    }
  }
  Set<JType> toKill=new LinkedHashSet<JType>();
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (tic.isFieldSerializable() && !supersOfInstantiableTypes.contains(tic.getType().getErasedType())) {
      toKill.add(tic.getType());
    }
  }
  for (  JType type : toKill) {
    typeToTypeInfoComputed.remove(type);
  }
}
Program: 54468
Project: 54468
Buggy source:
/** 
 * Consider any subtype of java.lang.Object which qualifies for serialization.
 * @param logger
 */
private void checkAllSubtypesOfObject(TreeLogger logger,TypePath parent,ProblemReport problems){
  if (alreadyCheckedObject) {
    return;
  }
  alreadyCheckedObject=true;
  TreeLogger localLogger=logger.branch(TreeLogger.WARN,"String_Node_Str",null);
  JClassType[] allTypes=typeOracle.getJavaLangObject().getSubtypes();
  for (  JClassType cls : allTypes) {
    if (isDeclaredSerializable(cls)) {
      checkTypeInstantiable(localLogger,cls,TypePaths.createSubtypePath(parent,cls,typeOracle.getJavaLangObject()),problems);
    }
  }
}

Fixed version (ground truth):
/** 
 * Consider any subtype of java.lang.Object which qualifies for serialization.
 * @param logger
 */
private void checkAllSubtypesOfObject(TreeLogger logger,TypePath parent,ProblemReport problems){
  if (alreadyCheckedObject) {
    return;
  }
  alreadyCheckedObject=true;
  TreeLogger localLogger=logger.branch(TreeLogger.WARN,"String_Node_Str",null);
  JClassType[] allTypes=typeOracle.getJavaLangObject().getSubtypes();
  for (  JClassType cls : allTypes) {
    if (isDeclaredSerializable(cls)) {
      computeTypeInstantiability(localLogger,cls,TypePaths.createSubtypePath(parent,cls,typeOracle.getJavaLangObject()),problems);
    }
  }
}
Program: 54470
Project: 54470
Buggy source:
public TypeInfoComputed(JClassType type,TypePath path){
  this.type=type;
  this.path=path;
  autoSerializable=SerializableTypeOracleBuilder.isAutoSerializable(type);
  manualSerializer=findCustomFieldSerializer(typeOracle,type);
  directlyImplementsMarker=directlyImplementsMarkerInterface(type);
  maybeEnhanced=hasJdoAnnotation(type) || hasJpaAnnotation(type);
}

Fixed version (ground truth):
public TypeInfoComputed(JType type,TypePath path){
  this.type=type;
  this.path=path;
  if (type instanceof JClassType) {
    JClassType typeClass=(JClassType)type;
    autoSerializable=SerializableTypeOracleBuilder.isAutoSerializable(typeClass);
    manualSerializer=findCustomFieldSerializer(typeOracle,typeClass);
    directlyImplementsMarker=directlyImplementsMarkerInterface(typeClass);
    maybeEnhanced=hasJdoAnnotation(typeClass) || hasJpaAnnotation(typeClass);
  }
 else {
    autoSerializable=false;
    manualSerializer=null;
    directlyImplementsMarker=false;
    maybeEnhanced=false;
  }
}
Program: 54472
Project: 54472
Buggy source:
public JClassType getType(){
  return type;
}

Fixed version (ground truth):
public JType getType(){
  return type;
}
Program: 54473
Project: 54473
Buggy source:
private boolean checkArrayInstantiable(TreeLogger logger,JArrayType array,TypePath path,ProblemReport problems){
}

Fixed version (ground truth):
private TypeInfoComputed checkArrayInstantiable(TreeLogger logger,JArrayType array,TypePath path,ProblemReport problems){
}
Program: 54474
Project: 54474
Buggy source:
private TypeInfoComputed getTypeInfoComputed(JClassType type,TypePath path,boolean createIfNeeded){
  TypeInfoComputed tic=typeToTypeInfoComputed.get(type);
  if (tic == null && createIfNeeded) {
    tic=new TypeInfoComputed(type,path);
    typeToTypeInfoComputed.put(type,tic);
  }
  return tic;
}

Fixed version (ground truth):
private TypeInfoComputed getTypeInfoComputed(JType type,TypePath path,boolean createIfNeeded){
  TypeInfoComputed tic=typeToTypeInfoComputed.get(type);
  if (tic == null && createIfNeeded) {
    tic=new TypeInfoComputed(type,path);
    typeToTypeInfoComputed.put(type,tic);
  }
  return tic;
}
Program: 54476
Project: 54476
Buggy source:
public DependencyRecorder(OutputStream out) throws IOException {
  try {
    this.writer=new OutputStreamWriter(new GZIPOutputStream(out),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    throw new InternalCompilerException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public DependencyRecorder(OutputStream out){
  this.finalOutput=out;
}
Program: 54477
Project: 54477
Buggy source:
public void open(){
  printPre();
}

Fixed version (ground truth):
public void open(){
  try {
    this.writer=new OutputStreamWriter(new GZIPOutputStream(finalOutput),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    throw new InternalCompilerException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new NestedIOException(e);
  }
  printPre();
}
Program: 54479
Project: 54479
Buggy source:
public WebModePayloadSink(ClientOracle clientOracle,OutputStream out){
  this.clientOracle=clientOracle;
  this.out=out;
  backRefIdent=clientOracle.createUnusedIdent("String_Node_Str");
}

Fixed version (ground truth):
public WebModePayloadSink(ClientOracle clientOracle,OutputStream out){
  this.clientOracle=clientOracle;
  this.out=out;
}
Program: 54480
Project: 54480
Buggy source:
byte[] makeBackRef(ValueCommand x){
  byte[] toReturn=valueBackRefs.get(x);
  if (toReturn == null) {
    if (freeBackRefs.isEmpty()) {
      int idx=valueBackRefs.size();
      toReturn=getBytes(backRefIdent + "String_Node_Str" + Integer.toString(idx,Character.MAX_RADIX));
    }
 else {
      toReturn=freeBackRefs.pop();
    }
    valueBackRefs.put(x,toReturn);
  }
  return toReturn;
}

Fixed version (ground truth):
byte[] makeBackRef(ValueCommand x){
  byte[] toReturn=valueBackRefs.get(x);
  if (toReturn == null) {
    if (freeBackRefs.isEmpty()) {
      int idx=valueBackRefs.size();
      toReturn=getBytes(BACKREF_IDENT + "String_Node_Str" + Integer.toString(idx,Character.MAX_RADIX));
    }
 else {
      toReturn=freeBackRefs.pop();
    }
    valueBackRefs.put(x,toReturn);
  }
  return toReturn;
}
Program: 54481
Project: 54481
Buggy source:
/** 
 * Run the specified callback once the necessary code for it has been loaded.
 */
public static void runAsync(RunAsyncCallback callback){
  UncaughtExceptionHandler handler=sUncaughtExceptionHandler;
  if (handler == null) {
    callback.onSuccess();
  }
 else {
    try {
      callback.onSuccess();
    }
 catch (    Throwable e) {
      handler.onUncaughtException(e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Run the specified callback once the necessary code for it has been loaded.
 */
public static void runAsync(RunAsyncCallback callback){
  if (isScript()) {
    AsyncFragmentLoader.BROWSER_LOADER.logEventProgress("String_Node_Str","String_Node_Str");
    AsyncFragmentLoader.BROWSER_LOADER.logEventProgress("String_Node_Str","String_Node_Str");
  }
  UncaughtExceptionHandler handler=sUncaughtExceptionHandler;
  if (handler == null) {
    callback.onSuccess();
  }
 else {
    try {
      callback.onSuccess();
    }
 catch (    Throwable e) {
      handler.onUncaughtException(e);
    }
  }
}
Program: 54482
Project: 54482
Buggy source:
private static String downloadGroup(int splitPoint){
  return "String_Node_Str" + splitPoint;
}

Fixed version (ground truth):
private String downloadGroup(int fragment){
  return (fragment == leftoversFragment()) ? LwmLabels.LEFTOVERS_DOWNLOAD : LwmLabels.downloadGroupForExclusive(fragment);
}
Program: 54483
Project: 54483
Buggy source:
private void logFragmentLoaded(int fragment){
  String logGroup=(fragment == leftoversFragment()) ? LwmLabels.LEFTOVERS_DOWNLOAD : LwmLabels.downloadGroup(fragment);
  logEventProgress(logGroup,LwmLabels.END,fragment,null);
}

Fixed version (ground truth):
private void logFragmentLoaded(int fragment){
  String logGroup=downloadGroup(fragment);
  logEventProgress(logGroup,LwmLabels.END,fragment,null);
}
Program: 54484
Project: 54484
Buggy source:
/** 
 * Start downloading the next fragment in the initial sequence, if there are any left.
 */
private void startLoadingNextInitial(){
  if (remainingInitialFragments == null) {
    remainingInitialFragments=new BoundedIntQueue(initialLoadSequence.length + 1);
    for (    int sp : initialLoadSequence) {
      remainingInitialFragments.add(sp);
    }
    remainingInitialFragments.add(leftoversFragment());
  }
  if (initialFragmentErrorHandlers.isEmpty() && waitingForInitialFragmentsErrorHandlers.isEmpty() && remainingInitialFragments.size() > 1) {
    initialFragmentsLoading=false;
    return;
  }
  if (remainingInitialFragments.size() > 0) {
    initialFragmentsLoading=true;
    int nextSplitPoint=remainingInitialFragments.peek();
    logEventProgress(LwmLabels.downloadGroup(nextSplitPoint),LwmLabels.BEGIN,nextSplitPoint,null);
    startLoadingFragment(nextSplitPoint,new InitialFragmentDownloadFailed());
    return;
  }
  initialFragmentsLoading=false;
  assert(haveInitialFragmentsLoaded());
  assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
  while (waitingForInitialFragments.size() > 0) {
    startLoadingFragment(waitingForInitialFragments.remove(),waitingForInitialFragmentsErrorHandlers.remove());
  }
}

Fixed version (ground truth):
/** 
 * Start downloading the next fragment in the initial sequence, if there are any left.
 */
private void startLoadingNextInitial(){
  if (remainingInitialFragments == null) {
    remainingInitialFragments=new BoundedIntQueue(initialLoadSequence.length + 1);
    for (    int sp : initialLoadSequence) {
      remainingInitialFragments.add(sp);
    }
    remainingInitialFragments.add(leftoversFragment());
  }
  if (initialFragmentErrorHandlers.isEmpty() && waitingForInitialFragmentsErrorHandlers.isEmpty() && remainingInitialFragments.size() > 1) {
    initialFragmentsLoading=false;
    return;
  }
  if (remainingInitialFragments.size() > 0) {
    initialFragmentsLoading=true;
    int nextSplitPoint=remainingInitialFragments.peek();
    logDownloadStart(nextSplitPoint);
    startLoadingFragment(nextSplitPoint,new InitialFragmentDownloadFailed());
    return;
  }
  initialFragmentsLoading=false;
  assert(haveInitialFragmentsLoaded());
  assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
  while (waitingForInitialFragments.size() > 0) {
    int nextSplitPoint=waitingForInitialFragments.remove();
    LoadErrorHandler handler=waitingForInitialFragmentsErrorHandlers.remove();
    logDownloadStart(nextSplitPoint);
    startLoadingFragment(nextSplitPoint,handler);
  }
}
Program: 54485
Project: 54485
Buggy source:
/** 
 * Loads the specified split point.
 * @param splitPoint the split point whose code needs to be loaded
 */
public void inject(int splitPoint,LoadErrorHandler loadErrorHandler){
  if (haveInitialFragmentsLoaded()) {
    logEventProgress(LwmLabels.downloadGroup(splitPoint),LwmLabels.BEGIN,splitPoint,null);
    startLoadingFragment(splitPoint,loadErrorHandler);
    return;
  }
  if (isInitial(splitPoint)) {
    initialFragmentErrorHandlers.put(splitPoint,loadErrorHandler);
  }
 else {
    assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
    waitingForInitialFragments.add(splitPoint);
    waitingForInitialFragmentsErrorHandlers.add(loadErrorHandler);
  }
  if (!initialFragmentsLoading) {
    startLoadingNextInitial();
  }
}

Fixed version (ground truth):
/** 
 * Loads the specified split point.
 * @param splitPoint the split point whose code needs to be loaded
 */
public void inject(int splitPoint,LoadErrorHandler loadErrorHandler){
  if (haveInitialFragmentsLoaded()) {
    logDownloadStart(splitPoint);
    startLoadingFragment(splitPoint,loadErrorHandler);
    return;
  }
  if (isInitial(splitPoint)) {
    initialFragmentErrorHandlers.put(splitPoint,loadErrorHandler);
  }
 else {
    assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
    waitingForInitialFragments.add(splitPoint);
    waitingForInitialFragmentsErrorHandlers.add(loadErrorHandler);
  }
  if (!initialFragmentsLoading) {
    startLoadingNextInitial();
  }
}
Program: 54486
Project: 54486
Buggy source:
private JsExpression mapUnaryVariant(Node unOp) throws JsParserException {
switch (unOp.getIntDatum()) {
case TokenStream.SUB:
    return mapPrefixOperation(JsUnaryOperator.NEG,unOp);
case TokenStream.NOT:
  return mapPrefixOperation(JsUnaryOperator.NOT,unOp);
case TokenStream.BITNOT:
return mapPrefixOperation(JsUnaryOperator.BIT_NOT,unOp);
case TokenStream.TYPEOF:
return mapPrefixOperation(JsUnaryOperator.TYPEOF,unOp);
case TokenStream.ADD:
return mapExpression(unOp.getFirstChild());
case TokenStream.VOID:
return mapPrefixOperation(JsUnaryOperator.VOID,unOp);
default :
throw new JsParserException("String_Node_Str" + unOp.getIntDatum());
}
}

Fixed version (ground truth):
private JsExpression mapUnaryVariant(Node unOp) throws JsParserException {
switch (unOp.getIntDatum()) {
case TokenStream.SUB:
    return mapPrefixOperation(JsUnaryOperator.NEG,unOp);
case TokenStream.NOT:
  return mapPrefixOperation(JsUnaryOperator.NOT,unOp);
case TokenStream.BITNOT:
return mapPrefixOperation(JsUnaryOperator.BIT_NOT,unOp);
case TokenStream.TYPEOF:
return mapPrefixOperation(JsUnaryOperator.TYPEOF,unOp);
case TokenStream.ADD:
if (unOp.getFirstChild().getType() != TokenStream.NUMBER) {
return mapPrefixOperation(JsUnaryOperator.POS,unOp);
}
 else {
return mapExpression(unOp.getFirstChild());
}
case TokenStream.VOID:
return mapPrefixOperation(JsUnaryOperator.VOID,unOp);
default :
throw new JsParserException("String_Node_Str" + unOp.getIntDatum());
}
}
Program: 54487
Project: 54487
Buggy source:
private void doTest(String js) throws Exception {
  List<JsStatement> expected=JsParser.parse(SourceOrigin.UNKNOWN,new JsProgram().getScope(),new StringReader(js));
  List<JsStatement> actual=parse(expected,true);
  ComparingVisitor.exec(expected,actual);
  actual=parse(expected,false);
  ComparingVisitor.exec(expected,actual);
}

Fixed version (ground truth):
private void doTest(String js,String expectedJs) throws Exception {
  List<JsStatement> actual=JsParser.parse(SourceOrigin.UNKNOWN,new JsProgram().getScope(),new StringReader(js));
  List<JsStatement> expected=JsParser.parse(SourceOrigin.UNKNOWN,new JsProgram().getScope(),new StringReader(expectedJs));
  ComparingVisitor.exec(expected,actual);
}
Program: 54488
Project: 54488
Buggy source:
public void testUnaryOperations() throws Exception {
  doTest("String_Node_Str");
}

Fixed version (ground truth):
public void testUnaryOperations() throws Exception {
  doTest("String_Node_Str");
  doTest("String_Node_Str","String_Node_Str");
  doTest("String_Node_Str","String_Node_Str");
}
Program: 54489
Project: 54489
Buggy source:
private JsExpression mapUnaryVariant(Node unOp) throws JsParserException {
switch (unOp.getIntDatum()) {
case TokenStream.SUB:
    return mapPrefixOperation(JsUnaryOperator.NEG,unOp);
case TokenStream.NOT:
  return mapPrefixOperation(JsUnaryOperator.NOT,unOp);
case TokenStream.BITNOT:
return mapPrefixOperation(JsUnaryOperator.BIT_NOT,unOp);
case TokenStream.TYPEOF:
return mapPrefixOperation(JsUnaryOperator.TYPEOF,unOp);
case TokenStream.ADD:
return mapExpression(unOp.getFirstChild());
case TokenStream.VOID:
return mapPrefixOperation(JsUnaryOperator.VOID,unOp);
default :
throw new JsParserException("String_Node_Str" + unOp.getIntDatum());
}
}

Fixed version (ground truth):
private JsExpression mapUnaryVariant(Node unOp) throws JsParserException {
switch (unOp.getIntDatum()) {
case TokenStream.SUB:
    return mapPrefixOperation(JsUnaryOperator.NEG,unOp);
case TokenStream.NOT:
  return mapPrefixOperation(JsUnaryOperator.NOT,unOp);
case TokenStream.BITNOT:
return mapPrefixOperation(JsUnaryOperator.BIT_NOT,unOp);
case TokenStream.TYPEOF:
return mapPrefixOperation(JsUnaryOperator.TYPEOF,unOp);
case TokenStream.ADD:
if (unOp.getFirstChild().getType() != TokenStream.NUMBER) {
return mapPrefixOperation(JsUnaryOperator.POS,unOp);
}
 else {
return mapExpression(unOp.getFirstChild());
}
case TokenStream.VOID:
return mapPrefixOperation(JsUnaryOperator.VOID,unOp);
default :
throw new JsParserException("String_Node_Str" + unOp.getIntDatum());
}
}