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

Better stack trace on bad complex property reference

    XMLWordPrintable

    Details

    • Type: Clean up
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.6
    • Fix Version/s: 5.6.0-HF12, 5.7.1
    • Component/s: Core

      Description

      When calling DocumentModel.getPropertyValue on missing complex list element, like files:files/0/filename when the files list is empty, the following stack trace is returned, without any indication of the property involved:

      Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
                      at java.util.ArrayList.rangeCheck(ArrayList.java:571)
                      at java.util.ArrayList.get(ArrayList.java:349)
                      at org.nuxeo.ecm.core.api.model.impl.ListProperty.get(ListProperty.java:125)
                      at org.nuxeo.ecm.core.api.model.impl.AbstractProperty.resolvePath(AbstractProperty.java:435)
                      at org.nuxeo.ecm.core.api.model.impl.AbstractProperty.resolvePath(AbstractProperty.java:394)
                      at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getProperty(DocumentModelImpl.java:1378)
                      at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getPropertyValue(DocumentModelImpl.java:1429)
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: