Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-51675

DateUtil equals can throw NPE if ignoreMilliseconds is true

    Details

      Description

      1) Use the following api:

      DateUtil.equals(null, new Date(), false);

      Checkpoint: returns with false

      2) Use

      DateUtil.equals(null, new Date(), true);

      Result:

       [render_portlet_jsp:132] null
      java.lang.NullPointerException...
      

      Hint: execute it as Groovy-script from Server Admin:

      out.println(com.liferay.portal.kernel.util.DateUtil.equals(null, new Date(), true));
      

        Attachments

        1. fixed.png
          fixed.png
          17 kB
        2. reproduced.png
          reproduced.png
          15 kB

          Issue Links

            Activity

              People

              Assignee:
              joyce.wang Joyce Wang
              Reporter:
              tibor.lipusz Tibor Lipusz
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 15 weeks, 2 days ago

                  Packages

                  Version Package
                  6.2.2 CE GA3
                  6.2.X EE
                  7.0.0 M3