Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2717

Allow unboxing and widening primitive conversions in property injection

    Details

      Description

      I ran into a problem with accessing boolean properties of an eventListener.
      I've attached a patch to trunk of ./modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java that adds a test that exposes this problem.

      Basically, the example below fails with the error
      "org.jbpm.pvm.internal.wire.WireException: couldn't initialize object 'null': couldn't find property setter setCreateXml for value true"

      JPDL-fragment:
      <event-listener expr="#

      {stateApprovalAction}

      ">
      <property name="createXml">
      <true/>
      </property>
      </event-listener>

      Java-fragment:
      public void setCreateXml(boolean createXml)

      { this.createXml = createXml; }

      Workaround: changing the Java-side to use a Boolean instead of a boolean for the method parameter.

      While there is a workaround, I will still suggest supporting both Boolean and boolean-based setters.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                aguizar Alejandro Guizar
                Reporter:
                perchrh Per Christian Henden
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: