Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8050494

OptimisticTypesPersistence should use java.util.Date, not java.sql.Date

XMLWordPrintable

      The change for JDK-8046921 introduced a new utility class, OptimisticTypesPersistence, that makes use of a type in java.sql, java.sql.Date. This would appear to be a mistake, most likely by the IDE when automatically adding the import statements. I suspect that it should be "import java.util.Date".

      Snippets below show the affected code, in OptimisticTypesPersistence.java:

          import java.sql.Date;
          ....

          private static String getVersionDirName() throws Exception {
               ....
               return "dev-" + new SimpleDateFormat("yyyyMMdd-HHmmss").format(new Date(getLastModifiedClassFile(dir, 0L)));
              ....
          }


      This issue causes problems for modularity, as it creates a new dependency on a type in java.sql.

            sundar Sundararajan Athijegannathan
            chegar Chris Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: