Program: 104903
Project: 104903
Buggy source:
void mapValuesFromDBObject(BasicDBObject dbObject,MappedField mf,Object entity){
  String name=mf.getName();
  try {
    Class fieldType=mf.getType();
    if (mf.hasAnnotation(Serialized.class)) {
      Object data=dbObject.get(name);
      if (!(data instanceof DBBinary || data instanceof byte[]))       throw new MappingException("String_Node_Str" + mf.getFullName() + "String_Node_Str"+ data.getClass().getName());
      try {
        mf.setFieldValue(entity,deserialize(data));
      }
 catch (      IOException ex) {
        throw new RuntimeException(ex);
      }
catch (      ClassNotFoundException ex) {
        throw new IllegalStateException("String_Node_Str" + data + "String_Node_Str"+ mf.getFullName(),ex);
      }
    }
 else     if (mf.isMap()) {
      if (dbObject.containsField(name)) {
        Map<Object,Object> map=(Map<Object,Object>)dbObject.get(name);
        Map values=(Map)tryConstructor(HashMap.class,mf.getCTor());
        for (        Map.Entry<Object,Object> entry : map.entrySet()) {
          Object objKey=objectFromValue(mf.getMapKeyType(),entry.getKey());
          values.put(objKey,objectFromValue(mf.getSubType(),entry.getValue()));
        }
        mf.setFieldValue(entity,values);
      }
    }
 else     if (mf.isMultipleValues()) {
      if (dbObject.containsField(name)) {
        Class subtype=mf.getSubType();
        if (subtype == byte.class && fieldType.isArray()) {
          mf.setFieldValue(entity,dbObject.get(name));
          return;
        }
        List list=(List)dbObject.get(name);
        if (subtype != null) {
          Collection values;
          if (!mf.isSet())           values=(List)tryConstructor(ArrayList.class,mf.getCTor());
 else           values=(Set)tryConstructor(HashSet.class,mf.getCTor());
          if (subtype == Locale.class) {
            for (            Object o : list)             values.add(parseLocale((String)o));
          }
 else           if (subtype == Key.class) {
            for (            Object o : list)             values.add(new Key((DBRef)o));
          }
 else           if (subtype.isEnum()) {
            for (            Object o : list)             values.add(Enum.valueOf(subtype,(String)o));
          }
 else {
            for (            Object o : list)             values.add(o);
          }
          if (fieldType.isArray()) {
            Object exampleArray=Array.newInstance(subtype,1);
            Object[] array=((ArrayList)values).toArray((Object[])exampleArray);
            mf.setFieldValue(entity,array);
          }
 else           mf.setFieldValue(entity,values);
        }
 else {
          mf.setFieldValue(entity,list);
        }
      }
    }
 else {
      if (dbObject.containsField(name)) {
        mf.setFieldValue(entity,objectFromValue(fieldType,dbObject,name));
      }
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
void mapValuesFromDBObject(BasicDBObject dbObject,MappedField mf,Object entity){
  String name=mf.getName();
  try {
    Class fieldType=mf.getType();
    if (mf.hasAnnotation(Serialized.class)) {
      Object data=dbObject.get(name);
      if (!(data instanceof DBBinary || data instanceof byte[]))       throw new MappingException("String_Node_Str" + mf.getFullName() + "String_Node_Str"+ data.getClass().getName());
      try {
        mf.setFieldValue(entity,deserialize(data));
      }
 catch (      IOException ex) {
        throw new RuntimeException(ex);
      }
catch (      ClassNotFoundException ex) {
        throw new IllegalStateException("String_Node_Str" + data + "String_Node_Str"+ mf.getFullName(),ex);
      }
    }
 else     if (mf.isMap()) {
      if (dbObject.containsField(name)) {
        Map<Object,Object> map=(Map<Object,Object>)dbObject.get(name);
        Map values=(Map)tryConstructor(HashMap.class,mf.getCTor());
        for (        Map.Entry<Object,Object> entry : map.entrySet()) {
          Object objKey=objectFromValue(mf.getMapKeyType(),entry.getKey());
          values.put(objKey,objectFromValue(mf.getSubType(),entry.getValue()));
        }
        mf.setFieldValue(entity,values);
      }
    }
 else     if (mf.isMultipleValues()) {
      if (dbObject.containsField(name)) {
        Class subtype=mf.getSubType();
        if (subtype == byte.class && fieldType.isArray()) {
          mf.setFieldValue(entity,dbObject.get(name));
          return;
        }
        List list=(List)dbObject.get(name);
        if (subtype != null) {
          Collection values;
          if (!mf.isSet())           values=(List)tryConstructor(ArrayList.class,mf.getCTor());
 else           values=(Set)tryConstructor(HashSet.class,mf.getCTor());
          if (subtype == Locale.class) {
            for (            Object o : list)             values.add(parseLocale((String)o));
          }
 else           if (subtype == Key.class) {
            for (            Object o : list)             values.add(new Key((DBRef)o));
          }
 else           if (subtype.isEnum()) {
            for (            Object o : list)             values.add(Enum.valueOf(subtype,(String)o));
          }
 else {
            for (            Object o : list)             values.add(o);
          }
          if (fieldType.isArray()) {
            Object[] array=convertToArray(subtype,values);
            mf.setFieldValue(entity,array);
          }
 else           mf.setFieldValue(entity,values);
        }
 else {
          mf.setFieldValue(entity,list);
        }
      }
    }
 else {
      if (dbObject.containsField(name)) {
        mf.setFieldValue(entity,objectFromValue(fieldType,dbObject,name));
      }
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}