This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: FileOutputStream exceptions


A user pointed out to me that the FileOutputStream constructors throw
FileNotFoundException, not IOException.  This patch fixes it.
I'm checking this in on the trunk.

2001-07-12  Tom Tromey  <tromey@redhat.com>

	Report from Henner Zeller:
	* java/io/FileOutputStream.java (FileOutputStream): Throw
	FileNotFoundException, not IOException.

Tom

Index: java/io/FileOutputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/FileOutputStream.java,v
retrieving revision 1.3
diff -u -r1.3 FileOutputStream.java
--- java/io/FileOutputStream.java 2000/03/07 19:55:26 1.3
+++ java/io/FileOutputStream.java 2001/07/11 15:26:48
@@ -1,6 +1,6 @@
 // FileOutputStream.java - Write bytes to a file.
 
-/* Copyright (C) 1998, 1999  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -23,7 +23,7 @@
 public class FileOutputStream extends OutputStream
 {
   public FileOutputStream (String path, boolean append)
-    throws SecurityException, IOException
+    throws SecurityException, FileNotFoundException
   {
     SecurityManager s = System.getSecurityManager();
     if (s != null)
@@ -33,17 +33,20 @@
 				    : FileDescriptor.WRITE));
   }
 
-  public FileOutputStream (String path) throws SecurityException, IOException
+  public FileOutputStream (String path)
+    throws SecurityException, FileNotFoundException
   {
     this (path, false);
   }
 
-  public FileOutputStream (File file) throws SecurityException, IOException
+  public FileOutputStream (File file)
+    throws SecurityException, FileNotFoundException
   {
     this (file.getPath(), false);
   }
 
-  public FileOutputStream (FileDescriptor fdObj) throws SecurityException
+  public FileOutputStream (FileDescriptor fdObj)
+    throws SecurityException
   {
     SecurityManager s = System.getSecurityManager();
     if (s != null)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]