-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.2beta
-
sparc
-
solaris_2.5
-
Not verified
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.
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.