Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3483

Date type properties: Content.setNodeData() expects Calendar object, while Content2Bean passes Date object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 4.3.8
    • content2bean, core

      Observation: While working on REG-91, I used info.magnolia.cms.core.Content.setNodeData(String, Calendar) to set the value of a type="Date" JCR property. Later, I just assumed Content2Bean likewise to pass a Calendar object to my bean setter methods - see the state of AuthenticationTokenConfig.java in commit r40983. This did not work, and it turns out that the Content2Bean mechanism actually passes a Date object for type="Date" JCR properties. (I found out by changing the parameter of the setter method from Calendar to Object and stepping into the method in debugging mode.)

      Problem: Representing the same JCR data using two different Java types just feels plain wrong.

      Proposed solution: Use the same (sane) Java type for the JCR API and for the Content2Bean mechanism in Magnolia 5.0.

        Acceptance criteria

              Unassigned Unassigned
              frabe Felix Rabe
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD