src/share/classes/java/util/zip/ZipEntry.java

Print this page
rev 4802 : 7117249: fix warnings in java.util.jar, .logging, .prefs, .zip
Reviewed-by: alanb, dholmes, forax, sherman, smarks
Contributed-by: London Java Community and Michael Barker <mikeb01@gmail.com>

@@ -279,10 +279,11 @@
 
     /*
      * Converts DOS time to Java time (number of milliseconds since epoch).
      */
     private static long dosToJavaTime(long dtime) {
+        @SuppressWarnings("deprecation") // Use of date constructor.
         Date d = new Date((int)(((dtime >> 25) & 0x7f) + 80),
                           (int)(((dtime >> 21) & 0x0f) - 1),
                           (int)((dtime >> 16) & 0x1f),
                           (int)((dtime >> 11) & 0x1f),
                           (int)((dtime >> 5) & 0x3f),

@@ -291,10 +292,11 @@
     }
 
     /*
      * Converts Java time to DOS time.
      */
+    @SuppressWarnings("deprecation") // Use of date methods
     private static long javaToDosTime(long time) {
         Date d = new Date(time);
         int year = d.getYear() + 1900;
         if (year < 1980) {
             return (1 << 21) | (1 << 16);