aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramurillo <none@none>2014-03-13 10:18:28 -0700
committeramurillo <none@none>2014-03-13 10:18:28 -0700
commit72dcdcda75b55141fa6df348579e697dcfacb6b3 (patch)
tree379833ab94c360ee8cbe0a192d27e463f9207f4b
parent43bd4995c0d2c142f1971eb8db05370f318ae19b (diff)
parent0c36733c22391b126bbe1f7bc931a8bd67b52ebf (diff)
-rw-r--r--src/share/native/sun/management/DiagnosticCommandImpl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/share/native/sun/management/DiagnosticCommandImpl.c b/src/share/native/sun/management/DiagnosticCommandImpl.c
index 4ca0315ab..0ad49ddc1 100644
--- a/src/share/native/sun/management/DiagnosticCommandImpl.c
+++ b/src/share/native/sun/management/DiagnosticCommandImpl.c
@@ -23,18 +23,19 @@
* questions.
*/
+#include <stdlib.h>
#include <jni.h>
#include "management.h"
#include "sun_management_DiagnosticCommandImpl.h"
JNIEXPORT void JNICALL Java_sun_management_DiagnosticCommandImpl_setNotificationEnabled
(JNIEnv *env, jobject dummy, jboolean enabled) {
- if(jmm_version > JMM_VERSION_1_2_2) {
- jmm_interface->SetDiagnosticFrameworkNotificationEnabled(env, enabled);
- } else {
+ if (jmm_version <= JMM_VERSION_1_2_2) {
JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
"JMX interface to diagnostic framework notifications is not supported by this VM");
+ return;
}
+ jmm_interface->SetDiagnosticFrameworkNotificationEnabled(env, enabled);
}
JNIEXPORT jobjectArray JNICALL
@@ -121,6 +122,7 @@ Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo
sizeof(dcmdInfo));
if (dcmd_info_array == NULL) {
JNU_ThrowOutOfMemoryError(env, NULL);
+ return NULL;
}
jmm_interface->GetDiagnosticCommandInfo(env, commands, dcmd_info_array);
dcmdInfoCls = (*env)->FindClass(env,
@@ -129,6 +131,7 @@ Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo
if (result == NULL) {
free(dcmd_info_array);
JNU_ThrowOutOfMemoryError(env, 0);
+ return NULL;
}
for (i=0; i<num_commands; i++) {
args = getDiagnosticCommandArgumentInfoArray(env,
@@ -137,6 +140,7 @@ Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo
if (args == NULL) {
free(dcmd_info_array);
JNU_ThrowOutOfMemoryError(env, 0);
+ return NULL;
}
obj = JNU_NewObjectByName(env,
"sun/management/DiagnosticCommandInfo",
@@ -152,6 +156,7 @@ Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo
if (obj == NULL) {
free(dcmd_info_array);
JNU_ThrowOutOfMemoryError(env, 0);
+ return NULL;
}
(*env)->SetObjectArrayElement(env, result, i, obj);
}