提交 7b87c56a 编写于 作者: L lana

Merge

......@@ -253,6 +253,10 @@ a9088d517f2fa9919886d3d95023c518b59172b8 jdk8-b126
fbf251b8ef8a4a2aa1fd58efc8d0d5c8e2fd582b jdk8-b127
f644211c59fd7c1d0c81239c55b31e1d377d7650 jdk8-b128
80568a19aab7300bc92baf2dc225be929f5b03ed jdk8-b129
9543b632ab87368c887d8b29b21157ebb44228d0 jdk8u20-b02
5a9f04957f826ce23639479c9791c7d8fd282b01 jdk8u20-b03
c347889445c1153f11aaa56092d44a911e497454 jdk8u20-b04
c9117a5defe912b1f7ae92bb0730d6e7a5a045df jdk8u20-b05
43386cc9a017a9f9e704760050086bb18b778ae0 jdk8-b130
e291ac47c9a90366c3c0787a6f7ce547a2bda308 jdk8-b131
43cb25339b5500871f41388a5197f1b01c4b57b8 jdk8-b132
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -30,6 +30,7 @@ import java.awt.event.*;
import javax.swing.event.*;
import sun.awt.AppContext;
import sun.swing.SwingUtilities2;
/**
* A MenuSelectionManager owns the selection in menu hierarchy.
......@@ -60,6 +61,12 @@ public class MenuSelectionManager {
if (msm == null) {
msm = new MenuSelectionManager();
context.put(MENU_SELECTION_MANAGER_KEY, msm);
// installing additional listener if found in the AppContext
Object o = context.get(SwingUtilities2.MENU_SELECTION_MANAGER_LISTENER_KEY);
if (o != null && o instanceof ChangeListener) {
msm.addChangeListener((ChangeListener) o);
}
}
return msm;
......
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -81,6 +81,9 @@ public class SwingUtilities2 {
public static final Object LAF_STATE_KEY =
new StringBuffer("LookAndFeel State");
public static final Object MENU_SELECTION_MANAGER_LISTENER_KEY =
new StringBuffer("MenuSelectionManager listener key");
// Maintain a cache of CACHE_SIZE fonts and the left side bearing
// of the characters falling into the range MIN_CHAR_INDEX to
// MAX_CHAR_INDEX. The values in fontCache are created as needed.
......
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册