nus-yam/ex-repair huggingface dataset:
Program: 179226
Project: 179226
Buggy source:
/** 
 * Navigate all the fields of the specified object. If a field is null, it does not get visited.
 * @param objTypePair The object,type (fully genericized) being navigated
 */
public void accept(ObjectTypePair objTypePair,Visitor visitor){
  if (exclusionStrategy.shouldSkipClass($Gson$Types.getRawType(objTypePair.type))) {
    return;
  }
  boolean visitedWithCustomHandler=visitor.visitUsingCustomHandler(objTypePair);
  if (!visitedWithCustomHandler) {
    Object obj=objTypePair.getObject();
    Object objectToVisit=(obj == null) ? visitor.getTarget() : obj;
    if (objectToVisit == null) {
      return;
    }
    objTypePair.setObject(objectToVisit);
    visitor.start(objTypePair);
    try {
      if ($Gson$Types.isArray(objTypePair.type)) {
        visitor.visitArray(objectToVisit,objTypePair.type);
      }
 else       if (objTypePair.type == Object.class && isPrimitiveOrString(objectToVisit)) {
        visitor.visitPrimitive(objectToVisit);
        visitor.getTarget();
      }
 else {
        visitor.startVisitingObject(objectToVisit);
        reflectingFieldNavigator.visitFieldsReflectively(objTypePair,visitor);
      }
    }
  finally {
      visitor.end(objTypePair);
    }
  }
}

Fixed version (ground truth):
/** 
 * Navigate all the fields of the specified object. If a field is null, it does not get visited.
 * @param objTypePair The object,type (fully genericized) being navigated
 */
public void accept(ObjectTypePair objTypePair,Visitor visitor){
  if (exclusionStrategy.shouldSkipClass($Gson$Types.getRawType(objTypePair.type))) {
    return;
  }
  boolean visitedWithCustomHandler=visitor.visitUsingCustomHandler(objTypePair);
  if (!visitedWithCustomHandler) {
    objTypePair=objTypePair.toMoreSpecificType();
    Object obj=objTypePair.getObject();
    Object objectToVisit=(obj == null) ? visitor.getTarget() : obj;
    if (objectToVisit == null) {
      return;
    }
    objTypePair.setObject(objectToVisit);
    visitor.start(objTypePair);
    try {
      if ($Gson$Types.isArray(objTypePair.getMoreSpecificType())) {
        visitor.visitArray(objectToVisit,objTypePair.type);
      }
 else       if (objTypePair.type == Object.class && isPrimitiveOrString(objectToVisit)) {
        visitor.visitPrimitive(objectToVisit);
        visitor.getTarget();
      }
 else {
        visitor.startVisitingObject(objectToVisit);
        reflectingFieldNavigator.visitFieldsReflectively(objTypePair,visitor);
      }
    }
  finally {
      visitor.end(objTypePair);
    }
  }
}
Program: 179227
Project: 179227
Buggy source:
ObjectTypePair toMoreSpecificType(){
  if (preserveType || obj == null) {
    return this;
  }
  Type actualType=getActualTypeIfMoreSpecific(type,obj.getClass());
  if (actualType == type) {
    return this;
  }
  return new ObjectTypePair(obj,actualType,preserveType);
}

Fixed version (ground truth):
ObjectTypePair toMoreSpecificType(){
  if (preserveType || obj == null) {
    return this;
  }
  Type actualType=getActualTypeIfMoreSpecific(type,obj.getClass());
  if (actualType == type) {
    return this;
  }
  return new ObjectTypePair(obj,actualType,true);
}
Program: 179228
Project: 179228
Buggy source:
/** 
 * Regression test for Issue 205
 */
public void testMixingTypesInObjectArraySerialization(){
  Object[] array=new Object[]{1,2,new Object[]{"String_Node_Str","String_Node_Str"}};
  assertEquals("String_Node_Str",gson.toJson(array));
}

Fixed version (ground truth):
/** 
 * Regression test for Issue 205
 */
public void testMixingTypesInObjectArraySerialization(){
  Object[] array=new Object[]{1,2,new Object[]{"String_Node_Str","String_Node_Str",3}};
  assertEquals("String_Node_Str",gson.toJson(array));
}
Program: 179230
Project: 179230
Buggy source:
private static ParameterizedTypeHandlerMap<JsonSerializer<?>> createDefaultSerializers(){
  ParameterizedTypeHandlerMap<JsonSerializer<?>> map=new ParameterizedTypeHandlerMap<JsonSerializer<?>>();
  map.register(URL.class,URL_TYPE_ADAPTER);
  map.register(URI.class,URI_TYPE_ADAPTER);
  map.register(UUID.class,UUUID_TYPE_ADAPTER);
  map.register(Locale.class,LOCALE_TYPE_ADAPTER);
  map.register(Date.class,DATE_TYPE_ADAPTER);
  map.register(java.sql.Date.class,JAVA_SQL_DATE_TYPE_ADAPTER);
  map.register(Timestamp.class,DATE_TYPE_ADAPTER);
  map.register(Time.class,TIME_TYPE_ADAPTER);
  map.register(Calendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(GregorianCalendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(BigDecimal.class,BIG_DECIMAL_TYPE_ADAPTER);
  map.register(BigInteger.class,BIG_INTEGER_TYPE_ADAPTER);
  map.register(Boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(Byte.class,BYTE_TYPE_ADAPTER);
  map.register(byte.class,BYTE_TYPE_ADAPTER);
  map.register(Character.class,CHARACTER_TYPE_ADAPTER);
  map.register(char.class,CHARACTER_TYPE_ADAPTER);
  map.register(Integer.class,INTEGER_TYPE_ADAPTER);
  map.register(int.class,INTEGER_TYPE_ADAPTER);
  map.register(Number.class,NUMBER_TYPE_ADAPTER);
  map.register(Short.class,SHORT_TYPE_ADAPTER);
  map.register(short.class,SHORT_TYPE_ADAPTER);
  map.register(String.class,STRING_TYPE_ADAPTER);
  map.makeUnmodifiable();
  return map;
}

Fixed version (ground truth):
private static ParameterizedTypeHandlerMap<JsonSerializer<?>> createDefaultSerializers(){
  ParameterizedTypeHandlerMap<JsonSerializer<?>> map=new ParameterizedTypeHandlerMap<JsonSerializer<?>>();
  map.register(URL.class,URL_TYPE_ADAPTER);
  map.register(URI.class,URI_TYPE_ADAPTER);
  map.register(UUID.class,UUUID_TYPE_ADAPTER);
  map.register(Locale.class,LOCALE_TYPE_ADAPTER);
  map.register(Date.class,DATE_TYPE_ADAPTER);
  map.register(java.sql.Date.class,JAVA_SQL_DATE_TYPE_ADAPTER);
  map.register(Timestamp.class,DATE_TYPE_ADAPTER);
  map.register(Time.class,TIME_TYPE_ADAPTER);
  map.register(Calendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(GregorianCalendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(BigDecimal.class,BIG_DECIMAL_TYPE_ADAPTER);
  map.register(BigInteger.class,BIG_INTEGER_TYPE_ADAPTER);
  map.register(Boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(Byte.class,BYTE_TYPE_ADAPTER);
  map.register(byte.class,BYTE_TYPE_ADAPTER);
  map.register(Character.class,CHARACTER_TYPE_ADAPTER);
  map.register(char.class,CHARACTER_TYPE_ADAPTER);
  map.register(Integer.class,INTEGER_TYPE_ADAPTER);
  map.register(int.class,INTEGER_TYPE_ADAPTER);
  map.register(Number.class,NUMBER_TYPE_ADAPTER);
  map.register(Short.class,SHORT_TYPE_ADAPTER);
  map.register(short.class,SHORT_TYPE_ADAPTER);
  map.register(String.class,STRING_TYPE_ADAPTER);
  map.register(StringBuilder.class,STRING_BUILDER_TYPE_ADAPTER);
  map.register(StringBuffer.class,STRING_BUFFER_TYPE_ADAPTER);
  map.makeUnmodifiable();
  return map;
}
Program: 179232
Project: 179232
Buggy source:
public synchronized ParameterizedTypeHandlerMap<T> copyOf(){
  ParameterizedTypeHandlerMap<T> copy=new ParameterizedTypeHandlerMap<T>();
  for (  Map.Entry<Type,T> entry : map.entrySet()) {
    copy.register(entry.getKey(),entry.getValue());
  }
  for (  Pair<Class<?>,T> entry : typeHierarchyList) {
    copy.registerForTypeHierarchy(entry);
  }
  return copy;
}

Fixed version (ground truth):
public synchronized ParameterizedTypeHandlerMap<T> copyOf(){
  ParameterizedTypeHandlerMap<T> copy=new ParameterizedTypeHandlerMap<T>();
  copy.map.putAll(map);
  copy.typeHierarchyList.addAll(typeHierarchyList);
  return copy;
}
Program: 179233
Project: 179233
Buggy source:
public void disabled_testEnumSubclassWithRegisteredTypeAdapter(){
  gson=new GsonBuilder().registerTypeHierarchyAdapter(Roshambo.class,new MyEnumTypeAdapter()).create();
  assertRoshambo();
}

Fixed version (ground truth):
public void disabled_testEnumSubclassWithRegisteredTypeAdapter(){
  gson=new GsonBuilder().create();
  assertRoshambo();
}
Program: 179235
Project: 179235
Buggy source:
private void string(String value) throws IOException {
  out.write("String_Node_Str");
  for (int i=0, length=value.length(); i < length; i++) {
    char c=value.charAt(i);
    if (c == '"' || c == '\\') {
      out.write('\\');
      out.write(c);
    }
 else     if (c <= 0x1F) {
      out.write(String.format("String_Node_Str",(int)c));
    }
 else {
      out.write(c);
    }
  }
  out.write("String_Node_Str");
}

Fixed version (ground truth):
private void string(String value) throws IOException {
  out.write("String_Node_Str");
  for (int i=0, length=value.length(); i < length; i++) {
    char c=value.charAt(i);
switch (c) {
case '"':
case '\\':
      out.write('\\');
    out.write(c);
  break;
case '\t':
out.write("String_Node_Str");
break;
case '\b':
out.write("String_Node_Str");
break;
case '\n':
out.write("String_Node_Str");
break;
case '\r':
out.write("String_Node_Str");
break;
case '\f':
out.write("String_Node_Str");
break;
default :
if (c <= 0x1F) {
out.write(String.format("String_Node_Str",(int)c));
}
 else {
out.write(c);
}
break;
}
}
out.write("String_Node_Str");
}
Program: 179236
Project: 179236
Buggy source:
/** 
 * Inserts any necessary separators and whitespace before a literal value, inline array, or inline object. Also adjusts the stack to expect either a closing bracket or another element.
 * @param root true if the value is a new array or object, the two valuespermitted as top-level elements.
 */
private void beforeValue(boolean root) throws IOException {
switch (peek()) {
case EMPTY_DOCUMENT:
    if (!root) {
      throw new IllegalStateException("String_Node_Str");
    }
  replaceTop(JsonScope.NONEMPTY_DOCUMENT);
break;
case EMPTY_ARRAY:
replaceTop(JsonScope.NONEMPTY_ARRAY);
newline();
break;
case NONEMPTY_ARRAY:
out.append(',');
newline();
break;
case DANGLING_NAME:
out.append(separator);
replaceTop(JsonScope.NONEMPTY_OBJECT);
break;
case NONEMPTY_DOCUMENT:
throw new IllegalStateException("String_Node_Str");
default :
throw new IllegalStateException("String_Node_Str" + stack);
}
}

Fixed version (ground truth):
/** 
 * Inserts any necessary separators and whitespace before a literal value, inline array, or inline object. Also adjusts the stack to expect either a closing bracket or another element.
 * @param root true if the value is a new array or object, the two valuespermitted as top-level elements.
 */
private void beforeValue(boolean root) throws IOException {
switch (peek()) {
case EMPTY_DOCUMENT:
    if (!lenient && !root) {
      throw new IllegalStateException("String_Node_Str");
    }
  replaceTop(JsonScope.NONEMPTY_DOCUMENT);
break;
case EMPTY_ARRAY:
replaceTop(JsonScope.NONEMPTY_ARRAY);
newline();
break;
case NONEMPTY_ARRAY:
out.append(',');
newline();
break;
case DANGLING_NAME:
out.append(separator);
replaceTop(JsonScope.NONEMPTY_OBJECT);
break;
case NONEMPTY_DOCUMENT:
throw new IllegalStateException("String_Node_Str");
default :
throw new IllegalStateException("String_Node_Str" + stack);
}
}
Program: 179237
Project: 179237
Buggy source:
/** 
 * Encodes   {@code value}.
 * @param value a finite value. May not be {@link Double#isNaN() NaNs} or{@link Double#isInfinite() infinities}.
 * @return this writer.
 */
public JsonWriter value(Number value) throws IOException {
  if (value == null) {
    return nullValue();
  }
  String string=value.toString();
  if (string.equals("String_Node_Str") || string.equals("String_Node_Str") || string.equals("String_Node_Str")) {
    throw new IllegalArgumentException("String_Node_Str" + value);
  }
  beforeValue(false);
  out.append(string);
  return this;
}

Fixed version (ground truth):
/** 
 * Encodes   {@code value}.
 * @param value a finite value. May not be {@link Double#isNaN() NaNs} or{@link Double#isInfinite() infinities}.
 * @return this writer.
 */
public JsonWriter value(Number value) throws IOException {
  if (value == null) {
    return nullValue();
  }
  String string=value.toString();
  if (!lenient && (string.equals("String_Node_Str") || string.equals("String_Node_Str") || string.equals("String_Node_Str"))) {
    throw new IllegalArgumentException("String_Node_Str" + value);
  }
  beforeValue(false);
  out.append(string);
  return this;
}
Program: 179238
Project: 179238
Buggy source:
public void testAddingNullOrEmptyPropertyName() throws Exception {
  JsonObject jsonObj=new JsonObject();
  try {
    jsonObj.add(null,JsonNull.createJsonNull());
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException expected) {
  }
  try {
    jsonObj.add("String_Node_Str",JsonNull.createJsonNull());
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException expected) {
  }
  try {
    jsonObj.add("String_Node_Str",JsonNull.createJsonNull());
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException expected) {
  }
}

Fixed version (ground truth):
public void testAddingNullOrEmptyPropertyName() throws Exception {
  JsonObject jsonObj=new JsonObject();
  try {
    jsonObj.add(null,JsonNull.createJsonNull());
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException expected) {
  }
  jsonObj.add("String_Node_Str",JsonNull.createJsonNull());
  jsonObj.add("String_Node_Str",JsonNull.createJsonNull());
}
Program: 179239
Project: 179239
Buggy source:
public void testReadWriteTwoObjects() throws Exception {
  Gson gson=new Gson();
  CharArrayWriter writer=new CharArrayWriter();
  BagOfPrimitives expectedOne=new BagOfPrimitives(1,1,true,"String_Node_Str");
  writer.write(gson.toJson(expectedOne).toCharArray());
  BagOfPrimitives expectedTwo=new BagOfPrimitives(2,2,false,"String_Node_Str");
  writer.write(gson.toJson(expectedTwo).toCharArray());
  CharArrayReader reader=new CharArrayReader(writer.toCharArray());
  JsonReader parser=new JsonReader(reader);
  parser.setLenient(true);
  JsonElement element1=GsonReader.parse(parser);
  JsonElement element2=GsonReader.parse(parser);
  BagOfPrimitives actualOne=gson.fromJson(element1,BagOfPrimitives.class);
  assertEquals("String_Node_Str",actualOne.stringValue);
  BagOfPrimitives actualTwo=gson.fromJson(element2,BagOfPrimitives.class);
  assertEquals("String_Node_Str",actualTwo.stringValue);
}

Fixed version (ground truth):
public void testReadWriteTwoObjects() throws Exception {
  Gson gson=new Gson();
  CharArrayWriter writer=new CharArrayWriter();
  BagOfPrimitives expectedOne=new BagOfPrimitives(1,1,true,"String_Node_Str");
  writer.write(gson.toJson(expectedOne).toCharArray());
  BagOfPrimitives expectedTwo=new BagOfPrimitives(2,2,false,"String_Node_Str");
  writer.write(gson.toJson(expectedTwo).toCharArray());
  CharArrayReader reader=new CharArrayReader(writer.toCharArray());
  JsonReader parser=new JsonReader(reader);
  parser.setLenient(true);
  JsonElement element1=Streams.parse(parser);
  JsonElement element2=Streams.parse(parser);
  BagOfPrimitives actualOne=gson.fromJson(element1,BagOfPrimitives.class);
  assertEquals("String_Node_Str",actualOne.stringValue);
  BagOfPrimitives actualTwo=gson.fromJson(element2,BagOfPrimitives.class);
  assertEquals("String_Node_Str",actualTwo.stringValue);
}
Program: 179240
Project: 179240
Buggy source:
public void visitObjectMember(JsonObject parent,String memberName,JsonObject member,boolean isFirst) throws IOException {
  if (!isFirst) {
    writer.append(',');
  }
  writer.append('"');
  writer.append(memberName);
  writer.append("String_Node_Str");
}

Fixed version (ground truth):
public void visitObjectMember(JsonObject parent,String memberName,JsonObject member,boolean isFirst) throws IOException {
  if (!isFirst) {
    writer.append(',');
  }
  writer.append('"');
  writer.append(escaper.escapeJsonString(memberName));
  writer.append("String_Node_Str");
}
Program: 179241
Project: 179241
Buggy source:
@Override protected void toString(Appendable sb,Escaper escaper) throws IOException {
  sb.append('{');
  boolean first=true;
  for (  Map.Entry<String,JsonElement> entry : members.entrySet()) {
    if (first) {
      first=false;
    }
 else {
      sb.append(',');
    }
    sb.append('\"');
    sb.append(entry.getKey());
    sb.append("String_Node_Str");
    entry.getValue().toString(sb,escaper);
  }
  sb.append('}');
}

Fixed version (ground truth):
@Override protected void toString(Appendable sb,Escaper escaper) throws IOException {
  sb.append('{');
  boolean first=true;
  for (  Map.Entry<String,JsonElement> entry : members.entrySet()) {
    if (first) {
      first=false;
    }
 else {
      sb.append(',');
    }
    sb.append('\"');
    sb.append(escaper.escapeJsonString(entry.getKey()));
    sb.append("String_Node_Str");
    entry.getValue().toString(sb,escaper);
  }
  sb.append('}');
}
Program: 179242
Project: 179242
Buggy source:
public void visitObjectMember(JsonObject parent,String memberName,JsonObject member,boolean isFirst) throws IOException {
  addCommaCheckingFirst(isFirst);
  writer.key(memberName);
  writer.fieldSeparator();
}

Fixed version (ground truth):
public void visitObjectMember(JsonObject parent,String memberName,JsonObject member,boolean isFirst) throws IOException {
  addCommaCheckingFirst(isFirst);
  writer.key(escaper.escapeJsonString(memberName));
  writer.fieldSeparator();
}
Program: 179243
Project: 179243
Buggy source:
private static ParameterizedTypeHandlerMap<JsonSerializer<?>> createDefaultSerializers(){
  ParameterizedTypeHandlerMap<JsonSerializer<?>> map=new ParameterizedTypeHandlerMap<JsonSerializer<?>>();
  map.register(Enum.class,ENUM_TYPE_ADAPTER);
  map.register(URL.class,URL_TYPE_ADAPTER);
  map.register(URI.class,URI_TYPE_ADAPTER);
  map.register(UUID.class,UUUID_TYPE_ADAPTER);
  map.register(Locale.class,LOCALE_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Date.class,DATE_TYPE_ADAPTER);
  map.register(Calendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(GregorianCalendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(BigDecimal.class,BIG_DECIMAL_TYPE_ADAPTER);
  map.register(BigInteger.class,BIG_INTEGER_TYPE_ADAPTER);
  map.register(Boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(Byte.class,BYTE_TYPE_ADAPTER);
  map.register(byte.class,BYTE_TYPE_ADAPTER);
  map.register(Character.class,CHARACTER_TYPE_ADAPTER);
  map.register(char.class,CHARACTER_TYPE_ADAPTER);
  map.register(Integer.class,INTEGER_TYPE_ADAPTER);
  map.register(int.class,INTEGER_TYPE_ADAPTER);
  map.register(Number.class,NUMBER_TYPE_ADAPTER);
  map.register(Short.class,SHORT_TYPE_ADAPTER);
  map.register(short.class,SHORT_TYPE_ADAPTER);
  map.register(String.class,STRING_TYPE_ADAPTER);
  map.makeUnmodifiable();
  return map;
}

Fixed version (ground truth):
private static ParameterizedTypeHandlerMap<JsonSerializer<?>> createDefaultSerializers(){
  ParameterizedTypeHandlerMap<JsonSerializer<?>> map=new ParameterizedTypeHandlerMap<JsonSerializer<?>>();
  map.register(Enum.class,ENUM_TYPE_ADAPTER);
  map.register(URL.class,URL_TYPE_ADAPTER);
  map.register(URI.class,URI_TYPE_ADAPTER);
  map.register(UUID.class,UUUID_TYPE_ADAPTER);
  map.register(Locale.class,LOCALE_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Date.class,DATE_TYPE_ADAPTER);
  map.register(Timestamp.class,DATE_TYPE_ADAPTER);
  map.register(java.sql.Date.class,DATE_TYPE_ADAPTER);
  map.register(Calendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(GregorianCalendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(BigDecimal.class,BIG_DECIMAL_TYPE_ADAPTER);
  map.register(BigInteger.class,BIG_INTEGER_TYPE_ADAPTER);
  map.register(Boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(Byte.class,BYTE_TYPE_ADAPTER);
  map.register(byte.class,BYTE_TYPE_ADAPTER);
  map.register(Character.class,CHARACTER_TYPE_ADAPTER);
  map.register(char.class,CHARACTER_TYPE_ADAPTER);
  map.register(Integer.class,INTEGER_TYPE_ADAPTER);
  map.register(int.class,INTEGER_TYPE_ADAPTER);
  map.register(Number.class,NUMBER_TYPE_ADAPTER);
  map.register(Short.class,SHORT_TYPE_ADAPTER);
  map.register(short.class,SHORT_TYPE_ADAPTER);
  map.register(String.class,STRING_TYPE_ADAPTER);
  map.makeUnmodifiable();
  return map;
}
Program: 179245
Project: 179245
Buggy source:
public void testDefaultDateDeserialization(){
  Date date=new Date();
  String json=gson.toJson(date);
  Date extracted=gson.fromJson(json,Date.class);
  assertEquals(date.toString(),extracted.toString());
}

Fixed version (ground truth):
public void testDefaultDateDeserialization(){
  String json="String_Node_Str";
  Date extracted=gson.fromJson(json,Date.class);
  assertEquals(extracted,2009,11,13,7,18,02);
}
Program: 179246
Project: 179246
Buggy source:
private static ParameterizedTypeHandlerMap<InstanceCreator<?>> createDefaultInstanceCreators(){
  ParameterizedTypeHandlerMap<InstanceCreator<?>> map=new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(List.class,COLLECTION_TYPE_ADAPTER);
  map.register(Queue.class,COLLECTION_TYPE_ADAPTER);
  map.register(Set.class,HASH_SET_CREATOR);
  map.register(SortedSet.class,TREE_SET_CREATOR);
  map.register(Properties.class,PROPERTIES_CREATOR);
  map.makeUnmodifiable();
  return map;
}

Fixed version (ground truth):
private static ParameterizedTypeHandlerMap<InstanceCreator<?>> createDefaultInstanceCreators(){
  ParameterizedTypeHandlerMap<InstanceCreator<?>> map=new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(List.class,COLLECTION_TYPE_ADAPTER);
  map.register(Queue.class,COLLECTION_TYPE_ADAPTER);
  map.register(Set.class,HASH_SET_CREATOR);
  map.register(SortedSet.class,TREE_SET_CREATOR);
  map.register(TreeSet.class,TREE_SET_CREATOR);
  map.register(Properties.class,PROPERTIES_CREATOR);
  map.makeUnmodifiable();
  return map;
}
Program: 179247
Project: 179247
Buggy source:
/** 
 * This method serializes the specified object, including those of generic types, into its equivalent Json representation. This method must be used if the specified object is a generic type. For non-generic objects, use   {@link #toJson(Object,Appendable)} instead.
 * @param src the object for which JSON representation is to be created
 * @param typeOfSrc The specific genericized type of src. You can obtainthis type by using the  {@link com.google.gson.reflect.TypeToken} class. For example,to get the type for  {@code Collection<Foo>}, you should use: <pre> Type typeOfSrc = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType(); </pre>
 * @param writer Writer to which the Json representation of src needs to be written.
 * @since 1.2
 */
public void toJson(Object src,Type typeOfSrc,Appendable writer){
  try {
    if (generateNonExecutableJson) {
      writer.append(JSON_NON_EXECUTABLE_PREFIX);
    }
    JsonElement jsonElement=toJsonTree(src,typeOfSrc);
    formatter.format(jsonElement,writer,serializeNulls);
  }
 catch (  IOException ioe) {
    throw new RuntimeException(ioe);
  }
}

Fixed version (ground truth):
/** 
 * Writes out the equivalent JSON for the tree of   {@link JsonElement}s.
 * @param jsonElement root of the tree of {@link JsonElement}s
 * @param writer Writer to which the Json representation needs to be written
 * @since 1.4
 */
public void toJson(JsonElement jsonElement,Appendable writer){
  try {
    if (generateNonExecutableJson) {
      writer.append(JSON_NON_EXECUTABLE_PREFIX);
    }
    if (jsonElement == null && serializeNulls) {
      writeOutNullString(writer);
    }
    formatter.format(jsonElement,writer,serializeNulls);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 179248
Project: 179248
Buggy source:
@Override public int hashCode(){
  return (value == null) ? 31 : value.hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  if (value == null) {
    return 31;
  }
  if (isIntegral(this)) {
    long value=getAsNumber().longValue();
    return (int)(value ^ (value >>> 32));
  }
  if (isFloatingPoint(this)) {
    long value=Double.doubleToLongBits(getAsNumber().doubleValue());
    return (int)(value ^ (value >>> 32));
  }
  return value.hashCode();
}
Program: 179249
Project: 179249
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  JsonPrimitive other=(JsonPrimitive)obj;
  if (value == null) {
    return other.value == null;
  }
  return value.equals(other.value);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  JsonPrimitive other=(JsonPrimitive)obj;
  if (value == null) {
    return other.value == null;
  }
  if (isIntegral(this) && isIntegral(other)) {
    return getAsNumber().longValue() == other.getAsNumber().longValue();
  }
  if (isFloatingPoint(this) && isFloatingPoint(other)) {
    return getAsNumber().doubleValue() == other.getAsNumber().doubleValue();
  }
  return value.equals(other.value);
}
Program: 179250
Project: 179250
Buggy source:
public void visitObjectField(Field f,Type typeOfF,Object obj){
  if (isFieldNull(f,obj)) {
    if (serializeNulls) {
      addChildAsElement(f,JsonNull.createJsonNull());
    }
  }
 else {
    Object fieldValue=getFieldValue(f,obj);
    if (fieldValue != null && typeOfF == Object.class) {
      typeOfF=fieldValue.getClass();
    }
    addAsChildOfObject(f,typeOfF,fieldValue);
  }
}

Fixed version (ground truth):
public void visitObjectField(Field f,Type typeOfF,Object obj){
  if (isFieldNull(f,obj)) {
    if (serializeNulls) {
      addChildAsElement(f,JsonNull.createJsonNull());
    }
  }
 else {
    Object fieldValue=getFieldValue(f,obj);
    if (fieldValue != null) {
      typeOfF=getActualTypeIfMoreSpecific(typeOfF,fieldValue.getClass());
    }
    addAsChildOfObject(f,typeOfF,fieldValue);
  }
}
Program: 179251
Project: 179251
Buggy source:
public void visitArray(Object array,Type arrayType){
  assignToRoot(new JsonArray());
  int length=Array.getLength(array);
  TypeInfoArray fieldTypeInfo=TypeInfoFactory.getTypeInfoForArray(arrayType);
  Type componentType=fieldTypeInfo.getSecondLevelType();
  for (int i=0; i < length; ++i) {
    Object child=Array.get(array,i);
    addAsArrayElement(componentType,child);
  }
}

Fixed version (ground truth):
public void visitArray(Object array,Type arrayType){
  assignToRoot(new JsonArray());
  int length=Array.getLength(array);
  TypeInfoArray fieldTypeInfo=TypeInfoFactory.getTypeInfoForArray(arrayType);
  Type componentType=fieldTypeInfo.getSecondLevelType();
  for (int i=0; i < length; ++i) {
    Object child=Array.get(array,i);
    Type childType=componentType;
    if (child != null) {
      childType=getActualTypeIfMoreSpecific(childType,child.getClass());
    }
    addAsArrayElement(childType,child);
  }
}
Program: 179252
Project: 179252
Buggy source:
public DefaultDateTypeAdapter(int dateStyle,int timeStyle){
  this.format=DateFormat.getDateTimeInstance(dateStyle,timeStyle);
}

Fixed version (ground truth):
public DefaultDateTypeAdapter(final int dateStyle,final int timeStyle){
  this.format=DateFormat.getDateTimeInstance(dateStyle,timeStyle);
}
Program: 179253
Project: 179253
Buggy source:
private void navigateClassFields(Object obj,Class<?> clazz,Visitor visitor){
  Field[] fields=clazz.getDeclaredFields();
  AccessibleObject.setAccessible(fields,true);
  for (  Field f : fields) {
    TypeInfo fieldTypeInfo=TypeInfoFactory.getTypeInfoForField(f,objType);
    Type actualTypeOfField=fieldTypeInfo.getActualType();
    if (exclusionStrategy.shouldSkipField(f)) {
      continue;
    }
 else {
      boolean visitedWithCustomHandler=visitor.visitFieldUsingCustomHandler(f,actualTypeOfField,obj);
      if (!visitedWithCustomHandler) {
        if (fieldTypeInfo.isArray()) {
          visitor.visitArrayField(f,actualTypeOfField,obj);
        }
 else {
          visitor.visitObjectField(f,actualTypeOfField,obj);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void navigateClassFields(Object obj,Class<?> clazz,Visitor visitor){
  Field[] fields=clazz.getDeclaredFields();
  AccessibleObject.setAccessible(fields,true);
  for (  Field f : fields) {
    if (exclusionStrategy.shouldSkipField(f)) {
      continue;
    }
 else {
      TypeInfo fieldTypeInfo=TypeInfoFactory.getTypeInfoForField(f,objType);
      Type actualTypeOfField=fieldTypeInfo.getActualType();
      boolean visitedWithCustomHandler=visitor.visitFieldUsingCustomHandler(f,actualTypeOfField,obj);
      if (!visitedWithCustomHandler) {
        if (fieldTypeInfo.isArray()) {
          visitor.visitArrayField(f,actualTypeOfField,obj);
        }
 else {
          visitor.visitObjectField(f,actualTypeOfField,obj);
        }
      }
    }
  }
}
Program: 179254
Project: 179254
Buggy source:
public void startArray(JsonArray array) throws IOException {
  firstArrayElement.put(++level,true);
  writer.beginArray();
}

Fixed version (ground truth):
public void startArray(JsonArray array) throws IOException {
  firstElementInLevel.push(true);
  writer.beginArray();
}
Program: 179255
Project: 179255
Buggy source:
public void visitNullArrayMember(JsonArray parent,boolean isFirst) throws IOException {
  addCommaCheckingFirst(firstArrayElement);
}

Fixed version (ground truth):
public void visitNullArrayMember(JsonArray parent,boolean isFirst) throws IOException {
  addCommaCheckingFirst();
}
Program: 179256
Project: 179256
Buggy source:
private void addCommaCheckingFirst(Map<Integer,Boolean> first) throws IOException {
  if (first.get(level) != Boolean.FALSE) {
    first.put(level,false);
  }
 else {
    writer.elementSeparator();
  }
}

Fixed version (ground truth):
private void addCommaCheckingFirst() throws IOException {
  if (firstElementInLevel.peek()) {
    firstElementInLevel.pop();
    firstElementInLevel.push(false);
  }
 else {
    writer.elementSeparator();
  }
}
Program: 179257
Project: 179257
Buggy source:
public void endArray(JsonArray array){
  level--;
  writer.endArray();
}

Fixed version (ground truth):
public void endArray(JsonArray array){
  writer.endArray();
  firstElementInLevel.pop();
}
Program: 179258
Project: 179258
Buggy source:
PrintFormattingVisitor(JsonWriter writer,Escaper escaper,boolean serializeNulls){
  this.writer=writer;
  this.escaper=escaper;
  this.serializeNulls=serializeNulls;
  this.firstArrayElement=new HashMap<Integer,Boolean>();
  this.firstObjectMember=new HashMap<Integer,Boolean>();
}

Fixed version (ground truth):
PrintFormattingVisitor(JsonWriter writer,Escaper escaper,boolean serializeNulls){
  this.writer=writer;
  this.escaper=escaper;
  this.serializeNulls=serializeNulls;
  this.firstElementInLevel=new Stack<Boolean>();
}
Program: 179259
Project: 179259
Buggy source:
public void visitArrayMember(JsonArray parent,JsonObject member,boolean first) throws IOException {
  addCommaCheckingFirst(firstArrayElement);
}

Fixed version (ground truth):
public void visitArrayMember(JsonArray parent,JsonObject member,boolean first) throws IOException {
  addCommaCheckingFirst();
}
Program: 179260
Project: 179260
Buggy source:
public void endObject(JsonObject object){
  writer.endObject();
}

Fixed version (ground truth):
public void endObject(JsonObject object){
  writer.endObject();
  firstElementInLevel.pop();
}
Program: 179261
Project: 179261
Buggy source:
public void startObject(JsonObject object) throws IOException {
  firstObjectMember.put(level,true);
  writer.beginObject();
}

Fixed version (ground truth):
public void startObject(JsonObject object) throws IOException {
  firstElementInLevel.push(true);
  writer.beginObject();
}
Program: 179262
Project: 179262
Buggy source:
public void visitObjectMember(JsonObject parent,String memberName,JsonObject member,boolean isFirst) throws IOException {
  addCommaCheckingFirst(firstObjectMember);
  writer.key(memberName);
  writer.fieldSeparator();
}

Fixed version (ground truth):
public void visitObjectMember(JsonObject parent,String memberName,JsonObject member,boolean isFirst) throws IOException {
  addCommaCheckingFirst();
  writer.key(memberName);
  writer.fieldSeparator();
}
Program: 179263
Project: 179263
Buggy source:
private static ParameterizedTypeHandlerMap<JsonSerializer<?>> createDefaultSerializers(){
  ParameterizedTypeHandlerMap<JsonSerializer<?>> map=new ParameterizedTypeHandlerMap<JsonSerializer<?>>();
  map.register(Enum.class,ENUM_TYPE_ADAPTER);
  map.register(URL.class,URL_TYPE_ADAPTER);
  map.register(URI.class,URI_TYPE_ADAPTER);
  map.register(UUID.class,UUUID_TYPE_ADAPTER);
  map.register(Locale.class,LOCALE_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Date.class,DATE_TYPE_ADAPTER);
  map.register(BigDecimal.class,BIG_DECIMAL_TYPE_ADAPTER);
  map.register(BigInteger.class,BIG_INTEGER_TYPE_ADAPTER);
  map.register(Boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(Byte.class,BYTE_TYPE_ADAPTER);
  map.register(byte.class,BYTE_TYPE_ADAPTER);
  map.register(Character.class,CHARACTER_TYPE_ADAPTER);
  map.register(char.class,CHARACTER_TYPE_ADAPTER);
  map.register(Integer.class,INTEGER_TYPE_ADAPTER);
  map.register(int.class,INTEGER_TYPE_ADAPTER);
  map.register(Number.class,NUMBER_TYPE_ADAPTER);
  map.register(Short.class,SHORT_TYPE_ADAPTER);
  map.register(short.class,SHORT_TYPE_ADAPTER);
  map.register(String.class,STRING_TYPE_ADAPTER);
  map.makeUnmodifiable();
  return map;
}

Fixed version (ground truth):
private static ParameterizedTypeHandlerMap<JsonSerializer<?>> createDefaultSerializers(){
  ParameterizedTypeHandlerMap<JsonSerializer<?>> map=new ParameterizedTypeHandlerMap<JsonSerializer<?>>();
  map.register(Enum.class,ENUM_TYPE_ADAPTER);
  map.register(URL.class,URL_TYPE_ADAPTER);
  map.register(URI.class,URI_TYPE_ADAPTER);
  map.register(UUID.class,UUUID_TYPE_ADAPTER);
  map.register(Locale.class,LOCALE_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Date.class,DATE_TYPE_ADAPTER);
  map.register(Calendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(GregorianCalendar.class,GREGORIAN_CALENDAR_TYPE_ADAPTER);
  map.register(BigDecimal.class,BIG_DECIMAL_TYPE_ADAPTER);
  map.register(BigInteger.class,BIG_INTEGER_TYPE_ADAPTER);
  map.register(Boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(boolean.class,BOOLEAN_TYPE_ADAPTER);
  map.register(Byte.class,BYTE_TYPE_ADAPTER);
  map.register(byte.class,BYTE_TYPE_ADAPTER);
  map.register(Character.class,CHARACTER_TYPE_ADAPTER);
  map.register(char.class,CHARACTER_TYPE_ADAPTER);
  map.register(Integer.class,INTEGER_TYPE_ADAPTER);
  map.register(int.class,INTEGER_TYPE_ADAPTER);
  map.register(Number.class,NUMBER_TYPE_ADAPTER);
  map.register(Short.class,SHORT_TYPE_ADAPTER);
  map.register(short.class,SHORT_TYPE_ADAPTER);
  map.register(String.class,STRING_TYPE_ADAPTER);
  map.makeUnmodifiable();
  return map;
}
Program: 179265
Project: 179265
Buggy source:
/** 
 * Translates the field name into its JSON field name representation.
 * @param f the field object that we are translating
 * @return the translated field name.
 */
public String translateName(Field f);

Fixed version (ground truth):
/** 
 * Translates the field name into its JSON field name representation.
 * @param f the field object that we are translating
 * @return the translated field name.
 * @since 1.3
 */
public String translateName(Field f);
Program: 179266
Project: 179266
Buggy source:
/** 
 * Configures Gson to apply a specific naming policy strategy to an object's field during serialization and deserialization.
 * @param fieldNamingPolicy the actual naming strategy to apply to the fields
 * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
 */
private GsonBuilder setFieldNamingStrategy(FieldNamingStrategy fieldNamingPolicy){
  this.fieldNamingPolicy=new SerializedNameAnnotationInterceptingNamingPolicy(fieldNamingPolicy);
  return this;
}

Fixed version (ground truth):
/** 
 * Configures Gson to apply a specific naming policy strategy to an object's field during serialization and deserialization.
 * @param fieldNamingStrategy the actual naming strategy to apply to the fields
 * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
 * @since 1.3
 */
public GsonBuilder setFieldNamingStrategy(FieldNamingStrategy fieldNamingStrategy){
  this.fieldNamingPolicy=new SerializedNameAnnotationInterceptingNamingPolicy(fieldNamingStrategy);
  return this;
}
Program: 179267
Project: 179267
Buggy source:
public TreeSet<?> createInstance(Type type){
  return new TreeSet<Object>();
}

Fixed version (ground truth):
public HashSet<?> createInstance(Type type){
  return new HashSet<Object>();
}
Program: 179268
Project: 179268
Buggy source:
@Override public String toString(){
  return TreeSetCreator.class.getSimpleName();
}

Fixed version (ground truth):
@Override public String toString(){
  return HashSetCreator.class.getSimpleName();
}
Program: 179269
Project: 179269
Buggy source:
private static ParameterizedTypeHandlerMap<InstanceCreator<?>> createDefaultInstanceCreators(){
  ParameterizedTypeHandlerMap<InstanceCreator<?>> map=new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(List.class,COLLECTION_TYPE_ADAPTER);
  map.register(Queue.class,COLLECTION_TYPE_ADAPTER);
  map.register(Set.class,TREE_SET_CREATOR);
  map.register(SortedSet.class,TREE_SET_CREATOR);
  map.register(Properties.class,PROPERTIES_CREATOR);
  map.makeUnmodifiable();
  return map;
}

Fixed version (ground truth):
private static ParameterizedTypeHandlerMap<InstanceCreator<?>> createDefaultInstanceCreators(){
  ParameterizedTypeHandlerMap<InstanceCreator<?>> map=new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(List.class,COLLECTION_TYPE_ADAPTER);
  map.register(Queue.class,COLLECTION_TYPE_ADAPTER);
  map.register(Set.class,HASH_SET_CREATOR);
  map.register(SortedSet.class,HASH_SET_CREATOR);
  map.register(Properties.class,PROPERTIES_CREATOR);
  map.makeUnmodifiable();
  return map;
}
Program: 179270
Project: 179270
Buggy source:
private static ParameterizedTypeHandlerMap<InstanceCreator<?>> createDefaultInstanceCreators(){
  ParameterizedTypeHandlerMap<InstanceCreator<?>> map=new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(List.class,COLLECTION_TYPE_ADAPTER);
  map.register(Queue.class,COLLECTION_TYPE_ADAPTER);
  map.register(Set.class,HASH_SET_CREATOR);
  map.register(SortedSet.class,HASH_SET_CREATOR);
  map.register(Properties.class,PROPERTIES_CREATOR);
  map.makeUnmodifiable();
  return map;
}

Fixed version (ground truth):
private static ParameterizedTypeHandlerMap<InstanceCreator<?>> createDefaultInstanceCreators(){
  ParameterizedTypeHandlerMap<InstanceCreator<?>> map=new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(List.class,COLLECTION_TYPE_ADAPTER);
  map.register(Queue.class,COLLECTION_TYPE_ADAPTER);
  map.register(Set.class,HASH_SET_CREATOR);
  map.register(SortedSet.class,TREE_SET_CREATOR);
  map.register(Properties.class,PROPERTIES_CREATOR);
  map.makeUnmodifiable();
  return map;
}
Program: 179271
Project: 179271
Buggy source:
public void testSubInterfacesOfCollectionDeserialization() throws Exception {
  String json="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  ClassWithSubInterfacesOfCollection target=gson.fromJson(json,ClassWithSubInterfacesOfCollection.class);
  assertEquals(json,target.getExpectedJson());
}

Fixed version (ground truth):
public void testSubInterfacesOfCollectionDeserialization() throws Exception {
  String json="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  ClassWithSubInterfacesOfCollection target=gson.fromJson(json,ClassWithSubInterfacesOfCollection.class);
  assertTrue(target.listContains(0,1,2,3));
  assertTrue(target.queueContains(0,1,2,3));
  assertTrue(target.setContains(0.1F,0.2F,0.3F,0.4F));
  assertTrue(target.sortedSetContains('a','b','c','d'));
}
Program: 179272
Project: 179272
Buggy source:
private static ParameterizedTypeHandlerMap<InstanceCreator<?>> createDefaultInstanceCreators(){
  ParameterizedTypeHandlerMap<InstanceCreator<?>> map=new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
  map.register(Enum.class,ENUM_TYPE_ADAPTER);
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(List.class,COLLECTION_TYPE_ADAPTER);
  map.register(Queue.class,COLLECTION_TYPE_ADAPTER);
  map.register(Set.class,TREE_SET_CREATOR);
  map.register(SortedSet.class,TREE_SET_CREATOR);
  map.makeUnmodifiable();
  return map;
}

Fixed version (ground truth):
private static ParameterizedTypeHandlerMap<InstanceCreator<?>> createDefaultInstanceCreators(){
  ParameterizedTypeHandlerMap<InstanceCreator<?>> map=new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
  map.register(Enum.class,ENUM_TYPE_ADAPTER);
  map.register(Map.class,MAP_TYPE_ADAPTER);
  map.register(Collection.class,COLLECTION_TYPE_ADAPTER);
  map.register(List.class,COLLECTION_TYPE_ADAPTER);
  map.register(Queue.class,COLLECTION_TYPE_ADAPTER);
  map.register(Set.class,TREE_SET_CREATOR);
  map.register(SortedSet.class,TREE_SET_CREATOR);
  map.register(Properties.class,PROPERTIES_CREATOR);
  map.makeUnmodifiable();
  return map;
}
Program: 179273
Project: 179273
Buggy source:
public TypeInfoMap(Type mapType){
  if (!(mapType instanceof ParameterizedType)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  TypeInfo rawType=new TypeInfo(mapType);
  Preconditions.checkArgument(Map.class.isAssignableFrom(rawType.getRawClass()));
  this.mapType=(ParameterizedType)mapType;
}

Fixed version (ground truth):
public TypeInfoMap(Type mapType){
  if (mapType instanceof Class && Properties.class.isAssignableFrom((Class<?>)mapType)) {
    keyType=String.class;
    valueType=String.class;
  }
 else   if (mapType instanceof ParameterizedType) {
    TypeInfo rawType=new TypeInfo(mapType);
    Preconditions.checkArgument(Map.class.isAssignableFrom(rawType.getRawClass()));
    ParameterizedType paramType=(ParameterizedType)mapType;
    keyType=paramType.getActualTypeArguments()[0];
    valueType=paramType.getActualTypeArguments()[1];
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
}
Program: 179274
Project: 179274
Buggy source:
public Type getKeyType(){
  return mapType.getActualTypeArguments()[0];
}

Fixed version (ground truth):
public Type getKeyType(){
  return keyType;
}
Program: 179275
Project: 179275
Buggy source:
public Type getValueType(){
  return mapType.getActualTypeArguments()[1];
}

Fixed version (ground truth):
public Type getValueType(){
  return valueType;
}
Program: 179276
Project: 179276
Buggy source:
public void testPropertiesDeserialization(){
  String json="String_Node_Str";
  Properties props=gson.fromJson(json,Properties.class);
  assertEquals("String_Node_Str",props.get("String_Node_Str"));
}

Fixed version (ground truth):
public void testPropertiesDeserialization(){
  String json="String_Node_Str";
  Properties props=gson.fromJson(json,Properties.class);
  assertEquals("String_Node_Str",props.getProperty("String_Node_Str"));
}
Program: 179277
Project: 179277
Buggy source:
public void testPropertiesSerialization(){
  Properties props=new Properties();
  props.put("String_Node_Str","String_Node_Str");
  String json=gson.toJson(props);
  System.out.println(json);
}

Fixed version (ground truth):
public void testPropertiesSerialization(){
  Properties props=new Properties();
  props.setProperty("String_Node_Str","String_Node_Str");
  String json=gson.toJson(props);
  System.out.println(json);
}
Program: 179278
Project: 179278
Buggy source:
public void startObject(JsonObject object){
  delegate.startObject(object);
}

Fixed version (ground truth):
public void startObject(JsonObject object) throws IOException {
  delegate.startObject(object);
}
Program: 179279
Project: 179279
Buggy source:
public void startArray(JsonArray array){
  delegate.startArray(array);
}

Fixed version (ground truth):
public void startArray(JsonArray array) throws IOException {
  delegate.startArray(array);
}
Program: 179280
Project: 179280
Buggy source:
public void visitPrimitive(JsonPrimitive primitive){
  delegate.visitPrimitive(primitive);
}

Fixed version (ground truth):
public void visitPrimitive(JsonPrimitive primitive) throws IOException {
  delegate.visitPrimitive(primitive);
}
Program: 179281
Project: 179281
Buggy source:
public void visitNullArrayMember(JsonArray parent,boolean isFirst){
  delegate.visitNullArrayMember(parent,isFirst);
}

Fixed version (ground truth):
public void visitNullArrayMember(JsonArray parent,boolean isFirst) throws IOException {
  delegate.visitNullArrayMember(parent,isFirst);
}
Program: 179282
Project: 179282
Buggy source:
public void visitNull(){
  delegate.visitNull();
}

Fixed version (ground truth):
public void visitNull() throws IOException {
  delegate.visitNull();
}
Program: 179283
Project: 179283
Buggy source:
public void visitObjectMember(JsonObject parent,String memberName,JsonObject member,boolean isFirst){
  delegate.visitObjectMember(parent,memberName,member,isFirst);
}

Fixed version (ground truth):
public void visitObjectMember(JsonObject parent,String memberName,JsonObject member,boolean isFirst) throws IOException {
  delegate.visitObjectMember(parent,memberName,member,isFirst);
}
Program: 179284
Project: 179284
Buggy source:
public void visitNullObjectMember(JsonObject parent,String memberName,boolean isFirst){
  delegate.visitNullObjectMember(parent,memberName,isFirst);
}

Fixed version (ground truth):
public void visitNullObjectMember(JsonObject parent,String memberName,boolean isFirst) throws IOException {
  delegate.visitNullObjectMember(parent,memberName,isFirst);
}
Program: 179285
Project: 179285
Buggy source:
public void visitArrayMember(JsonArray parent,JsonObject member,boolean isFirst){
  delegate.visitArrayMember(parent,member,isFirst);
}

Fixed version (ground truth):
public void visitArrayMember(JsonArray parent,JsonObject member,boolean isFirst) throws IOException {
  delegate.visitArrayMember(parent,member,isFirst);
}
Program: 179286
Project: 179286
Buggy source:
public void endArray(JsonArray array){
  delegate.endArray(array);
}

Fixed version (ground truth):
public void endArray(JsonArray array) throws IOException {
  delegate.endArray(array);
}
Program: 179287
Project: 179287
Buggy source:
public void endObject(JsonObject object){
  delegate.endObject(object);
}

Fixed version (ground truth):
public void endObject(JsonObject object) throws IOException {
  delegate.endObject(object);
}
Program: 179288
Project: 179288
Buggy source:
/** 
 * Appends the   {@link #NULL_STRING} to the {@code writer} object.
 * @param writer the object to append the null value to
 */
private void writeOutNullString(Writer writer){
  try {
    writer.append(NULL_STRING);
  }
 catch (  IOException e) {
    throw new JsonParseException(e);
  }
}

Fixed version (ground truth):
/** 
 * Appends the   {@link #NULL_STRING} to the {@code writer} object.
 * @param writer the object to append the null value to
 */
private void writeOutNullString(Appendable writer) throws IOException {
  writer.append(NULL_STRING);
}