On Wednesday, October 17, 2001, at 10:12  PM, [EMAIL PROTECTED] 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.



_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to