Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-23304

Fix NPE in DocumentMultivaluedProperty.addItem for numerical and Date types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 8.10
    • Fix Version/s: 8.10-HF18, 9.3
    • Component/s: Automation
    • Release Notes Summary:
      DocumentMultivaluedProperty.addItem operation is compatible with numerical and date types
    • Backlog priority:
      300
    • Sprint:
      nxL2IT 9.3.11
    • Story Points:
      3

      Description

      When using multivalued field (with multiple default values separated by spaces), and using the field with the Document > DocumentMultivaluedProperty.addItem API, one gets a NullPointerException with the following stack trace:

      ****** chain ******
      Name: NodeWorkflowChain
      Exception: OperationException
      Caught error: Failed to invoke operation DocumentMultivaluedProperty.addItem with aliases [AddEntryToMultivaluedProperty]
      Caused by: java.lang.NullPointerException
      ****** Hierarchy calls ******
              org.nuxeo.ecm.automation.core.operations.FetchContextDocument
                      org.nuxeo.ecm.automation.core.operations.document.AddEntryToMultiValuedProperty
      
              at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:234)
              at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:93)
              at org.nuxeo.ecm.platform.routing.core.impl.GraphNodeImpl.executeChain(GraphNodeImpl.java:514)
              ... 112 more
      Caused by: org.nuxeo.ecm.automation.OperationException: Failed to invoke operation DocumentMultivaluedProperty.addItem with aliases [AddEntryToMultivaluedProperty]
              at org.nuxeo.ecm.automation.core.impl.InvokableMethod.invoke(InvokableMethod.java:189)
              at org.nuxeo.ecm.automation.core.impl.CompiledChainImpl.doInvoke(CompiledChainImpl.java:130)
              at org.nuxeo.ecm.automation.core.impl.CompiledChainImpl.invoke(CompiledChainImpl.java:116)
              at org.nuxeo.ecm.automation.core.impl.CompiledChainImpl.doInvoke(CompiledChainImpl.java:133)
              at org.nuxeo.ecm.automation.core.impl.CompiledChainImpl.invoke(CompiledChainImpl.java:116)
              at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:210)
              ... 114 more
      Caused by: java.lang.NullPointerException
              at org.nuxeo.ecm.automation.core.operations.document.AbstractOperationMultiValuedProperty.checkFieldType(AbstractOperationMultiValuedProperty.java:48)
              at org.nuxeo.ecm.automation.core.operations.document.AddEntryToMultiValuedProperty.run(AddEntryToMultiValuedProperty.java:68)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.nuxeo.ecm.automation.core.impl.InvokableMethod.doInvoke(InvokableMethod.java:171)
              at org.nuxeo.ecm.automation.core.impl.InvokableIteratorMethod.doInvoke(InvokableIteratorMethod.java:108)
              at org.nuxeo.ecm.automation.core.impl.InvokableMethod.invoke(InvokableMethod.java:177)
              ... 119 more
      

      The goal for this ticket is to fix the NPE and to have the API working with all types of scalar data offered by Nuxeo (including integer, date...)

      Currently it works only with String and Boolean because the newInstance method is defined for StringType and BooleanType classes

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h