Program: 44158
Project: 44158
Buggy source:
private void parseObjectInto(ParseContext cx,JSONTokenizer tokenizer) throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
  boolean containerIsMap=Map.class.isAssignableFrom(cx.target.getClass());
  boolean containerIsDynAttrs=cx.target instanceof DynamicProperties;
  boolean first=true;
  while (true) {
    Token key;
    if (first) {
      key=tokenizer.expectNext(TokenType.STRING,TokenType.BRACE_CLOSE);
    }
 else {
      key=tokenizer.expectNext(TokenType.COMMA,TokenType.BRACE_CLOSE);
    }
    if (key.type() == TokenType.BRACE_CLOSE) {
      break;
    }
    if (!first) {
      key=tokenizer.expectNext(TokenType.STRING);
    }
    String jsonName=(String)key.value();
    if (jsonName.length() == 0) {
      throw new JSONParseException("String_Node_Str");
    }
    String name=null;
    tokenizer.expectNext(TokenType.COLON);
    Token valueToken=tokenizer.next();
    TokenType valueType=valueToken.type();
    boolean isProperty=false;
    boolean isIgnoredOnParse=false;
    JSONClassInfo classInfo=null;
    JSONPropertyInfo propertyInfo=null;
    if (!containerIsMap) {
      classInfo=TypeAnalyzer.getClassInfo(objectSupport,cx.target.getClass());
      propertyInfo=classInfo.getPropertyInfo(jsonName);
      if (propertyInfo != null) {
        name=propertyInfo.getJavaPropertyName();
      }
      isProperty=false;
      isIgnoredOnParse=false;
      if (name != null) {
        boolean writeable=propertyInfo.isWriteable();
        isIgnoredOnParse=(!writeable && propertyInfo.isReadOnly());
        if (propertyInfo.isLinkedProperty()) {
          isIgnoredOnParse=true;
        }
        isProperty=writeable || isIgnoredOnParse;
      }
    }
    TypeConverter typeConverter=propertyInfo == null ? null : propertyInfo.getTypeConverter();
    if (!(isProperty || containerIsMap || containerIsDynAttrs|| (propertyInfo != null && propertyInfo.canAdd()))) {
      throw new JSONParseException("String_Node_Str" + jsonName + "String_Node_Str"+ cx.target.getClass());
    }
    if (name == null) {
      name=jsonName;
    }
    Class typeHint=getTypeHint(cx,cx.getParsePathInfo(jsonName),tokenizer,name,isProperty,valueType.isPrimitive());
    Object value;
    if (valueType.isPrimitive()) {
      value=valueToken.value();
    }
 else {
      Object newTarget=null;
      if (valueType == TokenType.BRACE_OPEN) {
        Class memberType=null;
        if (isProperty) {
          JSONPropertyInfo propertyInfo2=TypeAnalyzer.getClassInfo(objectSupport,cx.target.getClass()).getPropertyInfo(name);
          if (propertyInfo2 != null) {
            memberType=propertyInfo2.getTypeHint();
          }
        }
        newTarget=createNewTargetInstance(typeHint,true);
        parseObjectInto(cx.push(newTarget,memberType,"String_Node_Str" + name),tokenizer);
      }
 else       if (valueType == TokenType.BRACKET_OPEN) {
        if (isProperty || containerIsMap || containerIsDynAttrs) {
          Class arrayTypeHint=typeHint;
          if (isProperty) {
            if (typeConverter != null && !List.class.isAssignableFrom(arrayTypeHint)) {
              arrayTypeHint=List.class;
            }
          }
          newTarget=createNewTargetInstance(arrayTypeHint,false);
          JSONPropertyInfo propertyInfo2=TypeAnalyzer.getClassInfo(objectSupport,cx.target.getClass()).getPropertyInfo(name);
          Class memberType=null;
          if (propertyInfo2 != null) {
            memberType=propertyInfo2.getTypeHint();
          }
          parseArrayInto(cx.push(newTarget,memberType,"String_Node_Str" + name),tokenizer);
        }
 else {
          if (propertyInfo.canAdd()) {
            List temp=new ArrayList();
            parseArrayInto(cx.push(temp,propertyInfo.getAdderType(),"String_Node_Str" + name),tokenizer);
            for (            Object o : temp) {
              propertyInfo.add(cx.target,o);
            }
            continue;
          }
 else {
            throw new JSONParseException("String_Node_Str" + name + "String_Node_Str"+ cx.target);
          }
        }
      }
 else {
        throw new JSONParseException("String_Node_Str" + valueToken);
      }
      value=newTarget;
    }
    if (typeConverter != null && !isIgnoredOnParse) {
      value=typeConverter.fromJSON(value);
    }
    if (typeHint == null && propertyInfo != null) {
      typeHint=propertyInfo.getTypeOfProperty();
    }
    if (typeHint != null && !isIgnoredOnParse) {
      value=convertValueTo(value,typeHint);
    }
    if (isProperty) {
      if (!isIgnoredOnParse) {
        propertyInfo.setProperty(cx.target,value);
      }
    }
 else     if (containerIsMap) {
      ((Map)cx.target).put(name,value);
    }
 else     if (containerIsDynAttrs) {
      ((DynamicProperties)cx.target).setProperty(name,value);
    }
 else {
      throw new JSONParseException("String_Node_Str" + name + "String_Node_Str"+ cx.target);
    }
    first=false;
  }
}

Fixed version (ground truth):
private void parseObjectInto(ParseContext cx,JSONTokenizer tokenizer) throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
  boolean containerIsMap=Map.class.isAssignableFrom(cx.target.getClass());
  boolean containerIsDynAttrs=cx.target instanceof DynamicProperties;
  boolean first=true;
  while (true) {
    Token key;
    if (first) {
      key=tokenizer.expectNext(TokenType.STRING,TokenType.BRACE_CLOSE);
    }
 else {
      key=tokenizer.expectNext(TokenType.COMMA,TokenType.BRACE_CLOSE);
    }
    if (key.type() == TokenType.BRACE_CLOSE) {
      break;
    }
    if (!first) {
      key=tokenizer.expectNext(TokenType.STRING);
    }
    String jsonName=(String)key.value();
    if (jsonName.length() == 0) {
      throw new JSONParseException("String_Node_Str");
    }
    String name=null;
    tokenizer.expectNext(TokenType.COLON);
    Token valueToken=tokenizer.next();
    TokenType valueType=valueToken.type();
    boolean isProperty=false;
    boolean isIgnoredOnParse=false;
    JSONClassInfo classInfo=null;
    JSONPropertyInfo propertyInfo=null;
    if (!containerIsMap) {
      classInfo=TypeAnalyzer.getClassInfo(objectSupport,cx.target.getClass());
      propertyInfo=classInfo.getPropertyInfo(jsonName);
      if (propertyInfo != null) {
        name=propertyInfo.getJavaPropertyName();
      }
      isProperty=false;
      isIgnoredOnParse=false;
      if (name != null) {
        boolean writeable=propertyInfo.isWriteable();
        isIgnoredOnParse=(!writeable && propertyInfo.isReadOnly());
        if (propertyInfo.isLinkedProperty()) {
          isIgnoredOnParse=true;
        }
        isProperty=writeable || isIgnoredOnParse;
      }
    }
    TypeConverter typeConverter=propertyInfo == null ? null : propertyInfo.getTypeConverter();
    if (!(isProperty || containerIsMap || containerIsDynAttrs|| (propertyInfo != null && propertyInfo.canAdd()))) {
      throw new JSONParseException("String_Node_Str" + jsonName + "String_Node_Str"+ cx.target.getClass());
    }
    if (name == null) {
      name=jsonName;
    }
    Class typeHint=getTypeHint(cx,cx.getParsePathInfo(jsonName),tokenizer,jsonName,isProperty,valueType.isPrimitive());
    Object value;
    if (valueType.isPrimitive()) {
      value=valueToken.value();
    }
 else {
      Object newTarget=null;
      if (valueType == TokenType.BRACE_OPEN) {
        Class memberType=null;
        if (isProperty) {
          JSONPropertyInfo propertyInfo2=TypeAnalyzer.getClassInfo(objectSupport,cx.target.getClass()).getPropertyInfo(jsonName);
          if (propertyInfo2 != null) {
            memberType=propertyInfo2.getTypeHint();
          }
        }
        newTarget=createNewTargetInstance(typeHint,true);
        parseObjectInto(cx.push(newTarget,memberType,"String_Node_Str" + name),tokenizer);
      }
 else       if (valueType == TokenType.BRACKET_OPEN) {
        if (isProperty || containerIsMap || containerIsDynAttrs) {
          Class arrayTypeHint=typeHint;
          if (isProperty) {
            if (typeConverter != null && !List.class.isAssignableFrom(arrayTypeHint)) {
              arrayTypeHint=List.class;
            }
          }
          newTarget=createNewTargetInstance(arrayTypeHint,false);
          JSONPropertyInfo propertyInfo2=TypeAnalyzer.getClassInfo(objectSupport,cx.target.getClass()).getPropertyInfo(jsonName);
          Class memberType=null;
          if (propertyInfo2 != null) {
            memberType=propertyInfo2.getTypeHint();
          }
          parseArrayInto(cx.push(newTarget,memberType,"String_Node_Str" + name),tokenizer);
        }
 else {
          if (propertyInfo.canAdd()) {
            List temp=new ArrayList();
            parseArrayInto(cx.push(temp,propertyInfo.getAdderType(),"String_Node_Str" + name),tokenizer);
            for (            Object o : temp) {
              propertyInfo.add(cx.target,o);
            }
            continue;
          }
 else {
            throw new JSONParseException("String_Node_Str" + name + "String_Node_Str"+ cx.target);
          }
        }
      }
 else {
        throw new JSONParseException("String_Node_Str" + valueToken);
      }
      value=newTarget;
    }
    if (typeConverter != null && !isIgnoredOnParse) {
      value=typeConverter.fromJSON(value);
    }
    if (typeHint == null && propertyInfo != null) {
      typeHint=propertyInfo.getTypeOfProperty();
    }
    if (typeHint != null && !isIgnoredOnParse) {
      value=convertValueTo(value,typeHint);
    }
    if (isProperty) {
      if (!isIgnoredOnParse) {
        propertyInfo.setProperty(cx.target,value);
      }
    }
 else     if (containerIsMap) {
      ((Map)cx.target).put(name,value);
    }
 else     if (containerIsDynAttrs) {
      ((DynamicProperties)cx.target).setProperty(name,value);
    }
 else {
      throw new JSONParseException("String_Node_Str" + name + "String_Node_Str"+ cx.target);
    }
    first=false;
  }
}