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

java.util.zip.ZipFile allows reading after close

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      Name: sdC67446 Date: 01/15/98


      Method java.util.zip.ZipFile.getEntry allows reading after calling
      close() method.

      Here is the test demonstrating the bug:
      -----------------Test.java------------------------
      import java.util.zip.*;

      public class Test {
        public static void main(String[] args) {
          try {
            
            ZipFile zipfile = new ZipFile("ZipFile.zip");
            
            String testEntry = "ZipFileTest.data1";
            
            zipfile.close();
            if (zipfile.getEntry(testEntry) != null) {
      System.out.println(zipfile.getEntry(testEntry).getName()+
      " entry accessible after calling close().");
            } else {
      System.out.println("OKAY.");
            }
            
          } catch ( Exception e ) {
            System.out.println(e);
          }
        }
      }
      ---------Output from the test---------------------
      ZipFileTest.data1 entry accessible after calling close().
      --------------------------------------------------

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zlisunw Zhenghua Li (Inactive)
                Reporter:
                sdmitriesunw Sergei Dmitriev (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: