mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8308300: enhance exceptions in MappedMemoryUtils.c
Reviewed-by: alanb, clanger, bpb
This commit is contained in:
parent
c4408278d1
commit
69f508a2ac
3 changed files with 18 additions and 5 deletions
|
@ -176,7 +176,7 @@ JNU_ThrowByNameWithMessageAndLastError
|
|||
}
|
||||
|
||||
/*
|
||||
* Convenience method.
|
||||
* Convenience function.
|
||||
* Call JNU_ThrowByNameWithLastError for java.io.IOException.
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
|
@ -185,6 +185,16 @@ JNU_ThrowIOExceptionWithLastError(JNIEnv *env, const char *defaultDetail)
|
|||
JNU_ThrowByNameWithLastError(env, "java/io/IOException", defaultDetail);
|
||||
}
|
||||
|
||||
/*
|
||||
* Throw java.io.IOException using a given message and the string
|
||||
* returned by getLastErrorString to construct the detail string.
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
JNU_ThrowIOExceptionWithMessageAndLastError(JNIEnv *env, const char *message)
|
||||
{
|
||||
JNU_ThrowByNameWithMessageAndLastError(env, "java/io/IOException", message);
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jvalue JNICALL
|
||||
JNU_CallStaticMethodByName(JNIEnv *env,
|
||||
|
|
|
@ -92,6 +92,9 @@ JNU_ThrowByNameWithMessageAndLastError
|
|||
JNIEXPORT void JNICALL
|
||||
JNU_ThrowIOExceptionWithLastError(JNIEnv *env, const char *defaultDetail);
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
JNU_ThrowIOExceptionWithMessageAndLastError(JNIEnv *env, const char *message);
|
||||
|
||||
/* Convert between Java strings and i18n C strings */
|
||||
JNIEXPORT const char *
|
||||
GetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue