classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error in FileInputStream?


From: Bryce McKinlay
Subject: Re: Error in FileInputStream?
Date: Sat, 20 Oct 2001 12:54:04 +1300

On Wednesday, October 17, 2001, at 10:12  PM, address@hidden wrote:

When the JVM boots, System.in is allocated using a file descriptor.
If the security manager is already installed, then an exception
is thrown.

Is there a reason, for assuming that the security manager is not
available at this point or is this only some forgotten code that,
by chance, nobody else but me run into?

I agree that it looks wrong. My guess is that the SecurityManager wasn't working correctly at the time the FileInputStream was written so we ended up with some weird code.

In libgcj the implementation is simply:

  public FileInputStream(FileDescriptor fdObj)
  {
    SecurityManager s = System.getSecurityManager();
    if (s != null)
      s.checkRead(fdObj);
    fd = fdObj;
  }

Note that SecurityException is unchecked, so it does nto need to be declared in the throws clause.

regards

Bryce.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]