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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 8u40
    • Fix Version/s: None
    • Component/s: core-libs

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: