Changeset 6777


Ignore:
Timestamp:
Jun 17, 2022, 1:20:01 PM (2 months ago)
Author:
Nicklas Nordborg
Message:

Fixes #1398: The Release exporter should include missing/null annotation values in JSON files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/release/CohortItem.java

    r6580 r6777  
    647647    name: name of the annotation type,
    648648    value: The annotation value
    649     Returns null if the annotation doesn't have a value
     649    The "value" field is not included if the annotation value is null
    650650    @since 4.10
    651651  */
     
    715715    name: name of the annotation type,
    716716    value: The annotation value
    717     Returns null if the value is null
     717    The "value" field is only included for non-null values.
    718718    @since 4.10
    719719  */
    720720  public JSONObject createAnnotationJSON(String name, Object value)
    721721  {
    722     JSONObject json = null;
    723     if (value != null)
    724     {
    725       json = new JSONObject();
    726       json.put("name", name);
    727       json.put("value", value);
    728     }
     722    JSONObject json = new JSONObject();
     723    json.put("name", name);
     724    if (value != null) json.put("value", value);
    729725    return json;
    730726  }
Note: See TracChangeset for help on using the changeset viewer.