nus-yam/ex-repair huggingface dataset:
Program: 82987
Project: 82987
Buggy source:
protected final CompilationUnitDeclaration[] compile(TreeLogger logger,ICompilationUnit[] units){
  threadLogger.set(logger);
  Set<CompilationUnitDeclaration> cuds=new HashSet<CompilationUnitDeclaration>();
  compiler.compile(units,cuds);
  int size=cuds.size();
  CompilationUnitDeclaration[] cudArray=new CompilationUnitDeclaration[size];
  return cuds.toArray(cudArray);
}

Fixed version (ground truth):
protected final CompilationUnitDeclaration[] compile(TreeLogger logger,ICompilationUnit[] units){
  TreeLogger oldLogger=threadLogger.push(logger);
  try {
    Set<CompilationUnitDeclaration> cuds=new HashSet<CompilationUnitDeclaration>();
    compiler.compile(units,cuds);
    int size=cuds.size();
    CompilationUnitDeclaration[] cudArray=new CompilationUnitDeclaration[size];
    return cuds.toArray(cudArray);
  }
  finally {
    threadLogger.pop(oldLogger);
  }
}
Program: 82988
Project: 82988
Buggy source:
/** 
 * Get the bytecode for the specified type.
 * @param binaryTypeName the binary type name to look up or compile
 */
public byte[] getClassBytes(TreeLogger logger,String binaryTypeName) throws UnableToCompleteException {
  String msg="String_Node_Str" + binaryTypeName + "String_Node_Str";
  logger=logger.branch(TreeLogger.SPAM,msg,null);
  setLogger(logger);
  ByteCode byteCode=doGetByteCodeFromCache(logger,binaryTypeName);
  if (byteCode != null) {
    return byteCode.getBytes();
  }
  ICompilationUnit start=getCompilationUnitForType(logger,binaryTypeName);
  compile(logger,new ICompilationUnit[]{start});
  byteCode=doGetByteCodeFromCache(logger,binaryTypeName);
  if (byteCode != null) {
    return byteCode.getBytes();
  }
 else {
    throw new UnableToCompleteException();
  }
}

Fixed version (ground truth):
/** 
 * Get the bytecode for the specified type.
 * @param binaryTypeName the binary type name to look up or compile
 */
public byte[] getClassBytes(TreeLogger logger,String binaryTypeName) throws UnableToCompleteException {
  String msg="String_Node_Str" + binaryTypeName + "String_Node_Str";
  logger=logger.branch(TreeLogger.SPAM,msg,null);
  TreeLogger oldLogger=threadLogger.push(logger);
  try {
    ByteCode byteCode=doGetByteCodeFromCache(logger,binaryTypeName);
    if (byteCode != null) {
      return byteCode.getBytes();
    }
    ICompilationUnit start=getCompilationUnitForType(logger,binaryTypeName);
    compile(logger,new ICompilationUnit[]{start});
    byteCode=doGetByteCodeFromCache(logger,binaryTypeName);
    if (byteCode != null) {
      return byteCode.getBytes();
    }
 else {
      throw new UnableToCompleteException();
    }
  }
  finally {
    threadLogger.pop(oldLogger);
  }
}
Program: 82990
Project: 82990
Buggy source:
public ThreadLocalTreeLoggerProxy(TreeLogger logger){
  set(logger);
}

Fixed version (ground truth):
public ThreadLocalTreeLoggerProxy(TreeLogger logger){
  push(logger);
}
Program: 82991
Project: 82991
Buggy source:
/** 
 * Sets the height of the panel's child widget. If the panel's child widget has not been set, the height passed in will be cached and used to set the height immediately after the child widget is set.
 * @param height the object's new height, in CSS units (e.g. "10px", "1em")
 */
@Override public void setHeight(String height){
  desiredHeight=height;
  maybeUpdateSize();
  if (height.length() == 0) {
    desiredHeight=null;
  }
}

Fixed version (ground truth):
/** 
 * Sets the height of the panel's child widget. If the panel's child widget has not been set, the height passed in will be cached and used to set the height immediately after the child widget is set. <p> Note that subclasses may have a different behavior. A subclass may decide not to change the height of the child widget. It may instead decide to change the height of an internal panel widget, which contains the child widget. </p>
 * @param height the object's new height, in CSS units (e.g. "10px", "1em")
 */
@Override public void setHeight(String height){
  desiredHeight=height;
  maybeUpdateSize();
  if (height.length() == 0) {
    desiredHeight=null;
  }
}
Program: 82992
Project: 82992
Buggy source:
/** 
 * Sets the width of the panel's child widget. If the panel's child widget has not been set, the width passed in will be cached and used to set the width immediately after the child widget is set.
 * @param width the object's new width, in CSS units (e.g. "10px", "1em")
 */
@Override public void setWidth(String width){
  desiredWidth=width;
  maybeUpdateSize();
  if (width.length() == 0) {
    desiredWidth=null;
  }
}

Fixed version (ground truth):
/** 
 * Sets the width of the panel's child widget. If the panel's child widget has not been set, the width passed in will be cached and used to set the width immediately after the child widget is set. <p> Note that subclasses may have a different behavior. A subclass may decide not to change the width of the child widget. It may instead decide to change the width of an internal panel widget, which contains the child widget. </p>
 * @param width the object's new width, in CSS units (e.g. "10px", "1em")
 */
@Override public void setWidth(String width){
  desiredWidth=width;
  maybeUpdateSize();
  if (width.length() == 0) {
    desiredWidth=null;
  }
}
Program: 82993
Project: 82993
Buggy source:
/** 
 * We control size by setting our child widget's size. However, if we don't currently have a child, we record the size the user wanted so that when we do get a child, we can set it correctly. Until size is explicitly cleared, any child put into the popup will be given that size.
 */
private void maybeUpdateSize(){
  Widget w=getWidget();
  if (w != null) {
    if (desiredHeight != null) {
      w.setHeight(desiredHeight);
    }
    if (desiredWidth != null) {
      w.setWidth(desiredWidth);
    }
  }
}

Fixed version (ground truth):
/** 
 * We control size by setting our child widget's size. However, if we don't currently have a child, we record the size the user wanted so that when we do get a child, we can set it correctly. Until size is explicitly cleared, any child put into the popup will be given that size.
 */
private void maybeUpdateSize(){
  Widget w=super.getWidget();
  if (w != null) {
    if (desiredHeight != null) {
      w.setHeight(desiredHeight);
    }
    if (desiredWidth != null) {
      w.setWidth(desiredWidth);
    }
  }
}
Program: 82994
Project: 82994
Buggy source:
/** 
 * Wraps a JSO-typed argument if the target type is a different type.
 */
private JExpression checkAndReplaceJso(JExpression arg,JType targetType){
  JType argType=arg.getType();
  if (argType == targetType) {
    return arg;
  }
  if (!(targetType instanceof JReferenceType)) {
    return arg;
  }
  if (!program.isJavaScriptObject(argType)) {
    return arg;
  }
  JCastOperation cast=new JCastOperation(program,arg.getSourceInfo(),argType,arg);
  return cast;
}

Fixed version (ground truth):
/** 
 * Wraps a JSO-typed argument if the target type is a different type.
 */
private JExpression checkAndReplaceJso(JExpression arg,JType targetType,boolean nowrapJso){
  JType argType=arg.getType();
  if (argType == targetType) {
    return arg;
  }
  if (!(targetType instanceof JReferenceType)) {
    return arg;
  }
  if (!program.isJavaScriptObject(argType)) {
    return arg;
  }
  if (nowrapJso && program.isJavaScriptObject(targetType)) {
    return arg;
  }
  JCastOperation cast=new JCastOperation(program,arg.getSourceInfo(),argType,arg);
  return cast;
}
Program: 82995
Project: 82995
Buggy source:
private String getHtmlPrefix(){
  DefaultTextOutput out=new DefaultTextOutput(obfuscate);
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newline();
  return out.toString();
}

Fixed version (ground truth):
private String getHtmlPrefix(){
  DefaultTextOutput out=new DefaultTextOutput(obfuscate);
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str" + About.GWT_VERSION_NUM + "String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newline();
  return out.toString();
}
Program: 82996
Project: 82996
Buggy source:
private String getJsPrefix(){
  DefaultTextOutput out=new DefaultTextOutput(obfuscate);
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  return out.toString();
}

Fixed version (ground truth):
private String getJsPrefix(){
  DefaultTextOutput out=new DefaultTextOutput(obfuscate);
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str" + About.GWT_VERSION_NUM + "String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  out.print("String_Node_Str");
  out.newlineOpt();
  return out.toString();
}
Program: 82997
Project: 82997
Buggy source:
private void ctorAddKnownGlobalSymbols(){
  String[] commonBuiltins=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < commonBuiltins.length; i++) {
    String ident=commonBuiltins[i];
    this.doCreateName(ident,ident);
  }
}

Fixed version (ground truth):
private void ctorAddKnownGlobalSymbols(){
  String[] commonBuiltins=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < commonBuiltins.length; i++) {
    String ident=commonBuiltins[i];
    this.doCreateName(ident,ident);
  }
}
Program: 82998
Project: 82998
Buggy source:
public static void doPost(String url,String postData){
  RequestBuilder builder=new RequestBuilder(RequestBuilder.POST,url);
  try {
    Request response=builder.sendRequest(postData,new RequestCallback(){
      public void onError(      Request request,      Throwable exception){
      }
      public void onResponseReceived(      Request request,      Response response){
      }
    }
);
  }
 catch (  RequestException e) {
    Window.alert("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
public static void doPost(String url,String postData){
  RequestBuilder builder=new RequestBuilder(RequestBuilder.POST,url);
  try {
    builder.setHeader("String_Node_Str","String_Node_Str");
    Request response=builder.sendRequest(postData,new RequestCallback(){
      public void onError(      Request request,      Throwable exception){
      }
      public void onResponseReceived(      Request request,      Response response){
      }
    }
);
  }
 catch (  RequestException e) {
    Window.alert("String_Node_Str" + e.getMessage());
  }
}
Program: 82999
Project: 82999
Buggy source:
/** 
 * Gets the height of the browser window's client area excluding the scroll bar.
 * @return the window's client height
 */
public native int windowGetClientHeight();

Fixed version (ground truth):
/** 
 * Gets the height of the browser window's client area excluding the scroll bar.
 * @return the window's client height
 */
public abstract int windowGetClientHeight();
Program: 83000
Project: 83000
Buggy source:
/** 
 * Gets the width of the browser window's client area excluding the vertical scroll bar.
 * @return the window's client width
 */
public native int windowGetClientWidth();

Fixed version (ground truth):
/** 
 * Gets the width of the browser window's client area excluding the vertical scroll bar.
 * @return the window's client width
 */
public abstract int windowGetClientWidth();
Program: 83001
Project: 83001
Buggy source:
public void testPartialParsing(){
  DateTimeFormat fmt=DateTimeFormat.getFormat("String_Node_Str");
  Date dateOnly=fmt.parse("String_Node_Str");
  assertEquals(dateOnly.getHours(),0);
  assertEquals(dateOnly.getMinutes(),0);
  assertEquals(dateOnly.getSeconds(),0);
  fmt=DateTimeFormat.getFormat("String_Node_Str");
  dateOnly=fmt.parse("String_Node_Str");
  assertEquals(dateOnly.getHours(),16);
  assertEquals(dateOnly.getMinutes(),0);
  assertEquals(dateOnly.getSeconds(),0);
}

Fixed version (ground truth):
public void testPartialParsing(){
  DateTimeFormat fmt=DateTimeFormat.getFormat("String_Node_Str");
  Date dateActual=new Date(87,10,22);
  Date dateOnly=fmt.parse("String_Node_Str");
  assertEquals(dateOnly.getHours(),0);
  assertEquals(dateOnly.getMinutes(),0);
  assertEquals(dateOnly.getSeconds(),0);
  assertEquals(dateOnly.getTime(),dateActual.getTime());
  fmt=DateTimeFormat.getFormat("String_Node_Str");
  dateOnly=fmt.parse("String_Node_Str");
  assertEquals(dateOnly.getHours(),16);
  assertEquals(dateOnly.getMinutes(),0);
  assertEquals(dateOnly.getSeconds(),0);
}
Program: 83002
Project: 83002
Buggy source:
public void characters(char[] ch,int start,int length) throws SAXException {
  int lineNumber=locator.getLineNumber();
  Schema schemaLevel=getTopSchemaLevel();
  Class slc=schemaLevel.getClass();
  HandlerClassInfo classInfo=HandlerClassInfo.getClassInfo(slc);
  assert(classInfo != null);
  HandlerMethod method=classInfo.getTextMethod();
  if (method == null) {
    return;
  }
  try {
    final String text=String.valueOf(ch,start,length);
    method.invokeText(lineNumber,text,schemaLevel);
  }
 catch (  UnableToCompleteException e) {
    throw new SAXException(e);
  }
}

Fixed version (ground truth):
public void characters(char[] ch,int start,int length) throws SAXException {
  int lineNumber=locator.getLineNumber();
  Schema schemaLevel=getTopSchemaLevel();
  if (schemaLevel == null) {
    for (int i=0; i < length; i++) {
      if (!Character.isWhitespace(ch[i + start])) {
        throw new SAXException("String_Node_Str" + String.valueOf(ch,start,length));
      }
    }
    return;
  }
  Class slc=schemaLevel.getClass();
  HandlerClassInfo classInfo=HandlerClassInfo.getClassInfo(slc);
  assert(classInfo != null);
  HandlerMethod method=classInfo.getTextMethod();
  if (method == null) {
    return;
  }
  try {
    final String text=String.valueOf(ch,start,length);
    method.invokeText(lineNumber,text,schemaLevel);
  }
 catch (  UnableToCompleteException e) {
    throw new SAXException(e);
  }
}
Program: 83003
Project: 83003
Buggy source:
/** 
 * This method is supposed to return the simple class name for this compilation unit. Examples of simple class names would be "String", or "ArrayList". JDT allows this method to return null in the cases where this compilation unit is not a package-info class.
 */
public char[] getMainTypeName(){
  String mainTypeName=cup.getLocation();
  int ext=mainTypeName.lastIndexOf("String_Node_Str");
  if (ext == -1) {
    return null;
  }
  mainTypeName=mainTypeName.substring(0,ext);
  int nameStart=mainTypeName.lastIndexOf(File.separatorChar);
  if (nameStart == -1) {
    nameStart=mainTypeName.lastIndexOf('/');
  }
  mainTypeName=mainTypeName.substring(nameStart + 1);
  return mainTypeName.toCharArray();
}

Fixed version (ground truth):
/** 
 * This method is supposed to return the simple class name for this compilation unit. Examples of simple class names would be "String", or "ArrayList". JDT allows this method to return null in the cases where this compilation unit is not a package-info class.
 */
public char[] getMainTypeName(){
  String typeName=cup.getMainTypeName();
  if (typeName != null) {
    return typeName.toCharArray();
  }
  return null;
}
Program: 83004
Project: 83004
Buggy source:
public String toString(){
  return location;
}

Fixed version (ground truth):
@Override public String toString(){
  return location;
}
Program: 83005
Project: 83005
Buggy source:
public URLCompilationUnitProvider(URL url,String packageName){
  assert(url != null);
  assert(packageName != null);
  this.url=url;
  this.file=trySimplify(url);
  if (file == null) {
    this.location=url.toExternalForm();
  }
 else {
    this.location=this.file.getAbsolutePath();
  }
  this.packageName=packageName;
}

Fixed version (ground truth):
public URLCompilationUnitProvider(URL url,String packageName){
  assert(url != null);
  assert(packageName != null);
  this.url=url;
  this.file=trySimplify(url);
  String simpleTypeName;
  if (file == null) {
    this.location=url.toExternalForm();
    simpleTypeName=new File(url.getPath()).getName();
  }
 else {
    this.location=this.file.getAbsolutePath();
    simpleTypeName=this.file.getName();
  }
  int i=simpleTypeName.lastIndexOf("String_Node_Str");
  if (i != -1) {
    simpleTypeName=simpleTypeName.substring(0,i);
  }
  mainTypeName=simpleTypeName;
  this.packageName=packageName;
}
Program: 83006
Project: 83006
Buggy source:
private <T extends JsVisitable<T>>void popList(List<T> collection,int count){
  List<T> list=new ArrayList<T>();
  while (count > 0) {
    T item=pop();
    if (item != null) {
      list.add(item);
    }
    --count;
  }
  Collections.reverse(list);
  collection.addAll(list);
}

Fixed version (ground truth):
private <T extends JsVisitable<T>>void popList(List<T> collection,int count){
  List<T> list=new ArrayList<T>();
  while (count > 0) {
    T item=this.<T>pop();
    if (item != null) {
      list.add(item);
    }
    --count;
  }
  Collections.reverse(list);
  collection.addAll(list);
}
Program: 83008
Project: 83008
Buggy source:
private JsExpression mapExpression(Node exprNode) throws JsParserException {
  JsNode<?> unknown=map(exprNode);
  if (unknown instanceof JsExpression) {
    return (JsExpression)unknown;
  }
 else {
    throw createParserException("String_Node_Str",exprNode);
  }
}

Fixed version (ground truth):
private JsExpression mapExpression(Node exprNode) throws JsParserException {
  JsNode unknown=map(exprNode);
  if (unknown instanceof JsExpression) {
    return (JsExpression)unknown;
  }
 else {
    throw createParserException("String_Node_Str",exprNode);
  }
}
Program: 83009
Project: 83009
Buggy source:
private JsStatement mapStatement(Node nodeStmt) throws JsParserException {
  JsNode<?> unknown=map(nodeStmt);
  if (unknown != null) {
    if (unknown instanceof JsStatement) {
      return (JsStatement)unknown;
    }
 else     if (unknown instanceof JsExpression) {
      return ((JsExpression)unknown).makeStmt();
    }
 else {
      throw createParserException("String_Node_Str",nodeStmt);
    }
  }
 else {
    return program.getEmptyStmt();
  }
}

Fixed version (ground truth):
private JsStatement mapStatement(Node nodeStmt) throws JsParserException {
  JsNode unknown=map(nodeStmt);
  if (unknown != null) {
    if (unknown instanceof JsStatement) {
      return (JsStatement)unknown;
    }
 else     if (unknown instanceof JsExpression) {
      return ((JsExpression)unknown).makeStmt();
    }
 else {
      throw createParserException("String_Node_Str",nodeStmt);
    }
  }
 else {
    return program.getEmptyStmt();
  }
}
Program: 83010
Project: 83010
Buggy source:
private JsExpression mapOptionalExpression(Node exprNode) throws JsParserException {
  JsNode<?> unknown=map(exprNode);
  if (unknown != null) {
    if (unknown instanceof JsExpression) {
      return (JsExpression)unknown;
    }
 else {
      throw createParserException("String_Node_Str",exprNode);
    }
  }
  return null;
}

Fixed version (ground truth):
private JsExpression mapOptionalExpression(Node exprNode) throws JsParserException {
  JsNode unknown=map(exprNode);
  if (unknown != null) {
    if (unknown instanceof JsExpression) {
      return (JsExpression)unknown;
    }
 else {
      throw createParserException("String_Node_Str",exprNode);
    }
  }
  return null;
}
Program: 83011
Project: 83011
Buggy source:
/** 
 * Produces a   {@link JsNameRef}.
 */
private JsNameRef mapAsPropertyNameRef(Node nameRefNode) throws JsParserException {
  JsNode<?> unknown=map(nameRefNode);
  if (unknown instanceof JsStringLiteral) {
    JsStringLiteral lit=(JsStringLiteral)unknown;
    String litName=lit.getValue();
    return new JsNameRef(litName);
  }
 else {
    throw createParserException("String_Node_Str",nameRefNode);
  }
}

Fixed version (ground truth):
/** 
 * Produces a   {@link JsNameRef}.
 */
private JsNameRef mapAsPropertyNameRef(Node nameRefNode) throws JsParserException {
  JsNode unknown=map(nameRefNode);
  if (unknown instanceof JsStringLiteral) {
    JsStringLiteral lit=(JsStringLiteral)unknown;
    String litName=lit.getValue();
    return new JsNameRef(litName);
  }
 else {
    throw createParserException("String_Node_Str",nameRefNode);
  }
}
Program: 83012
Project: 83012
Buggy source:
public final <T extends JsVisitable>T accept(T node){
  return doAccept(node);
}

Fixed version (ground truth):
public final <T extends JsVisitable>T accept(T node){
  return (T)doAccept(node);
}
Program: 83014
Project: 83014
Buggy source:
public static int deepHashCode(Object[] a){
  if (a == null) {
    return 0;
  }
  int hashCode=1;
  for (int i=0, n=a.length; i < n; ++i) {
    Object obj=a[i];
    int hash;
    if (obj instanceof Object[]) {
      hash=deepHashCode((Object[])a);
    }
 else     if (obj instanceof boolean[]) {
      hash=hashCode((boolean[])obj);
    }
 else     if (obj instanceof byte[]) {
      hash=hashCode((byte[])obj);
    }
 else     if (obj instanceof char[]) {
      hash=hashCode((char[])obj);
    }
 else     if (obj instanceof short[]) {
      hash=hashCode((short[])obj);
    }
 else     if (obj instanceof int[]) {
      hash=hashCode((int[])obj);
    }
 else     if (obj instanceof long[]) {
      hash=hashCode((long[])obj);
    }
 else     if (obj instanceof float[]) {
      hash=hashCode((float[])obj);
    }
 else     if (obj instanceof double[]) {
      hash=hashCode((double[])obj);
    }
 else {
      hash=obj.hashCode();
    }
    hashCode=(31 * hashCode + hash) | 0;
  }
  return hashCode;
}

Fixed version (ground truth):
public static int deepHashCode(Object[] a){
  if (a == null) {
    return 0;
  }
  int hashCode=1;
  for (int i=0, n=a.length; i < n; ++i) {
    Object obj=a[i];
    int hash;
    if (obj instanceof Object[]) {
      hash=deepHashCode((Object[])obj);
    }
 else     if (obj instanceof boolean[]) {
      hash=hashCode((boolean[])obj);
    }
 else     if (obj instanceof byte[]) {
      hash=hashCode((byte[])obj);
    }
 else     if (obj instanceof char[]) {
      hash=hashCode((char[])obj);
    }
 else     if (obj instanceof short[]) {
      hash=hashCode((short[])obj);
    }
 else     if (obj instanceof int[]) {
      hash=hashCode((int[])obj);
    }
 else     if (obj instanceof long[]) {
      hash=hashCode((long[])obj);
    }
 else     if (obj instanceof float[]) {
      hash=hashCode((float[])obj);
    }
 else     if (obj instanceof double[]) {
      hash=hashCode((double[])obj);
    }
 else {
      hash=obj.hashCode();
    }
    hashCode=(31 * hashCode + hash) | 0;
  }
  return hashCode;
}
Program: 83015
Project: 83015
Buggy source:
private void doGetModule(HttpServletRequest request,HttpServletResponse response,TreeLogger logger,RequestParts parts) throws IOException {
  if ("String_Node_Str".equalsIgnoreCase(parts.moduleName)) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str");
    return;
  }
  String msg="String_Node_Str" + parts.moduleName + "String_Node_Str";
  logger=logger.branch(TreeLogger.TRACE,msg,null);
  try {
    getModuleDef(logger,parts.moduleName);
  }
 catch (  UnableToCompleteException e) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str" + parts.moduleName + "String_Node_Str");
    return;
  }
  response.setContentType("String_Node_Str");
  PrintWriter writer=response.getWriter();
  writer.println("String_Node_Str");
  writer.print("String_Node_Str");
  writer.print(parts.moduleName);
  writer.println("String_Node_Str");
  Map<String,String[]> params=request.getParameterMap();
  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");
}

Fixed version (ground truth):
private void doGetModule(HttpServletRequest request,HttpServletResponse response,TreeLogger logger,RequestParts parts) throws IOException {
  if ("String_Node_Str".equalsIgnoreCase(parts.moduleName)) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str");
    return;
  }
  String msg="String_Node_Str" + parts.moduleName + "String_Node_Str";
  logger=logger.branch(TreeLogger.TRACE,msg,null);
  try {
    getModuleDef(logger,parts.moduleName);
  }
 catch (  UnableToCompleteException e) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str" + 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=request.getParameterMap();
  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");
}
Program: 83016
Project: 83016
Buggy source:
/** 
 * Escapes '&', '<', '>', '"', and '\'' to their XML entity equivalents.
 */
private static String escapeXml(String unescaped){
  String escaped=unescaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  return escaped;
}

Fixed version (ground truth):
/** 
 * Escapes '&', '<', '>', '"', and '\'' to their XML entity equivalents.
 */
public static String escapeXml(String unescaped){
  String escaped=unescaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  return escaped;
}
Program: 83017
Project: 83017
Buggy source:
private GenerateJavaScriptAST(JProgram program,JsProgram jsProgram,boolean obfuscate,boolean prettyNames){
  this.program=program;
  typeOracle=program.typeOracle;
  this.jsProgram=jsProgram;
  topScope=jsProgram.getScope();
  objectScope=jsProgram.getObjectScope();
  interfaceScope=new JsScope(objectScope,"String_Node_Str");
  this.obfuscate=obfuscate;
  this.prettyNames=prettyNames;
  specialObfuscatedTypes.add(program.getIndexedType("String_Node_Str"));
  specialObfuscatedTypes.add(program.getIndexedType("String_Node_Str"));
  specialObfuscatedTypes.add(program.getTypeJavaLangObject());
  specialObfuscatedTypes.add(program.getTypeJavaLangString());
  specialObfuscatedTypes.add(program.getIndexedType("String_Node_Str"));
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private GenerateJavaScriptAST(JProgram program,JsProgram jsProgram,boolean obfuscate,boolean prettyNames){
  this.program=program;
  typeOracle=program.typeOracle;
  this.jsProgram=jsProgram;
  topScope=jsProgram.getScope();
  objectScope=jsProgram.getObjectScope();
  interfaceScope=new JsScope(objectScope,"String_Node_Str");
  this.obfuscate=obfuscate;
  this.prettyNames=prettyNames;
  specialObfuscatedTypes.add(program.getIndexedType("String_Node_Str"));
  specialObfuscatedTypes.add(program.getIndexedType("String_Node_Str"));
  specialObfuscatedTypes.add(program.getTypeJavaLangObject());
  specialObfuscatedTypes.add(program.getTypeJavaLangString());
  specialObfuscatedTypes.add(program.getIndexedType("String_Node_Str"));
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
  specialObfuscatedIdents.put("String_Node_Str","String_Node_Str");
}
Program: 83018
Project: 83018
Buggy source:
public char[] getMainTypeName(){
  String mainTypeName=cup.getLocation();
  int nameStart=mainTypeName.lastIndexOf(File.separatorChar);
  if (nameStart != -1) {
    mainTypeName=mainTypeName.substring(nameStart + 1);
  }
  int ext=mainTypeName.lastIndexOf("String_Node_Str");
  if (ext != -1) {
    return mainTypeName.substring(0,ext).toCharArray();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This method is supposed to return the simple class name for this compilation unit. Examples of simple class names would be "String", or "ArrayList". JDT allows this method to return null in the cases where this compilation unit is not a package-info class.
 */
public char[] getMainTypeName(){
  String mainTypeName=cup.getLocation();
  int ext=mainTypeName.lastIndexOf("String_Node_Str");
  if (ext == -1) {
    return null;
  }
  mainTypeName=mainTypeName.substring(0,ext);
  int nameStart=mainTypeName.lastIndexOf(File.separatorChar);
  if (nameStart == -1) {
    nameStart=mainTypeName.lastIndexOf('/');
  }
  mainTypeName=mainTypeName.substring(nameStart + 1);
  return mainTypeName.toCharArray();
}
Program: 83019
Project: 83019
Buggy source:
/** 
 * For a given method(and method binding), recursively try to find all methods that it overrides/implements.
 */
private void tryFindUpRefsRecursive(JMethod method,MethodBinding binding,ReferenceBinding searchThisType){
  if (binding.declaringClass != searchThisType) {
    MethodBinding result=searchThisType.getExactMethod(binding.selector,binding.parameters,null);
    if (result != null) {
      if (areParametersIdentical(binding,result)) {
        JMethod upRef=(JMethod)typeMap.get(result);
        if (!method.overrides.contains(upRef)) {
          method.overrides.add(upRef);
        }
      }
    }
  }
  if (searchThisType.superclass() != null) {
    tryFindUpRefsRecursive(method,binding,searchThisType.superclass());
  }
  if (searchThisType.superInterfaces() != null) {
    for (int i=0; i < searchThisType.superInterfaces().length; i++) {
      ReferenceBinding intf=searchThisType.superInterfaces()[i];
      tryFindUpRefsRecursive(method,binding,intf);
    }
  }
}

Fixed version (ground truth):
/** 
 * For a given method(and method binding), recursively try to find all methods that it overrides/implements.
 */
private void tryFindUpRefsRecursive(JMethod method,MethodBinding binding,ReferenceBinding searchThisType){
  if (binding.declaringClass != searchThisType) {
    for (    MethodBinding tryMethod : searchThisType.getMethods(binding.selector)) {
      if (binding.areParameterErasuresEqual(tryMethod)) {
        JMethod upRef=(JMethod)typeMap.get(tryMethod);
        if (!method.overrides.contains(upRef)) {
          method.overrides.add(upRef);
          break;
        }
      }
    }
  }
  if (searchThisType.superclass() != null) {
    tryFindUpRefsRecursive(method,binding,searchThisType.superclass());
  }
  if (searchThisType.superInterfaces() != null) {
    for (int i=0; i < searchThisType.superInterfaces().length; i++) {
      ReferenceBinding intf=searchThisType.superInterfaces()[i];
      tryFindUpRefsRecursive(method,binding,intf);
    }
  }
}
Program: 83020
Project: 83020
Buggy source:
/** 
 * Called when an asynchronous call completes successfully. It is always safe to downcast the parameter (of type <code>Object</code>) to the return type of the original method for which this is a callback. Note that if the return type of the synchronous service interface method is a primitive then the parameter will be the boxed version of the primitive (for example, an <code>int</code> return type becomes an   {@link Integer}.
 */
void onSuccess(Object result);

Fixed version (ground truth):
/** 
 * Called when an asynchronous call completes successfully. It is always safe to downcast the parameter (of type <code>Object</code>) to the return type of the original method for which this is a callback. Note that if the return type of the synchronous service interface method is a primitive then the parameter will be the boxed version of the primitive (for example, an <code>int</code> return type becomes an   {@link Integer}.
 */
void onSuccess(T result);
Program: 83021
Project: 83021
Buggy source:
public Iterator<T> iterator(){
  return listIterator();
}

Fixed version (ground truth):
public Iterator<T> iterator(){
  final Iterator<? extends T> it=set.iterator();
  return new Iterator<T>(){
    public boolean hasNext(){
      return it.hasNext();
    }
    public T next(){
      return it.next();
    }
    public void remove(){
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
;
}
Program: 83022
Project: 83022
Buggy source:
public static <T>Set<T> unmodifiableSet(Set<? extends T> set){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public static <T>Set<T> unmodifiableSet(final Set<? extends T> set){
  return new Set<T>(){
    public boolean add(    T o){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public boolean addAll(    Collection<? extends T> c){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public void clear(){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public boolean contains(    Object o){
      return set.contains(o);
    }
    public boolean containsAll(    Collection<?> c){
      return set.containsAll(c);
    }
    public boolean isEmpty(){
      return set.isEmpty();
    }
    public Iterator<T> iterator(){
      final Iterator<? extends T> it=set.iterator();
      return new Iterator<T>(){
        public boolean hasNext(){
          return it.hasNext();
        }
        public T next(){
          return it.next();
        }
        public void remove(){
          throw new UnsupportedOperationException("String_Node_Str");
        }
      }
;
    }
    public boolean remove(    Object o){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public boolean removeAll(    Collection<?> c){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public boolean retainAll(    Collection<?> c){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public int size(){
      return set.size();
    }
    public Object[] toArray(){
      return set.toArray();
    }
    public <OT>OT[] toArray(    OT[] a){
      return set.toArray(a);
    }
  }
;
}
Program: 83023
Project: 83023
Buggy source:
public T get(int index){
  return list.get(index);
}

Fixed version (ground truth):
public V get(Object key){
  return map.get(key);
}
Program: 83024
Project: 83024
Buggy source:
public <OT>OT[] toArray(OT[] array){
  return list.toArray(array);
}

Fixed version (ground truth):
public <OT>OT[] toArray(OT[] a){
  return set.toArray(a);
}
Program: 83025
Project: 83025
Buggy source:
public boolean containsAll(Collection<?> c){
  return list.containsAll(c);
}

Fixed version (ground truth):
public boolean containsAll(Collection<?> c){
  return set.containsAll(c);
}
Program: 83026
Project: 83026
Buggy source:
public boolean isEmpty(){
  return list.isEmpty();
}

Fixed version (ground truth):
public boolean isEmpty(){
  return set.isEmpty();
}
Program: 83027
Project: 83027
Buggy source:
public static <K,V>Map<K,V> unmodifiableMap(Map<? extends K,? extends V> map){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public static <K,V>Map<K,V> unmodifiableMap(final Map<? extends K,? extends V> map){
  return new Map<K,V>(){
    public void clear(){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public boolean containsKey(    Object key){
      return map.containsKey(key);
    }
    public boolean containsValue(    Object value){
      return map.containsValue(value);
    }
    public Set<Map.Entry<K,V>> entrySet(){
      Set<? extends Map.Entry<? extends K,? extends V>> entrySet=map.entrySet();
      return (Set<Map.Entry<K,V>>)entrySet;
    }
    public V get(    Object key){
      return map.get(key);
    }
    public boolean isEmpty(){
      return map.isEmpty();
    }
    public Set<K> keySet(){
      return (Set<K>)map.keySet();
    }
    public V put(    K key,    V value){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public void putAll(    Map<? extends K,? extends V> t){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public V remove(    Object key){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public int size(){
      return map.size();
    }
    public Collection<V> values(){
      return (Collection<V>)map.values();
    }
  }
;
}
Program: 83028
Project: 83028
Buggy source:
public boolean contains(Object o){
  return list.contains(o);
}

Fixed version (ground truth):
public boolean contains(Object o){
  return set.contains(o);
}
Program: 83029
Project: 83029
Buggy source:
public int size(){
  return list.size();
}

Fixed version (ground truth):
public int size(){
  return set.size();
}
Program: 83030
Project: 83030
Buggy source:
public boolean addAll(int index,Collection<? extends T> c){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public boolean addAll(Collection<? extends T> c){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 83031
Project: 83031
Buggy source:
public boolean remove(Widget w){
  Element td=DOM.getParent(w.getElement());
  Element tr=DOM.getParent(td);
  boolean removed=super.remove(w);
  if (removed) {
    DOM.removeChild(getBody(),tr);
  }
  return removed;
}

Fixed version (ground truth):
public boolean remove(Widget w){
  Element td=DOM.getParent(w.getElement());
  boolean removed=super.remove(w);
  if (removed) {
    DOM.removeChild(getBody(),DOM.getParent(td));
  }
  return removed;
}
Program: 83032
Project: 83032
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new AbsolutePanel());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new AbsolutePanel());
}
Program: 83033
Project: 83033
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new DisclosurePanel());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new DisclosurePanel());
}
Program: 83034
Project: 83034
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new DockPanel(),new Adder());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new DockPanel(),new Adder());
}
Program: 83035
Project: 83035
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new FlowPanel());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new FlowPanel());
}
Program: 83036
Project: 83036
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new FocusPanel());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new FocusPanel());
}
Program: 83037
Project: 83037
Buggy source:
public void testAttachDetachOrder(HasWidgets container,WidgetAdder adder){
  HasWidgetsTester.testAttachDetachOrder(new FormPanel());
}

Fixed version (ground truth):
public void testAttachDetachOrder(HasWidgets container,WidgetAdder adder){
  HasWidgetsTester.testAll(new FormPanel());
}
Program: 83038
Project: 83038
Buggy source:
public void testAttachDetachOrder(){
  HTMLPanel p=new HTMLPanel("String_Node_Str");
  HasWidgetsTester.testAttachDetachOrder(p,new Adder());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HTMLPanel p=new HTMLPanel("String_Node_Str");
  HasWidgetsTester.testAll(p,new Adder());
}
Program: 83039
Project: 83039
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(getTable(1,1),new Adder());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(getTable(1,1),new Adder());
}
Program: 83040
Project: 83040
Buggy source:
/** 
 * Tests attach and detach order, assuming that the container's  {@link HasWidgets#add(Widget)} method does not throw{@link UnsupportedOperationException}.
 * @param test
 * @param container
 * @see #testAttachDetachOrder(TestCase,HasWidgets,com.google.gwt.user.client.ui.HasWidgetsTester.WidgetAdder)
 */
static void testAttachDetachOrder(HasWidgets container){
  testAttachDetachOrder(container,new DefaultWidgetAdder());
}

Fixed version (ground truth):
/** 
 * Ensures that children are attached and detached in the proper order. This must result in the child's onLoad() method being called just *after* its element is attached to the DOM, and its onUnload method being called just *before* its element is detached from the DOM.
 */
static void testAttachDetachOrder(HasWidgets container,WidgetAdder adder){
  Assert.assertTrue(container instanceof Widget);
  RootPanel.get().add((Widget)container);
  TestWidget widget=new TestWidget();
  adder.addChild(container,widget);
  container.remove(widget);
  Assert.assertFalse(widget.isAttached());
  Assert.assertFalse(DOM.isOrHasChild(RootPanel.getBodyElement(),widget.getElement()));
}
Program: 83041
Project: 83041
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new HorizontalPanel());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new HorizontalPanel());
}
Program: 83042
Project: 83042
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new ScrollPanel());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new ScrollPanel());
}
Program: 83043
Project: 83043
Buggy source:
public void testVerticalAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new VerticalSplitPanel());
}

Fixed version (ground truth):
public void testVerticalAttachDetachOrder(){
  HasWidgetsTester.testAll(new VerticalSplitPanel());
}
Program: 83044
Project: 83044
Buggy source:
public void testHorizontalAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new HorizontalSplitPanel());
}

Fixed version (ground truth):
public void testHorizontalAttachDetachOrder(){
  HasWidgetsTester.testAll(new HorizontalSplitPanel());
}
Program: 83045
Project: 83045
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new StackPanel(),new Adder());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new StackPanel(),new Adder());
}
Program: 83046
Project: 83046
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new TabPanel(),new Adder());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new TabPanel(),new Adder());
}
Program: 83047
Project: 83047
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new Tree(),new Adder());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new Tree(),new Adder());
}
Program: 83048
Project: 83048
Buggy source:
public void testAttachDetachOrder(){
  HasWidgetsTester.testAttachDetachOrder(new VerticalPanel());
}

Fixed version (ground truth):
public void testAttachDetachOrder(){
  HasWidgetsTester.testAll(new VerticalPanel());
}