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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      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")

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: