changeset 9227:9b750cc73624

Merge
author lana
date Tue, 18 Mar 2014 12:53:28 -0700
parents 4df843ea9fb7 1ecfc0fac3e7
children db30cb9eb18d
files .hgtags
diffstat 4 files changed, 24 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Feb 21 16:55:25 2014 +0400
+++ b/.hgtags	Tue Mar 18 12:53:28 2014 -0700
@@ -253,6 +253,10 @@
 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
--- a/src/share/classes/javax/swing/MenuSelectionManager.java	Fri Feb 21 16:55:25 2014 +0400
+++ b/src/share/classes/javax/swing/MenuSelectionManager.java	Tue Mar 18 12:53:28 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * 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 javax.swing.event.*;
 
 import sun.awt.AppContext;
+import sun.swing.SwingUtilities2;
 
 /**
  * A MenuSelectionManager owns the selection in menu hierarchy.
@@ -60,6 +61,12 @@
             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;
--- a/src/share/classes/sun/swing/SwingUtilities2.java	Fri Feb 21 16:55:25 2014 +0400
+++ b/src/share/classes/sun/swing/SwingUtilities2.java	Tue Mar 18 12:53:28 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * 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 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.
--- a/src/share/native/sun/management/DiagnosticCommandImpl.c	Fri Feb 21 16:55:25 2014 +0400
+++ b/src/share/native/sun/management/DiagnosticCommandImpl.c	Tue Mar 18 12:53:28 2014 -0700
@@ -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 @@
                                        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 @@
   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 @@
       if (args == NULL) {
           free(dcmd_info_array);
           JNU_ThrowOutOfMemoryError(env, 0);
+          return NULL;
       }
       obj = JNU_NewObjectByName(env,
                                 "sun/management/DiagnosticCommandInfo",
@@ -152,6 +156,7 @@
       if (obj == NULL) {
           free(dcmd_info_array);
           JNU_ThrowOutOfMemoryError(env, 0);
+          return NULL;
       }
       (*env)->SetObjectArrayElement(env, result, i, obj);
   }