nus-yam/ex-repair huggingface dataset:
Program: 179353
Project: 179353
Buggy source:
public void testDefaultDateDeserialization(){
  Date date=new Date();
  assertEquals(date,gson.fromJson(gson.toJson(date),Date.class));
}

Fixed version (ground truth):
public void testDefaultDateDeserialization(){
  Date date=new Date();
  String json=gson.toJson(date);
  Date extracted=gson.fromJson(json,Date.class);
  assertEquals(date.toString(),extracted.toString());
}
Program: 179354
Project: 179354
Buggy source:
public void testDateDeserializationWithPattern() throws Exception {
  String pattern="String_Node_Str";
  DateFormat formatter=new SimpleDateFormat(pattern);
  Gson gson=new GsonBuilder().setDateFormat(DateFormat.LONG).setDateFormat(pattern).create();
  Date now=new Date();
  String json=gson.toJson(now);
  assertEquals(now,gson.fromJson(json,Date.class));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void testDateDeserializationWithPattern() throws Exception {
  String pattern="String_Node_Str";
  DateFormat formatter=new SimpleDateFormat(pattern);
  Gson gson=new GsonBuilder().setDateFormat(DateFormat.FULL).setDateFormat(pattern).create();
  Date now=new Date();
  String json=gson.toJson(now);
  Date extracted=gson.fromJson(json,Date.class);
  assertEquals(now.getYear(),extracted.getYear());
  assertEquals(now.getMonth(),extracted.getMonth());
  assertEquals(now.getDay(),extracted.getDay());
}
Program: 179355
Project: 179355
Buggy source:
public void testDefaultDateSerializationUsingBuilder() throws Exception {
  Gson gson=new GsonBuilder().create();
  Date now=new Date();
  String json=gson.toJson(now);
  assertEquals("String_Node_Str" + DateFormat.getDateInstance().format(now) + "String_Node_Str",json);
}

Fixed version (ground truth):
public void testDefaultDateSerializationUsingBuilder() throws Exception {
  Gson gson=new GsonBuilder().create();
  Date now=new Date();
  String json=gson.toJson(now);
  assertEquals("String_Node_Str" + DateFormat.getDateTimeInstance().format(now) + "String_Node_Str",json);
}
Program: 179356
Project: 179356
Buggy source:
public void testDefaultDateDeserializationUsingBuilder() throws Exception {
  Gson gson=new GsonBuilder().create();
  Date now=new Date();
  String json=gson.toJson(now);
  assertEquals(now,gson.fromJson(json,Date.class));
}

Fixed version (ground truth):
public void testDefaultDateDeserializationUsingBuilder() throws Exception {
  Gson gson=new GsonBuilder().create();
  Date now=new Date();
  String json=gson.toJson(now);
  Date extracted=gson.fromJson(json,Date.class);
  assertEquals(now.toString(),extracted.toString());
}
Program: 179357
Project: 179357
Buggy source:
public void visitPrimitiveField(Field f,Type typeOfF,Object obj){
  if (!isFieldNull(f,obj)) {
    TypeInfo typeInfo=new TypeInfo(typeOfF);
    if (typeInfo.isPrimitiveOrStringAndNotAnArray()) {
      Object fieldValue=getFieldValue(f,obj);
      addAsChildOfObject(f,typeOfF,fieldValue);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void visitPrimitiveField(Field f,Type typeOfF,Object obj){
  if (isFieldNull(f,obj)) {
    if (serializeNulls) {
      addChildAsElement(f,new JsonNull());
    }
  }
 else {
    TypeInfo typeInfo=new TypeInfo(typeOfF);
    if (typeInfo.isPrimitiveOrStringAndNotAnArray()) {
      Object fieldValue=getFieldValue(f,obj);
      addAsChildOfObject(f,typeOfF,fieldValue);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
}
Program: 179358
Project: 179358
Buggy source:
public void visitArrayField(Field f,Type typeOfF,Object obj){
  if (!isFieldNull(f,obj)) {
    Object array=getFieldValue(f,obj);
    addAsChildOfObject(f,typeOfF,array);
  }
}

Fixed version (ground truth):
public void visitArrayField(Field f,Type typeOfF,Object obj){
  if (isFieldNull(f,obj)) {
    if (serializeNulls) {
      addChildAsElement(f,new JsonNull());
    }
  }
 else {
    Object array=getFieldValue(f,obj);
    addAsChildOfObject(f,typeOfF,array);
  }
}
Program: 179359
Project: 179359
Buggy source:
public void visitCollectionField(Field f,Type typeOfF,Object obj){
  if (!isFieldNull(f,obj)) {
    if (typeOfF == null) {
      throw new RuntimeException("String_Node_Str");
    }
    Object collection=getFieldValue(f,obj);
    addAsChildOfObject(f,typeOfF,collection);
  }
}

Fixed version (ground truth):
public void visitCollectionField(Field f,Type typeOfF,Object obj){
  if (isFieldNull(f,obj)) {
    if (serializeNulls) {
      addChildAsElement(f,new JsonNull());
    }
  }
 else {
    if (typeOfF == null) {
      throw new RuntimeException("String_Node_Str");
    }
    Object collection=getFieldValue(f,obj);
    addAsChildOfObject(f,typeOfF,collection);
  }
}
Program: 179361
Project: 179361
Buggy source:
private static void jj_la1_0(){
  jj_la1_0=new int[]{0x16880c0,0x80,0x20000,0x1e880c0,0x20000,0x1e880c0,0x16000c0,0x2000000,0x20,0x1000000,0x4c00,0x4c00,0x4c00};
}

Fixed version (ground truth):
private static void jj_la1_0(){
  jj_la1_0=new int[]{0x1d180c0,0x80,0x40000,0x1d180c0,0x40000,0x1d180c0,0x1c000c0,0x2000000,0x20,0x1000000,0x4c00,0x4c00,0x4c00};
}
Program: 179362
Project: 179362
Buggy source:
final private JsonPrimitive JsonPrimitive() throws ParseException {
  JsonPrimitive value;
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case QUOTE:
    value=JsonString();
{
    if (true)     return value;
  }
break;
case DIGITS:
case 24:
value=JsonNumber();
{
if (true) return value;
}
break;
case 21:
jj_consume_token(21);
{
if (true) return new JsonPrimitive(true);
}
break;
case 22:
jj_consume_token(22);
{
if (true) return new JsonPrimitive(false);
}
break;
default :
jj_la1[6]=jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("String_Node_Str");
}

Fixed version (ground truth):
final private JsonPrimitive JsonPrimitive() throws ParseException {
  JsonPrimitive value;
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case QUOTE:
    value=JsonString();
{
    if (true)     return value;
  }
break;
case DIGITS:
case 24:
value=JsonNumber();
{
if (true) return value;
}
break;
case 22:
jj_consume_token(22);
{
if (true) return new JsonPrimitive(true);
}
break;
case 23:
jj_consume_token(23);
{
if (true) return new JsonPrimitive(false);
}
break;
default :
jj_la1[6]=jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("String_Node_Str");
}
Program: 179363
Project: 179363
Buggy source:
final private JsonObject JsonObject() throws ParseException {
  JsonObject o=new JsonObject();
  jj_consume_token(15);
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case QUOTE:
    Members(o);
  break;
default :
jj_la1[1]=jj_gen;
;
}
jj_consume_token(16);
{
if (true) return o;
}
throw new Error("String_Node_Str");
}

Fixed version (ground truth):
final private JsonObject JsonObject() throws ParseException {
  JsonObject o=new JsonObject();
  jj_consume_token(16);
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case QUOTE:
    Members(o);
  break;
default :
jj_la1[1]=jj_gen;
;
}
jj_consume_token(17);
{
if (true) return o;
}
throw new Error("String_Node_Str");
}
Program: 179364
Project: 179364
Buggy source:
final private void Elements(JsonArray array) throws ParseException {
  JsonElement element;
  element=JsonValue();
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 17:
    jj_consume_token(17);
  Elements(array);
break;
default :
jj_la1[4]=jj_gen;
;
}
array.add(element);
}

Fixed version (ground truth):
final private void Elements(JsonArray array) throws ParseException {
  JsonElement element;
  element=JsonValue();
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 18:
    jj_consume_token(18);
  Elements(array);
break;
default :
jj_la1[4]=jj_gen;
;
}
array.add(element);
}
Program: 179365
Project: 179365
Buggy source:
final private void Pair(JsonObject o) throws ParseException {
  JsonPrimitive property;
  JsonElement value;
  property=JsonString();
  jj_consume_token(18);
  value=JsonValue();
  o.add(property.getAsString(),value);
}

Fixed version (ground truth):
final private void Pair(JsonObject o) throws ParseException {
  JsonPrimitive property;
  JsonElement value;
  property=JsonString();
  jj_consume_token(19);
  value=JsonValue();
  o.add(property.getAsString(),value);
}
Program: 179366
Project: 179366
Buggy source:
final private JsonElement JsonValue() throws ParseException {
  JsonElement o=null;
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case QUOTE:
    o=JsonString();
  break;
case DIGITS:
case 24:
o=JsonNumber();
break;
case 15:
o=JsonObject();
break;
case 19:
o=JsonArray();
break;
case 21:
jj_consume_token(21);
o=new JsonPrimitive(true);
break;
case 22:
jj_consume_token(22);
o=new JsonPrimitive(false);
break;
case 23:
jj_consume_token(23);
break;
default :
jj_la1[5]=jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if (true) return o;
}
throw new Error("String_Node_Str");
}

Fixed version (ground truth):
final private JsonElement JsonValue() throws ParseException {
  JsonElement o=null;
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case QUOTE:
    o=JsonString();
  break;
case DIGITS:
case 24:
o=JsonNumber();
break;
case 16:
o=JsonObject();
break;
case 20:
o=JsonArray();
break;
case 22:
jj_consume_token(22);
o=new JsonPrimitive(true);
break;
case 23:
jj_consume_token(23);
o=new JsonPrimitive(false);
break;
case 15:
jj_consume_token(15);
break;
default :
jj_la1[5]=jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if (true) return o;
}
throw new Error("String_Node_Str");
}
Program: 179367
Project: 179367
Buggy source:
final public JsonElement parse() throws ParseException {
  JsonElement json;
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 15:
    json=JsonObject();
  break;
case 19:
json=JsonArray();
break;
case DIGITS:
case QUOTE:
case 21:
case 22:
case 24:
json=JsonPrimitive();
break;
default :
jj_la1[0]=jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if (true) return json;
}
throw new Error("String_Node_Str");
}

Fixed version (ground truth):
final public JsonElement parse() throws ParseException {
  JsonElement json=null;
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 16:
    json=JsonObject();
  break;
case 20:
json=JsonArray();
break;
case DIGITS:
case QUOTE:
case 22:
case 23:
case 24:
json=JsonPrimitive();
break;
case 15:
jj_consume_token(15);
break;
default :
jj_la1[0]=jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if (true) return json;
}
throw new Error("String_Node_Str");
}
Program: 179368
Project: 179368
Buggy source:
final private JsonArray JsonArray() throws ParseException {
  JsonArray array=new JsonArray();
  jj_consume_token(19);
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case DIGITS:
case QUOTE:
case 15:
case 19:
case 21:
case 22:
case 23:
case 24:
    Elements(array);
  break;
default :
jj_la1[3]=jj_gen;
;
}
jj_consume_token(20);
array.reverse();
{
if (true) return array;
}
throw new Error("String_Node_Str");
}

Fixed version (ground truth):
final private JsonArray JsonArray() throws ParseException {
  JsonArray array=new JsonArray();
  jj_consume_token(20);
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case DIGITS:
case QUOTE:
case 15:
case 16:
case 20:
case 22:
case 23:
case 24:
    Elements(array);
  break;
default :
jj_la1[3]=jj_gen;
;
}
jj_consume_token(21);
array.reverse();
{
if (true) return array;
}
throw new Error("String_Node_Str");
}
Program: 179369
Project: 179369
Buggy source:
final private void Members(JsonObject o) throws ParseException {
  Pair(o);
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 17:
    jj_consume_token(17);
  Members(o);
break;
default :
jj_la1[2]=jj_gen;
;
}
}

Fixed version (ground truth):
final private void Members(JsonObject o) throws ParseException {
  Pair(o);
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 18:
    jj_consume_token(18);
  Members(o);
break;
default :
jj_la1[2]=jj_gen;
;
}
}
Program: 179370
Project: 179370
Buggy source:
private final int jjMoveStringLiteralDfa2_0(long old0,long active0){
  if (((active0&=old0)) == 0L)   return jjStartNfa_0(0,old0);
  try {
    curChar=input_stream.readChar();
  }
 catch (  java.io.IOException e) {
    jjStopStringLiteralDfa_0(1,active0);
    return 2;
  }
switch (curChar) {
case 108:
    return jjMoveStringLiteralDfa3_0(active0,0xc00000L);
case 117:
  return jjMoveStringLiteralDfa3_0(active0,0x200000L);
default :
break;
}
return jjStartNfa_0(1,active0);
}

Fixed version (ground truth):
private final int jjMoveStringLiteralDfa2_0(long old0,long active0){
  if (((active0&=old0)) == 0L)   return jjStartNfa_0(0,old0);
  try {
    curChar=input_stream.readChar();
  }
 catch (  java.io.IOException e) {
    jjStopStringLiteralDfa_0(1,active0);
    return 2;
  }
switch (curChar) {
case 108:
    return jjMoveStringLiteralDfa3_0(active0,0x808000L);
case 117:
  return jjMoveStringLiteralDfa3_0(active0,0x400000L);
default :
break;
}
return jjStartNfa_0(1,active0);
}
Program: 179371
Project: 179371
Buggy source:
private final int jjMoveStringLiteralDfa1_0(long active0){
  try {
    curChar=input_stream.readChar();
  }
 catch (  java.io.IOException e) {
    jjStopStringLiteralDfa_0(0,active0);
    return 1;
  }
switch (curChar) {
case 97:
    return jjMoveStringLiteralDfa2_0(active0,0x400000L);
case 114:
  return jjMoveStringLiteralDfa2_0(active0,0x200000L);
case 117:
return jjMoveStringLiteralDfa2_0(active0,0x800000L);
default :
break;
}
return jjStartNfa_0(0,active0);
}

Fixed version (ground truth):
private final int jjMoveStringLiteralDfa1_0(long active0){
  try {
    curChar=input_stream.readChar();
  }
 catch (  java.io.IOException e) {
    jjStopStringLiteralDfa_0(0,active0);
    return 1;
  }
switch (curChar) {
case 97:
    return jjMoveStringLiteralDfa2_0(active0,0x800000L);
case 114:
  return jjMoveStringLiteralDfa2_0(active0,0x400000L);
case 117:
return jjMoveStringLiteralDfa2_0(active0,0x8000L);
default :
break;
}
return jjStartNfa_0(0,active0);
}
Program: 179372
Project: 179372
Buggy source:
private final int jjMoveStringLiteralDfa4_0(long old0,long active0){
  if (((active0&=old0)) == 0L)   return jjStartNfa_0(2,old0);
  try {
    curChar=input_stream.readChar();
  }
 catch (  java.io.IOException e) {
    jjStopStringLiteralDfa_0(3,active0);
    return 4;
  }
switch (curChar) {
case 101:
    if ((active0 & 0x400000L) != 0L)     return jjStopAtPos(4,22);
  break;
default :
break;
}
return jjStartNfa_0(3,active0);
}

Fixed version (ground truth):
private final int jjMoveStringLiteralDfa4_0(long old0,long active0){
  if (((active0&=old0)) == 0L)   return jjStartNfa_0(2,old0);
  try {
    curChar=input_stream.readChar();
  }
 catch (  java.io.IOException e) {
    jjStopStringLiteralDfa_0(3,active0);
    return 4;
  }
switch (curChar) {
case 101:
    if ((active0 & 0x800000L) != 0L)     return jjStopAtPos(4,23);
  break;
default :
break;
}
return jjStartNfa_0(3,active0);
}
Program: 179373
Project: 179373
Buggy source:
private final int jjMoveStringLiteralDfa3_0(long old0,long active0){
  if (((active0&=old0)) == 0L)   return jjStartNfa_0(1,old0);
  try {
    curChar=input_stream.readChar();
  }
 catch (  java.io.IOException e) {
    jjStopStringLiteralDfa_0(2,active0);
    return 3;
  }
switch (curChar) {
case 101:
    if ((active0 & 0x200000L) != 0L)     return jjStopAtPos(3,21);
  break;
case 108:
if ((active0 & 0x800000L) != 0L) return jjStopAtPos(3,23);
break;
case 115:
return jjMoveStringLiteralDfa4_0(active0,0x400000L);
default :
break;
}
return jjStartNfa_0(2,active0);
}

Fixed version (ground truth):
private final int jjMoveStringLiteralDfa3_0(long old0,long active0){
  if (((active0&=old0)) == 0L)   return jjStartNfa_0(1,old0);
  try {
    curChar=input_stream.readChar();
  }
 catch (  java.io.IOException e) {
    jjStopStringLiteralDfa_0(2,active0);
    return 3;
  }
switch (curChar) {
case 101:
    if ((active0 & 0x400000L) != 0L)     return jjStopAtPos(3,22);
  break;
case 108:
if ((active0 & 0x8000L) != 0L) return jjStopAtPos(3,15);
break;
case 115:
return jjMoveStringLiteralDfa4_0(active0,0x800000L);
default :
break;
}
return jjStartNfa_0(2,active0);
}
Program: 179374
Project: 179374
Buggy source:
private final int jjMoveStringLiteralDfa0_0(){
switch (curChar) {
case 34:
    return jjStopAtPos(0,7);
case 44:
  return jjStopAtPos(0,17);
case 45:
return jjStopAtPos(0,24);
case 46:
return jjStopAtPos(0,25);
case 58:
return jjStopAtPos(0,18);
case 91:
return jjStopAtPos(0,19);
case 93:
return jjStopAtPos(0,20);
case 102:
return jjMoveStringLiteralDfa1_0(0x400000L);
case 110:
return jjMoveStringLiteralDfa1_0(0x800000L);
case 116:
return jjMoveStringLiteralDfa1_0(0x200000L);
case 123:
return jjStopAtPos(0,15);
case 125:
return jjStopAtPos(0,16);
default :
return jjMoveNfa_0(0,0);
}
}

Fixed version (ground truth):
private final int jjMoveStringLiteralDfa0_0(){
switch (curChar) {
case 34:
    return jjStopAtPos(0,7);
case 44:
  return jjStopAtPos(0,18);
case 45:
return jjStopAtPos(0,24);
case 46:
return jjStopAtPos(0,25);
case 58:
return jjStopAtPos(0,19);
case 91:
return jjStopAtPos(0,20);
case 93:
return jjStopAtPos(0,21);
case 102:
return jjMoveStringLiteralDfa1_0(0x800000L);
case 110:
return jjMoveStringLiteralDfa1_0(0x8000L);
case 116:
return jjMoveStringLiteralDfa1_0(0x400000L);
case 123:
return jjStopAtPos(0,16);
case 125:
return jjStopAtPos(0,17);
default :
return jjMoveNfa_0(0,0);
}
}
Program: 179377
Project: 179377
Buggy source:
/** 
 * convenience method to get this element as a   {@link BigInteger}.
 * @return get this element as a {@link BigInteger}.
 * @throws ClassCastException if the value contained is not a valid {@link BigInteger}.
 */
@Override public BigInteger getAsBigInteger(){
  return (BigInteger)value;
}

Fixed version (ground truth):
/** 
 * convenience method to get this element as a   {@link BigInteger}.
 * @return get this element as a {@link BigInteger}.
 * @throws NumberFormatException if the value contained is not a valid {@link BigInteger}.
 */
@Override public BigInteger getAsBigInteger(){
  if (value instanceof BigInteger) {
    return (BigInteger)value;
  }
 else {
    return new BigInteger(value.toString());
  }
}
Program: 179378
Project: 179378
Buggy source:
/** 
 * convenience method to get this element as a   {@link BigDecimal}.
 * @return get this element as a {@link BigDecimal}.
 * @throws ClassCastException if the value contained is not a valid {@link BigDecimal}.
 */
@Override public BigDecimal getAsBigDecimal(){
  return (BigDecimal)value;
}

Fixed version (ground truth):
/** 
 * convenience method to get this element as a   {@link BigDecimal}.
 * @return get this element as a {@link BigDecimal}.
 * @throws NumberFormatException if the value contained is not a valid {@link BigDecimal}.
 */
@Override public BigDecimal getAsBigDecimal(){
  if (value instanceof BigDecimal) {
    return (BigDecimal)value;
  }
 else {
    return new BigDecimal(value.toString());
  }
}
Program: 179380
Project: 179380
Buggy source:
private final int jjMoveNfa_1(int startState,int curPos){
  int[] nextStates;
  int startsAt=0;
  jjnewStateCnt=2;
  int i=1;
  jjstateSet[0]=startState;
  int j, kind=0x7fffffff;
  for (; ; ) {
    if (++jjround == 0x7fffffff)     ReInitRounds();
    if (curChar < 64) {
      long l=1L << curChar;
      MatchLoop:       do {
switch (jjstateSet[--i]) {
case 0:
          if ((0xfffffffbffffffffL & l) != 0L) {
            if (kind > 10)             kind=10;
          }
 else           if (curChar == 34) {
            if (kind > 9)             kind=9;
          }
        break;
case 1:
      if ((0xfffffffbffffffffL & l) != 0L)       kind=10;
    break;
default :
  break;
}
}
 while (i != startsAt);
}
 else if (curChar < 128) {
long l=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
case 0:
if ((0xffffffffefffffffL & l) != 0L) kind=10;
break;
default :
break;
}
}
 while (i != startsAt);
}
 else {
int i2=(curChar & 0xff) >> 6;
long l2=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
case 0:
if ((jjbitVec0[i2] & l2) != 0L && kind > 10) kind=10;
break;
default :
break;
}
}
 while (i != startsAt);
}
if (kind != 0x7fffffff) {
jjmatchedKind=kind;
jjmatchedPos=curPos;
kind=0x7fffffff;
}
++curPos;
if ((i=jjnewStateCnt) == (startsAt=2 - (jjnewStateCnt=startsAt))) return curPos;
try {
curChar=input_stream.readChar();
}
 catch (java.io.IOException e) {
return curPos;
}
}
}

Fixed version (ground truth):
private final int jjMoveNfa_1(int startState,int curPos){
  int[] nextStates;
  int startsAt=0;
  jjnewStateCnt=2;
  int i=1;
  jjstateSet[0]=startState;
  int j, kind=0x7fffffff;
  for (; ; ) {
    if (++jjround == 0x7fffffff)     ReInitRounds();
    if (curChar < 64) {
      long l=1L << curChar;
      MatchLoop:       do {
switch (jjstateSet[--i]) {
case 0:
          if ((0xfffffffbffffffffL & l) != 0L) {
            if (kind > 10)             kind=10;
          }
 else           if (curChar == 34) {
            if (kind > 9)             kind=9;
          }
        break;
case 1:
      if ((0xfffffffbffffffffL & l) != 0L)       kind=10;
    break;
default :
  break;
}
}
 while (i != startsAt);
}
 else if (curChar < 128) {
long l=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
case 0:
if ((0xffffffffefffffffL & l) != 0L) kind=10;
break;
default :
break;
}
}
 while (i != startsAt);
}
 else {
int hiByte=(int)(curChar >> 8);
int i1=hiByte >> 6;
long l1=1L << (hiByte & 077);
int i2=(curChar & 0xff) >> 6;
long l2=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
case 0:
if (jjCanMove_0(hiByte,i1,i2,l1,l2) && kind > 10) kind=10;
break;
default :
break;
}
}
 while (i != startsAt);
}
if (kind != 0x7fffffff) {
jjmatchedKind=kind;
jjmatchedPos=curPos;
kind=0x7fffffff;
}
++curPos;
if ((i=jjnewStateCnt) == (startsAt=2 - (jjnewStateCnt=startsAt))) return curPos;
try {
curChar=input_stream.readChar();
}
 catch (java.io.IOException e) {
return curPos;
}
}
}
Program: 179381
Project: 179381
Buggy source:
private final int jjMoveNfa_2(int startState,int curPos){
  int[] nextStates;
  int startsAt=0;
  jjnewStateCnt=1;
  int i=1;
  jjstateSet[0]=startState;
  int j, kind=0x7fffffff;
  for (; ; ) {
    if (++jjround == 0x7fffffff)     ReInitRounds();
    if (curChar < 64) {
      long l=1L << curChar;
      MatchLoop:       do {
switch (jjstateSet[--i]) {
case 0:
          if ((0x800400000000L & l) != 0L)           kind=11;
        break;
default :
      break;
  }
}
 while (i != startsAt);
}
 else if (curChar < 128) {
long l=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
case 0:
    if ((0x14404410000000L & l) != 0L)     kind=11;
  break;
default :
break;
}
}
 while (i != startsAt);
}
 else {
int i2=(curChar & 0xff) >> 6;
long l2=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
default :
break;
}
}
 while (i != startsAt);
}
if (kind != 0x7fffffff) {
jjmatchedKind=kind;
jjmatchedPos=curPos;
kind=0x7fffffff;
}
++curPos;
if ((i=jjnewStateCnt) == (startsAt=1 - (jjnewStateCnt=startsAt))) return curPos;
try {
curChar=input_stream.readChar();
}
 catch (java.io.IOException e) {
return curPos;
}
}
}

Fixed version (ground truth):
private final int jjMoveNfa_2(int startState,int curPos){
  int[] nextStates;
  int startsAt=0;
  jjnewStateCnt=1;
  int i=1;
  jjstateSet[0]=startState;
  int j, kind=0x7fffffff;
  for (; ; ) {
    if (++jjround == 0x7fffffff)     ReInitRounds();
    if (curChar < 64) {
      long l=1L << curChar;
      MatchLoop:       do {
switch (jjstateSet[--i]) {
case 0:
          if ((0x800400000000L & l) != 0L)           kind=11;
        break;
default :
      break;
  }
}
 while (i != startsAt);
}
 else if (curChar < 128) {
long l=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
case 0:
    if ((0x14404410000000L & l) != 0L)     kind=11;
  break;
default :
break;
}
}
 while (i != startsAt);
}
 else {
int hiByte=(int)(curChar >> 8);
int i1=hiByte >> 6;
long l1=1L << (hiByte & 077);
int i2=(curChar & 0xff) >> 6;
long l2=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
default :
break;
}
}
 while (i != startsAt);
}
if (kind != 0x7fffffff) {
jjmatchedKind=kind;
jjmatchedPos=curPos;
kind=0x7fffffff;
}
++curPos;
if ((i=jjnewStateCnt) == (startsAt=1 - (jjnewStateCnt=startsAt))) return curPos;
try {
curChar=input_stream.readChar();
}
 catch (java.io.IOException e) {
return curPos;
}
}
}
Program: 179382
Project: 179382
Buggy source:
private final int jjMoveNfa_0(int startState,int curPos){
  int[] nextStates;
  int startsAt=0;
  jjnewStateCnt=3;
  int i=1;
  jjstateSet[0]=startState;
  int j, kind=0x7fffffff;
  for (; ; ) {
    if (++jjround == 0x7fffffff)     ReInitRounds();
    if (curChar < 64) {
      long l=1L << curChar;
      MatchLoop:       do {
switch (jjstateSet[--i]) {
case 0:
case 2:
          if ((0x3ff000000000000L & l) == 0L)           break;
        kind=6;
      jjCheckNAdd(2);
    break;
case 1:
  if ((0x280000000000L & l) != 0L)   kind=5;
break;
default :
break;
}
}
 while (i != startsAt);
}
 else if (curChar < 128) {
long l=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
case 0:
if ((0x2000000020L & l) == 0L) break;
kind=5;
jjstateSet[jjnewStateCnt++]=1;
break;
default :
break;
}
}
 while (i != startsAt);
}
 else {
int i2=(curChar & 0xff) >> 6;
long l2=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
default :
break;
}
}
 while (i != startsAt);
}
if (kind != 0x7fffffff) {
jjmatchedKind=kind;
jjmatchedPos=curPos;
kind=0x7fffffff;
}
++curPos;
if ((i=jjnewStateCnt) == (startsAt=3 - (jjnewStateCnt=startsAt))) return curPos;
try {
curChar=input_stream.readChar();
}
 catch (java.io.IOException e) {
return curPos;
}
}
}

Fixed version (ground truth):
private final int jjMoveNfa_0(int startState,int curPos){
  int[] nextStates;
  int startsAt=0;
  jjnewStateCnt=3;
  int i=1;
  jjstateSet[0]=startState;
  int j, kind=0x7fffffff;
  for (; ; ) {
    if (++jjround == 0x7fffffff)     ReInitRounds();
    if (curChar < 64) {
      long l=1L << curChar;
      MatchLoop:       do {
switch (jjstateSet[--i]) {
case 0:
case 2:
          if ((0x3ff000000000000L & l) == 0L)           break;
        kind=6;
      jjCheckNAdd(2);
    break;
case 1:
  if ((0x280000000000L & l) != 0L)   kind=5;
break;
default :
break;
}
}
 while (i != startsAt);
}
 else if (curChar < 128) {
long l=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
case 0:
if ((0x2000000020L & l) == 0L) break;
kind=5;
jjstateSet[jjnewStateCnt++]=1;
break;
default :
break;
}
}
 while (i != startsAt);
}
 else {
int hiByte=(int)(curChar >> 8);
int i1=hiByte >> 6;
long l1=1L << (hiByte & 077);
int i2=(curChar & 0xff) >> 6;
long l2=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
default :
break;
}
}
 while (i != startsAt);
}
if (kind != 0x7fffffff) {
jjmatchedKind=kind;
jjmatchedPos=curPos;
kind=0x7fffffff;
}
++curPos;
if ((i=jjnewStateCnt) == (startsAt=3 - (jjnewStateCnt=startsAt))) return curPos;
try {
curChar=input_stream.readChar();
}
 catch (java.io.IOException e) {
return curPos;
}
}
}
Program: 179383
Project: 179383
Buggy source:
public MapTypeInfo(Type mapType){
  this.mapType=(ParameterizedType)mapType;
}

Fixed version (ground truth):
public MapTypeInfo(Type mapType){
  if (!(mapType instanceof ParameterizedType)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  TypeInfo<Object> rawType=new TypeInfo<Object>(mapType);
  Preconditions.checkArgument(Map.class.isAssignableFrom(rawType.getTopLevelClass()));
  this.mapType=(ParameterizedType)mapType;
}
Program: 179384
Project: 179384
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)} 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>
 * @return Json representation of src.
 */
public String toJson(Object src,Type typeOfSrc){
  if (src == null) {
    return "String_Node_Str";
  }
  JsonSerializationContext context=new JsonSerializationContextDefault(navigatorFactory,serializeNulls,serializers);
  JsonElement jsonElement=context.serialize(src,typeOfSrc);
  StringWriter writer=new StringWriter();
  formatter.format(jsonElement,new PrintWriter(writer),serializeNulls);
  return jsonElement == null ? "String_Node_Str" : writer.toString();
}

Fixed version (ground truth):
/** 
 * 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,Writer)} 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.
 */
public void toJson(Object src,Type typeOfSrc,Writer writer){
  if (src == null) {
    return;
  }
  JsonSerializationContext context=new JsonSerializationContextDefault(navigatorFactory,serializeNulls,serializers);
  JsonElement jsonElement=context.serialize(src,typeOfSrc);
  formatter.format(jsonElement,new PrintWriter(writer),serializeNulls);
}
Program: 179386
Project: 179386
Buggy source:
PrintFormattingVisitor(JsonWriter writer){
  this.writer=writer;
}

Fixed version (ground truth):
PrintFormattingVisitor(JsonWriter writer){
  this.writer=writer;
  this.first=new HashMap<Integer,Boolean>();
}
Program: 179387
Project: 179387
Buggy source:
public void startArray(JsonArray array){
  writer.beginArray();
}

Fixed version (ground truth):
public void startArray(JsonArray array){
  first.put(++level,true);
  writer.beginArray();
}
Program: 179388
Project: 179388
Buggy source:
private void addCommaCheckingFirst(){
  if (first) {
    first=false;
  }
 else {
    writer.elementSeparator();
  }
}

Fixed version (ground truth):
private void addCommaCheckingFirst(){
  if (first.get(level) != Boolean.FALSE) {
    first.put(level,false);
  }
 else {
    writer.elementSeparator();
  }
}
Program: 179389
Project: 179389
Buggy source:
public void endArray(JsonArray array){
  writer.endArray();
}

Fixed version (ground truth):
public void endArray(JsonArray array){
  level--;
  writer.endArray();
}
Program: 179390
Project: 179390
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public <T>T adaptType(Object from,Class<T> to){
  Class<?> aClass=Primitives.wrap(to);
  if (Primitives.isWrapperType(aClass)) {
    if (aClass == Character.class) {
      return (T)(Character)from.toString().charAt(0);
    }
    try {
      Constructor<?> constructor=aClass.getConstructor(String.class);
      return (T)constructor.newInstance(from.toString());
    }
 catch (    NoSuchMethodException e) {
      throw new JsonParseException(e);
    }
catch (    IllegalAccessException e) {
      throw new JsonParseException(e);
    }
catch (    InvocationTargetException e) {
      throw new JsonParseException(e);
    }
catch (    InstantiationException e) {
      throw new JsonParseException(e);
    }
  }
 else   if (Enum.class.isAssignableFrom(to)) {
    try {
      Method valuesMethod=to.getMethod("String_Node_Str",String.class);
      return (T)valuesMethod.invoke(null,from.toString());
    }
 catch (    NoSuchMethodException e) {
      throw new RuntimeException(e);
    }
catch (    IllegalAccessException e) {
      throw new RuntimeException(e);
    }
catch (    InvocationTargetException e) {
      throw new RuntimeException(e);
    }
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + from.getClass() + "String_Node_Str"+ to);
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public <T>T adaptType(Object from,Class<T> to){
  Class<?> aClass=Primitives.wrap(to);
  if (Primitives.isWrapperType(aClass)) {
    if (aClass == Character.class) {
      String value=from.toString();
      if (value.length() == 1) {
        return (T)(Character)from.toString().charAt(0);
      }
 else {
        throw new JsonParseException("String_Node_Str" + value + "String_Node_Str");
      }
    }
    try {
      Constructor<?> constructor=aClass.getConstructor(String.class);
      return (T)constructor.newInstance(from.toString());
    }
 catch (    NoSuchMethodException e) {
      throw new JsonParseException(e);
    }
catch (    IllegalAccessException e) {
      throw new JsonParseException(e);
    }
catch (    InvocationTargetException e) {
      throw new JsonParseException(e);
    }
catch (    InstantiationException e) {
      throw new JsonParseException(e);
    }
  }
 else   if (Enum.class.isAssignableFrom(to)) {
    try {
      Method valuesMethod=to.getMethod("String_Node_Str",String.class);
      return (T)valuesMethod.invoke(null,from.toString());
    }
 catch (    NoSuchMethodException e) {
      throw new RuntimeException(e);
    }
catch (    IllegalAccessException e) {
      throw new RuntimeException(e);
    }
catch (    InvocationTargetException e) {
      throw new RuntimeException(e);
    }
  }
 else {
    throw new JsonParseException("String_Node_Str" + from.getClass() + "String_Node_Str"+ to);
  }
}
Program: 179392
Project: 179392
Buggy source:
@SuppressWarnings("String_Node_Str") final Object visitChildAsObject(Type childType,JsonElement jsonChild){
  if (jsonChild == null) {
    return null;
  }
  JsonDeserializationVisitor<?> childVisitor=new JsonObjectDeserializationVisitor<Object>(jsonChild,childType,factory,objectConstructor,typeAdapter,deserializers,context);
  return visitChild(childType,childVisitor);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") final Object visitChildAsObject(Type childType,JsonElement jsonChild){
  JsonDeserializationVisitor<?> childVisitor=new JsonObjectDeserializationVisitor<Object>(jsonChild,childType,factory,objectConstructor,typeAdapter,deserializers,context);
  return visitChild(childType,childVisitor);
}
Program: 179393
Project: 179393
Buggy source:
@SuppressWarnings("String_Node_Str") final Object visitChildAsArray(Type childType,JsonArray jsonChild){
  if (jsonChild == null) {
    return null;
  }
  JsonDeserializationVisitor<?> childVisitor=new JsonArrayDeserializationVisitor<Object>(jsonChild.getAsJsonArray(),childType,factory,objectConstructor,typeAdapter,deserializers,context);
  return visitChild(childType,childVisitor);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") final Object visitChildAsArray(Type childType,JsonArray jsonChild){
  JsonDeserializationVisitor<?> childVisitor=new JsonArrayDeserializationVisitor<Object>(jsonChild.getAsJsonArray(),childType,factory,objectConstructor,typeAdapter,deserializers,context);
  return visitChild(childType,childVisitor);
}
Program: 179394
Project: 179394
Buggy source:
public void visitArrayField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    if (jsonObject.has(fName)) {
      JsonArray jsonChild=(JsonArray)jsonObject.get(fName);
      Object array=visitChildAsArray(f.getType(),jsonChild);
      f.set(obj,array);
    }
 else {
      f.set(obj,null);
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void visitArrayField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    JsonArray jsonChild=(JsonArray)jsonObject.get(fName);
    if (jsonChild != null) {
      Object array=visitChildAsArray(f.getType(),jsonChild);
      f.set(obj,array);
    }
 else {
      f.set(obj,null);
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}
Program: 179395
Project: 179395
Buggy source:
@SuppressWarnings("String_Node_Str") public void visitCollectionField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    if (jsonObject.has(fName)) {
      Collection collection=(Collection)objectConstructor.construct(f.getType());
      f.set(obj,collection);
      Type childType=new TypeInfo(f.getGenericType()).getGenericClass();
      JsonArray jsonArray=jsonObject.get(fName).getAsJsonArray();
      for (      JsonElement jsonChild : jsonArray) {
        Object child=visitChild(childType,jsonChild);
        if (childType == Object.class) {
          throw new JsonParseException(fName + "String_Node_Str");
        }
        collection.add(child);
      }
    }
 else {
      f.set(obj,null);
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void visitCollectionField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    JsonArray jsonArray=(JsonArray)jsonObject.get(fName);
    if (jsonArray != null) {
      Collection collection=(Collection)objectConstructor.construct(f.getType());
      f.set(obj,collection);
      Type childType=new TypeInfo(f.getGenericType()).getGenericClass();
      for (      JsonElement jsonChild : jsonArray) {
        Object child=visitChild(childType,jsonChild);
        if (childType == Object.class) {
          throw new JsonParseException(fName + "String_Node_Str");
        }
        collection.add(child);
      }
    }
 else {
      f.set(obj,null);
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}
Program: 179396
Project: 179396
Buggy source:
public void visitPrimitiveField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    if (jsonObject.has(fName)) {
      JsonPrimitive value=jsonObject.getAsJsonPrimitive(fName);
      if (value == null) {
        throw new JsonParseException("String_Node_Str" + fName + "String_Node_Str");
      }
      f.set(obj,typeAdapter.adaptType(value.getAsObject(),f.getType()));
    }
 else {
      if (f.getType() == String.class) {
        f.set(obj,null);
      }
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void visitPrimitiveField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    JsonPrimitive value=jsonObject.getAsJsonPrimitive(fName);
    if (value != null) {
      f.set(obj,typeAdapter.adaptType(value.getAsObject(),f.getType()));
    }
 else {
      if (f.getType() == String.class) {
        f.set(obj,null);
      }
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}
Program: 179397
Project: 179397
Buggy source:
public void visitObjectField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    if (jsonObject.has(fName)) {
      JsonElement jsonChild=jsonObject.get(fName);
      Type fieldType=f.getGenericType();
      Object child=visitChildAsObject(fieldType,jsonChild);
      f.set(obj,child);
    }
 else {
      f.set(obj,null);
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void visitObjectField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    JsonElement jsonChild=jsonObject.get(fName);
    if (jsonChild != null) {
      Type fieldType=f.getGenericType();
      Object child=visitChildAsObject(fieldType,jsonChild);
      f.set(obj,child);
    }
 else {
      f.set(obj,null);
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}
Program: 179398
Project: 179398
Buggy source:
/** 
 * Created in response to Issue 14: http://code.google.com/p/google-gson/issues/detail?id=14
 */
public void testNullPrimitiveFields(){
  try {
    String json="String_Node_Str";
    gson.fromJson(json,BagOfPrimitives.class);
    fail("String_Node_Str");
  }
 catch (  JsonParseException expected) {
  }
}

Fixed version (ground truth):
/** 
 * Created in response to Issue 14: http://code.google.com/p/google-gson/issues/detail?id=14
 */
public void testNullPrimitiveFields(){
  String json="String_Node_Str";
  BagOfPrimitives target=gson.fromJson(json,BagOfPrimitives.class);
  assertEquals(BagOfPrimitives.DEFAULT_VALUE,target.longValue);
}
Program: 179399
Project: 179399
Buggy source:
@SuppressWarnings("String_Node_Str") final Object visitChildAsObject(Type childType,JsonElement jsonChild){
  JsonDeserializationVisitor<?> childVisitor=new JsonObjectDeserializationVisitor<Object>(jsonChild,childType,factory,objectConstructor,typeAdapter,deserializers,context);
  return visitChild(childType,childVisitor);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") final Object visitChildAsObject(Type childType,JsonElement jsonChild){
  if (jsonChild == null) {
    return null;
  }
  JsonDeserializationVisitor<?> childVisitor=new JsonObjectDeserializationVisitor<Object>(jsonChild,childType,factory,objectConstructor,typeAdapter,deserializers,context);
  return visitChild(childType,childVisitor);
}
Program: 179400
Project: 179400
Buggy source:
@SuppressWarnings("String_Node_Str") final Object visitChildAsPrimitive(Type childType,JsonPrimitive jsonChild){
  Class<?> childClass;
  if (childType instanceof Class) {
    childClass=(Class)childType;
  }
 else {
    TypeInfo<?> childTypeInfo=new TypeInfo(childType);
    Type genericClass=childTypeInfo.getGenericClass();
    childClass=new TypeInfo(genericClass).getTopLevelClass();
  }
  return typeAdapter.adaptType(jsonChild.getAsObject(),childClass);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") final Object visitChildAsPrimitive(Type childType,JsonPrimitive jsonChild){
  Preconditions.checkNotNull(jsonChild);
  Class<?> childClass;
  if (childType instanceof Class) {
    childClass=(Class)childType;
  }
 else {
    TypeInfo<?> childTypeInfo=new TypeInfo(childType);
    Type genericClass=childTypeInfo.getGenericClass();
    childClass=new TypeInfo(genericClass).getTopLevelClass();
  }
  return typeAdapter.adaptType(jsonChild.getAsObject(),childClass);
}
Program: 179401
Project: 179401
Buggy source:
@SuppressWarnings("String_Node_Str") final Object visitChildAsArray(Type childType,JsonArray jsonChild){
  JsonDeserializationVisitor<?> childVisitor=new JsonArrayDeserializationVisitor<Object>(jsonChild.getAsJsonArray(),childType,factory,objectConstructor,typeAdapter,deserializers,context);
  return visitChild(childType,childVisitor);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") final Object visitChildAsArray(Type childType,JsonArray jsonChild){
  if (jsonChild == null) {
    return null;
  }
  JsonDeserializationVisitor<?> childVisitor=new JsonArrayDeserializationVisitor<Object>(jsonChild.getAsJsonArray(),childType,factory,objectConstructor,typeAdapter,deserializers,context);
  return visitChild(childType,childVisitor);
}
Program: 179402
Project: 179402
Buggy source:
public void visitPrimitiveField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    if (jsonObject.has(fName)) {
      JsonPrimitive value=jsonObject.getAsJsonPrimitive(fName);
      f.set(obj,typeAdapter.adaptType(value.getAsObject(),f.getType()));
    }
 else {
      if (f.getType() == String.class) {
        f.set(obj,null);
      }
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void visitPrimitiveField(Field f,Object obj){
  try {
    JsonObject jsonObject=json.getAsJsonObject();
    String fName=f.getName();
    if (jsonObject.has(fName)) {
      JsonPrimitive value=jsonObject.getAsJsonPrimitive(fName);
      if (value == null) {
        throw new JsonParseException("String_Node_Str" + fName + "String_Node_Str");
      }
      f.set(obj,typeAdapter.adaptType(value.getAsObject(),f.getType()));
    }
 else {
      if (f.getType() == String.class) {
        f.set(obj,null);
      }
    }
  }
 catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}
Program: 179403
Project: 179403
Buggy source:
public void visitArray(Object array,Type arrayType){
  JsonArray jsonArray=json.getAsJsonArray();
  TypeInfo<?> arrayTypeInfo=new TypeInfo<Object>(arrayType);
  for (int i=0; i < jsonArray.size(); i++) {
    JsonElement jsonChild=jsonArray.get(i);
    Object child;
    if (jsonChild instanceof JsonObject) {
      child=visitChildAsObject(arrayTypeInfo.getComponentType(),jsonChild);
    }
 else     if (jsonChild instanceof JsonArray) {
      child=visitChildAsArray(arrayTypeInfo.getSecondLevelClass(),jsonChild.getAsJsonArray());
    }
 else     if (jsonChild instanceof JsonPrimitive) {
      child=visitChildAsPrimitive(arrayTypeInfo.getComponentType(),jsonChild.getAsJsonPrimitive());
    }
 else {
      throw new IllegalStateException();
    }
    Array.set(array,i,child);
  }
}

Fixed version (ground truth):
public void visitArray(Object array,Type arrayType){
  JsonArray jsonArray=json.getAsJsonArray();
  TypeInfo<?> arrayTypeInfo=new TypeInfo<Object>(arrayType);
  for (int i=0; i < jsonArray.size(); i++) {
    JsonElement jsonChild=jsonArray.get(i);
    Object child;
    if (jsonChild == null) {
      child=null;
    }
 else     if (jsonChild instanceof JsonObject) {
      child=visitChildAsObject(arrayTypeInfo.getComponentType(),jsonChild);
    }
 else     if (jsonChild instanceof JsonArray) {
      child=visitChildAsArray(arrayTypeInfo.getSecondLevelClass(),jsonChild.getAsJsonArray());
    }
 else     if (jsonChild instanceof JsonPrimitive) {
      child=visitChildAsPrimitive(arrayTypeInfo.getComponentType(),jsonChild.getAsJsonPrimitive());
    }
 else {
      throw new IllegalStateException();
    }
    Array.set(array,i,child);
  }
}
Program: 179404
Project: 179404
Buggy source:
private void addAsArrayElement(Type elementType,Object elementValue){
  JsonElement childElement=getJsonElementForChild(elementType,elementValue);
  root.getAsJsonArray().add(childElement);
}

Fixed version (ground truth):
private void addAsArrayElement(Type elementType,Object elementValue){
  if (elementValue == null) {
    addNullAsArrayElement();
  }
 else {
    JsonElement childElement=getJsonElementForChild(elementType,elementValue);
    root.getAsJsonArray().add(childElement);
  }
}
Program: 179405
Project: 179405
Buggy source:
@SuppressWarnings("String_Node_Str") public void visitCollection(Collection collection,Type collectionType){
  assignToRoot(new JsonArray());
  for (  Object child : collection) {
    addAsArrayElement(child.getClass(),child);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void visitCollection(Collection collection,Type collectionType){
  assignToRoot(new JsonArray());
  for (  Object child : collection) {
    TypeInfo<?> collectionTypeInfo=new TypeInfo<Object>(collectionType);
    Type childType=collectionTypeInfo.getGenericClass();
    if (childType == Object.class && child != null) {
      childType=child.getClass();
    }
    addAsArrayElement(childType,child);
  }
}