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

Properties.save(OutputStream,String) signature has been changed in jdk1.2beta3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • 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")

      ======================================================================

            Unassigned Unassigned
            mgorshen Mikhail Gorshenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: