Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-2205

Jackson JSON cannot handle BaseOpenmrsObject

    XMLWordPrintable

    Details

    • Complexity:
      Medium
    • Sprint:
      Platform 2.0 Beta Sprint 1

      Description

      We have defined both isVoided() and getVoided() methods in BaseOpenmrsData (and isRetired() and getRetired() in BaseOpenmrsMetadata), which is technically not right according to bean specifications. The Jackson JSON library bombs on this, like:

      Caused by: java.lang.IllegalArgumentException: Conflicting getter definitions 
      for property "voided": org.openmrs.BaseOpenmrsData#isVoided(0 params) vs 
      org.openmrs.BaseOpenmrsData#getVoided(0 params)
      

      Selected approach (per the Design Forum on 15-Aug-2012):

      • Go through the API and find all methods with the signature "Boolean isXyz()", and for each of them:
        • Verify we have a correct "Boolean getXyz()" method
        • Deprecate the incorrect isXyz() method, saying to use the getXyz() method instead
        • Add the @JsonIgnore annotation to the incorrect isXyz method

      It may be possible to salvage Saptarshi's attached patch here, but given the amount of time that has passed since he wrote it, it may be easier to just re-do the work against trunk.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ivange94 Ivange Larry Ndumbe
              Reporter:
              mseaton Mike Seaton
              Designated Committer:
              Daniel Kayiwa
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Time Spent - 2 hours Remaining Estimate - 1 hour
                  1h
                  Logged:
                  Time Spent - 2 hours Remaining Estimate - 1 hour Time Not Required
                  2h