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

DocumentImpl toString() generates NPE when no modification date is available

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.1.0.Final
    • jBPM 6.4.0.Final
    • Runtime Engine
    • None
    • 1
    • NEW
    • NEW
    • Hide

      Configure a cmis endpoint.
      Run the refered test.

      Show
      Configure a cmis endpoint. Run the refered test.

      While performing a unit test, with org.jbpm.document.service.impl.DocumentImpl inside the session, audit StringProcessVariableIndexer performs a DocumentImpl.toString() generating a NPE (only when no modificationDate has been set).

      This test comes from
      https://github.com/mswiderski/jbpm-examples/blob/master/jbpm-open-cmis/src/test/java/org/jbpm/integration/cmis/OpenCMISVariablesProcessTest.java

      //The source code is not checking that lastModified can be null.
      DocumentImpl. toString()

      { SimpleDateFormat sdf = new SimpleDateFormat( DOCUMENT_DATE_PATTERN ); return name + PROPERTIES_SEPARATOR + size + PROPERTIES_SEPARATOR + sdf.format( ***lastModified*** ) + PROPERTIES_SEPARATOR + link ; }

      Alternative:
      DocumentImpl. toString()

      { SimpleDateFormat sdf = new SimpleDateFormat( DOCUMENT_DATE_PATTERN ); return name + PROPERTIES_SEPARATOR + size + PROPERTIES_SEPARATOR + ((lastModified!=null)? sdf.format( lastModified ) : "" ) + PROPERTIES_SEPARATOR + link ; }

            swiderski.maciej Maciej Swiderski (Inactive)
            ngs_mtech_jira Manuel Castro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: