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

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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jBPM 6.4.0.Final
    • Fix Version/s: 7.1.0.Final
    • Component/s: Runtime Engine
    • Labels:
      None
    • Environment:

      Tomcat 7.0, JBPM 6.4.0

    • Story Points:
      1
    • Steps to Reproduce:
      Hide

      Configure a cmis endpoint.
      Run the refered test.

      Show
      Configure a cmis endpoint. Run the refered test.
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      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 ; }

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swiderski.maciej Maciej Swiderski
                Reporter:
                ngs_mtech Manuel Castro
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: