-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
sparc
-
solaris_2.5
Name: mgC56079 Date: 02/18/98
The 'public void java.util.Properties.save(OutputStream,String)' signature has been changed
to 'public void java.util.Properties.save(OutputStream,String) throws IOException' in jdk1.2beta3.
The following example no longer compile on jdk1.2:
----- Here is the test (Props.java) -----
public class Props {
public static void main(String argv[]) {
System.getProperties().save(System.out, "System Properties");
}
}
---- Here is the compiler output (JDK-1.1.5) -------
% javac Props.java
%
---- Here is the compiler output (JDK-1.2beta3-G) -------
% javac Props.java
Props.java:4: Exception java.io.IOException must be caught, or it must be declared in the throws clause of this method.
System.getProperties().save(System.out, "System Properties");
^
1 error
%
-----------------
The source changed to match this change
try {
System.getProperties().save(System.out, "System Properties");
}
catch (java.io.IOException e) {
}
will not compile on jdk1.1.x (giving the following error message "Exception java.io.IOException is
never thrown in the body of the corresponding try statement")
======================================================================
- duplicates
-
JDK-4112318 java.util.Properties.save now throws IOException
- Closed