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

FileDescriptor.sync native code throws IOException, not SyncFailedException

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.2beta
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Not verified

      Description

      Since it was converted to use the JNI, the native implementation of
      FileDescriptor.sync looks like this:

      JNIEXPORT void JNICALL
      Java_java_io_FileDescriptor_sync(JNIEnv *env, jobject this) {
          int fd = (*env)->GetIntField(env, this, IO_fd_fdID);
          if (JVM_Sync(fd) == -1) {
              JNU_ThrowIOException(env, "sync failed");
          }
      }

      On failure, this implementation will throw a java.io.IOException, but the
      specification of the method states that it should instead throw a
      java.io.SyncFailedException in this case. IOException is a checked exception
      and is not declared in the "throws" clause of the sync() method.

        Attachments

          Activity

            People

            Assignee:
            peterjones Peter Jones
            Reporter:
            peterjones Peter Jones
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: