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

File.get{Free,Usable,Total}Space throws NPE (win98)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_98

      Description

      File.get{Free,Total,Usable}Space throws NullPointerException on Windows 98,
      if File Object is created as File("tmp"); where tmp is windows file

      C:\>uname -a
      Windows_98 JLAB408 4 10 586

      C:\>c:\jdk\win\bin\java -version
      java version "1.6.0-beta2"
      Java(TM) SE Runtime Environment (build 1.6.0-beta2-b86)
      Java HotSpot(TM) Client VM (build 1.6.0-beta2-b86, mixed mode)

      <Code>
      import java.io.File;
      public class TestDS {
        public static void main(String... args) throws Exception{
          
           File f = new File("tmp");
           if (!f.exists()) {
              f.createNewFile();
           }
           System.out.println(f.getFreeSpace());
           System.out.println(f.getUsableSpace());
           System.out.println(f.getTotalSpace());
           
           }
        }
      </Code>

      <Result>

      C:\>c:\jdk\win\bin\java TestDS
      Exception in thread "main" java.lang.NullPointerException
              at java.io.Win32FileSystem.getSpace0(Native Method)
              at java.io.Win32FileSystem.getSpace(Win32FileSystem.java:565)
              at java.io.File.getFreeSpace(File.java:1619)
              at TestDS.main(TestDS.java:9)

      </Result>

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              alanb Alan Bateman
              Reporter:
              rgutupalsunw Rajendra Gutupalli (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: