Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-15864

Replace new Date().getTime() with System.currentTimeMillis()

XMLWordPrintable

      Using new Date().getTime() is inefficient compared to System.currentTimeMillis() because System.getCurrentTimeMillis is called to get a new Date.

      ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerTask.java:            long now = new Date().getTime();
      jdr/jboss-as-jdr/src/main/java/org/jboss/as/jdr/JdrReport.java:        setStartTime(new Date().getTime());
      jdr/jboss-as-jdr/src/main/java/org/jboss/as/jdr/JdrReport.java:        setEndTime(new Date().getTime());
      testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/interceptor/annotatedejbclient/AnnotatedEJBClientInterceptorTestCase.java:        if(bean.invoke("Test-" + new Date().getTime()) > 1){
      testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/runas/TimerTesterBean.java:        timerService.createTimer(new Date(new Date().getTime() + pPeriod), null);
      

              cfang@redhat.com Cheng Fang
              clara0 Clara Fang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: