Program: 35969
Project: 35969
Buggy source:
private static void serializeMember(IContext context,JSONObject target,String targetMemberName,IMendixObjectMember<?> member,IMetaObject viewType,Set<Long> alreadySeen,boolean useServiceUrls) throws Exception {
  if (context == null)   throw new IllegalStateException("String_Node_Str");
  Object value=member.getValue(context);
  String memberName=member.getName();
  if (Utils.isSystemAttribute(memberName) || memberName.endsWith("String_Node_Str")) {
  }
 else   if (!(member instanceof MendixObjectReference) && !(member instanceof MendixObjectReferenceSet)) {
switch (viewType.getMetaPrimitive(member.getName()).getType()) {
case AutoNumber:
case Long:
case Boolean:
case Currency:
case Float:
case Integer:
      if (value == null)       throw new IllegalStateException("String_Node_Str" + member.getName() + "String_Node_Str");
    target.put(targetMemberName,value);
  break;
case Enum:
MendixEnum me=(MendixEnum)member;
if ("String_Node_Str".equals(me.getEnumeration().getName())) {
if (BooleanValue._true.toString().equals(me.getValue(context))) target.put(targetMemberName,true);
 else if (BooleanValue._false.toString().equals(me.getValue(context))) target.put(targetMemberName,false);
break;
}
case HashString:
case String:
if (value == null) target.put(targetMemberName,JSONObject.NULL);
 else target.put(targetMemberName,value);
break;
case DateTime:
if (value == null) target.put(targetMemberName,JSONObject.NULL);
 else target.put(targetMemberName,(((Date)value).getTime()));
break;
case Binary:
break;
default :
throw new IllegalStateException("String_Node_Str" + memberName);
}
}
 else if (member instanceof MendixObjectReference) {
if (value != null) value=identifierToJSON(context,(IMendixIdentifier)value,alreadySeen,useServiceUrls);
if (value == null) target.put(targetMemberName,JSONObject.NULL);
 else target.put(targetMemberName,value);
}
 else if (member instanceof MendixObjectReferenceSet) {
JSONArray ar=new JSONArray();
if (value != null) {
@SuppressWarnings("String_Node_Str") List<IMendixIdentifier> ids=(List<IMendixIdentifier>)value;
for (IMendixIdentifier id : ids) if (id != null) {
Object url=identifierToJSON(context,id,alreadySeen,useServiceUrls);
if (url != null) ar.put(url);
}
}
target.put(targetMemberName,ar);
}
 else throw new IllegalStateException("String_Node_Str" + member.getClass().getSimpleName());
}

Fixed version (ground truth):
private static void serializeMember(IContext context,JSONObject target,String targetMemberName,IMendixObjectMember<?> member,IMetaObject viewType,Set<Long> alreadySeen,boolean useServiceUrls) throws Exception {
  if (context == null)   throw new IllegalStateException("String_Node_Str");
  Object value=member.getValue(context);
  String memberName=member.getName();
  if (Utils.isSystemAttribute(memberName) || memberName.endsWith("String_Node_Str")) {
  }
 else   if (!(member instanceof MendixObjectReference) && !(member instanceof MendixObjectReferenceSet)) {
switch (viewType.getMetaPrimitive(member.getName()).getType()) {
case AutoNumber:
case Long:
case Boolean:
case Currency:
case Float:
case Integer:
      if (value == null)       throw new IllegalStateException("String_Node_Str" + member.getName() + "String_Node_Str");
    target.put(targetMemberName,value);
  break;
case Enum:
MendixEnum me=(MendixEnum)member;
if ("String_Node_Str".equals(me.getEnumeration().getName())) {
if (BooleanValue._true.toString().equals(me.getValue(context))) target.put(targetMemberName,true);
 else if (BooleanValue._false.toString().equals(me.getValue(context))) target.put(targetMemberName,false);
break;
}
case HashString:
case String:
if (value == null) target.put(targetMemberName,JSONObject.NULL);
 else target.put(targetMemberName,value);
break;
case DateTime:
if (value == null) target.put(targetMemberName,JSONObject.NULL);
 else target.put(targetMemberName,(((Date)value).getTime()));
break;
case Binary:
break;
default :
throw new IllegalStateException("String_Node_Str" + memberName);
}
}
 else if (member instanceof MendixObjectReference) {
if (value != null) value=identifierToJSON(context,(IMendixIdentifier)value,alreadySeen,useServiceUrls);
if (value == null) target.put(targetMemberName,JSONObject.NULL);
 else target.put(targetMemberName,value);
}
 else if (member instanceof MendixObjectReferenceSet) {
JSONArray ar=new JSONArray();
if (value != null) {
@SuppressWarnings("String_Node_Str") List<IMendixIdentifier> ids=(List<IMendixIdentifier>)value;
Utils.sortIdList(ids);
for (IMendixIdentifier id : ids) if (id != null) {
Object url=identifierToJSON(context,id,alreadySeen,useServiceUrls);
if (url != null) ar.put(url);
}
}
target.put(targetMemberName,ar);
}
 else throw new IllegalStateException("String_Node_Str" + member.getClass().getSimpleName());
}