Program: 143427
Project: 143427
Buggy source:
@Override public JSONWriter toJSON(JSONWriter writer,String key,Object sabloValue,DataConversion clientConversion,IDataConverterContext dataConverterContext) throws JSONException {
  JSONUtils.addKeyIfPresent(writer,key);
  if (sabloValue != null) {
    if (sabloValue.getClass().isArray() && sabloValue.getClass().getComponentType() == byte.class) {
      ByteArrayResourcePropertyType.INSTANCE.toJSON(writer,null,(byte[])sabloValue,clientConversion,new DataConverterContext(NGUtils.MEDIA_DATAPROVIDER_BYTE_ARRAY_CACHED_PD,dataConverterContext.getWebObject()));
    }
 else     if (sabloValue instanceof Date) {
      DatePropertyType.INSTANCE.toJSON(writer,null,(Date)sabloValue,clientConversion,new DataConverterContext(NGUtils.DATE_DATAPROVIDER_CACHED_PD,dataConverterContext.getWebObject()));
    }
 else     if (sabloValue instanceof String) {
      if (Boolean.TRUE.equals(dataConverterContext.getPropertyDescription().getConfig())) {
        HTMLStringPropertyType.INSTANCE.toJSON(writer,null,(String)sabloValue,clientConversion,new DataConverterContext(NGUtils.TEXT_PARSEHTML_DATAPROVIDER_CACHED_PD,dataConverterContext.getWebObject()));
      }
 else {
        HTMLStringPropertyType.INSTANCE.toJSON(writer,null,(String)sabloValue,clientConversion,new DataConverterContext(NGUtils.TEXT_NO_PARSEHTML_DATAPROVIDER_CACHED_PD,dataConverterContext.getWebObject()));
      }
    }
 else {
      writer.value(sabloValue);
    }
  }
 else {
    writer.value(null);
  }
  return writer;
}

Fixed version (ground truth):
@Override public JSONWriter toJSON(JSONWriter writer,String key,Object sabloValue,DataConversion clientConversion,IDataConverterContext dataConverterContext) throws JSONException {
  JSONUtils.addKeyIfPresent(writer,key);
  if (sabloValue != null) {
    if (sabloValue.getClass().isArray() && sabloValue.getClass().getComponentType() == byte.class) {
      ByteArrayResourcePropertyType.INSTANCE.toJSON(writer,null,(byte[])sabloValue,clientConversion,new DataConverterContext(NGUtils.MEDIA_DATAPROVIDER_BYTE_ARRAY_CACHED_PD,dataConverterContext.getWebObject()));
    }
 else     if (sabloValue instanceof Date) {
      DatePropertyType.INSTANCE.toJSON(writer,null,(Date)sabloValue,clientConversion,new DataConverterContext(NGUtils.DATE_DATAPROVIDER_CACHED_PD,dataConverterContext.getWebObject()));
    }
 else     if (sabloValue instanceof String) {
      if (((String)sabloValue).toLowerCase().startsWith(MediaURLStreamHandler.MEDIA_URL_DEF)) {
        String url=MediaPropertyType.INSTANCE.getMediaUrl(sabloValue,((WebFormComponent)dataConverterContext.getWebObject()).getDataConverterContext().getApplication().getFlattenedSolution(),null);
        MediaPropertyType.INSTANCE.toJSON(writer,key,new MediaWrapper(sabloValue,url),clientConversion,dataConverterContext);
      }
 else       if (Boolean.TRUE.equals(dataConverterContext.getPropertyDescription().getConfig())) {
        HTMLStringPropertyType.INSTANCE.toJSON(writer,null,(String)sabloValue,clientConversion,new DataConverterContext(NGUtils.TEXT_PARSEHTML_DATAPROVIDER_CACHED_PD,dataConverterContext.getWebObject()));
      }
 else {
        HTMLStringPropertyType.INSTANCE.toJSON(writer,null,(String)sabloValue,clientConversion,new DataConverterContext(NGUtils.TEXT_NO_PARSEHTML_DATAPROVIDER_CACHED_PD,dataConverterContext.getWebObject()));
      }
    }
 else {
      writer.value(sabloValue);
    }
  }
 else {
    writer.value(null);
  }
  return writer;
}