changeset 11955:786e9aa80e15

Merge
author prr
date Tue, 05 May 2015 13:29:31 -0700
parents 063bc66c3e1f 207c1b0356ea
children 9a13d4ab1503
files src/java.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider src/java.management/share/classes/com/sun/management/DiagnosticCommandMBean.java src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java src/java.management/share/classes/com/sun/management/GarbageCollectorMXBean.java src/java.management/share/classes/com/sun/management/GcInfo.java src/java.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java src/java.management/share/classes/com/sun/management/OperatingSystemMXBean.java src/java.management/share/classes/com/sun/management/ThreadMXBean.java src/java.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java src/java.management/share/classes/com/sun/management/VMOption.java src/java.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java src/java.management/share/classes/com/sun/management/package-info.java src/java.management/share/classes/sun/management/DiagnosticCommandArgumentInfo.java src/java.management/share/classes/sun/management/DiagnosticCommandImpl.java src/java.management/share/classes/sun/management/DiagnosticCommandInfo.java src/java.management/share/classes/sun/management/Flag.java src/java.management/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java src/java.management/share/classes/sun/management/GcInfoBuilder.java src/java.management/share/classes/sun/management/GcInfoCompositeData.java src/java.management/share/classes/sun/management/HotSpotDiagnostic.java src/java.management/share/classes/sun/management/ManagementFactory.java src/java.management/share/classes/sun/management/VMOptionCompositeData.java src/java.management/share/native/libmanagement/DiagnosticCommandImpl.c src/java.management/share/native/libmanagement/Flag.c src/java.management/share/native/libmanagement/GcInfoBuilder.c src/java.management/share/native/libmanagement/HotSpotDiagnostic.c src/java.management/unix/classes/sun/management/OperatingSystemImpl.java src/java.management/unix/native/libmanagement/LinuxOperatingSystem.c src/java.management/unix/native/libmanagement/MacosxOperatingSystem.c src/java.management/unix/native/libmanagement/OperatingSystemImpl.c src/java.management/unix/native/libmanagement/SolarisOperatingSystem.c src/java.management/windows/classes/sun/management/OperatingSystemImpl.java src/java.management/windows/native/libmanagement/OperatingSystemImpl.c test/java/lang/management/ThreadMXBean/Semaphore.java test/java/math/RandomSeed.java test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java
diffstat 424 files changed, 11567 insertions(+), 9121 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Apr 30 16:47:05 2015 +0300
+++ b/.hgtags	Tue May 05 13:29:31 2015 -0700
@@ -304,3 +304,4 @@
 48ee960f29df93a9b2a895621321358a86909086 jdk9-b59
 84c5527f742bc64562e47d3149c16197fe1c4c1a jdk9-b60
 da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61
+49118e68fbd4cc0044e718c47db681946d5efd69 jdk9-b62
--- a/make/Import.gmk	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/Import.gmk	Tue May 05 13:29:31 2015 -0700
@@ -32,11 +32,11 @@
 
 # Put the libraries here. Different locations for different target OS types.
 ifneq ($(OPENJDK_TARGET_OS), windows)
-  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)
+  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
   BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)
   SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent$(OPENJDK_TARGET_CPU_LIBDIR)
 else
-  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/bin
+  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/bin
   BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
   SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent
 endif
@@ -80,11 +80,11 @@
 ################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \
-      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
+  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \
+      $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
 else
-  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
-      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
+  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
+      $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
 endif
 
 ifneq ($(OPENJDK_TARGET_OS), windows)
--- a/make/data/tzdata/VERSION	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/data/tzdata/VERSION	Tue May 05 13:29:31 2015 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2015b
+tzdata2015d
--- a/make/data/tzdata/africa	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/data/tzdata/africa	Tue May 05 13:29:31 2015 -0700
@@ -342,35 +342,29 @@
 # above) says DST had no affect on electricity consumption.  There is
 # no information about when DST will end this fall.  See:
 # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833
+
+# From Steffen Thorsen (2015-04-08):
+# Egypt will start DST on midnight after Thursday, April 30, 2015.
+# This is based on a law (no 35) from May 15, 2014 saying it starts the last
+# Thursday of April....  Clocks will still be turned back for Ramadan, but
+# dates not yet announced....
+# http://almogaz.com/news/weird-news/2015/04/05/1947105 ...
+# http://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
+
+# From Ahmed Nazmy (2015-04-20):
+# Egypt's ministers cabinet just announced ... that it will cancel DST at
+# least for 2015.
 #
-# For now, guess that later spring and fall transitions will use
-# 2010's rules, and guess that Egypt will switch to standard time at
-# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the
-# first Friday after Ramadan.  To implement this,
-# transition dates for 2015 through 2037 were determined by running
-# the following program under GNU Emacs 24.3, with the results integrated
-# by hand into the table below.  Ramadan again intrudes on the guessed
-# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff.
-# (let ((islamic-year 1436))
-#   (while (< islamic-year 1460)
-#     (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
-#           (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
-#           (friday 5))
-#       (while (/= friday (mod a 7))
-#         (setq a (1- a)))
-#       (while (/= friday (mod b 7))
-#         (setq b (1+ b)))
-#       (setq a (1- a))
-#       (setq b (1- b))
-#       (setq a (calendar-gregorian-from-absolute a))
-#       (setq b (calendar-gregorian-from-absolute b))
-#       (insert
-#        (format
-#         (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n"
-#                 "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n")
-#         (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
-#         (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
-#     (setq islamic-year (+ 1 islamic-year))))
+# From Tim Parenti (2015-04-20):
+# http://english.ahram.org.eg/WriterArticles/NewsContentP/1/128195/Egypt/No-daylight-saving-this-summer-Egypts-prime-minist.aspx
+# "Egypt's cabinet agreed on Monday not to switch clocks for daylight saving
+# time this summer, and carry out studies on the possibility of canceling the
+# practice altogether in future years."
+#
+# From Paul Eggert (2015-04-20):
+# For now, assume DST will be canceled.  Any resumption would likely
+# use different rules anyway.
+
 Rule	Egypt	2008	only	-	Aug	lastThu	24:00	0	-
 Rule	Egypt	2009	only	-	Aug	20	24:00	0	-
 Rule	Egypt	2010	only	-	Aug	10	24:00	0	-
@@ -379,22 +373,7 @@
 Rule	Egypt	2014	only	-	May	15	24:00	1:00	S
 Rule	Egypt	2014	only	-	Jun	26	24:00	0	-
 Rule	Egypt	2014	only	-	Jul	31	24:00	1:00	S
-Rule	Egypt	2014	max	-	Sep	lastThu	24:00	0	-
-Rule	Egypt	2015	2019	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	2015	only	-	Jun	11	24:00	0	-
-Rule	Egypt	2015	only	-	Jul	23	24:00	1:00	S
-Rule	Egypt	2016	only	-	Jun	 2	24:00	0	-
-Rule	Egypt	2016	only	-	Jul	 7	24:00	1:00	S
-Rule	Egypt	2017	only	-	May	25	24:00	0	-
-Rule	Egypt	2017	only	-	Jun	29	24:00	1:00	S
-Rule	Egypt	2018	only	-	May	10	24:00	0	-
-Rule	Egypt	2018	only	-	Jun	14	24:00	1:00	S
-Rule	Egypt	2019	only	-	May	 2	24:00	0	-
-Rule	Egypt	2019	only	-	Jun	 6	24:00	1:00	S
-Rule	Egypt	2020	only	-	May	28	24:00	1:00	S
-Rule	Egypt	2021	only	-	May	13	24:00	1:00	S
-Rule	Egypt	2022	only	-	May	 5	24:00	1:00	S
-Rule	Egypt	2023	max	-	Apr	lastFri	 0:00s	1:00	S
+Rule	Egypt	2014	only	-	Sep	lastThu	24:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Cairo	2:05:09 -	LMT	1900 Oct
--- a/make/data/tzdata/antarctica	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/data/tzdata/antarctica	Tue May 05 13:29:31 2015 -0700
@@ -38,41 +38,6 @@
 # I made up all time zone abbreviations mentioned here; corrections welcome!
 # FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited.
 
-# These rules are stolen from the 'southamerica' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-
-Rule	ArgAQ	1964	1966	-	Oct	15	0:00	1:00	S
-Rule	ArgAQ	1967	only	-	Apr	 2	0:00	0	-
-Rule	ArgAQ	1967	1968	-	Oct	Sun>=1	0:00	1:00	S
-Rule	ArgAQ	1968	1969	-	Apr	Sun>=1	0:00	0	-
-Rule	ArgAQ	1974	only	-	Jan	23	0:00	1:00	S
-Rule	ArgAQ	1974	only	-	May	 1	0:00	0	-
-Rule	ChileAQ	1972	1986	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1987	only	-	Apr	12	3:00u	0	-
-Rule	ChileAQ	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	ChileAQ	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1990	only	-	Mar	18	3:00u	0	-
-Rule	ChileAQ	1990	only	-	Sep	16	4:00u	1:00	S
-Rule	ChileAQ	1991	1996	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1997	only	-	Mar	30	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Sep	27	4:00u	1:00	S
-Rule	ChileAQ	1999	only	-	Apr	 4	3:00u	0	-
-Rule	ChileAQ	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	2000	2007	-	Mar	Sun>=9	3:00u	0	-
-# N.B.: the end of March 29 in Chile is March 30 in Universal time,
-# which is used below in specifying the transition.
-Rule	ChileAQ	2008	only	-	Mar	30	3:00u	0	-
-Rule	ChileAQ	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	2010	only	-	Apr	Sun>=1	3:00u	0	-
-Rule	ChileAQ	2011	only	-	May	Sun>=2	3:00u	0	-
-Rule	ChileAQ	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
-Rule	ChileAQ	2012	2015	-	Apr	Sun>=23	3:00u	0	-
-Rule	ChileAQ	2012	2014	-	Sep	Sun>=2	4:00u	1:00	S
-
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
 # Carlini, Potter Cove, King George Island, -6414-0602320, since 1982-01
@@ -367,21 +332,7 @@
 # USA - year-round bases
 #
 # Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
-#
-# From Ethan Dicks (1996-10-06):
-# It keeps the same time as Punta Arenas, Chile, because, just like us
-# and the South Pole, that's the other end of their supply line....
-# I verified with someone who was there that since 1980,
-# Palmer has followed Chile.  Prior to that, before the Falklands War,
-# Palmer used to be supplied from Argentina.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/Palmer	0	-	zzz	1965
-			-4:00	ArgAQ	AR%sT	1969 Oct  5
-			-3:00	ArgAQ	AR%sT	1982 May
-			-4:00	ChileAQ	CL%sT	2015 Apr 26 3:00u
-			-3:00	-	CLT
-#
+# See 'southamerica' for Antarctica/Palmer, since it uses South American DST.
 #
 # McMurdo Station, Ross Island, since 1955-12
 # Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20
--- a/make/data/tzdata/backward	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/data/tzdata/backward	Tue May 05 13:29:31 2015 -0700
@@ -43,6 +43,7 @@
 Link	America/Indiana/Knox	America/Knox_IN
 Link	America/Kentucky/Louisville	America/Louisville
 Link	America/Argentina/Mendoza	America/Mendoza
+Link	America/Toronto		America/Montreal
 Link	America/Rio_Branco	America/Porto_Acre
 Link	America/Argentina/Cordoba	America/Rosario
 Link	America/Denver		America/Shiprock
--- a/make/data/tzdata/europe	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/data/tzdata/europe	Tue May 05 13:29:31 2015 -0700
@@ -99,7 +99,7 @@
 #        1:00:14    SET           Swedish (1879-1899)*
 #        2:00       EET EEST      Eastern Europe
 #        3:00       FET           Further-eastern Europe (2011-2014)*
-#        3:00       MSK MSD  MSM* Moscow
+#        3:00       MSK MSD  MSM* Minsk, Moscow
 
 # From Peter Ilieve (1994-12-04),
 # The original six [EU members]: Belgium, France, (West) Germany, Italy,
--- a/make/data/tzdata/northamerica	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/data/tzdata/northamerica	Tue May 05 13:29:31 2015 -0700
@@ -250,9 +250,14 @@
 # The law doesn't give abbreviations.
 #
 # From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
-# Public law 106-564 (2000-12-23) introduced the abbreviation
-# "Chamorro Standard Time" for time in Guam and the Northern Marianas.
-# See the file "australasia".
+# Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time"
+# for time in Guam and the Northern Marianas.  See the file "australasia".
+#
+# From Paul Eggert (2015-04-17):
+# HST and HDT are standardized abbreviations for Hawaii-Aleutian
+# standard and daylight times.  See section 9.47 (p 234) of the
+# U.S. Government Printing Office Style Manual (2008)
+# http://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
 
 # From Arthur David Olson, 2005-08-09
 # The following was signed into law on 2005-08-08.
@@ -559,7 +564,7 @@
 			-11:00	-	BST	1969
 			-11:00	US	B%sT	1983 Oct 30  2:00
 			-10:00	US	AH%sT	1983 Nov 30
-			-10:00	US	HA%sT
+			-10:00	US	H%sT
 # The following switches don't quite make our 1970 cutoff.
 #
 # Shanks writes that part of southwest Alaska (e.g. Aniak)
@@ -1354,14 +1359,9 @@
 
 # Quebec
 
-# From Paul Eggert (2013-08-30):
-# Since 1970 most of Quebec has been like Toronto.
-# However, because earlier versions of the tz database mistakenly relied on data
-# from Shanks & Pottenger saying that Quebec differed from Ontario after 1970,
-# a separate entry was created for most of Quebec.  We're loath to lose
-# its pre-1970 info, even though the tz database is normally limited to
-# zones that differ after 1970, so keep this otherwise out-of-scope entry.
-
+# From Paul Eggert (2015-03-24):
+# See America/Toronto for most of Quebec, including Montreal.
+#
 # Matthews and Vincent (1998) also write that Quebec east of the -63
 # meridian is supposed to observe AST, but residents as far east as
 # Natashquan use EST/EDT, and residents east of Natashquan use AST.
@@ -1375,39 +1375,10 @@
 # For lack of better info, guess this practice began around 1970, contra to
 # Shanks & Pottenger who have this region observing AST/ADT.
 
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
-Rule	Mont	1917	only	-	Apr	24	0:00	0	S
-Rule	Mont	1919	only	-	Mar	31	2:30	1:00	D
-Rule	Mont	1919	only	-	Oct	25	2:30	0	S
-Rule	Mont	1920	only	-	May	 2	2:30	1:00	D
-Rule	Mont	1920	1922	-	Oct	Sun>=1	2:30	0	S
-Rule	Mont	1921	only	-	May	 1	2:00	1:00	D
-Rule	Mont	1922	only	-	Apr	30	2:00	1:00	D
-Rule	Mont	1924	only	-	May	17	2:00	1:00	D
-Rule	Mont	1924	1926	-	Sep	lastSun	2:30	0	S
-Rule	Mont	1925	1926	-	May	Sun>=1	2:00	1:00	D
-Rule	Mont	1927	1937	-	Apr	lastSat	24:00	1:00	D
-Rule	Mont	1927	1937	-	Sep	lastSat	24:00	0	S
-Rule	Mont	1938	1940	-	Apr	lastSun	0:00	1:00	D
-Rule	Mont	1938	1939	-	Sep	lastSun	0:00	0	S
-Rule	Mont	1946	1973	-	Apr	lastSun	2:00	1:00	D
-Rule	Mont	1945	1948	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1949	1950	-	Oct	lastSun	2:00	0	S
-Rule	Mont	1951	1956	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1957	1973	-	Oct	lastSun	2:00	0	S
-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Blanc-Sablon -3:48:28 -	LMT	1884
 			-4:00	Canada	A%sT	1970
 			-4:00	-	AST
-Zone America/Montreal	-4:54:16 -	LMT	1884
-			-5:00	Mont	E%sT	1918
-			-5:00	Canada	E%sT	1919
-			-5:00	Mont	E%sT	1942 Feb  9  2:00s
-			-5:00	Canada	E%sT	1946
-			-5:00	Mont	E%sT	1974
-			-5:00	Canada	E%sT
 
 # Ontario
 
@@ -1898,17 +1869,115 @@
 # Dawson switched to PST in 1973.  Inuvik switched to MST in 1979.
 # Mathew Englander (1996-10-07) gives the following refs:
 #	* 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
-#	c. 7 defines Yukon standard time as UTC-9.  This is still valid;
+#	c. 7 defines Yukon standard time as UTC-9....
 #	see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1).
+#	[http://canlii.ca/t/7vhg]
 #	* C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00.
 #	* O.I.C. 1980/02 established DST.
 #	* O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00.
-# Shanks & Pottenger say Yukon's 1973-10-28 switch was at 2:00; go
-# with Englander.
-# From Chris Walton (2006-06-26):
-# Here is a link to the old daylight saving portion of the interpretation
-# act which was last updated in 1987:
-# http://www.gov.yk.ca/legislation/regs/oic1987_056.pdf
+
+# From Brian Inglis (2015-04-14):
+#
+# I tried to trace the history of Yukon time and found the following
+# regulations, giving the reference title and URL if found, regulation name,
+# and relevant quote if available.  Each regulation specifically revokes its
+# predecessor.  The final reference is to the current Interpretation Act
+# authorizing and resulting from these regulatory changes.
+#
+# Only recent regulations were retrievable via Yukon government site search or
+# index, and only some via Canadian legal sources.  Other sources used include
+# articles titled "Standard Time and Time Zones in Canada" from JRASC via ADS
+# Abstracts, cited by ADO for 1932 ..., and updated versions from 1958 and
+# 1970 quoted below; each article includes current extracts from provincial
+# and territorial ST and DST regulations at the end, summaries and details of
+# standard times and daylight saving time at many locations across Canada,
+# with time zone maps, tables and calculations for Canadian Sunrise, Sunset,
+# and LMST; they also cover many countries and global locations, with a chart
+# and table showing current Universal Time offsets, and may be useful as
+# another source of information for 1970 and earlier.
+#
+# * Standard Time and Time Zones in Canada; Smith, C.C.; JRASC, Vol. 26,
+#   pp.49-77; February 1932; SAO/NASA Astrophysics Data System (ADS)
+#   http://adsabs.harvard.edu/abs/1932JRASC..26...49S from p.75:
+#   Yukon Interpretation Ordinance
+#   Yukon standard time is the local mean time at the one hundred and
+#   thirty-fifth meridian.
+#
+# * Standard Time and Time Zones in Canada; Smith, C.C.; Thomson, Malcolm M.;
+#   JRASC, Vol. 52, pp.193-223; October 1958; SAO/NASA Astrophysics Data System
+#   (ADS) http://adsabs.harvard.edu/abs/1958JRASC..52..193S from pp.220-1:
+#   Yukon Interpretation Ordinance, 1955, Chap. 16.
+#
+#     (1) Subject to this section, standard time shall be reckoned as nine
+#     hours behind Greenwich Time and called Yukon Standard Time.
+#
+#     (2) Notwithstanding subsection (1), the Commissioner may make regulations
+#     varying the manner of reckoning standard time.
+#
+# * Yukon Territory Commissioner's Order 1966-20 Interpretation Ordinance
+#   http://? - no online source found
+#
+# * Standard Time and Time Zones in Canada; Thomson, Malcolm M.; JRASC,
+#   Vol. 64, pp.129-162; June 1970; SAO/NASA Astrophysics Data System (ADS)
+#   http://adsabs.harvard.edu/abs/1970JRASC..64..129T from p.156: Yukon
+#   Territory Commissioner's Order 1967-59 Interpretation Ordinance ...
+#
+#     1. Commissioner's Order 1966-20 dated at Whitehorse in the Yukon
+#     Territory on 27th January, 1966, is hereby revoked.
+#
+#     2. Yukon (East) Standard Time as defined by section 36 of the
+#     Interpretation Ordinance from and after mid-night on the 28th day of May,
+#     1967 shall be reckoned in the same manner as Pacific Standard Time, that
+#     is to say, eight hours behind Greenwich Time in the area of the Yukon
+#     Territory lying east of the 138th degree longitude west.
+#
+#     3. In the remainder of the Territory, lying west of the 138th degree
+#     longitude west, Yukon (West) Standard Time shall be reckoned as nine
+#     hours behind Greenwich Time.
+#
+# * Yukon Standard Time defined as Pacific Standard Time, YCO 1973/214
+#   http://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
+#   C.O. 1973/214 INTERPRETATION ACT ...
+#
+#     1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby
+#     revoked.
+#
+#     2. Yukon Standard Time as defined by section 36 of the Interpretation
+#     Act from and after midnight on the twenty-eighth day of October, 1973
+#     shall be reckoned in the same manner as Pacific Standard Time, that is
+#     to say eight hours behind Greenwich Time.
+#
+# * O.I.C. 1980/02 INTERPRETATION ACT
+#   http://? - no online source found
+#
+# * Yukon Daylight Saving Time, YOIC 1987/56
+#   http://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
+#   O.I.C. 1987/056 INTERPRETATION ACT ...
+#
+#   In every year between
+#     (a) two o'clock in the morning in the first Sunday in April, and
+#     (b) two o'clock in the morning in the last Sunday in October,
+#   Standard Time shall be reckoned as seven hours behind Greenwich Time and
+#   called Yukon Daylight Saving Time.
+#   ...
+#   Dated ... 9th day of March, A.D., 1987.
+#
+# * Yukon Daylight Saving Time 2006, YOIC 2006/127
+#   http://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
+#   O.I.C. 2006/127 INTERPRETATION ACT ...
+#
+#     1. In Yukon each year the time for general purposes shall be 7 hours
+#     behind Greenwich mean time during the period commencing at two o'clock
+#     in the forenoon on the second Sunday of March and ending at two o'clock
+#     in the forenoon on the first Sunday of November and shall be called
+#     Yukon Daylight Saving Time.
+#
+#     2. Order-in-Council 1987/56 is revoked.
+#
+#     3. This order comes into force January 1, 2007.
+#
+# * Interpretation Act, RSY 2002, c 125
+# http://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
 
 # From Rives McDow (1999-09-04):
 # Nunavut ... moved ... to incorporate the whole territory into one time zone.
@@ -2134,7 +2203,7 @@
 			-7:00	NT_YK	M%sT	1980
 			-7:00	Canada	M%sT
 Zone America/Whitehorse	-9:00:12 -	LMT	1900 Aug 20
-			-9:00	NT_YK	Y%sT	1966 Jul  1  2:00
+			-9:00	NT_YK	Y%sT	1967 May 28  0:00
 			-8:00	NT_YK	P%sT	1980
 			-8:00	Canada	P%sT
 Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
--- a/make/data/tzdata/southamerica	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/data/tzdata/southamerica	Tue May 05 13:29:31 2015 -0700
@@ -1121,6 +1121,60 @@
 
 # Chile
 
+# From Paul Eggert (2015-04-03):
+# Shanks & Pottenger says America/Santiago introduced standard time in
+# 1890 and rounds its UTC offset to 70W40; guess that in practice this
+# was the same offset as in 1916-1919.  It also says Pacific/Easter
+# standardized on 109W22 in 1890; assume this didn't change the clocks.
+#
+# Dates for America/Santiago from 1910 to 2004 are primarily from
+# the following source, cited by Oscar van Vlijmen (2006-10-08):
+# [1] Chile Law
+# http://www.webexhibits.org/daylightsaving/chile.html
+# This contains a copy of a this official table:
+# Cambios en la hora oficial de Chile desde 1900 (retrieved 2008-03-30)
+# http://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
+# [1] needs several corrections, though.
+#
+# The first set of corrections is from:
+# [2] History of the Official Time of Chile
+# http://www.horaoficial.cl/ing/horaof_ing.html (retrieved 2012-03-06).  See:
+# http://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
+# This is an English translation of:
+# Historia de la hora oficial de Chile (retrieved 2012-10-24).  See:
+# http://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
+# A fancier Spanish version (requiring mouse-clicking) is at:
+# http://www.horaoficial.cl/historia_hora.html
+# Conflicts between [1] and [2] were resolved as follows:
+#
+#  - [1] says the 1910 transition was Jan 1, [2] says Jan 10 and cites
+#    Boletín Nº 1, Aviso Nº 1 (1910).  Go with [2].
+#
+#  - [1] says SMT was -4:42:45, [2] says Chile's official time from
+#    1916 to 1919 was -4:42:46.3, the meridian of Chile's National
+#    Astronomical Observatory (OAN), then located in what is now
+#    Quinta Normal in Santiago.  Go with [2], rounding it to -4:42:46.
+#
+#  - [1] says the 1918 transition was Sep 1, [2] says Sep 10 and cites
+#    Boletín Nº 22, Aviso Nº 129/1918 (1918-08-23).  Go with [2].
+#
+#  - [1] does not give times for transitions; assume they occur
+#    at midnight mainland time, the current common practice.  However,
+#    go with [2]'s specification of 23:00 for the 1947-05-21 transition.
+#
+# Another correction to [1] is from Jesper Nørgaard Welen, who
+# wrote (2006-10-08), "I think that there are some obvious mistakes in
+# the suggested link from Oscar van Vlijmen,... for instance entry 66
+# says that GMT-4 ended 1990-09-12 while entry 67 only begins GMT-3 at
+# 1990-09-15 (they should have been 1990-09-15 and 1990-09-16
+# respectively), but anyhow it clears up some doubts too."
+#
+# Data for Pacific/Easter from 1910 through 1967 come from Shanks &
+# Pottenger.  After that, for lack of better info assume
+# Pacific/Easter is always two hours behind America/Santiago;
+# this is known to work for DST transitions starting in 2008 and
+# may well be true for earlier transitions.
+
 # From Eduardo Krell (1995-10-19):
 # The law says to switch to DST at midnight [24:00] on the second SATURDAY
 # of October....  The law is the same for March and October.
@@ -1133,78 +1187,35 @@
 # Because of the same drought, the government decided to end DST later,
 # on April 3, (one-time change).
 
-# From Oscar van Vlijmen (2006-10-08):
-# http://www.horaoficial.cl/cambio.htm
-
-# From Jesper Nørgaard Welen (2006-10-08):
-# I think that there are some obvious mistakes in the suggested link
-# from Oscar van Vlijmen,... for instance entry 66 says that GMT-4
-# ended 1990-09-12 while entry 67 only begins GMT-3 at 1990-09-15
-# (they should have been 1990-09-15 and 1990-09-16 respectively), but
-# anyhow it clears up some doubts too.
-
-# From Paul Eggert (2014-08-12):
-# The following data entries for Chile and America/Santiago are from
-# <http://www.horaoficial.cl/horaof.htm> (2006-09-20), transcribed by
-# Jesper Nørgaard Welen.  The data entries for Pacific/Easter are from Shanks
-# & Pottenger, except with DST transitions after 1932 cloned from
-# America/Santiago.  The pre-1980 Pacific/Easter data entries are dubious,
-# but we have no other source.
-
 # From Germán Poo-Caamaño (2008-03-03):
 # Due to drought, Chile extends Daylight Time in three weeks.  This
 # is one-time change (Saturday 3/29 at 24:00 for America/Santiago
 # and Saturday 3/29 at 22:00 for Pacific/Easter)
 # The Supreme Decree is located at
 # http://www.shoa.cl/servicios/supremo316.pdf
-# and the instructions for 2008 are located in:
-# http://www.horaoficial.cl/cambio.htm
-
+#
 # From José Miguel Garrido (2008-03-05):
-# ...
-# You could see the announces of the change on
 # http://www.shoa.cl/noticias/2008/04hora/hora.htm
 
 # From Angel Chiang (2010-03-04):
 # Subject: DST in Chile exceptionally extended to 3 April due to earthquake
 # http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098
-# (in Spanish, last paragraph).
 #
-# This is breaking news. There should be more information available later.
-
 # From Arthur David Olson (2010-03-06):
 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
 
-# From Glenn Eychaner (2011-03-02):
-# It appears that the Chilean government has decided to postpone the
-# change from summer time to winter time again, by three weeks to April
-# 2nd:
-# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
-#
-# This is not yet reflected in the official "cambio de hora" site, but
-# probably will be soon:
-# http://www.horaoficial.cl/cambio.htm
-
-# From Arthur David Olson (2011-03-02):
-# The emol.com article mentions a water shortage as the cause of the
-# postponement, which may mean that it's not a permanent change.
-
 # From Glenn Eychaner (2011-03-28):
-# The article:
 # http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
-#
 # In English:
 # Chile's clocks will go back an hour this year on the 7th of May instead
 # of this Saturday. They will go forward again the 3rd Saturday in
-# August, not in October as they have since 1968. This is a pilot plan
-# which will be reevaluated in 2012.
+# August, not in October as they have since 1968.
 
 # From Mauricio Parada (2012-02-22), translated by Glenn Eychaner (2012-02-23):
 # As stated in the website of the Chilean Energy Ministry
 # http://www.minenergia.cl/ministerio/noticias/generales/gobierno-anuncia-fechas-de-cambio-de.html
 # The Chilean Government has decided to postpone the entrance into winter time
-# (to leave DST) from March 11 2012 to April 28th 2012. The decision has not
-# been yet formalized but it will within the next days.
+# (to leave DST) from March 11 2012 to April 28th 2012....
 # Quote from the website communication:
 #
 # 6. For the year 2012, the dates of entry into winter time will be as follows:
@@ -1237,17 +1248,9 @@
 # From Paul Eggert (2015-03-03):
 # For now, assume that the extension will persist indefinitely.
 
-# NOTE: ChileAQ rules for Antarctic bases are stored separately in the
-# 'antarctica' file.
-
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
+Rule	Chile	1927	1931	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
-Rule	Chile	1942	only	-	Jun	 1	4:00u	0	-
-Rule	Chile	1942	only	-	Aug	 1	5:00u	1:00	S
-Rule	Chile	1946	only	-	Jul	15	4:00u	1:00	S
-Rule	Chile	1946	only	-	Sep	 1	3:00u	0:00	-
-Rule	Chile	1947	only	-	Apr	 1	4:00u	0	-
 Rule	Chile	1968	only	-	Nov	 3	4:00u	1:00	S
 Rule	Chile	1969	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1969	only	-	Nov	23	4:00u	1:00	S
@@ -1258,10 +1261,8 @@
 Rule	Chile	1973	only	-	Sep	30	4:00u	1:00	S
 Rule	Chile	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	1987	only	-	Apr	12	3:00u	0	-
-Rule	Chile	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	Chile	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	Chile	1990	only	-	Mar	18	3:00u	0	-
+Rule	Chile	1988	1990	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	1988	1989	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	1990	only	-	Sep	16	4:00u	1:00	S
 Rule	Chile	1991	1996	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
@@ -1284,15 +1285,21 @@
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Santiago	-4:42:46 -	LMT	1890
-			-4:42:46 -	SMT	1910        # Santiago Mean Time
+			-4:42:46 -	SMT	1910 Jan 10 # Santiago Mean Time
 			-5:00	-	CLT	1916 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1918 Sep  1 # Santiago Mean Time
-			-4:00	-	CLT	1919 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1927 Sep  1 # Santiago Mean Time
-			-5:00	Chile	CL%sT	1947 May 22 # Chile Time
+			-4:42:46 -	SMT	1918 Sep 10
+			-4:00	-	CLT	1919 Jul  1
+			-4:42:46 -	SMT	1927 Sep  1
+			-5:00	Chile	CL%sT	1932 Sep  1
+			-4:00	-	CLT	1942 Jun  1
+			-5:00	-	CLT	1942 Aug  1
+			-4:00	-	CLT	1946 Jul 15
+			-4:00	1:00	CLST	1946 Sep  1 # central Chile
+			-4:00	-	CLT	1947 Apr  1
+			-5:00	-	CLT	1947 May 21 23:00
 			-4:00	Chile	CL%sT	2015 Apr 26  3:00u
 			-3:00	-	CLT
-Zone Pacific/Easter	-7:17:44 -	LMT	1890
+Zone Pacific/Easter	-7:17:28 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
 			-7:00	Chile	EAS%sT	1982 Mar 14 3:00u # Easter Time
 			-6:00	Chile	EAS%sT	2015 Apr 26 3:00u
@@ -1302,6 +1309,25 @@
 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
 # and Antarctic bases, are like America/Santiago.
 
+# Antarctic base using South American rules
+# (See the file 'antarctica' for more.)
+#
+# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
+#
+# From Ethan Dicks (1996-10-06):
+# It keeps the same time as Punta Arenas, Chile, because, just like us
+# and the South Pole, that's the other end of their supply line....
+# I verified with someone who was there that since 1980,
+# Palmer has followed Chile.  Prior to that, before the Falklands War,
+# Palmer used to be supplied from Argentina.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/Palmer	0	-	zzz	1965
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1982 May
+			-4:00	Chile	CL%sT	2015 Apr 26 3:00u
+			-3:00	-	CLT
+
 # Colombia
 
 # Milne gives 4:56:16.4 for Bogotá time in 1899; round to nearest.  He writes,
--- a/make/lib/Awt2dLibraries.gmk	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/lib/Awt2dLibraries.gmk	Tue May 05 13:29:31 2015 -0700
@@ -827,7 +827,7 @@
     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
   endif
 
-  LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
+  LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
       $(addprefix -I, $(LIBSPLASHSCREEN_DIRS)) \
       $(LIBJAVA_HEADER_FLAGS) \
       #
--- a/make/lib/Lib-java.instrument.gmk	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/lib/Lib-java.instrument.gmk	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -25,6 +25,9 @@
 
 include LibCommon.gmk
 
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, lib/Lib-java.instrument.gmk))
+
 ################################################################################
 
 LIBINSTRUMENT_SRC := $(JDK_TOPDIR)/src/java.instrument/share/native/libinstrument \
--- a/make/lib/Lib-java.management.gmk	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/lib/Lib-java.management.gmk	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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,33 +30,14 @@
 
 ################################################################################
 
-BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \
+LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \
     $(JDK_TOPDIR)/src/java.management/$(OPENJDK_TARGET_OS_TYPE)/native/libmanagement
-BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \
-    $(addprefix -I,$(BUILD_LIBMANAGEMENT_SRC)) \
+LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \
+    $(addprefix -I,$(LIBMANAGEMENT_SRC)) \
     -I$(SUPPORT_OUTPUTDIR)/headers/java.management \
     $(LIBJAVA_HEADER_FLAGS) \
     #
 
-# In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate
-# a binary that is compatible with windows versions older than 7/2008R2.
-# See MSDN documentation for GetProcessMemoryInfo for more information.
-BUILD_LIBMANAGEMENT_CFLAGS += -DPSAPI_VERSION=1
-
-BUILD_LIBMANAGEMENT_EXCLUDES :=
-
-ifneq ($(OPENJDK_TARGET_OS), solaris)
-  BUILD_LIBMANAGEMENT_EXCLUDES += SolarisOperatingSystem.c
-endif
-
-ifneq ($(OPENJDK_TARGET_OS), linux)
-  BUILD_LIBMANAGEMENT_EXCLUDES += LinuxOperatingSystem.c
-endif
-
-ifneq ($(OPENJDK_TARGET_OS), macosx)
-  BUILD_LIBMANAGEMENT_EXCLUDES += MacosxOperatingSystem.c
-endif
-
 LIBMANAGEMENT_OPTIMIZATION := HIGH
 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
   ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
@@ -64,17 +45,13 @@
   endif
 endif
 
-# Make it possible to override this variable
-LIBMANAGEMENT_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers
-
 $(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \
     LIBRARY := management, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
-    SRC := $(BUILD_LIBMANAGEMENT_SRC), \
-    EXCLUDE_FILES := $(BUILD_LIBMANAGEMENT_EXCLUDES), \
+    SRC := $(LIBMANAGEMENT_SRC), \
     OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
-    CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(BUILD_LIBMANAGEMENT_CFLAGS), \
-    MAPFILE := $(LIBMANAGEMENT_MAPFILE), \
+    CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(LIBMANAGEMENT_CFLAGS), \
+    MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_solaris := -lkstat, \
--- a/make/lib/Lib-jdk.hprof.agent.gmk	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/lib/Lib-jdk.hprof.agent.gmk	Tue May 05 13:29:31 2015 -0700
@@ -49,6 +49,7 @@
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
         $(BUILD_LIBHPROF_CFLAGS), \
     CFLAGS_debug := -DHPROF_LOGGING, \
+    CFLAGS_windows := -D_WINSOCK_DEPRECATED_NO_WARNINGS, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libhprof/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/lib/Lib-jdk.management.gmk	Tue May 05 13:29:31 2015 -0700
@@ -0,0 +1,80 @@
+#
+# Copyright (c) 2015, 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
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+include LibCommon.gmk
+
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, lib/Lib-jdk.management.gmk))
+
+################################################################################
+
+LIBMANAGEMENT_EXT_SRC += $(JDK_TOPDIR)/src/jdk.management/share/native/libmanagement_ext \
+    $(JDK_TOPDIR)/src/jdk.management/$(OPENJDK_TARGET_OS_TYPE)/native/libmanagement_ext       \
+    $(JDK_TOPDIR)/src/jdk.management/$(OPENJDK_TARGET_OS)/native/libmanagement_ext
+LIBMANAGEMENT_EXT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \
+    $(addprefix -I,$(LIBMANAGEMENT_EXT_SRC)) \
+    -I$(SUPPORT_OUTPUTDIR)/headers/jdk.management \
+    $(LIBJAVA_HEADER_FLAGS) \
+    #
+
+# In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate
+# a binary that is compatible with windows versions older than 7/2008R2.
+# See MSDN documentation for GetProcessMemoryInfo for more information.
+BUILD_LIBMANAGEMENT_EXT_CFLAGS += -DPSAPI_VERSION=1
+
+LIBMANAGEMENT_EXT_OPTIMIZATION := HIGH
+ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
+  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
+    LIBMANAGEMENT_EXT_OPTIMIZATION := LOW
+  endif
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT_EXT, \
+    LIBRARY := management_ext, \
+    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
+    SRC := $(LIBMANAGEMENT_EXT_SRC), \
+    LANG := C, \
+    OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \
+    CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(LIBMANAGEMENT_EXT_CFLAGS), \
+    MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmanagement_ext/mapfile-vers, \
+    LDFLAGS := $(LDFLAGS_JDKLIB) \
+        $(call SET_SHARED_LIBRARY_ORIGIN), \
+    LDFLAGS_solaris := -lkstat, \
+    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
+    LDFLAGS_SUFFIX_windows := jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib, \
+    LDFLAGS_SUFFIX_aix := -lperfstat,\
+    VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
+    RC_FLAGS := $(RC_FLAGS) \
+        -D "JDK_FNAME=management_ext.dll" \
+        -D "JDK_INTERNAL_NAME=management_ext" \
+        -D "JDK_FTYPE=0x2L", \
+    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmanagement_ext, \
+    DEBUG_SYMBOLS := true))
+
+$(BUILD_LIBMANAGEMENT_EXT): $(call FindLib, java.base, java)
+
+TARGETS += $(BUILD_LIBMANAGEMENT_EXT)
+
+################################################################################
--- a/make/mapfiles/libmanagement/mapfile-vers	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/mapfiles/libmanagement/mapfile-vers	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2015, 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
@@ -27,37 +27,10 @@
 
 SUNWprivate_1.1 {
 	global:
-	    Java_sun_management_OperatingSystemImpl_getCommittedVirtualMemorySize0;
-	    Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize0;
-	    Java_sun_management_OperatingSystemImpl_getFreeSwapSpaceSize0;
-	    Java_sun_management_OperatingSystemImpl_getMaxFileDescriptorCount0;
-	    Java_sun_management_OperatingSystemImpl_getOpenFileDescriptorCount0;
-	    Java_sun_management_OperatingSystemImpl_getProcessCpuLoad0;
-	    Java_sun_management_OperatingSystemImpl_getProcessCpuTime0;
-	    Java_sun_management_OperatingSystemImpl_getSystemCpuLoad0;
-	    Java_sun_management_OperatingSystemImpl_getTotalPhysicalMemorySize0;
-	    Java_sun_management_OperatingSystemImpl_getTotalSwapSpaceSize0;
-	    Java_sun_management_OperatingSystemImpl_initialize0;
 	    Java_sun_management_ClassLoadingImpl_setVerboseClass;
-            Java_sun_management_DiagnosticCommandImpl_executeDiagnosticCommand;
-            Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommands;
-            Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo;
-            Java_sun_management_DiagnosticCommandImpl_setNotificationEnabled;
-	    Java_sun_management_FileSystemImpl_isAccessUserOnly0;
-	    Java_sun_management_Flag_getAllFlagNames;
-	    Java_sun_management_Flag_getFlags;
-	    Java_sun_management_Flag_getInternalFlagCount;
-	    Java_sun_management_Flag_initialize;
-	    Java_sun_management_Flag_setLongValue;
-	    Java_sun_management_Flag_setBooleanValue;
-	    Java_sun_management_Flag_setStringValue;
-	    Java_sun_management_GarbageCollectorImpl_getCollectionCount;
+            Java_sun_management_FileSystemImpl_isAccessUserOnly0;
+            Java_sun_management_GarbageCollectorImpl_getCollectionCount;
 	    Java_sun_management_GarbageCollectorImpl_getCollectionTime;
-	    Java_sun_management_GarbageCollectorImpl_setNotificationEnabled;
-	    Java_sun_management_GcInfoBuilder_fillGcAttributeInfo;
-	    Java_sun_management_GcInfoBuilder_getLastGcInfo0;
-	    Java_sun_management_GcInfoBuilder_getNumGcExtAttributes;
-	    Java_sun_management_HotSpotDiagnostic_dumpHeap0;
 	    Java_sun_management_HotspotThread_getInternalThreadCount;
 	    Java_sun_management_HotspotThread_getInternalThreadTimes0;
 	    Java_sun_management_MemoryImpl_getMemoryManagers0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/mapfiles/libmanagement_ext/mapfile-vers	Tue May 05 13:29:31 2015 -0700
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2015, 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
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# Define library interface.
+
+SUNWprivate_1.1 {
+	global:
+	    Java_com_sun_management_internal_OperatingSystemImpl_getCommittedVirtualMemorySize0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_getFreePhysicalMemorySize0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_getFreeSwapSpaceSize0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_getMaxFileDescriptorCount0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_getOpenFileDescriptorCount0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuLoad0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuTime0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_getSystemCpuLoad0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_getTotalPhysicalMemorySize0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_getTotalSwapSpaceSize0;
+	    Java_com_sun_management_internal_OperatingSystemImpl_initialize0;
+            Java_com_sun_management_internal_DiagnosticCommandImpl_executeDiagnosticCommand;
+            Java_com_sun_management_internal_DiagnosticCommandImpl_getDiagnosticCommands;
+            Java_com_sun_management_internal_DiagnosticCommandImpl_getDiagnosticCommandInfo;
+            Java_com_sun_management_internal_DiagnosticCommandImpl_setNotificationEnabled;
+	    Java_com_sun_management_internal_Flag_getAllFlagNames;
+	    Java_com_sun_management_internal_Flag_getFlags;
+	    Java_com_sun_management_internal_Flag_getInternalFlagCount;
+	    Java_com_sun_management_internal_Flag_initialize;
+	    Java_com_sun_management_internal_Flag_setLongValue;
+	    Java_com_sun_management_internal_Flag_setBooleanValue;
+	    Java_com_sun_management_internal_Flag_setStringValue;
+            Java_com_sun_management_internal_GarbageCollectorExtImpl_setNotificationEnabled;
+	    Java_com_sun_management_internal_GcInfoBuilder_fillGcAttributeInfo;
+	    Java_com_sun_management_internal_GcInfoBuilder_getLastGcInfo0;
+	    Java_com_sun_management_internal_GcInfoBuilder_getNumGcExtAttributes;
+	    Java_com_sun_management_internal_HotSpotDiagnostic_dumpHeap0;
+            JNI_OnLoad;
+	local:
+	    *;
+};
--- a/make/src/classes/build/tools/module/boot.modules	Thu Apr 30 16:47:05 2015 +0300
+++ b/make/src/classes/build/tools/module/boot.modules	Tue May 05 13:29:31 2015 -0700
@@ -22,6 +22,7 @@
 jdk.hprof.agent
 jdk.httpserver
 jdk.jfr
+jdk.management
 jdk.management.cmm
 jdk.naming.rmi
 jdk.sctp
--- a/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java	Tue May 05 13:29:31 2015 -0700
@@ -38,7 +38,17 @@
  * under section 6.5. It needs to be constructed w/ an initialized
  * cipher object, and initial counter block(ICB). Given an input X
  * of arbitrary length, it processes and returns an output which has
- * the same length as X.
+ * the same length as X. The invariants of this class are:
+ *
+ * (1) The length of intialCounterBlk (and also of its clones, e.g.,
+ * fields counter and counterSave) is equal to AES_BLOCK_SIZE.
+ *
+ * (2) After construction, the field counter never becomes null, it
+ * always contains a byte array of length AES_BLOCK_SIZE.
+ *
+ * If any invariant is broken, failures can occur because the
+ * AESCrypt.encryptBlock method can be intrinsified on the HotSpot VM
+ * (see JDK-8067648 for details).
  *
  * <p>This function is used in the implementation of GCM mode.
  *
@@ -59,6 +69,10 @@
     // NOTE: cipher should already be initialized
     GCTR(SymmetricCipher cipher, byte[] initialCounterBlk) {
         this.aes = cipher;
+        if (initialCounterBlk.length != AES_BLOCK_SIZE) {
+            throw new RuntimeException("length of initial counter block (" + initialCounterBlk.length +
+                                       ") not equal to AES_BLOCK_SIZE (" + AES_BLOCK_SIZE + ")");
+        }
         this.icb = initialCounterBlk;
         this.counter = icb.clone();
     }
@@ -137,6 +151,8 @@
      * Restores the content of this object to the previous saved one.
      */
     void restore() {
-        this.counter = this.counterSave;
+        if (this.counterSave != null) {
+            this.counter = this.counterSave;
+        }
     }
 }
--- a/src/java.base/share/classes/java/lang/Class.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/lang/Class.java	Tue May 05 13:29:31 2015 -0700
@@ -1312,7 +1312,7 @@
         // e) Anonymous classes
 
 
-        // JVM Spec 4.8.6: A class must have an EnclosingMethod
+        // JVM Spec 4.7.7: A class must have an EnclosingMethod
         // attribute if and only if it is a local class or an
         // anonymous class.
         EnclosingMethodInfo enclosingInfo = getEnclosingMethodInfo();
@@ -1357,28 +1357,7 @@
             simpleName = getName();
             return simpleName.substring(simpleName.lastIndexOf('.')+1); // strip the package name
         }
-        // According to JLS3 "Binary Compatibility" (13.1) the binary
-        // name of non-package classes (not top level) is the binary
-        // name of the immediately enclosing class followed by a '$' followed by:
-        // (for nested and inner classes): the simple name.
-        // (for local classes): 1 or more digits followed by the simple name.
-        // (for anonymous classes): 1 or more digits.
-
-        // Since getSimpleBinaryName() will strip the binary name of
-        // the immediately enclosing class, we are now looking at a
-        // string that matches the regular expression "\$[0-9]*"
-        // followed by a simple name (considering the simple of an
-        // anonymous class to be the empty string).
-
-        // Remove leading "\$[0-9]*" from the name
-        int length = simpleName.length();
-        if (length < 1 || simpleName.charAt(0) != '$')
-            throw new InternalError("Malformed class name");
-        int index = 1;
-        while (index < length && isAsciiDigit(simpleName.charAt(index)))
-            index++;
-        // Eventually, this is the empty string iff this is an anonymous class
-        return simpleName.substring(index);
+        return simpleName;
     }
 
     /**
@@ -1489,20 +1468,20 @@
         Class<?> enclosingClass = getEnclosingClass();
         if (enclosingClass == null) // top level class
             return null;
-        // Otherwise, strip the enclosing class' name
-        try {
-            return getName().substring(enclosingClass.getName().length());
-        } catch (IndexOutOfBoundsException ex) {
-            throw new InternalError("Malformed class name", ex);
-        }
+        String name = getSimpleBinaryName0();
+        if (name == null) // anonymous class
+            return "";
+        return name;
     }
 
+    private native String getSimpleBinaryName0();
+
     /**
      * Returns {@code true} if this is a local class or an anonymous
      * class.  Returns {@code false} otherwise.
      */
     private boolean isLocalOrAnonymousClass() {
-        // JVM Spec 4.8.6: A class must have an EnclosingMethod
+        // JVM Spec 4.7.7: A class must have an EnclosingMethod
         // attribute if and only if it is a local class or an
         // anonymous class.
         return getEnclosingMethodInfo() != null;
--- a/src/java.base/share/classes/java/lang/invoke/CallSite.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/lang/invoke/CallSite.java	Tue May 05 13:29:31 2015 -0700
@@ -25,9 +25,10 @@
 
 package java.lang.invoke;
 
-import sun.invoke.empty.Empty;
 import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
+import java.lang.reflect.Field;
+import sun.misc.Cleaner;
 
 /**
  * A {@code CallSite} is a holder for a variable {@link MethodHandle},
@@ -136,6 +137,50 @@
     }
 
     /**
+     * {@code CallSite} dependency context.
+     * VM uses context class to store nmethod dependencies on the call site target.
+     * Can be in 2 states: (a) null; or (b) {@code Cleaner} instance pointing to some Class instance.
+     * Lazily initialized when CallSite instance is linked to some indy call site or VM needs
+     * it to store dependencies. As a corollary, "null" context means there are no dependencies
+     * registered yet. {@code Cleaner} is used in 2 roles:
+     *   (a) context class access for VM;
+     *   (b) stale context class cleanup.
+     * {@code Cleaner} holds the context class until cleanup action is finished (see {@code PhantomReference}).
+     * Though it's impossible to get the context class using {@code Reference.get()}, VM extracts it directly
+     * from {@code Reference.referent} field.
+     */
+    private volatile Cleaner context = null;
+
+    /**
+     * Default context.
+     * VM uses it to initialize non-linked CallSite context.
+     */
+    private static class DefaultContext {}
+    private static final Cleaner DEFAULT_CONTEXT = makeContext(DefaultContext.class, null);
+
+    private static Cleaner makeContext(Class<?> referent, final CallSite holder) {
+        return Cleaner.create(referent,
+                new Runnable() {
+                    @Override public void run() {
+                        MethodHandleNatives.invalidateDependentNMethods(holder);
+                    }
+                });
+    }
+
+    /** Initialize context class used for nmethod dependency tracking */
+    /*package-private*/
+    void initContext(Class<?> newContext) {
+        // If there are concurrent actions, exactly one succeeds.
+        if (context == null) {
+            UNSAFE.compareAndSwapObject(this, CONTEXT_OFFSET, /*expected=*/null, makeContext(newContext, this));
+            // No need to care about failed CAS attempt.
+            // Since initContext is called from indy call site linkage in newContext class, there's no risk
+            // that the context class becomes dead while corresponding context cleaner is alive (causing cleanup
+            // action in the wrong context).
+        }
+    }
+
+    /**
      * Returns the type of this call site's target.
      * Although targets may change, any call site's type is permanent, and can never change to an unequal type.
      * The {@code setTarget} method enforces this invariant by refusing any new target that does
@@ -246,11 +291,13 @@
     }
 
     // unsafe stuff:
-    private static final long TARGET_OFFSET;
+    private static final long  TARGET_OFFSET;
+    private static final long CONTEXT_OFFSET;
     static {
         try {
-            TARGET_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("target"));
-        } catch (Exception ex) { throw new Error(ex); }
+            TARGET_OFFSET  = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("target"));
+            CONTEXT_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("context"));
+        } catch (Exception ex) { throw newInternalError(ex); }
     }
 
     /*package-private*/
--- a/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Tue May 05 13:29:31 2015 -0700
@@ -691,10 +691,4 @@
             }
         }
     }
-
-    @Override
-    void customize() {
-        assert(form.customized == null);
-        // No need to customize DMHs.
-    }
 }
--- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue May 05 13:29:31 2015 -0700
@@ -847,11 +847,7 @@
             refKind = REF_invokeVirtual;
         }
 
-        if (member.getDeclaringClass().isInterface() && refKind == REF_invokeVirtual) {
-            // Methods from Object declared in an interface can be resolved by JVM to invokevirtual kind.
-            // Need to convert it back to invokeinterface to pass verification and make the invocation works as expected.
-            refKind = REF_invokeInterface;
-        }
+        assert(!(member.getDeclaringClass().isInterface() && refKind == REF_invokeVirtual));
 
         // push arguments
         emitPushArguments(name);
--- a/src/java.base/share/classes/java/lang/invoke/Invokers.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/lang/invoke/Invokers.java	Tue May 05 13:29:31 2015 -0700
@@ -281,7 +281,7 @@
             outArgs[0] = names[CHECK_TYPE];
         }
         if (CHECK_CUSTOM != -1) {
-            names[CHECK_CUSTOM] = new Name(NF_checkCustomized, names[CALL_MH]);
+            names[CHECK_CUSTOM] = new Name(NF_checkCustomized, outArgs[0]);
         }
         names[LINKER_CALL] = new Name(outCallType, outArgs);
         lform = new LambdaForm(debugName, INARG_LIMIT, names);
@@ -394,6 +394,7 @@
     @ForceInline
     void checkCustomized(Object o) {
         MethodHandle mh = (MethodHandle)o;
+        if (MethodHandleImpl.isCompileConstant(mh)) return;
         if (mh.form.customized == null) {
             maybeCustomize(mh);
         }
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Tue May 05 13:29:31 2015 -0700
@@ -722,6 +722,13 @@
         return result;
     }
 
+    // Intrinsified by C2. Returns true if obj is a compile-time constant.
+    @LambdaForm.Hidden
+    static
+    boolean isCompileConstant(Object obj) {
+        return false;
+    }
+
     static
     MethodHandle makeGuardWithTest(MethodHandle test,
                                    MethodHandle target,
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, 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
@@ -55,121 +55,42 @@
     static native Object staticFieldBase(MemberName self);  // e.g., returns clazz
     static native Object getMemberVMInfo(MemberName self);  // returns {vmindex,vmtarget}
 
-    /// MethodHandle support
-
-    /** Fetch MH-related JVM parameter.
-     *  which=0 retrieves MethodHandlePushLimit
-     *  which=1 retrieves stack slot push size (in address units)
-     */
-    static native int getConstant(int which);
-
-    static final boolean COUNT_GWT;
-
     /// CallSite support
 
     /** Tell the JVM that we need to change the target of a CallSite. */
     static native void setCallSiteTargetNormal(CallSite site, MethodHandle target);
     static native void setCallSiteTargetVolatile(CallSite site, MethodHandle target);
 
+    /** Invalidate CallSite context: clean up dependent nmethods and reset call site context to initial state (null). */
+    static native void invalidateDependentNMethods(CallSite site);
+
     private static native void registerNatives();
     static {
         registerNatives();
-        COUNT_GWT                   = getConstant(Constants.GC_COUNT_GWT) != 0;
 
         // The JVM calls MethodHandleNatives.<clinit>.  Cascade the <clinit> calls as needed:
         MethodHandleImpl.initStatics();
     }
 
-    // All compile-time constants go here.
-    // There is an opportunity to check them against the JVM's idea of them.
+    /**
+     * Compile-time constants go here. This collection exists not only for
+     * reference from clients, but also for ensuring the VM and JDK agree on the
+     * values of these constants (see {@link #verifyConstants()}).
+     */
     static class Constants {
         Constants() { } // static only
-        // MethodHandleImpl
-        static final int // for getConstant
-                GC_COUNT_GWT = 4,
-                GC_LAMBDA_SUPPORT = 5;
 
-        // MemberName
-        // The JVM uses values of -2 and above for vtable indexes.
-        // Field values are simple positive offsets.
-        // Ref: src/share/vm/oops/methodOop.hpp
-        // This value is negative enough to avoid such numbers,
-        // but not too negative.
         static final int
-                MN_IS_METHOD           = 0x00010000, // method (not constructor)
-                MN_IS_CONSTRUCTOR      = 0x00020000, // constructor
-                MN_IS_FIELD            = 0x00040000, // field
-                MN_IS_TYPE             = 0x00080000, // nested type
-                MN_CALLER_SENSITIVE    = 0x00100000, // @CallerSensitive annotation detected
-                MN_REFERENCE_KIND_SHIFT = 24, // refKind
-                MN_REFERENCE_KIND_MASK = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT,
-                // The SEARCH_* bits are not for MN.flags but for the matchFlags argument of MHN.getMembers:
-                MN_SEARCH_SUPERCLASSES = 0x00100000,
-                MN_SEARCH_INTERFACES   = 0x00200000;
-
-        /**
-         * Basic types as encoded in the JVM.  These code values are not
-         * intended for use outside this class.  They are used as part of
-         * a private interface between the JVM and this class.
-         */
-        static final int
-            T_BOOLEAN  =  4,
-            T_CHAR     =  5,
-            T_FLOAT    =  6,
-            T_DOUBLE   =  7,
-            T_BYTE     =  8,
-            T_SHORT    =  9,
-            T_INT      = 10,
-            T_LONG     = 11,
-            T_OBJECT   = 12,
-            //T_ARRAY    = 13
-            T_VOID     = 14,
-            //T_ADDRESS  = 15
-            T_ILLEGAL  = 99;
-
-        /**
-         * Constant pool entry types.
-         */
-        static final byte
-            CONSTANT_Utf8                = 1,
-            CONSTANT_Integer             = 3,
-            CONSTANT_Float               = 4,
-            CONSTANT_Long                = 5,
-            CONSTANT_Double              = 6,
-            CONSTANT_Class               = 7,
-            CONSTANT_String              = 8,
-            CONSTANT_Fieldref            = 9,
-            CONSTANT_Methodref           = 10,
-            CONSTANT_InterfaceMethodref  = 11,
-            CONSTANT_NameAndType         = 12,
-            CONSTANT_MethodHandle        = 15,  // JSR 292
-            CONSTANT_MethodType          = 16,  // JSR 292
-            CONSTANT_InvokeDynamic       = 18,
-            CONSTANT_LIMIT               = 19;   // Limit to tags found in classfiles
-
-        /**
-         * Access modifier flags.
-         */
-        static final char
-            ACC_PUBLIC                 = 0x0001,
-            ACC_PRIVATE                = 0x0002,
-            ACC_PROTECTED              = 0x0004,
-            ACC_STATIC                 = 0x0008,
-            ACC_FINAL                  = 0x0010,
-            ACC_SYNCHRONIZED           = 0x0020,
-            ACC_VOLATILE               = 0x0040,
-            ACC_TRANSIENT              = 0x0080,
-            ACC_NATIVE                 = 0x0100,
-            ACC_INTERFACE              = 0x0200,
-            ACC_ABSTRACT               = 0x0400,
-            ACC_STRICT                 = 0x0800,
-            ACC_SYNTHETIC              = 0x1000,
-            ACC_ANNOTATION             = 0x2000,
-            ACC_ENUM                   = 0x4000,
-            // aliases:
-            ACC_SUPER                  = ACC_SYNCHRONIZED,
-            ACC_BRIDGE                 = ACC_VOLATILE,
-            ACC_VARARGS                = ACC_TRANSIENT;
+            MN_IS_METHOD           = 0x00010000, // method (not constructor)
+            MN_IS_CONSTRUCTOR      = 0x00020000, // constructor
+            MN_IS_FIELD            = 0x00040000, // field
+            MN_IS_TYPE             = 0x00080000, // nested type
+            MN_CALLER_SENSITIVE    = 0x00100000, // @CallerSensitive annotation detected
+            MN_REFERENCE_KIND_SHIFT = 24, // refKind
+            MN_REFERENCE_KIND_MASK = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT,
+            // The SEARCH_* bits are not for MN.flags but for the matchFlags argument of MHN.getMembers:
+            MN_SEARCH_SUPERCLASSES = 0x00100000,
+            MN_SEARCH_INTERFACES   = 0x00200000;
 
         /**
          * Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries.
@@ -314,6 +235,7 @@
             return Invokers.linkToTargetMethod(type);
         } else {
             appendixResult[0] = callSite;
+            callSite.initContext(caller);
             return Invokers.linkToCallSiteMethod(type);
         }
     }
--- a/src/java.base/share/classes/java/nio/Bits.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/nio/Bits.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -567,32 +567,13 @@
 
     // -- Processor and memory-system properties --
 
-    private static final ByteOrder byteOrder;
+    private static final ByteOrder byteOrder
+        = unsafe.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
 
     static ByteOrder byteOrder() {
-        if (byteOrder == null)
-            throw new Error("Unknown byte order");
         return byteOrder;
     }
 
-    static {
-        long a = unsafe.allocateMemory(8);
-        try {
-            unsafe.putLong(a, 0x0102030405060708L);
-            byte b = unsafe.getByte(a);
-            switch (b) {
-            case 0x01: byteOrder = ByteOrder.BIG_ENDIAN;     break;
-            case 0x08: byteOrder = ByteOrder.LITTLE_ENDIAN;  break;
-            default:
-                assert false;
-                byteOrder = null;
-            }
-        } finally {
-            unsafe.freeMemory(a);
-        }
-    }
-
-
     private static int pageSize = -1;
 
     static int pageSize() {
@@ -605,17 +586,9 @@
         return (int)(size + (long)pageSize() - 1L) / pageSize();
     }
 
-    private static boolean unaligned;
-    private static boolean unalignedKnown = false;
+    private static boolean unaligned = unsafe.unalignedAccess();
 
     static boolean unaligned() {
-        if (unalignedKnown)
-            return unaligned;
-        String arch = AccessController.doPrivileged(
-            new sun.security.action.GetPropertyAction("os.arch"));
-        unaligned = arch.equals("i386") || arch.equals("x86")
-            || arch.equals("amd64") || arch.equals("x86_64");
-        unalignedKnown = true;
         return unaligned;
     }
 
--- a/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -27,6 +27,7 @@
 
 package java.nio;
 
+import sun.misc.Unsafe;
 
 /**
 #if[rw]
@@ -52,6 +53,16 @@
 #end[rw]
     */
 
+#if[byte]
+
+    // Cached unsafe-access object
+    private static final Unsafe unsafe = Bits.unsafe();
+
+    // Cached array base offset
+    private static final long arrayBaseOffset = unsafe.arrayBaseOffset($type$[].class);
+
+#end[byte]
+
     Heap$Type$Buffer$RW$(int cap, int lim) {            // package-private
 #if[rw]
         super(-1, 0, lim, cap, new $type$[cap], 0);
@@ -131,6 +142,12 @@
         return i + offset;
     }
 
+#if[byte]
+    private long byteOffset(long i) {
+        return arrayBaseOffset + i + offset;
+    }
+#end[byte]
+
     public $type$ get() {
         return hb[ix(nextGetIndex())];
     }
@@ -256,18 +273,18 @@
 #if[rw]
 
     public char getChar() {
-        return Bits.getChar(this, ix(nextGetIndex(2)), bigEndian);
+        return unsafe.getCharUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian);
     }
 
     public char getChar(int i) {
-        return Bits.getChar(this, ix(checkIndex(i, 2)), bigEndian);
+        return unsafe.getCharUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian);
     }
 
 #end[rw]
 
     public $Type$Buffer putChar(char x) {
 #if[rw]
-        Bits.putChar(this, ix(nextPutIndex(2)), x, bigEndian);
+        unsafe.putCharUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -276,7 +293,7 @@
 
     public $Type$Buffer putChar(int i, char x) {
 #if[rw]
-        Bits.putChar(this, ix(checkIndex(i, 2)), x, bigEndian);
+        unsafe.putCharUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -307,18 +324,18 @@
 #if[rw]
 
     public short getShort() {
-        return Bits.getShort(this, ix(nextGetIndex(2)), bigEndian);
+        return unsafe.getShortUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian);
     }
 
     public short getShort(int i) {
-        return Bits.getShort(this, ix(checkIndex(i, 2)), bigEndian);
+        return unsafe.getShortUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian);
     }
 
 #end[rw]
 
     public $Type$Buffer putShort(short x) {
 #if[rw]
-        Bits.putShort(this, ix(nextPutIndex(2)), x, bigEndian);
+        unsafe.putShortUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -327,7 +344,7 @@
 
     public $Type$Buffer putShort(int i, short x) {
 #if[rw]
-        Bits.putShort(this, ix(checkIndex(i, 2)), x, bigEndian);
+        unsafe.putShortUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -358,18 +375,18 @@
 #if[rw]
 
     public int getInt() {
-        return Bits.getInt(this, ix(nextGetIndex(4)), bigEndian);
+        return unsafe.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian);
     }
 
     public int getInt(int i) {
-        return Bits.getInt(this, ix(checkIndex(i, 4)), bigEndian);
+        return unsafe.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian);
     }
 
 #end[rw]
 
     public $Type$Buffer putInt(int x) {
 #if[rw]
-        Bits.putInt(this, ix(nextPutIndex(4)), x, bigEndian);
+        unsafe.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -378,7 +395,7 @@
 
     public $Type$Buffer putInt(int i, int x) {
 #if[rw]
-        Bits.putInt(this, ix(checkIndex(i, 4)), x, bigEndian);
+        unsafe.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -409,18 +426,18 @@
 #if[rw]
 
     public long getLong() {
-        return Bits.getLong(this, ix(nextGetIndex(8)), bigEndian);
+        return unsafe.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian);
     }
 
     public long getLong(int i) {
-        return Bits.getLong(this, ix(checkIndex(i, 8)), bigEndian);
+        return unsafe.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian);
     }
 
 #end[rw]
 
     public $Type$Buffer putLong(long x) {
 #if[rw]
-        Bits.putLong(this, ix(nextPutIndex(8)), x, bigEndian);
+        unsafe.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -429,7 +446,7 @@
 
     public $Type$Buffer putLong(int i, long x) {
 #if[rw]
-        Bits.putLong(this, ix(checkIndex(i, 8)), x, bigEndian);
+        unsafe.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -460,18 +477,21 @@
 #if[rw]
 
     public float getFloat() {
-        return Bits.getFloat(this, ix(nextGetIndex(4)), bigEndian);
+        int x = unsafe.getIntUnaligned(hb, byteOffset(nextPutIndex(4)), bigEndian);
+        return Float.intBitsToFloat(x);
     }
 
     public float getFloat(int i) {
-        return Bits.getFloat(this, ix(checkIndex(i, 4)), bigEndian);
+        int x = unsafe.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian);
+        return Float.intBitsToFloat(x);
     }
 
 #end[rw]
 
     public $Type$Buffer putFloat(float x) {
 #if[rw]
-        Bits.putFloat(this, ix(nextPutIndex(4)), x, bigEndian);
+        int y = Float.floatToRawIntBits(x);
+        unsafe.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), y, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -480,7 +500,8 @@
 
     public $Type$Buffer putFloat(int i, float x) {
 #if[rw]
-        Bits.putFloat(this, ix(checkIndex(i, 4)), x, bigEndian);
+        int y = Float.floatToRawIntBits(x);
+        unsafe.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), y, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -511,18 +532,21 @@
 #if[rw]
 
     public double getDouble() {
-        return Bits.getDouble(this, ix(nextGetIndex(8)), bigEndian);
+        long x = unsafe.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian);
+        return Double.longBitsToDouble(x);
     }
 
     public double getDouble(int i) {
-        return Bits.getDouble(this, ix(checkIndex(i, 8)), bigEndian);
+        long x = unsafe.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian);
+        return Double.longBitsToDouble(x);
     }
 
 #end[rw]
 
     public $Type$Buffer putDouble(double x) {
 #if[rw]
-        Bits.putDouble(this, ix(nextPutIndex(8)), x, bigEndian);
+        long y = Double.doubleToRawLongBits(x);
+        unsafe.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), y, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -531,7 +555,8 @@
 
     public $Type$Buffer putDouble(int i, double x) {
 #if[rw]
-        Bits.putDouble(this, ix(checkIndex(i, 8)), x, bigEndian);
+        long y = Double.doubleToRawLongBits(x);
+        unsafe.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), y, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
--- a/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java	Tue May 05 13:29:31 2015 -0700
@@ -104,6 +104,10 @@
      */
     private static final long serialVersionUID = -6946044323557704546L;
     /**
+     * The transition epoch-second.
+     */
+    private final long epochSecond;
+    /**
      * The local transition date-time at the transition.
      */
     private final LocalDateTime transition;
@@ -152,6 +156,7 @@
      * @param offsetAfter  the offset at and after the transition, not null
      */
     ZoneOffsetTransition(LocalDateTime transition, ZoneOffset offsetBefore, ZoneOffset offsetAfter) {
+        this.epochSecond = transition.toEpochSecond(offsetBefore);
         this.transition = transition;
         this.offsetBefore = offsetBefore;
         this.offsetAfter = offsetAfter;
@@ -165,6 +170,7 @@
      * @param offsetAfter  the offset at and after the transition, not null
      */
     ZoneOffsetTransition(long epochSecond, ZoneOffset offsetBefore, ZoneOffset offsetAfter) {
+        this.epochSecond = epochSecond;
         this.transition = LocalDateTime.ofEpochSecond(epochSecond, 0, offsetBefore);
         this.offsetBefore = offsetBefore;
         this.offsetAfter = offsetAfter;
@@ -209,7 +215,7 @@
      * @throws IOException if an error occurs
      */
     void writeExternal(DataOutput out) throws IOException {
-        Ser.writeEpochSec(toEpochSecond(), out);
+        Ser.writeEpochSec(epochSecond, out);
         Ser.writeOffset(offsetBefore, out);
         Ser.writeOffset(offsetAfter, out);
     }
@@ -253,7 +259,7 @@
      * @return the transition epoch second
      */
     public long toEpochSecond() {
-        return transition.toEpochSecond(offsetBefore);
+        return epochSecond;
     }
 
     //-------------------------------------------------------------------------
@@ -397,7 +403,13 @@
      */
     @Override
     public int compareTo(ZoneOffsetTransition transition) {
-        return this.getInstant().compareTo(transition.getInstant());
+        if (epochSecond < transition.epochSecond) {
+            return -1;
+        } else if (epochSecond > transition.epochSecond) {
+            return 1;
+        } else {
+            return this.getInstant().compareTo(transition.getInstant());
+        }
     }
 
     //-----------------------------------------------------------------------
@@ -416,7 +428,8 @@
         }
         if (other instanceof ZoneOffsetTransition) {
             ZoneOffsetTransition d = (ZoneOffsetTransition) other;
-            return transition.equals(d.transition) &&
+            return epochSecond == d.epochSecond &&
+                transition.equals(d.transition) &&
                 offsetBefore.equals(d.offsetBefore) && offsetAfter.equals(d.offsetAfter);
         }
         return false;
--- a/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -140,11 +140,24 @@
  */
 public abstract class LocaleServiceProvider {
 
+    private static Void checkPermission() {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new RuntimePermission("localeServiceProvider"));
+        }
+        return null;
+    }
+    private LocaleServiceProvider(Void ignore) { }
+
     /**
-     * Sole constructor.  (For invocation by subclass constructors, typically
-     * implicit.)
+     * Initializes a new locale service provider.
+     *
+     * @throws  SecurityException
+     *          If a security manager has been installed and it denies
+     *          {@link RuntimePermission RuntimePermission("localeServiceProvider")}
      */
     protected LocaleServiceProvider() {
+        this(checkPermission());
     }
 
     /**
--- a/src/java.base/share/classes/sun/misc/Unsafe.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/sun/misc/Unsafe.java	Tue May 05 13:29:31 2015 -0700
@@ -183,7 +183,7 @@
      * <p>
      * Unless the reference {@code x} being stored is either null
      * or matches the field type, the results are undefined.
-     * If the reference {@code o} is non-null, car marks or
+     * If the reference {@code o} is non-null, card marks or
      * other store barriers for that object (if the VM requires them)
      * are updated.
      * @see #putInt(Object, long, int)
@@ -219,6 +219,35 @@
     /** @see #putInt(Object, long, int) */
     public native void    putDouble(Object o, long offset, double x);
 
+    // These read VM internal data.
+
+    /**
+     * Fetches an uncompressed reference value from a given native variable
+     * ignoring the VM's compressed references mode.
+     *
+     * @param address a memory address locating the variable
+     * @return the value fetched from the indicated native variable
+     */
+    public native Object getUncompressedObject(long address);
+
+    /**
+     * Fetches the {@link java.lang.Class} Java mirror for the given native
+     * metaspace {@code Klass} pointer.
+     *
+     * @param metaspaceKlass a native metaspace {@code Klass} pointer
+     * @return the {@link java.lang.Class} Java mirror
+     */
+    public native Class<?> getJavaMirror(long metaspaceKlass);
+
+    /**
+     * Fetches a native metaspace {@code Klass} pointer for the given Java
+     * object.
+     *
+     * @param o Java heap object for which to fetch the class pointer
+     * @return a native metaspace {@code Klass} pointer
+     */
+    public native long getKlassPointer(Object o);
+
     // These work on values in the C heap.
 
     /**
@@ -934,4 +963,347 @@
     private static void throwIllegalAccessError() {
         throw new IllegalAccessError();
     }
+
+    /**
+     * @return Returns true if the native byte ordering of this
+     * platform is big-endian, false if it is little-endian.
+     */
+    public final boolean isBigEndian() { return BE; }
+
+    /**
+     * @return Returns true if this platform is capable of performing
+     * accesses at addresses which are not aligned for the type of the
+     * primitive type being accessed, false otherwise.
+     */
+    public final boolean unalignedAccess() { return unalignedAccess; }
+
+    /**
+     * Fetches a value at some byte offset into a given Java object.
+     * More specifically, fetches a value within the given object
+     * <code>o</code> at the given offset, or (if <code>o</code> is
+     * null) from the memory address whose numerical value is the
+     * given offset.  <p>
+     *
+     * The specification of this method is the same as {@link
+     * #getLong(Object, long)} except that the offset does not need to
+     * have been obtained from {@link #objectFieldOffset} on the
+     * {@link java.lang.reflect.Field} of some Java field.  The value
+     * in memory is raw data, and need not correspond to any Java
+     * variable.  Unless <code>o</code> is null, the value accessed
+     * must be entirely within the allocated object.  The endianness
+     * of the value in memory is the endianness of the native platform.
+     *
+     * <p> The read will be atomic with respect to the largest power
+     * of two that divides the GCD of the offset and the storage size.
+     * For example, getLongUnaligned will make atomic reads of 2-, 4-,
+     * or 8-byte storage units if the offset is zero mod 2, 4, or 8,
+     * respectively.  There are no other guarantees of atomicity.
+     * <p>
+     * 8-byte atomicity is only guaranteed on platforms on which
+     * support atomic accesses to longs.
+     *
+     * @param o Java heap object in which the value resides, if any, else
+     *        null
+     * @param offset The offset in bytes from the start of the object
+     * @return the value fetched from the indicated object
+     * @throws RuntimeException No defined exceptions are thrown, not even
+     *         {@link NullPointerException}
+     * @since 1.9
+     */
+    public final long getLongUnaligned(Object o, long offset) {
+        if ((offset & 7) == 0) {
+            return getLong(o, offset);
+        } else if ((offset & 3) == 0) {
+            return makeLong(getInt(o, offset),
+                            getInt(o, offset + 4));
+        } else if ((offset & 1) == 0) {
+            return makeLong(getShort(o, offset),
+                            getShort(o, offset + 2),
+                            getShort(o, offset + 4),
+                            getShort(o, offset + 6));
+        } else {
+            return makeLong(getByte(o, offset),
+                            getByte(o, offset + 1),
+                            getByte(o, offset + 2),
+                            getByte(o, offset + 3),
+                            getByte(o, offset + 4),
+                            getByte(o, offset + 5),
+                            getByte(o, offset + 6),
+                            getByte(o, offset + 7));
+        }
+    }
+    /**
+     * As {@link #getLongUnaligned(Object, long)} but with an
+     * additional argument which specifies the endianness of the value
+     * as stored in memory.
+     *
+     * @param o Java heap object in which the variable resides
+     * @param offset The offset in bytes from the start of the object
+     * @param bigEndian The endianness of the value
+     * @return the value fetched from the indicated object
+     * @since 1.9
+     */
+    public final long getLongUnaligned(Object o, long offset, boolean bigEndian) {
+        return convEndian(bigEndian, getLongUnaligned(o, offset));
+    }
+
+    /** @see #getLongUnaligned(Object, long) */
+    public final int getIntUnaligned(Object o, long offset) {
+        if ((offset & 3) == 0) {
+            return getInt(o, offset);
+        } else if ((offset & 1) == 0) {
+            return makeInt(getShort(o, offset),
+                           getShort(o, offset + 2));
+        } else {
+            return makeInt(getByte(o, offset),
+                           getByte(o, offset + 1),
+                           getByte(o, offset + 2),
+                           getByte(o, offset + 3));
+        }
+    }
+    /** @see #getLongUnaligned(Object, long, boolean) */
+    public final int getIntUnaligned(Object o, long offset, boolean bigEndian) {
+        return convEndian(bigEndian, getIntUnaligned(o, offset));
+    }
+
+    /** @see #getLongUnaligned(Object, long) */
+    public final short getShortUnaligned(Object o, long offset) {
+        if ((offset & 1) == 0) {
+            return getShort(o, offset);
+        } else {
+            return makeShort(getByte(o, offset),
+                             getByte(o, offset + 1));
+        }
+    }
+    /** @see #getLongUnaligned(Object, long, boolean) */
+    public final short getShortUnaligned(Object o, long offset, boolean bigEndian) {
+        return convEndian(bigEndian, getShortUnaligned(o, offset));
+    }
+
+    /** @see #getLongUnaligned(Object, long) */
+    public final char getCharUnaligned(Object o, long offset) {
+        return (char)getShortUnaligned(o, offset);
+    }
+    /** @see #getLongUnaligned(Object, long, boolean) */
+    public final char getCharUnaligned(Object o, long offset, boolean bigEndian) {
+        return convEndian(bigEndian, getCharUnaligned(o, offset));
+    }
+
+    /**
+     * Stores a value at some byte offset into a given Java object.
+     * <p>
+     * The specification of this method is the same as {@link
+     * #getLong(Object, long)} except that the offset does not need to
+     * have been obtained from {@link #objectFieldOffset} on the
+     * {@link java.lang.reflect.Field} of some Java field.  The value
+     * in memory is raw data, and need not correspond to any Java
+     * variable.  The endianness of the value in memory is the
+     * endianness of the native platform.
+     * <p>
+     * The write will be atomic with respect to the largest power of
+     * two that divides the GCD of the offset and the storage size.
+     * For example, putLongUnaligned will make atomic writes of 2-, 4-,
+     * or 8-byte storage units if the offset is zero mod 2, 4, or 8,
+     * respectively.  There are no other guarantees of atomicity.
+     * <p>
+     * 8-byte atomicity is only guaranteed on platforms on which
+     * support atomic accesses to longs.
+     * <p>
+     *
+     * @param o Java heap object in which the value resides, if any, else
+     *        null
+     * @param offset The offset in bytes from the start of the object
+     * @param x the value to store
+     * @throws RuntimeException No defined exceptions are thrown, not even
+     *         {@link NullPointerException}
+     * @since 1.9
+     */
+    public final void putLongUnaligned(Object o, long offset, long x) {
+        if ((offset & 7) == 0) {
+            putLong(o, offset, x);
+        } else if ((offset & 3) == 0) {
+            putLongParts(o, offset,
+                         (int)(x >> 0),
+                         (int)(x >>> 32));
+        } else if ((offset & 1) == 0) {
+            putLongParts(o, offset,
+                         (short)(x >>> 0),
+                         (short)(x >>> 16),
+                         (short)(x >>> 32),
+                         (short)(x >>> 48));
+        } else {
+            putLongParts(o, offset,
+                         (byte)(x >>> 0),
+                         (byte)(x >>> 8),
+                         (byte)(x >>> 16),
+                         (byte)(x >>> 24),
+                         (byte)(x >>> 32),
+                         (byte)(x >>> 40),
+                         (byte)(x >>> 48),
+                         (byte)(x >>> 56));
+        }
+    }
+    /**
+     * As {@link #putLongUnaligned(Object, long, long)} but with an additional
+     * argument which specifies the endianness of the value as stored in memory.
+     * @param o Java heap object in which the value resides
+     * @param offset The offset in bytes from the start of the object
+     * @param x the value to store
+     * @param bigEndian The endianness of the value
+     * @throws RuntimeException No defined exceptions are thrown, not even
+     *         {@link NullPointerException}
+     * @since 1.9
+     */
+    public final void putLongUnaligned(Object o, long offset, long x, boolean bigEndian) {
+        putLongUnaligned(o, offset, convEndian(bigEndian, x));
+    }
+
+    /** @see #putLongUnaligned(Object, long, long) */
+    public final void putIntUnaligned(Object o, long offset, int x) {
+        if ((offset & 3) == 0) {
+            putInt(o, offset, x);
+        } else if ((offset & 1) == 0) {
+            putIntParts(o, offset,
+                        (short)(x >> 0),
+                        (short)(x >>> 16));
+        } else {
+            putIntParts(o, offset,
+                        (byte)(x >>> 0),
+                        (byte)(x >>> 8),
+                        (byte)(x >>> 16),
+                        (byte)(x >>> 24));
+        }
+    }
+    /** @see #putLongUnaligned(Object, long, long, boolean) */
+    public final void putIntUnaligned(Object o, long offset, int x, boolean bigEndian) {
+        putIntUnaligned(o, offset, convEndian(bigEndian, x));
+    }
+
+    /** @see #putLongUnaligned(Object, long, long) */
+    public final void putShortUnaligned(Object o, long offset, short x) {
+        if ((offset & 1) == 0) {
+            putShort(o, offset, x);
+        } else {
+            putShortParts(o, offset,
+                          (byte)(x >>> 0),
+                          (byte)(x >>> 8));
+        }
+    }
+    /** @see #putLongUnaligned(Object, long, long, boolean) */
+    public final void putShortUnaligned(Object o, long offset, short x, boolean bigEndian) {
+        putShortUnaligned(o, offset, convEndian(bigEndian, x));
+    }
+
+    /** @see #putLongUnaligned(Object, long, long) */
+    public final void putCharUnaligned(Object o, long offset, char x) {
+        putShortUnaligned(o, offset, (short)x);
+    }
+    /** @see #putLongUnaligned(Object, long, long, boolean) */
+    public final void putCharUnaligned(Object o, long offset, char x, boolean bigEndian) {
+        putCharUnaligned(o, offset, convEndian(bigEndian, x));
+    }
+
+    // JVM interface methods
+    private native boolean unalignedAccess0();
+    private native boolean isBigEndian0();
+
+    // BE is true iff the native endianness of this platform is big.
+    private static final boolean BE = theUnsafe.isBigEndian0();
+
+    // unalignedAccess is true iff this platform can perform unaligned accesses.
+    private static final boolean unalignedAccess = theUnsafe.unalignedAccess0();
+
+    private static int pickPos(int top, int pos) { return BE ? top - pos : pos; }
+
+    // These methods construct integers from bytes.  The byte ordering
+    // is the native endianness of this platform.
+    private static long makeLong(byte i0, byte i1, byte i2, byte i3, byte i4, byte i5, byte i6, byte i7) {
+        return ((toUnsignedLong(i0) << pickPos(56, 0))
+              | (toUnsignedLong(i1) << pickPos(56, 8))
+              | (toUnsignedLong(i2) << pickPos(56, 16))
+              | (toUnsignedLong(i3) << pickPos(56, 24))
+              | (toUnsignedLong(i4) << pickPos(56, 32))
+              | (toUnsignedLong(i5) << pickPos(56, 40))
+              | (toUnsignedLong(i6) << pickPos(56, 48))
+              | (toUnsignedLong(i7) << pickPos(56, 56)));
+    }
+    private static long makeLong(short i0, short i1, short i2, short i3) {
+        return ((toUnsignedLong(i0) << pickPos(48, 0))
+              | (toUnsignedLong(i1) << pickPos(48, 16))
+              | (toUnsignedLong(i2) << pickPos(48, 32))
+              | (toUnsignedLong(i3) << pickPos(48, 48)));
+    }
+    private static long makeLong(int i0, int i1) {
+        return (toUnsignedLong(i0) << pickPos(32, 0))
+             | (toUnsignedLong(i1) << pickPos(32, 32));
+    }
+    private static int makeInt(short i0, short i1) {
+        return (toUnsignedInt(i0) << pickPos(16, 0))
+             | (toUnsignedInt(i1) << pickPos(16, 16));
+    }
+    private static int makeInt(byte i0, byte i1, byte i2, byte i3) {
+        return ((toUnsignedInt(i0) << pickPos(24, 0))
+              | (toUnsignedInt(i1) << pickPos(24, 8))
+              | (toUnsignedInt(i2) << pickPos(24, 16))
+              | (toUnsignedInt(i3) << pickPos(24, 24)));
+    }
+    private static short makeShort(byte i0, byte i1) {
+        return (short)((toUnsignedInt(i0) << pickPos(8, 0))
+                     | (toUnsignedInt(i1) << pickPos(8, 8)));
+    }
+
+    private static byte  pick(byte  le, byte  be) { return BE ? be : le; }
+    private static short pick(short le, short be) { return BE ? be : le; }
+    private static int   pick(int   le, int   be) { return BE ? be : le; }
+
+    // These methods write integers to memory from smaller parts
+    // provided by their caller.  The ordering in which these parts
+    // are written is the native endianness of this platform.
+    private void putLongParts(Object o, long offset, byte i0, byte i1, byte i2, byte i3, byte i4, byte i5, byte i6, byte i7) {
+        putByte(o, offset + 0, pick(i0, i7));
+        putByte(o, offset + 1, pick(i1, i6));
+        putByte(o, offset + 2, pick(i2, i5));
+        putByte(o, offset + 3, pick(i3, i4));
+        putByte(o, offset + 4, pick(i4, i3));
+        putByte(o, offset + 5, pick(i5, i2));
+        putByte(o, offset + 6, pick(i6, i1));
+        putByte(o, offset + 7, pick(i7, i0));
+    }
+    private void putLongParts(Object o, long offset, short i0, short i1, short i2, short i3) {
+        putShort(o, offset + 0, pick(i0, i3));
+        putShort(o, offset + 2, pick(i1, i2));
+        putShort(o, offset + 4, pick(i2, i1));
+        putShort(o, offset + 6, pick(i3, i0));
+    }
+    private void putLongParts(Object o, long offset, int i0, int i1) {
+        putInt(o, offset + 0, pick(i0, i1));
+        putInt(o, offset + 4, pick(i1, i0));
+    }
+    private void putIntParts(Object o, long offset, short i0, short i1) {
+        putShort(o, offset + 0, pick(i0, i1));
+        putShort(o, offset + 2, pick(i1, i0));
+    }
+    private void putIntParts(Object o, long offset, byte i0, byte i1, byte i2, byte i3) {
+        putByte(o, offset + 0, pick(i0, i3));
+        putByte(o, offset + 1, pick(i1, i2));
+        putByte(o, offset + 2, pick(i2, i1));
+        putByte(o, offset + 3, pick(i3, i0));
+    }
+    private void putShortParts(Object o, long offset, byte i0, byte i1) {
+        putByte(o, offset + 0, pick(i0, i1));
+        putByte(o, offset + 1, pick(i1, i0));
+    }
+
+    // Zero-extend an integer
+    private static int toUnsignedInt(byte n)    { return n & 0xff; }
+    private static int toUnsignedInt(short n)   { return n & 0xffff; }
+    private static long toUnsignedLong(byte n)  { return n & 0xffl; }
+    private static long toUnsignedLong(short n) { return n & 0xffffl; }
+    private static long toUnsignedLong(int n)   { return n & 0xffffffffl; }
+
+    // Maybe byte-reverse an integer
+    private static char convEndian(boolean big, char n)   { return big == BE ? n : Character.reverseBytes(n); }
+    private static short convEndian(boolean big, short n) { return big == BE ? n : Short.reverseBytes(n)    ; }
+    private static int convEndian(boolean big, int n)     { return big == BE ? n : Integer.reverseBytes(n)  ; }
+    private static long convEndian(boolean big, long n)   { return big == BE ? n : Long.reverseBytes(n)     ; }
 }
--- a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -1642,23 +1642,22 @@
             Entry entry = entries.get(alias);
 
             // certificate chain
-            int chainLen = 1;
-            Certificate[] certs = null;
+            Certificate[] certs;
 
             if (entry instanceof PrivateKeyEntry) {
                 PrivateKeyEntry keyEntry = (PrivateKeyEntry) entry;
-                    if (keyEntry.chain == null) {
-                        chainLen = 0;
-                    } else {
-                        chainLen = keyEntry.chain.length;
-                    }
-                certs = keyEntry.chain;
-
+                if (keyEntry.chain != null) {
+                    certs = keyEntry.chain;
+                } else {
+                    certs = new Certificate[0];
+                }
             } else if (entry instanceof CertEntry) {
-               certs = new Certificate[]{((CertEntry) entry).cert};
+                certs = new Certificate[]{((CertEntry) entry).cert};
+            } else {
+                certs = new Certificate[0];
             }
 
-            for (int i = 0; i < chainLen; i++) {
+            for (int i = 0; i < certs.length; i++) {
                 // create SafeBag of Type CertBag
                 DerOutputStream safeBag = new DerOutputStream();
                 safeBag.putOID(CertBag_OID);
--- a/src/java.base/share/classes/sun/security/provider/ByteArrayAccess.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/sun/security/provider/ByteArrayAccess.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, 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
@@ -88,13 +88,8 @@
 
     // Return whether this platform supports full speed int/long memory access
     // at unaligned addresses.
-    // This code was copied from java.nio.Bits because there is no equivalent
-    // public API.
     private static boolean unaligned() {
-        String arch = java.security.AccessController.doPrivileged
-            (new sun.security.action.GetPropertyAction("os.arch", ""));
-        return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64")
-            || arch.equals("x86_64");
+        return unsafe.unalignedAccess();
     }
 
     /**
--- a/src/java.base/share/classes/sun/util/locale/provider/AuxLocaleProviderAdapter.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/sun/util/locale/provider/AuxLocaleProviderAdapter.java	Tue May 05 13:29:31 2015 -0700
@@ -25,6 +25,8 @@
 
 package sun.util.locale.provider;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.text.spi.BreakIteratorProvider;
 import java.text.spi.CollatorProvider;
 import java.text.spi.DateFormatProvider;
@@ -177,7 +179,9 @@
      * A dummy locale service provider that indicates there is no
      * provider available
      */
-    private static final NullProvider NULL_PROVIDER = new NullProvider();
+    private static final NullProvider NULL_PROVIDER = AccessController.doPrivileged(
+        (PrivilegedAction<NullProvider>) () -> new NullProvider());
+
     private static class NullProvider extends LocaleServiceProvider {
         @Override
         public Locale[] getAvailableLocales() {
--- a/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java	Tue May 05 13:29:31 2015 -0700
@@ -26,7 +26,7 @@
 package sun.util.locale.provider;
 
 import java.security.AccessController;
-import java.security.PrivilegedActionException;
+import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
 import java.text.spi.BreakIteratorProvider;
 import java.text.spi.CollatorProvider;
@@ -133,8 +133,12 @@
     @Override
     public BreakIteratorProvider getBreakIteratorProvider() {
         if (breakIteratorProvider == null) {
-            BreakIteratorProvider provider = new BreakIteratorProviderImpl(getAdapterType(),
-                                                            getLanguageTagSet("FormatData"));
+            BreakIteratorProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<BreakIteratorProvider>) () ->
+                    new BreakIteratorProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("FormatData")));
+
             synchronized (this) {
                 if (breakIteratorProvider == null) {
                     breakIteratorProvider = provider;
@@ -147,8 +151,12 @@
     @Override
     public CollatorProvider getCollatorProvider() {
         if (collatorProvider == null) {
-            CollatorProvider provider = new CollatorProviderImpl(getAdapterType(),
-                                                getLanguageTagSet("CollationData"));
+            CollatorProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<CollatorProvider>) () ->
+                    new CollatorProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("CollationData")));
+
             synchronized (this) {
                 if (collatorProvider == null) {
                     collatorProvider = provider;
@@ -161,8 +169,12 @@
     @Override
     public DateFormatProvider getDateFormatProvider() {
         if (dateFormatProvider == null) {
-            DateFormatProvider provider = new DateFormatProviderImpl(getAdapterType(),
-                                                    getLanguageTagSet("FormatData"));
+            DateFormatProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<DateFormatProvider>) () ->
+                    new DateFormatProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("FormatData")));
+
             synchronized (this) {
                 if (dateFormatProvider == null) {
                     dateFormatProvider = provider;
@@ -175,8 +187,12 @@
     @Override
     public DateFormatSymbolsProvider getDateFormatSymbolsProvider() {
         if (dateFormatSymbolsProvider == null) {
-            DateFormatSymbolsProvider provider = new DateFormatSymbolsProviderImpl(getAdapterType(),
-                                                                getLanguageTagSet("FormatData"));
+            DateFormatSymbolsProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<DateFormatSymbolsProvider>) () ->
+                    new DateFormatSymbolsProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("FormatData")));
+
             synchronized (this) {
                 if (dateFormatSymbolsProvider == null) {
                     dateFormatSymbolsProvider = provider;
@@ -189,7 +205,12 @@
     @Override
     public DecimalFormatSymbolsProvider getDecimalFormatSymbolsProvider() {
         if (decimalFormatSymbolsProvider == null) {
-            DecimalFormatSymbolsProvider provider = new DecimalFormatSymbolsProviderImpl(getAdapterType(), getLanguageTagSet("FormatData"));
+            DecimalFormatSymbolsProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<DecimalFormatSymbolsProvider>) () ->
+                    new DecimalFormatSymbolsProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("FormatData")));
+
             synchronized (this) {
                 if (decimalFormatSymbolsProvider == null) {
                     decimalFormatSymbolsProvider = provider;
@@ -202,8 +223,12 @@
     @Override
     public NumberFormatProvider getNumberFormatProvider() {
         if (numberFormatProvider == null) {
-            NumberFormatProvider provider = new NumberFormatProviderImpl(getAdapterType(),
-                                                        getLanguageTagSet("FormatData"));
+            NumberFormatProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<NumberFormatProvider>) () ->
+                    new NumberFormatProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("FormatData")));
+
             synchronized (this) {
                 if (numberFormatProvider == null) {
                     numberFormatProvider = provider;
@@ -219,8 +244,12 @@
     @Override
     public CurrencyNameProvider getCurrencyNameProvider() {
         if (currencyNameProvider == null) {
-            CurrencyNameProvider provider = new CurrencyNameProviderImpl(getAdapterType(),
-                                            getLanguageTagSet("CurrencyNames"));
+            CurrencyNameProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<CurrencyNameProvider>) () ->
+                    new CurrencyNameProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("CurrencyNames")));
+
             synchronized (this) {
                 if (currencyNameProvider == null) {
                     currencyNameProvider = provider;
@@ -233,8 +262,12 @@
     @Override
     public LocaleNameProvider getLocaleNameProvider() {
         if (localeNameProvider == null) {
-            LocaleNameProvider provider = new LocaleNameProviderImpl(getAdapterType(),
-                                                    getLanguageTagSet("LocaleNames"));
+            LocaleNameProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<LocaleNameProvider>) () ->
+                    new LocaleNameProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("LocaleNames")));
+
             synchronized (this) {
                 if (localeNameProvider == null) {
                     localeNameProvider = provider;
@@ -247,8 +280,12 @@
     @Override
     public TimeZoneNameProvider getTimeZoneNameProvider() {
         if (timeZoneNameProvider == null) {
-            TimeZoneNameProvider provider = new TimeZoneNameProviderImpl(getAdapterType(),
-                                                    getLanguageTagSet("TimeZoneNames"));
+            TimeZoneNameProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<TimeZoneNameProvider>) () ->
+                    new TimeZoneNameProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("TimeZoneNames")));
+
             synchronized (this) {
                 if (timeZoneNameProvider == null) {
                     timeZoneNameProvider = provider;
@@ -261,9 +298,12 @@
     @Override
     public CalendarDataProvider getCalendarDataProvider() {
         if (calendarDataProvider == null) {
-            CalendarDataProvider provider;
-            provider = new CalendarDataProviderImpl(getAdapterType(),
-                                                    getLanguageTagSet("CalendarData"));
+            CalendarDataProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<CalendarDataProvider>) () ->
+                    new CalendarDataProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("CalendarData")));
+
             synchronized (this) {
                 if (calendarDataProvider == null) {
                     calendarDataProvider = provider;
@@ -276,9 +316,12 @@
     @Override
     public CalendarNameProvider getCalendarNameProvider() {
         if (calendarNameProvider == null) {
-            CalendarNameProvider provider;
-            provider = new CalendarNameProviderImpl(getAdapterType(),
-                                                    getLanguageTagSet("FormatData"));
+            CalendarNameProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<CalendarNameProvider>) () ->
+                    new CalendarNameProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("FormatData")));
+
             synchronized (this) {
                 if (calendarNameProvider == null) {
                     calendarNameProvider = provider;
@@ -294,8 +337,12 @@
     @Override
     public CalendarProvider getCalendarProvider() {
         if (calendarProvider == null) {
-            CalendarProvider provider = new CalendarProviderImpl(getAdapterType(),
-                                                    getLanguageTagSet("CalendarData"));
+            CalendarProvider provider = AccessController.doPrivileged(
+                (PrivilegedAction<CalendarProvider>) () ->
+                    new CalendarProviderImpl(
+                        getAdapterType(),
+                        getLanguageTagSet("CalendarData")));
+
             synchronized (this) {
                 if (calendarProvider == null) {
                     calendarProvider = provider;
@@ -319,6 +366,7 @@
     }
 
     // ResourceBundleBasedAdapter method implementation
+
     @Override
     public LocaleData getLocaleData() {
         if (localeData == null) {
@@ -449,4 +497,4 @@
         }
         return locales;
     }
-                            }
+}
--- a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java	Tue May 05 13:29:31 2015 -0700
@@ -152,9 +152,6 @@
         String GST[] = new String[] {"Gulf Standard Time", "GST",
                                      "Gulf Daylight Time", "GDT",
                                      "Gulf Time", "GT"};
-        String HAST[] = new String[] {"Hawaii-Aleutian Standard Time", "HAST",
-                                      "Hawaii-Aleutian Daylight Time", "HADT",
-                                      "Hawaii-Aleutian Time", "HAT"};
         String HKT[] =  new String[] {"Hong Kong Time", "HKT",
                                       "Hong Kong Summer Time", "HKST",
                                       "Hong Kong Time", "HKT"};
@@ -371,7 +368,7 @@
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
             {"Africa/Windhoek", WAT},
-            {"America/Adak", HAST},
+            {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
             {"America/Araguaina", BRT},
@@ -393,7 +390,7 @@
                                                "Paraguay Summer Time", "PYST",
                                                "Paraguay Time", "PYT"}},
             {"America/Atikokan", EST},
-            {"America/Atka", HAST},
+            {"America/Atka", HST},
             {"America/Bahia", BRT},
             {"America/Bahia_Banderas", CST},
             {"America/Barbados", AST},
@@ -1024,7 +1021,7 @@
             {"UCT", UTC},
             {"Universal", UTC},
             {"US/Alaska", AKST},
-            {"US/Aleutian", HAST},
+            {"US/Aleutian", HST},
             {"US/Arizona", MST},
             {"US/Central", CST},
             {"US/Eastern", EST},
--- a/src/java.base/share/native/include/jvm.h	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/native/include/jvm.h	Tue May 05 13:29:31 2015 -0700
@@ -395,6 +395,9 @@
 JNIEXPORT jclass JNICALL
 JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass);
 
+JNIEXPORT jstring JNICALL
+JVM_GetSimpleBinaryName(JNIEnv *env, jclass ofClass);
+
 /* Generics support (JDK 1.5) */
 JNIEXPORT jstring JNICALL
 JVM_GetClassSignature(JNIEnv *env, jclass cls);
--- a/src/java.base/share/native/libjava/Class.c	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.base/share/native/libjava/Class.c	Tue May 05 13:29:31 2015 -0700
@@ -67,6 +67,7 @@
     {"getProtectionDomain0", "()" PD,       (void *)&JVM_GetProtectionDomain},
     {"getDeclaredClasses0",  "()[" CLS,      (void *)&JVM_GetDeclaredClasses},
     {"getDeclaringClass0",   "()" CLS,      (void *)&JVM_GetDeclaringClass},
+    {"getSimpleBinaryName0", "()" STR,      (void *)&JVM_GetSimpleBinaryName},
     {"getGenericSignature0", "()" STR,      (void *)&JVM_GetClassSignature},
     {"getRawAnnotations",      "()" BA,        (void *)&JVM_GetClassAnnotations},
     {"getConstantPool",     "()" CPL,       (void *)&JVM_GetClassConstantPool},
--- a/src/java.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#
-# Copyright (c) 2015, 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-com.sun.management.internal.PlatformMBeanProviderImpl
--- a/src/java.management/share/classes/com/sun/management/DiagnosticCommandMBean.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.management;
-
-import java.lang.management.PlatformManagedObject;
-import javax.management.DynamicMBean;
-
-/**
- * Management interface for the diagnostic commands for the HotSpot Virtual Machine.
- *
- * <p>The {@code DiagnosticCommandMBean} is registered to the
- * {@linkplain java.lang.management.ManagementFactory#getPlatformMBeanServer
- * platform MBeanServer} as are other platform MBeans.
- *
- * <p>The {@link javax.management.ObjectName ObjectName} for uniquely identifying
- * the diagnostic MBean within an MBeanServer is:
- * <blockquote>
- *    {@code com.sun.management:type=DiagnosticCommand}
- * </blockquote>
- *
- * <p>This MBean is a {@link javax.management.DynamicMBean DynamicMBean}
- * and also a {@link javax.management.NotificationEmitter}.
- * The {@code DiagnosticCommandMBean} is generated at runtime and is subject to
- * modifications during the lifetime of the Java virtual machine.
- *
- * A <em>diagnostic command</em> is represented as an operation of
- * the {@code DiagnosticCommandMBean} interface. Each diagnostic command has:
- * <ul>
- * <li>the diagnostic command name which is the name being referenced in
- *     the HotSpot Virtual Machine</li>
- * <li>the MBean operation name which is the
- *     {@linkplain javax.management.MBeanOperationInfo#getName() name}
- *     generated for the diagnostic command operation invocation.
- *     The MBean operation name is implementation dependent</li>
- * </ul>
- *
- * The recommended way to transform a diagnostic command name into a MBean
- * operation name is as follows:
- * <ul>
- * <li>All characters from the first one to the first dot are set to be
- *      lower-case characters</li>
- * <li>Every dot or underline character is removed and the following
- *   character is set to be an upper-case character</li>
- * <li>All other characters are copied without modification</li>
- * </ul>
- *
- * <p>The diagnostic command name is always provided with the meta-data on the
- * operation in a field named {@code dcmd.name} (see below).
- *
- * <p>A diagnostic command may or may not support options or arguments.
- * All the operations return {@code String} and either take
- * no parameter for operations that do not support any option or argument,
- * or take a {@code String[]} parameter for operations that support at least
- * one option or argument.
- * Each option or argument must be stored in a single String.
- * Options or arguments split across several String instances are not supported.
- *
- * <p>The distinction between options and arguments: options are identified by
- * the option name while arguments are identified by their position in the
- * command line. Options and arguments are processed in the order of the array
- * passed to the invocation method.
- *
- * <p>Like any operation of a dynamic MBean, each of these operations is
- * described by {@link javax.management.MBeanOperationInfo MBeanOperationInfo}
- * instance. Here's the values returned by this object:
- * <ul>
- *  <li>{@link javax.management.MBeanOperationInfo#getName() getName()}
- *      returns the operation name generated from the diagnostic command name</li>
- *  <li>{@link javax.management.MBeanOperationInfo#getDescription() getDescription()}
- *      returns the diagnostic command description
- *      (the same as the one return in the 'help' command)</li>
- *  <li>{@link javax.management.MBeanOperationInfo#getImpact() getImpact()}
- *      returns {@code ACTION_INFO}</li>
- *  <li>{@link javax.management.MBeanOperationInfo#getReturnType() getReturnType()}
- *      returns {@code java.lang.String}</li>
- *  <li>{@link javax.management.MBeanOperationInfo#getDescriptor() getDescriptor()}
- *      returns a Descriptor instance (see below)</li>
- * </ul>
- *
- * <p>The {@link javax.management.Descriptor Descriptor}
- * is a collection of fields containing additional
- * meta-data for a JMX element. A field is a name and an associated value.
- * The additional meta-data provided for an operation associated with a
- * diagnostic command are described in the table below:
- *
- * <table border="1" cellpadding="5">
- *   <tr>
- *     <th>Name</th><th>Type</th><th>Description</th>
- *   </tr>
- *   <tr>
- *     <td>dcmd.name</td><td>String</td>
- *     <td>The original diagnostic command name (not the operation name)</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.description</td><td>String</td>
- *     <td>The diagnostic command description</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.help</td><td>String</td>
- *     <td>The full help message for this diagnostic command (same output as
- *          the one produced by the 'help' command)</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.vmImpact</td><td>String</td>
- *     <td>The impact of the diagnostic command,
- *      this value is the same as the one printed in the 'impact'
- *      section of the help message of the diagnostic command, and it
- *      is different from the getImpact() of the MBeanOperationInfo</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.enabled</td><td>boolean</td>
- *     <td>True if the diagnostic command is enabled, false otherwise</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.permissionClass</td><td>String</td>
- *     <td>Some diagnostic command might require a specific permission to be
- *          executed, in addition to the MBeanPermission to invoke their
- *          associated MBean operation. This field returns the fully qualified
- *          name of the permission class or null if no permission is required
- *   </td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.permissionName</td><td>String</td>
- *     <td>The fist argument of the permission required to execute this
- *          diagnostic command or null if no permission is required</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.permissionAction</td><td>String</td>
- *     <td>The second argument of the permission required to execute this
- *          diagnostic command or null if the permission constructor has only
- *          one argument (like the ManagementPermission) or if no permission
- *          is required</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.arguments</td><td>Descriptor</td>
- *     <td>A Descriptor instance containing the descriptions of options and
- *          arguments supported by the diagnostic command (see below)</td>
- *   </tr>
- * </table>
- *
- * <p>The description of parameters (options or arguments) of a diagnostic
- * command is provided within a Descriptor instance. In this Descriptor,
- * each field name is a parameter name, and each field value is itself
- * a Descriptor instance. The fields provided in this second Descriptor
- * instance are described in the table below:
- *
- * <table border="1" cellpadding="5">
- *   <tr>
- *     <th>Name</th><th>Type</th><th>Description</th>
- *   </tr>
- *   <tr>
- *     <td>dcmd.arg.name</td><td>String</td>
- *     <td>The name of the parameter</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.arg.type</td><td>String</td>
- *     <td>The type of the parameter. The returned String is the name of a type
- *          recognized by the diagnostic command parser. These types are not
- *          Java types and are implementation dependent.
- *          </td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.arg.description</td><td>String</td>
- *     <td>The parameter description</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.arg.isMandatory</td><td>boolean</td>
- *     <td>True if the parameter is mandatory, false otherwise</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.arg.isOption</td><td>boolean</td>
- *     <td>True if the parameter is an option, false if it is an argument</td>
- *   </tr>
- *   <tr>
- *     <td>dcmd.arg.isMultiple</td><td>boolean</td>
- *     <td>True if the parameter can be specified several times, false
- *          otherwise</td>
- *   </tr>
- * </table>
- *
- * <p>When the set of diagnostic commands currently supported by the Java
- * Virtual Machine is modified, the {@code DiagnosticCommandMBean} emits
- * a {@link javax.management.Notification} with a
- * {@linkplain javax.management.Notification#getType() type} of
- * <a href="{@docRoot}/../../../../api/javax/management/MBeanInfo.html#info-changed">
- * {@code "jmx.mbean.info.changed"}</a> and a
- * {@linkplain javax.management.Notification#getUserData() userData} that
- * is the new {@code MBeanInfo}.
- *
- * @since 1.8
- */
-public interface DiagnosticCommandMBean extends DynamicMBean
-{
-
-}
--- a/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.management;
-
-import javax.management.Notification;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataView;
-import javax.management.openmbean.CompositeType;
-import java.util.Collection;
-import java.util.Collections;
-import sun.management.GarbageCollectionNotifInfoCompositeData;
-
-/**
- * The information about a garbage collection
- *
- * <p>
- * A garbage collection notification is emitted by {@link GarbageCollectorMXBean}
- * when the Java virtual machine completes a garbage collection action
- * The notification emitted will contain the garbage collection notification
- * information about the status of the memory:
- * <ul>
- *   <li>The name of the garbage collector used to perform the collection.</li>
- *   <li>The action performed by the garbage collector.</li>
- *   <li>The cause of the garbage collection action.</li>
- *   <li>A {@link GcInfo} object containing some statistics about the GC cycle
-          (start time, end time) and the memory usage before and after
-          the GC cycle.</li>
- * </ul>
- *
- * <p>
- * A {@link CompositeData CompositeData} representing
- * the {@code GarbageCollectionNotificationInfo} object
- * is stored in the
- * {@linkplain javax.management.Notification#setUserData userdata}
- * of a {@linkplain javax.management.Notification notification}.
- * The {@link #from from} method is provided to convert from
- * a {@code CompositeData} to a {@code GarbageCollectionNotificationInfo}
- * object. For example:
- *
- * <blockquote><pre>
- *      Notification notif;
- *
- *      // receive the notification emitted by a GarbageCollectorMXBean and set to notif
- *      ...
- *
- *      String notifType = notif.getType();
- *      if (notifType.equals(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION)) {
- *          // retrieve the garbage collection notification information
- *          CompositeData cd = (CompositeData) notif.getUserData();
- *          GarbageCollectionNotificationInfo info = GarbageCollectionNotificationInfo.from(cd);
- *          ....
- *      }
- * </pre></blockquote>
- *
- * <p>
- * The type of the notification emitted by a {@code GarbageCollectorMXBean} is:
- * <ul>
- *   <li>A {@linkplain #GARBAGE_COLLECTION_NOTIFICATION garbage collection notification}.
- *       <br>Used by every notification emitted by the garbage collector, the details about
- *             the notification are provided in the {@linkplain #getGcAction action} String
- *       </li>
- * </ul>
- **/
-
-@jdk.Exported
-public class GarbageCollectionNotificationInfo implements  CompositeDataView {
-
-    private final String gcName;
-    private final String gcAction;
-    private final String gcCause;
-    private final GcInfo gcInfo;
-    private final CompositeData cdata;
-
-    /**
-     * Notification type denoting that
-     * the Java virtual machine has completed a garbage collection cycle.
-     * This notification is emitted by a {@link GarbageCollectorMXBean}.
-     * The value of this notification type is
-     * {@code com.sun.management.gc.notification}.
-     */
-    public static final String GARBAGE_COLLECTION_NOTIFICATION =
-        "com.sun.management.gc.notification";
-
-    /**
-     * Constructs a {@code GarbageCollectionNotificationInfo} object.
-     *
-     * @param gcName The name of the garbage collector used to perform the collection
-     * @param gcAction The name of the action performed by the garbage collector
-     * @param gcCause The cause of the garbage collection action
-     * @param gcInfo  a GcInfo object providing statistics about the GC cycle
-     */
-    public GarbageCollectionNotificationInfo(String gcName,
-                                             String gcAction,
-                                             String gcCause,
-                                             GcInfo gcInfo)  {
-        if (gcName == null) {
-            throw new NullPointerException("Null gcName");
-        }
-        if (gcAction == null) {
-            throw new NullPointerException("Null gcAction");
-        }
-        if (gcCause == null) {
-            throw new NullPointerException("Null gcCause");
-        }
-        this.gcName = gcName;
-        this.gcAction = gcAction;
-        this.gcCause = gcCause;
-        this.gcInfo = gcInfo;
-        this.cdata = new GarbageCollectionNotifInfoCompositeData(this);
-    }
-
-    GarbageCollectionNotificationInfo(CompositeData cd) {
-        GarbageCollectionNotifInfoCompositeData.validateCompositeData(cd);
-
-        this.gcName = GarbageCollectionNotifInfoCompositeData.getGcName(cd);
-        this.gcAction = GarbageCollectionNotifInfoCompositeData.getGcAction(cd);
-        this.gcCause = GarbageCollectionNotifInfoCompositeData.getGcCause(cd);
-        this.gcInfo = GarbageCollectionNotifInfoCompositeData.getGcInfo(cd);
-        this.cdata = cd;
-    }
-
-    /**
-     * Returns the name of the garbage collector used to perform the collection
-     *
-     * @return the name of the garbage collector used to perform the collection
-     */
-    public String getGcName() {
-        return gcName;
-    }
-
-    /**
-     * Returns the action performed by the garbage collector
-     *
-     * @return the action performed by the garbage collector
-     */
-    public String getGcAction() {
-        return gcAction;
-    }
-
-    /**
-     * Returns the cause of the garbage collection
-     *
-     * @return the cause of the garbage collection
-     */
-    public String getGcCause() {
-        return gcCause;
-    }
-
-    /**
-     * Returns the GC information related to the last garbage collection
-     *
-     * @return the GC information related to the
-     * last garbage collection
-     */
-    public GcInfo getGcInfo() {
-        return gcInfo;
-    }
-
-    /**
-     * Returns a {@code GarbageCollectionNotificationInfo} object represented by the
-     * given {@code CompositeData}.
-     * The given {@code CompositeData} must contain
-     * the following attributes:
-     * <blockquote>
-     * <table border>
-     * <tr>
-     *   <th align=left>Attribute Name</th>
-     *   <th align=left>Type</th>
-     * </tr>
-     * <tr>
-     *   <td>gcName</td>
-     *   <td>{@code java.lang.String}</td>
-     * </tr>
-     * <tr>
-     *   <td>gcAction</td>
-     *   <td>{@code java.lang.String}</td>
-     * </tr>
-     * <tr>
-     *   <td>gcCause</td>
-     *   <td>{@code java.lang.String}</td>
-     * </tr>
-     * <tr>
-     *   <td>gcInfo</td>
-     *   <td>{@code javax.management.openmbean.CompositeData}</td>
-     * </tr>
-     * </table>
-     * </blockquote>
-     *
-     * @param cd {@code CompositeData} representing a
-     *           {@code GarbageCollectionNotificationInfo}
-     *
-     * @throws IllegalArgumentException if {@code cd} does not
-     *   represent a {@code GarbaageCollectionNotificationInfo} object.
-     *
-     * @return a {@code GarbageCollectionNotificationInfo} object represented
-     *         by {@code cd} if {@code cd} is not {@code null};
-     *         {@code null} otherwise.
-     */
-    public static GarbageCollectionNotificationInfo from(CompositeData cd) {
-        if (cd == null) {
-            return null;
-        }
-
-        if (cd instanceof GarbageCollectionNotifInfoCompositeData) {
-            return ((GarbageCollectionNotifInfoCompositeData) cd).getGarbageCollectionNotifInfo();
-        } else {
-            return new GarbageCollectionNotificationInfo(cd);
-        }
-    }
-
-    public CompositeData toCompositeData(CompositeType ct) {
-        return cdata;
-    }
-
-}
--- a/src/java.management/share/classes/com/sun/management/GarbageCollectorMXBean.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.management;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeType;
-
-/**
- * Platform-specific management interface for a garbage collector
- * which performs collections in cycles.
- *
- * <p> This platform extension is only available to the garbage
- * collection implementation that supports this extension.
- *
- * @author  Mandy Chung
- * @since   1.5
- */
-@jdk.Exported
-public interface GarbageCollectorMXBean
-    extends java.lang.management.GarbageCollectorMXBean {
-
-    /**
-     * Returns the GC information about the most recent GC.
-     * This method returns a {@link GcInfo}.
-     * If no GC information is available, <tt>null</tt> is returned.
-     * The collector-specific attributes, if any, can be obtained
-     * via the {@link CompositeData CompositeData} interface.
-     * <p>
-     * <b>MBeanServer access:</b>
-     * The mapped type of <tt>GcInfo</tt> is <tt>CompositeData</tt>
-     * with attributes specified in {@link GcInfo#from GcInfo}.
-     *
-     * @return a <tt>GcInfo</tt> object representing
-     * the most GC information; or <tt>null</tt> if no GC
-     * information available.
-     */
-    public GcInfo getLastGcInfo();
-}
--- a/src/java.management/share/classes/com/sun/management/GcInfo.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 2003, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.management;
-
-import java.lang.management.MemoryUsage;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataView;
-import javax.management.openmbean.CompositeType;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.List;
-import sun.management.GcInfoCompositeData;
-import sun.management.GcInfoBuilder;
-
-/**
- * Garbage collection information.  It contains the following
- * information for one garbage collection as well as GC-specific
- * attributes:
- * <blockquote>
- * <ul>
- *   <li>Start time</li>
- *   <li>End time</li>
- *   <li>Duration</li>
- *   <li>Memory usage before the collection starts</li>
- *   <li>Memory usage after the collection ends</li>
- * </ul>
- * </blockquote>
- *
- * <p>
- * {@code GcInfo} is a {@link CompositeData CompositeData}
- * The GC-specific attributes can be obtained via the CompositeData
- * interface.  This is a historical relic, and other classes should
- * not copy this pattern.  Use {@link CompositeDataView} instead.
- *
- * <h4>MXBean Mapping</h4>
- * {@code GcInfo} is mapped to a {@link CompositeData CompositeData}
- * with attributes as specified in the {@link #from from} method.
- *
- * @author  Mandy Chung
- * @since   1.5
- */
-@jdk.Exported
-public class GcInfo implements CompositeData, CompositeDataView {
-    private final long index;
-    private final long startTime;
-    private final long endTime;
-    private final Map<String, MemoryUsage> usageBeforeGc;
-    private final Map<String, MemoryUsage> usageAfterGc;
-    private final Object[] extAttributes;
-    private final CompositeData cdata;
-    private final GcInfoBuilder builder;
-
-    private GcInfo(GcInfoBuilder builder,
-                   long index, long startTime, long endTime,
-                   MemoryUsage[] muBeforeGc,
-                   MemoryUsage[] muAfterGc,
-                   Object[] extAttributes) {
-        this.builder       = builder;
-        this.index         = index;
-        this.startTime     = startTime;
-        this.endTime       = endTime;
-        String[] poolNames = builder.getPoolNames();
-        this.usageBeforeGc = new HashMap<String, MemoryUsage>(poolNames.length);
-        this.usageAfterGc = new HashMap<String, MemoryUsage>(poolNames.length);
-        for (int i = 0; i < poolNames.length; i++) {
-            this.usageBeforeGc.put(poolNames[i],  muBeforeGc[i]);
-            this.usageAfterGc.put(poolNames[i],  muAfterGc[i]);
-        }
-        this.extAttributes = extAttributes;
-        this.cdata = new GcInfoCompositeData(this, builder, extAttributes);
-    }
-
-    private GcInfo(CompositeData cd) {
-        GcInfoCompositeData.validateCompositeData(cd);
-
-        this.index         = GcInfoCompositeData.getId(cd);
-        this.startTime     = GcInfoCompositeData.getStartTime(cd);
-        this.endTime       = GcInfoCompositeData.getEndTime(cd);
-        this.usageBeforeGc = GcInfoCompositeData.getMemoryUsageBeforeGc(cd);
-        this.usageAfterGc  = GcInfoCompositeData.getMemoryUsageAfterGc(cd);
-        this.extAttributes = null;
-        this.builder       = null;
-        this.cdata         = cd;
-    }
-
-    /**
-     * Returns the identifier of this garbage collection which is
-     * the number of collections that this collector has done.
-     *
-     * @return the identifier of this garbage collection which is
-     * the number of collections that this collector has done.
-     */
-    public long getId() {
-        return index;
-    }
-
-    /**
-     * Returns the start time of this GC in milliseconds
-     * since the Java virtual machine was started.
-     *
-     * @return the start time of this GC.
-     */
-    public long getStartTime() {
-        return startTime;
-    }
-
-    /**
-     * Returns the end time of this GC in milliseconds
-     * since the Java virtual machine was started.
-     *
-     * @return the end time of this GC.
-     */
-    public long getEndTime() {
-        return endTime;
-    }
-
-    /**
-     * Returns the elapsed time of this GC in milliseconds.
-     *
-     * @return the elapsed time of this GC in milliseconds.
-     */
-    public long getDuration() {
-        return endTime - startTime;
-    }
-
-    /**
-     * Returns the memory usage of all memory pools
-     * at the beginning of this GC.
-     * This method returns
-     * a {@code Map} of the name of a memory pool
-     * to the memory usage of the corresponding
-     * memory pool before GC starts.
-     *
-     * @return a {@code Map} of memory pool names to the memory
-     * usage of a memory pool before GC starts.
-     */
-    public Map<String, MemoryUsage> getMemoryUsageBeforeGc() {
-        return Collections.unmodifiableMap(usageBeforeGc);
-    }
-
-    /**
-     * Returns the memory usage of all memory pools
-     * at the end of this GC.
-     * This method returns
-     * a {@code Map} of the name of a memory pool
-     * to the memory usage of the corresponding
-     * memory pool when GC finishes.
-     *
-     * @return a {@code Map} of memory pool names to the memory
-     * usage of a memory pool when GC finishes.
-     */
-    public Map<String, MemoryUsage> getMemoryUsageAfterGc() {
-        return Collections.unmodifiableMap(usageAfterGc);
-    }
-
-   /**
-     * Returns a {@code GcInfo} object represented by the
-     * given {@code CompositeData}. The given
-     * {@code CompositeData} must contain
-     * all the following attributes:
-     *
-     * <blockquote>
-     * <table border>
-     * <tr>
-     *   <th align=left>Attribute Name</th>
-     *   <th align=left>Type</th>
-     * </tr>
-     * <tr>
-     *   <td>index</td>
-     *   <td>{@code java.lang.Long}</td>
-     * </tr>
-     * <tr>
-     *   <td>startTime</td>
-     *   <td>{@code java.lang.Long}</td>
-     * </tr>
-     * <tr>
-     *   <td>endTime</td>
-     *   <td>{@code java.lang.Long}</td>
-     * </tr>
-     * <tr>
-     *   <td>memoryUsageBeforeGc</td>
-     *   <td>{@code javax.management.openmbean.TabularData}</td>
-     * </tr>
-     * <tr>
-     *   <td>memoryUsageAfterGc</td>
-     *   <td>{@code javax.management.openmbean.TabularData}</td>
-     * </tr>
-     * </table>
-     * </blockquote>
-     *
-     * @throws IllegalArgumentException if {@code cd} does not
-     *   represent a {@code GcInfo} object with the attributes
-     *   described above.
-     *
-     * @return a {@code GcInfo} object represented by {@code cd}
-     * if {@code cd} is not {@code null}; {@code null} otherwise.
-     */
-    public static GcInfo from(CompositeData cd) {
-        if (cd == null) {
-            return null;
-        }
-
-        if (cd instanceof GcInfoCompositeData) {
-            return ((GcInfoCompositeData) cd).getGcInfo();
-        } else {
-            return new GcInfo(cd);
-        }
-
-    }
-
-    // Implementation of the CompositeData interface
-    public boolean containsKey(String key) {
-        return cdata.containsKey(key);
-    }
-
-    public boolean containsValue(Object value) {
-        return cdata.containsValue(value);
-    }
-
-    public boolean equals(Object obj) {
-        return cdata.equals(obj);
-    }
-
-    public Object get(String key) {
-        return cdata.get(key);
-    }
-
-    public Object[] getAll(String[] keys) {
-        return cdata.getAll(keys);
-    }
-
-    public CompositeType getCompositeType() {
-        return cdata.getCompositeType();
-    }
-
-    public int hashCode() {
-        return cdata.hashCode();
-    }
-
-    public String toString() {
-        return cdata.toString();
-    }
-
-    public Collection<?> values() {
-        return cdata.values();
-    }
-
-    /**
-     * Return the {@code CompositeData} representation of this
-     * {@code GcInfo}, including any GC-specific attributes.  The
-     * returned value will have at least all the attributes described
-     * in the {@link #from(CompositeData) from} method, plus optionally
-     * other attributes.
-     *
-     * @param ct the {@code CompositeType} that the caller expects.
-     * This parameter is ignored and can be null.
-     *
-     * @return the {@code CompositeData} representation.
-     */
-    public CompositeData toCompositeData(CompositeType ct) {
-        return cdata;
-    }
-}
--- a/src/java.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2005, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.management;
-
-import java.lang.management.PlatformManagedObject;
-
-/**
- * Diagnostic management interface for the HotSpot Virtual Machine.
- *
- * <p>The diagnostic MBean is registered to the platform MBeanServer
- * as are other platform MBeans.
- *
- * <p>The <tt>ObjectName</tt> for uniquely identifying the diagnostic
- * MXBean within an MBeanServer is:
- * <blockquote>
- *    <tt>com.sun.management:type=HotSpotDiagnostic</tt>
- * </blockquote>
-.*
- * It can be obtained by calling the
- * {@link PlatformManagedObject#getObjectName} method.
- *
- * All methods throw a {@code NullPointerException} if any input argument is
- * {@code null} unless it's stated otherwise.
- *
- * @see java.lang.management.ManagementFactory#getPlatformMXBeans(Class)
- */
-@jdk.Exported
-public interface HotSpotDiagnosticMXBean extends PlatformManagedObject {
-    /**
-     * Dumps the heap to the <tt>outputFile</tt> file in the same
-     * format as the hprof heap dump.
-     * <p>
-     * If this method is called remotely from another process,
-     * the heap dump output is written to a file named <tt>outputFile</tt>
-     * on the machine where the target VM is running.  If outputFile is
-     * a relative path, it is relative to the working directory where
-     * the target VM was started.
-     *
-     * @param  outputFile the system-dependent filename
-     * @param  live if <tt>true</tt> dump only <i>live</i> objects
-     *         i.e. objects that are reachable from others
-     * @throws IOException if the <tt>outputFile</tt>
-     *                     cannot be created, opened, or written to.
-     * @throws UnsupportedOperationException if this operation is not supported.
-     * @throws NullPointerException if <tt>outputFile</tt> is <tt>null</tt>.
-     * @throws SecurityException
-     *         If a security manager exists and its {@link
-     *         java.lang.SecurityManager#checkWrite(java.lang.String)}
-     *         method denies write access to the named file
-     *         or the caller does not have ManagmentPermission("control").
-     */
-    public void dumpHeap(String outputFile, boolean live) throws java.io.IOException;
-
-    /**
-     * Returns a list of <tt>VMOption</tt> objects for all diagnostic options.
-     * A diagnostic option is a {@link VMOption#isWriteable writeable}
-     * VM option that can be set dynamically mainly for troubleshooting
-     * and diagnosis.
-     *
-     * @return a list of <tt>VMOption</tt> objects for all diagnostic options.
-     */
-    public java.util.List<VMOption> getDiagnosticOptions();
-
-    /**
-     * Returns a <tt>VMOption</tt> object for a VM option of the given
-     * name.
-     *
-     * @return a <tt>VMOption</tt> object for a VM option of the given name.
-     * @throws NullPointerException if name is <tt>null</tt>.
-     * @throws IllegalArgumentException if a VM option of the given name
-     *                                     does not exist.
-     */
-    public VMOption getVMOption(String name);
-
-    /**
-     * Sets a VM option of the given name to the specified value.
-     * The new value will be reflected in a new <tt>VMOption</tt>
-     * object returned by the {@link #getVMOption} method or
-     * the {@link #getDiagnosticOptions} method.  This method does
-     * not change the value of this <tt>VMOption</tt> object.
-     *
-     * @param name Name of a VM option
-     * @param value New value of the VM option to be set
-     *
-     * @throws IllegalArgumentException if the VM option of the given name
-     *                                     does not exist.
-     * @throws IllegalArgumentException if the new value is invalid.
-     * @throws IllegalArgumentException if the VM option is not writable.
-     * @throws NullPointerException if name or value is <tt>null</tt>.
-     *
-     * @throws  java.lang.SecurityException
-     *     if a security manager exists and the caller does not have
-     *     ManagementPermission("control").
-     */
-    public void setVMOption(String name, String value);
-}
--- a/src/java.management/share/classes/com/sun/management/OperatingSystemMXBean.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.management;
-
-/**
- * Platform-specific management interface for the operating system
- * on which the Java virtual machine is running.
- *
- * <p>
- * The <tt>OperatingSystemMXBean</tt> object returned by
- * {@link java.lang.management.ManagementFactory#getOperatingSystemMXBean()}
- * is an instance of the implementation class of this interface
- * or {@link UnixOperatingSystemMXBean} interface depending on
- * its underlying operating system.
- *
- * @author  Mandy Chung
- * @since   1.5
- */
-@jdk.Exported
-public interface OperatingSystemMXBean extends
-    java.lang.management.OperatingSystemMXBean {
-
-    /**
-     * Returns the amount of virtual memory that is guaranteed to
-     * be available to the running process in bytes,
-     * or <tt>-1</tt> if this operation is not supported.
-     *
-     * @return the amount of virtual memory that is guaranteed to
-     * be available to the running process in bytes,
-     * or <tt>-1</tt> if this operation is not supported.
-     */
-    public long getCommittedVirtualMemorySize();
-
-    /**
-     * Returns the total amount of swap space in bytes.
-     *
-     * @return the total amount of swap space in bytes.
-     */
-    public long getTotalSwapSpaceSize();
-
-    /**
-     * Returns the amount of free swap space in bytes.
-     *
-     * @return the amount of free swap space in bytes.
-     */
-    public long getFreeSwapSpaceSize();
-
-    /**
-     * Returns the CPU time used by the process on which the Java
-     * virtual machine is running in nanoseconds.  The returned value
-     * is of nanoseconds precision but not necessarily nanoseconds
-     * accuracy.  This method returns <tt>-1</tt> if the
-     * the platform does not support this operation.
-     *
-     * @return the CPU time used by the process in nanoseconds,
-     * or <tt>-1</tt> if this operation is not supported.
-     */
-    public long getProcessCpuTime();
-
-    /**
-     * Returns the amount of free physical memory in bytes.
-     *
-     * @return the amount of free physical memory in bytes.
-     */
-    public long getFreePhysicalMemorySize();
-
-    /**
-     * Returns the total amount of physical memory in bytes.
-     *
-     * @return the total amount of physical memory in  bytes.
-     */
-    public long getTotalPhysicalMemorySize();
-
-    /**
-     * Returns the "recent cpu usage" for the whole system. This value is a
-     * double in the [0.0,1.0] interval. A value of 0.0 means that all CPUs
-     * were idle during the recent period of time observed, while a value
-     * of 1.0 means that all CPUs were actively running 100% of the time
-     * during the recent period being observed. All values betweens 0.0 and
-     * 1.0 are possible depending of the activities going on in the system.
-     * If the system recent cpu usage is not available, the method returns a
-     * negative value.
-     *
-     * @return the "recent cpu usage" for the whole system; a negative
-     * value if not available.
-     * @since   1.7
-     */
-    public double getSystemCpuLoad();
-
-    /**
-     * Returns the "recent cpu usage" for the Java Virtual Machine process.
-     * This value is a double in the [0.0,1.0] interval. A value of 0.0 means
-     * that none of the CPUs were running threads from the JVM process during
-     * the recent period of time observed, while a value of 1.0 means that all
-     * CPUs were actively running threads from the JVM 100% of the time
-     * during the recent period being observed. Threads from the JVM include
-     * the application threads as well as the JVM internal threads. All values
-     * betweens 0.0 and 1.0 are possible depending of the activities going on
-     * in the JVM process and the whole system. If the Java Virtual Machine
-     * recent CPU usage is not available, the method returns a negative value.
-     *
-     * @return the "recent cpu usage" for the Java Virtual Machine process;
-     * a negative value if not available.
-     * @since   1.7
-     */
-    public double getProcessCpuLoad();
-
-}
--- a/src/java.management/share/classes/com/sun/management/ThreadMXBean.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.management;
-
-import java.util.Map;
-
-/**
- * Platform-specific management interface for the thread system
- * of the Java virtual machine.
- * <p>
- * This platform extension is only available to a thread
- * implementation that supports this extension.
- *
- * @author  Paul Hohensee
- * @since   6u25
- */
-
-@jdk.Exported
-public interface ThreadMXBean extends java.lang.management.ThreadMXBean {
-    /**
-     * Returns the total CPU time for each thread whose ID is
-     * in the input array {@code ids} in nanoseconds.
-     * The returned values are of nanoseconds precision but
-     * not necessarily nanoseconds accuracy.
-     * <p>
-     * This method is equivalent to calling the
-     * {@link ThreadMXBean#getThreadCpuTime(long)}
-     * method for each thread ID in the input array {@code ids} and setting the
-     * returned value in the corresponding element of the returned array.
-     *
-     * @param ids an array of thread IDs.
-     * @return an array of long values, each of which is the amount of CPU
-     * time the thread whose ID is in the corresponding element of the input
-     * array of IDs has used,
-     * if the thread of a specified ID exists, the thread is alive,
-     * and CPU time measurement is enabled;
-     * {@code -1} otherwise.
-     *
-     * @throws NullPointerException if {@code ids} is {@code null}
-     * @throws IllegalArgumentException if any element in the input array
-     *         {@code ids} is {@code <=} {@code 0}.
-     * @throws java.lang.UnsupportedOperationException if the Java
-     *         virtual machine implementation does not support CPU time
-     *         measurement.
-     *
-     * @see ThreadMXBean#getThreadCpuTime(long)
-     * @see #getThreadUserTime
-     * @see ThreadMXBean#isThreadCpuTimeSupported
-     * @see ThreadMXBean#isThreadCpuTimeEnabled
-     * @see ThreadMXBean#setThreadCpuTimeEnabled
-     */
-    public long[] getThreadCpuTime(long[] ids);
-
-    /**
-     * Returns the CPU time that each thread whose ID is in the input array
-     * {@code ids} has executed in user mode in nanoseconds.
-     * The returned values are of nanoseconds precision but
-     * not necessarily nanoseconds accuracy.
-     * <p>
-     * This method is equivalent to calling the
-     * {@link ThreadMXBean#getThreadUserTime(long)}
-     * method for each thread ID in the input array {@code ids} and setting the
-     * returned value in the corresponding element of the returned array.
-     *
-     * @param ids an array of thread IDs.
-     * @return an array of long values, each of which is the amount of user
-     * mode CPU time the thread whose ID is in the corresponding element of
-     * the input array of IDs has used,
-     * if the thread of a specified ID exists, the thread is alive,
-     * and CPU time measurement is enabled;
-     * {@code -1} otherwise.
-     *
-     * @throws NullPointerException if {@code ids} is {@code null}
-     * @throws IllegalArgumentException if any element in the input array
-     *         {@code ids} is {@code <=} {@code 0}.
-     * @throws java.lang.UnsupportedOperationException if the Java
-     *         virtual machine implementation does not support CPU time
-     *         measurement.
-     *
-     * @see ThreadMXBean#getThreadUserTime(long)
-     * @see #getThreadCpuTime
-     * @see ThreadMXBean#isThreadCpuTimeSupported
-     * @see ThreadMXBean#isThreadCpuTimeEnabled
-     * @see ThreadMXBean#setThreadCpuTimeEnabled
-     */
-    public long[] getThreadUserTime(long[] ids);
-
-    /**
-     * Returns an approximation of the total amount of memory, in bytes,
-     * allocated in heap memory for the thread of the specified ID.
-     * The returned value is an approximation because some Java virtual machine
-     * implementations may use object allocation mechanisms that result in a
-     * delay between the time an object is allocated and the time its size is
-     * recorded.
-     * <p>
-     * If the thread of the specified ID is not alive or does not exist,
-     * this method returns {@code -1}. If thread memory allocation measurement
-     * is disabled, this method returns {@code -1}.
-     * A thread is alive if it has been started and has not yet died.
-     * <p>
-     * If thread memory allocation measurement is enabled after the thread has
-     * started, the Java virtual machine implementation may choose any time up
-     * to and including the time that the capability is enabled as the point
-     * where thread memory allocation measurement starts.
-     *
-     * @param id the thread ID of a thread
-     * @return an approximation of the total memory allocated, in bytes, in
-     * heap memory for a thread of the specified ID
-     * if the thread of the specified ID exists, the thread is alive,
-     * and thread memory allocation measurement is enabled;
-     * {@code -1} otherwise.
-     *
-     * @throws IllegalArgumentException if {@code id} {@code <=} {@code 0}.
-     * @throws java.lang.UnsupportedOperationException if the Java virtual
-     *         machine implementation does not support thread memory allocation
-     *         measurement.
-     *
-     * @see #isThreadAllocatedMemorySupported
-     * @see #isThreadAllocatedMemoryEnabled
-     * @see #setThreadAllocatedMemoryEnabled
-     */
-    public long getThreadAllocatedBytes(long id);
-
-    /**
-     * Returns an approximation of the total amount of memory, in bytes,
-     * allocated in heap memory for each thread whose ID is in the input
-     * array {@code ids}.
-     * The returned values are approximations because some Java virtual machine
-     * implementations may use object allocation mechanisms that result in a
-     * delay between the time an object is allocated and the time its size is
-     * recorded.
-     * <p>
-     * This method is equivalent to calling the
-     * {@link #getThreadAllocatedBytes(long)}
-     * method for each thread ID in the input array {@code ids} and setting the
-     * returned value in the corresponding element of the returned array.
-     *
-     * @param ids an array of thread IDs.
-     * @return an array of long values, each of which is an approximation of
-     * the total memory allocated, in bytes, in heap memory for the thread
-     * whose ID is in the corresponding element of the input array of IDs.
-     *
-     * @throws NullPointerException if {@code ids} is {@code null}
-     * @throws IllegalArgumentException if any element in the input array
-     *         {@code ids} is {@code <=} {@code 0}.
-     * @throws java.lang.UnsupportedOperationException if the Java virtual
-     *         machine implementation does not support thread memory allocation
-     *         measurement.
-     *
-     * @see #getThreadAllocatedBytes(long)
-     * @see #isThreadAllocatedMemorySupported
-     * @see #isThreadAllocatedMemoryEnabled
-     * @see #setThreadAllocatedMemoryEnabled
-     */
-    public long[] getThreadAllocatedBytes(long[] ids);
-
-    /**
-     * Tests if the Java virtual machine implementation supports thread memory
-     * allocation measurement.
-     *
-     * @return
-     *   {@code true}
-     *     if the Java virtual machine implementation supports thread memory
-     *     allocation measurement;
-     *   {@code false} otherwise.
-     */
-    public boolean isThreadAllocatedMemorySupported();
-
-    /**
-     * Tests if thread memory allocation measurement is enabled.
-     *
-     * @return {@code true} if thread memory allocation measurement is enabled;
-     *         {@code false} otherwise.
-     *
-     * @throws java.lang.UnsupportedOperationException if the Java virtual
-     *         machine does not support thread memory allocation measurement.
-     *
-     * @see #isThreadAllocatedMemorySupported
-     */
-    public boolean isThreadAllocatedMemoryEnabled();
-
-    /**
-     * Enables or disables thread memory allocation measurement.  The default
-     * is platform dependent.
-     *
-     * @param enable {@code true} to enable;
-     *               {@code false} to disable.
-     *
-     * @throws java.lang.UnsupportedOperationException if the Java virtual
-     *         machine does not support thread memory allocation measurement.
-     *
-     * @throws java.lang.SecurityException if a security manager
-     *         exists and the caller does not have
-     *         ManagementPermission("control").
-     *
-     * @see #isThreadAllocatedMemorySupported
-     */
-    public void setThreadAllocatedMemoryEnabled(boolean enable);
-}
--- a/src/java.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.management;
-
-/**
- * Platform-specific management interface for the Unix
- * operating system on which the Java virtual machine is running.
- *
- * @author  Mandy Chung
- * @since   1.5
- */
-@jdk.Exported
-public interface UnixOperatingSystemMXBean extends
-    com.sun.management.OperatingSystemMXBean {
-
-    /**
-     * Returns the number of open file descriptors.
-     *
-     * @return the number of open file descriptors.
-     */
-    public long getOpenFileDescriptorCount();
-
-    /**
-     * Returns the maximum number of file descriptors.
-     *
-     * @return the maximum number of file descriptors.
-     */
-    public long getMaxFileDescriptorCount();
-}
--- a/src/java.management/share/classes/com/sun/management/VMOption.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.management;
-
-import sun.management.VMOptionCompositeData;
-import javax.management.openmbean.CompositeData;
-
-/**
- * Information about a VM option including its value and
- * where the value came from which is referred as its
- * {@link VMOption.Origin <i>origin</i>}.
- * <p>
- * Each VM option has a default value.  A VM option can
- * be set at VM creation time typically as a command line
- * argument to the launcher or an argument passed to the
- * VM created using the JNI invocation interface.
- * In addition, a VM option may be set via an environment
- * variable or a configuration file. A VM option can also
- * be set dynamically via a management interface after
- * the VM was started.
- *
- * A {@code VMOption} contains the value of a VM option
- * and the origin of that value at the time this {@code VMOption}
- * object was constructed.  The value of the VM option
- * may be changed after the {@code VMOption} object was constructed,
- *
- * @see <a href="{@docRoot}/../../../../technotes/guides/vm/index.html">
- *         Java Virtual Machine</a>
- * @author Mandy Chung
- * @since 1.6
- */
-@jdk.Exported
-public class VMOption {
-    private String name;
-    private String value;
-    private boolean writeable;
-    private Origin origin;
-
-    /**
-     * Origin of the value of a VM option.  It tells where the
-     * value of a VM option came from.
-     *
-     * @since 1.6
-     */
-    @jdk.Exported
-    public enum Origin {
-        /**
-         * The VM option has not been set and its value
-         * is the default value.
-         */
-        DEFAULT,
-        /**
-         * The VM option was set at VM creation time typically
-         * as a command line argument to the launcher or
-         * an argument passed to the VM created using the
-         * JNI invocation interface.
-         */
-        VM_CREATION,
-        /**
-         * The VM option was set via an environment variable.
-         */
-        ENVIRON_VAR,
-        /**
-         * The VM option was set via a configuration file.
-         */
-        CONFIG_FILE,
-        /**
-         * The VM option was set via the management interface after the VM
-         * was started.
-         */
-        MANAGEMENT,
-        /**
-         * The VM option was set via the VM ergonomic support.
-         */
-        ERGONOMIC,
-        /**
-         * The VM option was set using the attach framework.
-         * @since 1.9
-         */
-        ATTACH_ON_DEMAND,
-        /**
-         * The VM option was set via some other mechanism.
-         */
-        OTHER
-    }
-
-    /**
-     * Constructs a {@code VMOption}.
-     *
-     * @param name Name of a VM option.
-     * @param value Value of a VM option.
-     * @param writeable {@code true} if a VM option can be set dynamically,
-     *                  or {@code false} otherwise.
-     * @param origin where the value of a VM option came from.
-     *
-     * @throws NullPointerException if the name or value is {@code null}
-     */
-    public VMOption(String name, String value, boolean writeable, Origin origin) {
-        this.name = name;
-        this.value = value;
-        this.writeable = writeable;
-        this.origin = origin;
-    }
-
-    /**
-     * Constructs a {@code VMOption} object from a
-     * {@link CompositeData CompositeData}.
-     */
-    private VMOption(CompositeData cd) {
-        // validate the input composite data
-        VMOptionCompositeData.validateCompositeData(cd);
-
-        this.name = VMOptionCompositeData.getName(cd);
-        this.value = VMOptionCompositeData.getValue(cd);
-        this.writeable = VMOptionCompositeData.isWriteable(cd);
-        this.origin = VMOptionCompositeData.getOrigin(cd);
-    }
-
-    /**
-     * Returns the name of this VM option.
-     *
-     * @return the name of this VM option.
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Returns the value of this VM option at the time when
-     * this {@code VMOption} was created. The value could have been changed.
-     *
-     * @return the value of the VM option at the time when
-     *         this {@code VMOption} was created.
-     */
-    public String getValue() {
-        return value;
-    }
-
-    /**
-     * Returns the origin of the value of this VM option. That is,
-     * where the value of this VM option came from.
-     *
-     * @return where the value of this VM option came from.
-     */
-    public Origin getOrigin() {
-        return origin;
-    }
-
-    /**
-     * Tests if this VM option is writeable.  If this VM option is writeable,
-     * it can be set by the {@link HotSpotDiagnosticMXBean#setVMOption
-     * HotSpotDiagnosticMXBean.setVMOption} method.
-     *
-     * @return {@code true} if this VM option is writeable; {@code false}
-     * otherwise.
-     */
-    public boolean isWriteable() {
-        return writeable;
-    }
-
-    public String toString() {
-        return "VM option: " + getName() +
-               " value: " + value + " " +
-               " origin: " + origin + " " +
-               (writeable ? "(read-write)" : "(read-only)");
-    }
-
-    /**
-     * Returns a {@code VMOption} object represented by the
-     * given {@code CompositeData}. The given {@code CompositeData}
-     * must contain the following attributes:
-     *
-     * <blockquote>
-     * <table border>
-     * <tr>
-     *   <th align=left>Attribute Name</th>
-     *   <th align=left>Type</th>
-     * </tr>
-     * <tr>
-     *   <td>name</td>
-     *   <td>{@code java.lang.String}</td>
-     * </tr>
-     * <tr>
-     *   <td>value</td>
-     *   <td>{@code java.lang.String}</td>
-     * </tr>
-     * <tr>
-     *   <td>origin</td>
-     *   <td>{@code java.lang.String}</td>
-     * </tr>
-     * <tr>
-     *   <td>writeable</td>
-     *   <td>{@code java.lang.Boolean}</td>
-     * </tr>
-     * </table>
-     * </blockquote>
-     *
-     * @param cd {@code CompositeData} representing a {@code VMOption}
-     *
-     * @throws IllegalArgumentException if {@code cd} does not
-     *   represent a {@code VMOption} with the attributes described
-     *   above.
-     *
-     * @return a {@code VMOption} object represented by {@code cd}
-     *         if {@code cd} is not {@code null};
-     *         {@code null} otherwise.
-     */
-    public static VMOption from(CompositeData cd) {
-        if (cd == null) {
-            return null;
-        }
-
-        if (cd instanceof VMOptionCompositeData) {
-            return ((VMOptionCompositeData) cd).getVMOption();
-        } else {
-            return new VMOption(cd);
-        }
-
-    }
-
-
-}
--- a/src/java.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2015, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.management.internal;
-
-import java.lang.management.ManagementFactory;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import javax.management.DynamicMBean;
-import javax.management.ObjectName;
-import sun.management.ManagementFactoryHelper;
-import sun.management.spi.PlatformMBeanProvider;
-
-public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider {
-    private final List<PlatformComponent<?>> mxbeanList;
-
-    public PlatformMBeanProviderImpl() {
-        mxbeanList = Collections.unmodifiableList(init());
-    }
-
-    @Override
-    public List<PlatformComponent<?>> getPlatformComponentList() {
-        return mxbeanList;
-    }
-
-    private List<PlatformComponent<?>> init() {
-        ArrayList<PlatformComponent<?>> initMBeanList = new ArrayList<>();
-        /**
-         * Garbage Collector in the Java virtual machine.
-         */
-        initMBeanList.add(new PlatformComponent<java.lang.management.MemoryManagerMXBean>() {
-            private final Set<String> garbageCollectorMXBeanInterfaceNames
-                    = Collections.unmodifiableSet(
-                            Stream.of("java.lang.management.MemoryManagerMXBean",
-                                    "java.lang.management.GarbageCollectorMXBean",
-                                    "com.sun.management.GarbageCollectorMXBean")
-                            .collect(Collectors.toSet()));
-
-            @Override
-            public Set<Class<? extends java.lang.management.MemoryManagerMXBean>> mbeanInterfaces() {
-                return Stream.of(java.lang.management.MemoryManagerMXBean.class,
-                        java.lang.management.GarbageCollectorMXBean.class,
-                        com.sun.management.GarbageCollectorMXBean.class)
-                        .collect(Collectors.toSet());
-            }
-
-            @Override
-            public Set<String> mbeanInterfaceNames() {
-                return garbageCollectorMXBeanInterfaceNames;
-            }
-
-            @Override
-            public String getObjectNamePattern() {
-                return ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",name=*";
-            }
-
-            @Override
-            public boolean isSingleton() {
-                return false; // zero or more instances
-            }
-
-            @Override
-            public Map<String, java.lang.management.MemoryManagerMXBean> nameToMBeanMap() {
-                List<java.lang.management.GarbageCollectorMXBean> list
-                        = ManagementFactoryHelper.getGarbageCollectorMXBeans();;
-                Map<String, java.lang.management.MemoryManagerMXBean> map;
-                if (list.isEmpty()) {
-                    map = Collections.<String, java.lang.management.MemoryManagerMXBean>emptyMap();
-                } else {
-                    map = new HashMap<>(list.size());
-                    for (java.lang.management.MemoryManagerMXBean gcm : list) {
-                        map.put(gcm.getObjectName().getCanonicalName(),
-                                gcm);
-                    }
-                }
-                return map;
-            }
-        });
-
-        /**
-         * OperatingSystemMXBean
-         */
-        initMBeanList.add(new PlatformComponent<java.lang.management.OperatingSystemMXBean>() {
-            private final Set<String> operatingSystemMXBeanInterfaceNames
-                    = Collections.unmodifiableSet(
-                            Stream.of("java.lang.management.OperatingSystemMXBean",
-                                    "com.sun.management.OperatingSystemMXBean",
-                                    "com.sun.management.UnixOperatingSystemMXBean")
-                            .collect(Collectors.toSet()));
-
-            @Override
-            public Set<Class<? extends java.lang.management.OperatingSystemMXBean>> mbeanInterfaces() {
-                return Stream.of(java.lang.management.OperatingSystemMXBean.class,
-                        com.sun.management.OperatingSystemMXBean.class,
-                        com.sun.management.UnixOperatingSystemMXBean.class)
-                        .collect(Collectors.toSet());
-            }
-
-            @Override
-            public Set<String> mbeanInterfaceNames() {
-                return operatingSystemMXBeanInterfaceNames;
-            }
-
-            @Override
-            public String getObjectNamePattern() {
-                return ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME;
-            }
-
-            @Override
-            public Map<String, java.lang.management.OperatingSystemMXBean> nameToMBeanMap() {
-                return Collections.<String, java.lang.management.OperatingSystemMXBean>singletonMap(
-                        ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME,
-                        ManagementFactoryHelper.getOperatingSystemMXBean());
-            }
-        });
-
-        /**
-         * Diagnostic support for the HotSpot Virtual Machine.
-         */
-        initMBeanList.add(new PlatformComponent<com.sun.management.HotSpotDiagnosticMXBean>() {
-            private final Set<String> hotSpotDiagnosticMXBeanInterfaceNames =
-                    Collections.unmodifiableSet(Collections.<String>singleton("com.sun.management.HotSpotDiagnosticMXBean"));
-
-            @Override
-            public Set<Class<? extends com.sun.management.HotSpotDiagnosticMXBean>> mbeanInterfaces() {
-                return Collections.singleton(com.sun.management.HotSpotDiagnosticMXBean.class);
-            }
-
-            @Override
-            public Set<String> mbeanInterfaceNames() {
-                return hotSpotDiagnosticMXBeanInterfaceNames;
-            }
-
-            @Override
-            public String getObjectNamePattern() {
-                return "com.sun.management:type=HotSpotDiagnostic";
-            }
-
-            @Override
-            public Map<String, com.sun.management.HotSpotDiagnosticMXBean> nameToMBeanMap() {
-                return Collections.<String, com.sun.management.HotSpotDiagnosticMXBean>singletonMap(
-                        "com.sun.management:type=HotSpotDiagnostic",
-                        ManagementFactoryHelper.getDiagnosticMXBean());
-            }
-        });
-
-        /**
-         * DynamicMBean
-         */
-        HashMap<ObjectName, DynamicMBean> dynmbeans
-                = ManagementFactoryHelper.getPlatformDynamicMBeans();
-        final Set<String> dynamicMBeanInterfaceNames =
-            Collections.unmodifiableSet(Collections.<String>singleton("javax.management.DynamicMBean"));
-        for (Map.Entry<ObjectName, DynamicMBean> e : dynmbeans.entrySet()) {
-            initMBeanList.add(new PlatformComponent<DynamicMBean>() {
-                @Override
-                public Set<String> mbeanInterfaceNames() {
-                    return dynamicMBeanInterfaceNames;
-                }
-
-                @Override
-                public Set<Class<? extends DynamicMBean>> mbeanInterfaces() {
-                    return Collections.emptySet(); // DynamicMBean cannot be used to find an MBean by ManagementFactory
-                }
-
-                @Override
-                public String getObjectNamePattern() {
-                    return e.getKey().getCanonicalName();
-                }
-
-                @Override
-                public Map<String, DynamicMBean> nameToMBeanMap() {
-                    return Collections.<String, DynamicMBean>singletonMap(
-                            e.getKey().getCanonicalName(),
-                            e.getValue());
-                }
-            });
-        }
-        initMBeanList.trimToSize();
-        return initMBeanList;
-    }
-}
--- a/src/java.management/share/classes/com/sun/management/package-info.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * This package contains Oracle Corporation's platform extension to
- * the implementation of the
- * <a href="{@docRoot}/../../../../api/java/lang/management/package-summary.html">
- * java.lang.management</a> API and also defines the management
- * interface for some other components for the platform.
- *
- * <p>
- * All platform MBeans are registered in the <em>platform MBeanServer</em>
- * which can be obtained via the
- * <a href="{@docRoot}/../../../../api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer()">
- * java.lang.management.ManagementFactory.getPlatformMBeanServer</a>
- *
- * @author  Mandy Chung
- * @since   1.5
- */
-
-@jdk.Exported
-package com.sun.management;
--- a/src/java.management/share/classes/java/lang/management/DefaultPlatformMBeanProvider.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/java/lang/management/DefaultPlatformMBeanProvider.java	Tue May 05 13:29:31 2015 -0700
@@ -33,7 +33,6 @@
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
-import javax.management.DynamicMBean;
 import javax.management.ObjectName;
 import sun.management.ManagementFactoryHelper;
 import sun.management.spi.PlatformMBeanProvider;
@@ -162,8 +161,7 @@
             @Override
             public Set<Class<? extends MemoryManagerMXBean>> mbeanInterfaces() {
                 return Stream.of(MemoryManagerMXBean.class,
-                        GarbageCollectorMXBean.class,
-                        com.sun.management.GarbageCollectorMXBean.class).collect(Collectors.toSet());
+                        GarbageCollectorMXBean.class).collect(Collectors.toSet());
             }
 
             @Override
@@ -464,39 +462,6 @@
 
         });
 
-        /**
-         * DynamicMBean
-         */
-        HashMap<ObjectName, DynamicMBean> dynmbeans
-                = ManagementFactoryHelper.getPlatformDynamicMBeans();
-        final Set<String> dynamicMBeanInterfaceNames =
-            Collections.unmodifiableSet(Collections.singleton("javax.management.DynamicMBean"));
-        for (Map.Entry<ObjectName, DynamicMBean> e : dynmbeans.entrySet()) {
-            initMBeanList.add(new PlatformComponent<DynamicMBean>() {
-                @Override
-                public Set<Class<? extends DynamicMBean>> mbeanInterfaces() {
-                    return Collections.emptySet();
-                }
-
-                @Override
-                public Set<String> mbeanInterfaceNames() {
-                    return dynamicMBeanInterfaceNames;
-                }
-
-                @Override
-                public String getObjectNamePattern() {
-                    return e.getKey().getCanonicalName();
-                }
-
-                @Override
-                public Map<String, DynamicMBean> nameToMBeanMap() {
-                    return Collections.<String, DynamicMBean>singletonMap(
-                            e.getKey().getCanonicalName(),
-                            e.getValue());
-                }
-            });
-        }
-
         initMBeanList.trimToSize();
         return initMBeanList;
     }
--- a/src/java.management/share/classes/java/lang/management/ManagementFactory.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/java/lang/management/ManagementFactory.java	Tue May 05 13:29:31 2015 -0700
@@ -582,7 +582,7 @@
         final Class<?> cls = mxbeanInterface;
         ClassLoader loader =
             AccessController.doPrivileged(
-                    (PrivilegedAction<ClassLoader>) () -> cls.getClassLoader());
+                (PrivilegedAction<ClassLoader>) () -> cls.getClassLoader());
         if (!sun.misc.VM.isSystemDomainLoader(loader)) {
             throw new IllegalArgumentException(mxbeanName +
                 " is not a platform MXBean");
@@ -883,7 +883,7 @@
                      all.add(new DefaultPlatformMBeanProvider());
                      return all;
                 }, null, new FilePermission("<<ALL FILES>>", "read"),
-                         new RuntimePermission("sun.management.spi.PlatformMBeanProvider"));
+                         new RuntimePermission("sun.management.spi.PlatformMBeanProvider.subclass"));
 
             // load all platform components into a map
             componentMap = providers.stream()
@@ -970,4 +970,11 @@
             return singleton;
         }
     }
+
+    static {
+        AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+            System.loadLibrary("management");
+            return null;
+        });
+    }
 }
--- a/src/java.management/share/classes/sun/management/Agent.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/sun/management/Agent.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -34,6 +34,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.InetAddress;
+import java.net.MalformedURLException;
 import java.net.UnknownHostException;
 import java.text.MessageFormat;
 import java.util.MissingResourceException;
@@ -55,6 +56,125 @@
  * system class loader. Also jmx framework could be started by jcmd
  */
 public class Agent {
+    /**
+     * Agent status collector strategy class
+     */
+    private static abstract class StatusCollector {
+        final protected StringBuilder sb = new StringBuilder();
+        final public String collect() {
+            Properties agentProps = VMSupport.getAgentProperties();
+            String localConnAddr = (String)agentProps.get(LOCAL_CONNECTOR_ADDRESS_PROP);
+            if (localConnAddr != null || jmxServer != null) {
+                addAgentStatus(true);
+                appendConnections(localConnAddr);
+            } else {
+                addAgentStatus(false);
+            }
+            return sb.toString();
+        }
+
+        private void appendConnections(String localConnAddr) {
+            appendConnectionsHeader();
+            if (localConnAddr != null) {
+                try {
+                    JMXServiceURL u = new JMXServiceURL(localConnAddr);
+                    addConnection(false, u);
+                } catch (MalformedURLException e) {
+                    // will never happen
+                }
+
+            }
+            if (jmxServer != null) {
+                addConnection(true, jmxServer.getAddress());
+            }
+            appendConnectionsFooter();
+        }
+
+        private void addConnection(boolean remote, JMXServiceURL u) {
+            appendConnectionHeader(remote);
+            addConnectionDetails(u);
+            if (remote) {
+                addConfigProperties();
+            }
+            appendConnectionFooter(remote);
+        }
+
+        private void addConfigProperties() {
+            appendConfigPropsHeader();
+            boolean[] first = new boolean[] {true};
+            configProps.entrySet().stream().forEach((e) -> {
+                String key = (String)e.getKey();
+                if (key.startsWith("com.sun.management.")) {
+                    addConfigProp(key, e.getValue(), first[0]);
+                    first[0] = false;
+                }
+            });
+            appendConfigPropsFooter();
+        }
+
+        abstract protected void addAgentStatus(boolean enabled);
+        abstract protected void appendConnectionsHeader();
+        abstract protected void appendConnectionsFooter();
+        abstract protected void addConnectionDetails(JMXServiceURL u);
+        abstract protected void appendConnectionHeader(boolean remote);
+        abstract protected void appendConnectionFooter(boolean remote);
+        abstract protected void appendConfigPropsHeader();
+        abstract protected void appendConfigPropsFooter();
+        abstract protected void addConfigProp(String key, Object value, boolean first);
+    }
+
+    /**
+     * Free-text status collector strategy implementation
+     */
+    final private static class TextStatusCollector extends StatusCollector {
+
+        @Override
+        protected void addAgentStatus(boolean enabled) {
+            sb.append("Agent: ").append(enabled ? "enabled" : "disabled").append('\n');
+        }
+
+        @Override
+        protected void appendConnectionsHeader() {
+            sb.append('\n');
+        }
+
+        @Override
+        protected void addConnectionDetails(JMXServiceURL u) {
+            sb.append("Protocol       : ").append(u.getProtocol()).append('\n')
+              .append("Host           : ").append(u.getHost()).append('\n')
+              .append("URL            : ").append(u).append('\n');
+        }
+
+        @Override
+        protected void appendConnectionHeader(boolean remote) {
+            sb.append("Connection Type: ").append(remote ? "remote" : "local").append('\n');
+        }
+
+        @Override
+        protected void appendConfigPropsHeader() {
+            sb.append("Properties     :\n");
+        }
+
+        @Override
+        protected void addConfigProp(String key, Object value, boolean first) {
+            if (!first) {
+                sb.append('\n');
+            }
+            sb.append("  ").append(key).append(" = ").append(value);
+        }
+
+        @Override
+        protected void appendConnectionsFooter() {}
+
+        @Override
+        protected void appendConnectionFooter(boolean remote) {
+            sb.append('\n');
+        }
+
+        @Override
+        protected void appendConfigPropsFooter() {}
+    }
+
     // management properties
 
     private static Properties mgmtProps;
@@ -81,6 +201,8 @@
 
     // The only active agent allowed
     private static JMXConnectorServer jmxServer = null;
+    // The properties used to configure the server
+    private static Properties configProps = null;
 
     // Parse string com.sun.management.prop=xxx,com.sun.management.prop=yyyy
     // and return property set if args is null or empty
@@ -161,7 +283,7 @@
 
         try {
             Properties argProps = parseString(args);
-            Properties configProps = new Properties();
+            configProps = new Properties();
 
             // Load the management properties from the config file
             // if config file is not specified readConfiguration implicitly
@@ -228,9 +350,14 @@
             // Don't cause any errors.
             jmxServer.stop();
             jmxServer = null;
+            configProps = null;
         }
     }
 
+    private static synchronized String getManagementAgentStatus() throws Exception {
+        return new TextStatusCollector().collect();
+    }
+
     private static void startAgent(Properties props) throws Exception {
         String snmpPort = props.getProperty(SNMP_PORT);
         String jmxremote = props.getProperty(JMXREMOTE);
--- a/src/java.management/share/classes/sun/management/DiagnosticCommandArgumentInfo.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-/**
- * Diagnostic Command Argument information. It contains the description
- * of one parameter of the diagnostic command. A parameter can either be an
- * option or an argument. Options are identified by the option name while
- * arguments are identified by their position in the command line. The generic
- * syntax of a diagnostic command is:
- *  <blockquote>
- *    &lt;command name&gt; [&lt;option&gt;=&lt;value&gt;] [&lt;argument_value&gt;]
- * </blockquote>
- * Example:
- * <blockquote>
- * command_name option1=value1 option2=value argumentA argumentB argumentC
- * </blockquote>
- * In this command line, the diagnostic command receives five parameters, two
- * options named {@code option1} and {@code option2}, and three arguments.
- * argumentA's position is 0, argumentB's position is 1 and argumentC's
- * position is 2.
- *
- * @since 1.8
- */
-
-class DiagnosticCommandArgumentInfo {
-    private final String name;
-    private final String description;
-    private final String type;
-    private final String defaultValue;
-    private final boolean mandatory;
-    private final boolean option;
-    private final boolean multiple;
-    private final int position;
-
-    /**
-     * Returns the argument name.
-     *
-     * @return the argument name
-     */
-    String getName() {
-        return name;
-    }
-
-   /**
-     * Returns the argument description.
-     *
-     * @return the argument description
-     */
-    String getDescription() {
-        return description;
-    }
-
-    /**
-     * Returns the argument type.
-     *
-     * @return the argument type
-     */
-    String getType() {
-        return type;
-    }
-
-    /**
-     * Returns the default value as a String if a default value
-     * is defined, null otherwise.
-     *
-     * @return the default value as a String if a default value
-     * is defined, null otherwise.
-     */
-    String getDefault() {
-        return defaultValue;
-    }
-
-    /**
-     * Returns {@code true} if the argument is mandatory,
-     *         {@code false} otherwise.
-     *
-     * @return {@code true} if the argument is mandatory,
-     *         {@code false} otherwise
-     */
-    boolean isMandatory() {
-        return mandatory;
-    }
-
-    /**
-     * Returns {@code true} if the argument is an option,
-     *         {@code false} otherwise. Options have to be specified using the
-     *         &lt;key&gt;=&lt;value&gt; syntax on the command line, while other
-     *         arguments are specified with a single &lt;value&gt; field and are
-     *         identified by their position on command line.
-     *
-     * @return {@code true} if the argument is an option,
-     *         {@code false} otherwise
-     */
-    boolean isOption() {
-        return option;
-    }
-
-    /**
-     * Returns {@code true} if the argument can be specified multiple times,
-     *         {@code false} otherwise.
-     *
-     * @return {@code true} if the argument can be specified multiple times,
-     *         {@code false} otherwise
-     */
-    boolean isMultiple() {
-        return multiple;
-    }
-
-    /**
-     * Returns the expected position of this argument if it is not an option,
-     *         -1 otherwise. Argument position if defined from left to right,
-     *         starting at zero and ignoring the diagnostic command name and
-     *         options.
-     *
-     * @return the expected position of this argument if it is not an option,
-     *         -1 otherwise.
-     */
-    int getPosition() {
-        return position;
-    }
-
-    DiagnosticCommandArgumentInfo(String name, String description,
-                                         String type, String defaultValue,
-                                         boolean mandatory, boolean option,
-                                         boolean multiple, int position) {
-        this.name = name;
-        this.description = description;
-        this.type = type;
-        this.defaultValue = defaultValue;
-        this.mandatory = mandatory;
-        this.option = option;
-        this.multiple = multiple;
-        this.position = position;
-    }
-}
--- a/src/java.management/share/classes/sun/management/DiagnosticCommandImpl.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,380 +0,0 @@
-/*
- * Copyright (c) 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-import com.sun.management.DiagnosticCommandMBean;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.security.Permission;
-import java.util.*;
-import javax.management.*;
-
-/**
- * Implementation class for the diagnostic commands subsystem.
- *
- * @since 1.8
- */
-class DiagnosticCommandImpl extends NotificationEmitterSupport
-    implements DiagnosticCommandMBean {
-
-    private final VMManagement jvm;
-    private volatile Map<String, Wrapper> wrappers = null;
-    private static final String strClassName = "".getClass().getName();
-    private static final String strArrayClassName = String[].class.getName();
-    private final boolean isSupported;
-
-    @Override
-    public Object getAttribute(String attribute) throws AttributeNotFoundException,
-        MBeanException, ReflectionException {
-        throw new AttributeNotFoundException(attribute);
-    }
-
-    @Override
-    public void setAttribute(Attribute attribute) throws AttributeNotFoundException,
-        InvalidAttributeValueException, MBeanException, ReflectionException {
-        throw new AttributeNotFoundException(attribute.getName());
-    }
-
-    @Override
-    public AttributeList getAttributes(String[] attributes) {
-        return new AttributeList();
-    }
-
-    @Override
-    public AttributeList setAttributes(AttributeList attributes) {
-        return new AttributeList();
-    }
-
-    private class Wrapper {
-
-        String name;
-        String cmd;
-        DiagnosticCommandInfo info;
-        Permission permission;
-
-        Wrapper(String name, String cmd, DiagnosticCommandInfo info)
-                throws InstantiationException {
-            this.name = name;
-            this.cmd = cmd;
-            this.info = info;
-            this.permission = null;
-            Exception cause = null;
-            if (info.getPermissionClass() != null) {
-                try {
-                    Class<?> c = Class.forName(info.getPermissionClass());
-                    if (info.getPermissionAction() == null) {
-                        try {
-                            Constructor<?> constructor = c.getConstructor(String.class);
-                            permission = (Permission) constructor.newInstance(info.getPermissionName());
-
-                        } catch (InstantiationException | IllegalAccessException
-                                | IllegalArgumentException | InvocationTargetException
-                                | NoSuchMethodException | SecurityException ex) {
-                            cause = ex;
-                        }
-                    }
-                    if (permission == null) {
-                        try {
-                            Constructor<?> constructor = c.getConstructor(String.class, String.class);
-                            permission = (Permission) constructor.newInstance(
-                                    info.getPermissionName(),
-                                    info.getPermissionAction());
-                        } catch (InstantiationException | IllegalAccessException
-                                | IllegalArgumentException | InvocationTargetException
-                                | NoSuchMethodException | SecurityException ex) {
-                            cause = ex;
-                        }
-                    }
-                } catch (ClassNotFoundException ex) { }
-                if (permission == null) {
-                    InstantiationException iex =
-                            new InstantiationException("Unable to instantiate required permission");
-                    iex.initCause(cause);
-                }
-            }
-        }
-
-        public String execute(String[] args) {
-            if (permission != null) {
-                SecurityManager sm = System.getSecurityManager();
-                if (sm != null) {
-                    sm.checkPermission(permission);
-                }
-            }
-            if(args == null) {
-                return executeDiagnosticCommand(cmd);
-            } else {
-                StringBuilder sb = new StringBuilder();
-                sb.append(cmd);
-                for(int i=0; i<args.length; i++) {
-                    if(args[i] == null) {
-                        throw new IllegalArgumentException("Invalid null argument");
-                    }
-                    sb.append(" ");
-                    sb.append(args[i]);
-                }
-                return executeDiagnosticCommand(sb.toString());
-            }
-        }
-    }
-
-    DiagnosticCommandImpl(VMManagement jvm) {
-        this.jvm = jvm;
-        isSupported = jvm.isRemoteDiagnosticCommandsSupported();
-    }
-
-    private static class OperationInfoComparator implements Comparator<MBeanOperationInfo> {
-        @Override
-        public int compare(MBeanOperationInfo o1, MBeanOperationInfo o2) {
-            return o1.getName().compareTo(o2.getName());
-        }
-    }
-
-    @Override
-    public MBeanInfo getMBeanInfo() {
-        SortedSet<MBeanOperationInfo> operations = new TreeSet<>(new OperationInfoComparator());
-        Map<String, Wrapper> wrappersmap;
-        if (!isSupported) {
-            wrappersmap = Collections.emptyMap();
-        } else {
-            try {
-                String[] command = getDiagnosticCommands();
-                DiagnosticCommandInfo[] info = getDiagnosticCommandInfo(command);
-                MBeanParameterInfo stringArgInfo[] = new MBeanParameterInfo[]{
-                    new MBeanParameterInfo("arguments", strArrayClassName,
-                    "Array of Diagnostic Commands Arguments and Options")
-                };
-                wrappersmap = new HashMap<>();
-                for (int i = 0; i < command.length; i++) {
-                    String name = transform(command[i]);
-                    try {
-                        Wrapper w = new Wrapper(name, command[i], info[i]);
-                        wrappersmap.put(name, w);
-                        operations.add(new MBeanOperationInfo(
-                                w.name,
-                                w.info.getDescription(),
-                                (w.info.getArgumentsInfo() == null
-                                    || w.info.getArgumentsInfo().isEmpty())
-                                    ? null : stringArgInfo,
-                                strClassName,
-                                MBeanOperationInfo.ACTION_INFO,
-                                commandDescriptor(w)));
-                    } catch (InstantiationException ex) {
-                        // If for some reasons the creation of a diagnostic command
-                        // wrappers fails, the diagnostic command is just ignored
-                        // and won't appear in the DynamicMBean
-                    }
-                }
-            } catch (IllegalArgumentException | UnsupportedOperationException e) {
-                wrappersmap = Collections.emptyMap();
-            }
-        }
-        wrappers =  Collections.unmodifiableMap(wrappersmap);
-        HashMap<String, Object> map = new HashMap<>();
-        map.put("immutableInfo", "false");
-        map.put("interfaceClassName","com.sun.management.DiagnosticCommandMBean");
-        map.put("mxbean", "false");
-        Descriptor desc = new ImmutableDescriptor(map);
-        return new MBeanInfo(
-                this.getClass().getName(),
-                "Diagnostic Commands",
-                null, // attributes
-                null, // constructors
-                operations.toArray(new MBeanOperationInfo[operations.size()]), // operations
-                getNotificationInfo(), // notifications
-                desc);
-    }
-
-    @Override
-    public Object invoke(String actionName, Object[] params, String[] signature)
-            throws MBeanException, ReflectionException {
-        if (!isSupported) {
-            throw new UnsupportedOperationException();
-        }
-        if (wrappers == null) {
-            getMBeanInfo();
-        }
-        Wrapper w = wrappers.get(actionName);
-        if (w != null) {
-            if (w.info.getArgumentsInfo().isEmpty()
-                    && (params == null || params.length == 0)
-                    && (signature == null || signature.length == 0)) {
-                return w.execute(null);
-            } else if((params != null && params.length == 1)
-                    && (signature != null && signature.length == 1
-                    && signature[0] != null
-                    && signature[0].compareTo(strArrayClassName) == 0)) {
-                return w.execute((String[]) params[0]);
-            }
-        }
-        throw new ReflectionException(new NoSuchMethodException(actionName));
-    }
-
-    private static String transform(String name) {
-        StringBuilder sb = new StringBuilder();
-        boolean toLower = true;
-        boolean toUpper = false;
-        for (int i = 0; i < name.length(); i++) {
-            char c = name.charAt(i);
-            if (c == '.' || c == '_') {
-                toLower = false;
-                toUpper = true;
-            } else {
-                if (toUpper) {
-                    toUpper = false;
-                    sb.append(Character.toUpperCase(c));
-                } else if(toLower) {
-                    sb.append(Character.toLowerCase(c));
-                } else {
-                    sb.append(c);
-                }
-            }
-        }
-        return sb.toString();
-    }
-
-    private Descriptor commandDescriptor(Wrapper w) throws IllegalArgumentException {
-        HashMap<String, Object> map = new HashMap<>();
-        map.put("dcmd.name", w.info.getName());
-        map.put("dcmd.description", w.info.getDescription());
-        map.put("dcmd.vmImpact", w.info.getImpact());
-        map.put("dcmd.permissionClass", w.info.getPermissionClass());
-        map.put("dcmd.permissionName", w.info.getPermissionName());
-        map.put("dcmd.permissionAction", w.info.getPermissionAction());
-        map.put("dcmd.enabled", w.info.isEnabled());
-        StringBuilder sb = new StringBuilder();
-        sb.append("help ");
-        sb.append(w.info.getName());
-        map.put("dcmd.help", executeDiagnosticCommand(sb.toString()));
-        if (w.info.getArgumentsInfo() != null && !w.info.getArgumentsInfo().isEmpty()) {
-            HashMap<String, Object> allargmap = new HashMap<>();
-            for (DiagnosticCommandArgumentInfo arginfo : w.info.getArgumentsInfo()) {
-                HashMap<String, Object> argmap = new HashMap<>();
-                argmap.put("dcmd.arg.name", arginfo.getName());
-                argmap.put("dcmd.arg.type", arginfo.getType());
-                argmap.put("dcmd.arg.description", arginfo.getDescription());
-                argmap.put("dcmd.arg.isMandatory", arginfo.isMandatory());
-                argmap.put("dcmd.arg.isMultiple", arginfo.isMultiple());
-                boolean isOption = arginfo.isOption();
-                argmap.put("dcmd.arg.isOption", isOption);
-                if(!isOption) {
-                    argmap.put("dcmd.arg.position", arginfo.getPosition());
-                } else {
-                    argmap.put("dcmd.arg.position", -1);
-                }
-                allargmap.put(arginfo.getName(), new ImmutableDescriptor(argmap));
-            }
-            map.put("dcmd.arguments", new ImmutableDescriptor(allargmap));
-        }
-        return new ImmutableDescriptor(map);
-    }
-
-    private final static String notifName =
-        "javax.management.Notification";
-
-    private final static String[] diagFramNotifTypes = {
-        "jmx.mbean.info.changed"
-    };
-
-    private MBeanNotificationInfo[] notifInfo = null;
-
-    @Override
-    public MBeanNotificationInfo[] getNotificationInfo() {
-        synchronized (this) {
-            if (notifInfo == null) {
-                 notifInfo = new MBeanNotificationInfo[1];
-                 notifInfo[0] =
-                         new MBeanNotificationInfo(diagFramNotifTypes,
-                                                   notifName,
-                                                   "Diagnostic Framework Notification");
-            }
-        }
-        return notifInfo;
-    }
-
-    private static long seqNumber = 0;
-    private static long getNextSeqNumber() {
-        return ++seqNumber;
-    }
-
-    private void createDiagnosticFrameworkNotification() {
-
-        if (!hasListeners()) {
-            return;
-        }
-        ObjectName on = null;
-        try {
-            on = ObjectName.getInstance(ManagementFactoryHelper.HOTSPOT_DIAGNOSTIC_COMMAND_MBEAN_NAME);
-        } catch (MalformedObjectNameException e) { }
-        Notification notif = new Notification("jmx.mbean.info.changed",
-                                              on,
-                                              getNextSeqNumber());
-        notif.setUserData(getMBeanInfo());
-        sendNotification(notif);
-    }
-
-    @Override
-    public synchronized void addNotificationListener(NotificationListener listener,
-            NotificationFilter filter,
-            Object handback) {
-        boolean before = hasListeners();
-        super.addNotificationListener(listener, filter, handback);
-        boolean after = hasListeners();
-        if (!before && after) {
-            setNotificationEnabled(true);
-        }
-    }
-
-    @Override
-    public synchronized void removeNotificationListener(NotificationListener listener)
-            throws ListenerNotFoundException {
-        boolean before = hasListeners();
-        super.removeNotificationListener(listener);
-        boolean after = hasListeners();
-        if (before && !after) {
-            setNotificationEnabled(false);
-        }
-    }
-
-    @Override
-    public synchronized void removeNotificationListener(NotificationListener listener,
-            NotificationFilter filter,
-            Object handback)
-            throws ListenerNotFoundException {
-        boolean before = hasListeners();
-        super.removeNotificationListener(listener, filter, handback);
-        boolean after = hasListeners();
-        if (before && !after) {
-            setNotificationEnabled(false);
-        }
-    }
-
-    private native void setNotificationEnabled(boolean enabled);
-    private native String[] getDiagnosticCommands();
-    private native DiagnosticCommandInfo[] getDiagnosticCommandInfo(String[] commands);
-    private native String executeDiagnosticCommand(String command);
-
-}
--- a/src/java.management/share/classes/sun/management/DiagnosticCommandInfo.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-import java.util.List;
-
-/**
- * Diagnostic command information. It contains the description of a
- * diagnostic command.
- *
- * @since 1.8
- */
-
-class DiagnosticCommandInfo {
-    private final String name;
-    private final String description;
-    private final String impact;
-    private final String permissionClass;
-    private final String permissionName;
-    private final String permissionAction;
-    private final boolean enabled;
-    private final List<DiagnosticCommandArgumentInfo> arguments;
-
-    /**
-     * Returns the diagnostic command name.
-     *
-     * @return the diagnostic command name
-     */
-    String getName() {
-        return name;
-    }
-
-   /**
-     * Returns the diagnostic command description.
-     *
-     * @return the diagnostic command description
-     */
-    String getDescription() {
-        return description;
-    }
-
-    /**
-     * Returns the potential impact of the diagnostic command execution
-     *         on the Java virtual machine behavior.
-     *
-     * @return the potential impact of the diagnostic command execution
-     *         on the Java virtual machine behavior
-     */
-    String getImpact() {
-        return impact;
-    }
-
-    /**
-     * Returns the name of the permission class required to be allowed
-     *         to invoke the diagnostic command, or null if no permission
-     *         is required.
-     *
-     * @return the name of the permission class name required to be allowed
-     *         to invoke the diagnostic command, or null if no permission
-     *         is required
-     */
-    String getPermissionClass() {
-        return permissionClass;
-    }
-
-    /**
-     * Returns the permission name required to be allowed to invoke the
-     *         diagnostic command, or null if no permission is required.
-     *
-     * @return the permission name required to be allowed to invoke the
-     *         diagnostic command, or null if no permission is required
-     */
-    String getPermissionName() {
-        return permissionName;
-    }
-
-    /**
-     * Returns the permission action required to be allowed to invoke the
-     *         diagnostic command, or null if no permission is required or
-     *         if the permission has no action specified.
-     *
-     * @return the permission action required to be allowed to invoke the
-     *         diagnostic command, or null if no permission is required or
-     *         if the permission has no action specified
-     */
-    String getPermissionAction() {
-        return permissionAction;
-    }
-
-    /**
-     * Returns {@code true} if the diagnostic command is enabled,
-     *         {@code false} otherwise. The enabled/disabled
-     *         status of a diagnostic command can evolve during
-     *         the lifetime of the Java virtual machine.
-     *
-     * @return {@code true} if the diagnostic command is enabled,
-     *         {@code false} otherwise
-     */
-    boolean isEnabled() {
-        return enabled;
-    }
-
-    /**
-     * Returns the list of the diagnostic command arguments description.
-     * If the diagnostic command has no arguments, it returns an empty list.
-     *
-     * @return a list of the diagnostic command arguments description
-     */
-    List<DiagnosticCommandArgumentInfo> getArgumentsInfo() {
-        return arguments;
-    }
-
-    DiagnosticCommandInfo(String name, String description,
-                                    String impact, String permissionClass,
-                                    String permissionName, String permissionAction,
-                                    boolean enabled,
-                                    List<DiagnosticCommandArgumentInfo> arguments)
-    {
-        this.name = name;
-        this.description = description;
-        this.impact = impact;
-        this.permissionClass = permissionClass;
-        this.permissionName = permissionName;
-        this.permissionAction = permissionAction;
-        this.enabled = enabled;
-        this.arguments = arguments;
-    }
-}
--- a/src/java.management/share/classes/sun/management/Flag.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2003, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-import java.util.*;
-import com.sun.management.VMOption;
-import com.sun.management.VMOption.Origin;
-import java.security.AccessController;
-
-/**
- * Flag class is a helper class for constructing a VMOption.
- * It has the static methods for getting the Flag objects, each
- * corresponds to one VMOption.
- *
- */
-class Flag {
-    private String name;
-    private Object value;
-    private Origin origin;
-    private boolean writeable;
-    private boolean external;
-
-    Flag(String name, Object value, boolean writeable,
-         boolean external, Origin origin) {
-        this.name = name;
-        this.value = value == null ? "" : value ;
-        this.origin = origin;
-        this.writeable = writeable;
-        this.external = external;
-    }
-
-    Object getValue() {
-        return value;
-    }
-
-    boolean isWriteable() {
-        return writeable;
-    }
-
-    boolean isExternal() {
-        return external;
-    }
-
-    VMOption getVMOption() {
-        return new VMOption(name, value.toString(), writeable, origin);
-    }
-
-    static Flag getFlag(String name) {
-        String[] names = new String[1];
-        names[0] = name;
-
-        List<Flag> flags = getFlags(names, 1);
-        if (flags.isEmpty()) {
-            return null;
-        } else {
-            // flags should have only one element
-            return flags.get(0);
-        }
-    }
-
-    static List<Flag> getAllFlags() {
-        int numFlags = getInternalFlagCount();
-
-        // Get all internal flags with names = null
-        return getFlags(null, numFlags);
-    }
-
-    private static List<Flag> getFlags(String[] names, int numFlags) {
-        Flag[] flags = new Flag[numFlags];
-        int count = getFlags(names, flags, numFlags);
-
-        List<Flag> result = new ArrayList<>();
-        for (Flag f : flags) {
-            if (f != null) {
-                result.add(f);
-            }
-        }
-        return result;
-    }
-
-    private static native String[] getAllFlagNames();
-    // getFlags sets each element in the given flags array
-    // with a Flag object only if the name is valid and the
-    // type is supported. The flags array may contain null elements.
-    private static native int getFlags(String[] names, Flag[] flags, int count);
-    private static native int getInternalFlagCount();
-
-    // These set* methods are synchronized on the class object
-    // to avoid multiple threads updating the same flag at the same time.
-    static synchronized native void setLongValue(String name, long value);
-    static synchronized native void setDoubleValue(String name, double value);
-    static synchronized native void setBooleanValue(String name, boolean value);
-    static synchronized native void setStringValue(String name, String value);
-
-    static {
-        AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() {
-                public Void run() {
-                    System.loadLibrary("management");
-                    return null;
-                }
-            });
-        initialize();
-    }
-    private static native void initialize();
-}
--- a/src/java.management/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2011, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-import com.sun.management.GarbageCollectionNotificationInfo;
-import com.sun.management.GcInfo;
-import java.lang.reflect.Method;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.SimpleType;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-
-/**
- * A CompositeData for GarbageCollectionNotificationInfo for the local management support.
- * This class avoids the performance penalty paid to the
- * construction of a CompositeData use in the local case.
- */
-public class GarbageCollectionNotifInfoCompositeData extends LazyCompositeData {
-    private final GarbageCollectionNotificationInfo gcNotifInfo;
-
-    public GarbageCollectionNotifInfoCompositeData(GarbageCollectionNotificationInfo info) {
-        this.gcNotifInfo = info;
-    }
-
-    public GarbageCollectionNotificationInfo getGarbageCollectionNotifInfo() {
-        return gcNotifInfo;
-    }
-
-    public static CompositeData toCompositeData(GarbageCollectionNotificationInfo info) {
-        GarbageCollectionNotifInfoCompositeData gcnicd =
-            new GarbageCollectionNotifInfoCompositeData(info);
-        return gcnicd.getCompositeData();
-    }
-
-    private CompositeType getCompositeTypeByBuilder() {
-        final GcInfoBuilder builder = AccessController.doPrivileged (new PrivilegedAction<GcInfoBuilder>() {
-                public GcInfoBuilder run() {
-                    try {
-                        Class<?> cl = Class.forName("com.sun.management.GcInfo");
-                        Field f = cl.getDeclaredField("builder");
-                        f.setAccessible(true);
-                        return (GcInfoBuilder)f.get(gcNotifInfo.getGcInfo());
-                    } catch(ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
-                        return null;
-                    }
-                }
-            });
-        CompositeType gict = null;
-        synchronized(compositeTypeByBuilder) {
-            gict = compositeTypeByBuilder.get(builder);
-            if(gict == null) {
-                OpenType<?>[] gcNotifInfoItemTypes = new OpenType<?>[] {
-                    SimpleType.STRING,
-                    SimpleType.STRING,
-                    SimpleType.STRING,
-                    builder.getGcInfoCompositeType(),
-                };
-                try {
-                    final String typeName =
-                        "sun.management.GarbageCollectionNotifInfoCompositeType";
-                    gict = new CompositeType(typeName,
-                                             "CompositeType for GC notification info",
-                                             gcNotifInfoItemNames,
-                                             gcNotifInfoItemNames,
-                                             gcNotifInfoItemTypes);
-                    compositeTypeByBuilder.put(builder,gict);
-                } catch (OpenDataException e) {
-                    // shouldn't reach here
-                    throw Util.newException(e);
-                }
-            }
-        }
-        return gict;
-    }
-
-    protected CompositeData getCompositeData() {
-        // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
-        // gcNotifInfoItemNames!
-        final Object[] gcNotifInfoItemValues;
-        gcNotifInfoItemValues = new Object[] {
-            gcNotifInfo.getGcName(),
-            gcNotifInfo.getGcAction(),
-            gcNotifInfo.getGcCause(),
-            GcInfoCompositeData.toCompositeData(gcNotifInfo.getGcInfo())
-        };
-
-        CompositeType gict = getCompositeTypeByBuilder();
-
-        try {
-            return new CompositeDataSupport(gict,
-                                            gcNotifInfoItemNames,
-                                            gcNotifInfoItemValues);
-        } catch (OpenDataException e) {
-            // Should never reach here
-            throw new AssertionError(e);
-        }
-    }
-
-    //    private static MappedMXBeanType gcInfoMapType;
-    private static final String GC_NAME = "gcName";
-    private static final String GC_ACTION = "gcAction";
-    private static final String GC_CAUSE = "gcCause";
-    private static final String GC_INFO     = "gcInfo";
-    private static final String[] gcNotifInfoItemNames = {
-        GC_NAME,
-        GC_ACTION,
-        GC_CAUSE,
-        GC_INFO
-    };
-    private static HashMap<GcInfoBuilder,CompositeType> compositeTypeByBuilder =
-        new HashMap<>();
-
-    public static String getGcName(CompositeData cd) {
-        String gcname = getString(cd, GC_NAME);
-        if (gcname == null) {
-            throw new IllegalArgumentException("Invalid composite data: " +
-                "Attribute " + GC_NAME + " has null value");
-        }
-        return gcname;
-    }
-
-    public static String getGcAction(CompositeData cd) {
-        String gcaction = getString(cd, GC_ACTION);
-        if (gcaction == null) {
-            throw new IllegalArgumentException("Invalid composite data: " +
-                "Attribute " + GC_ACTION + " has null value");
-        }
-        return gcaction;
-    }
-
-    public static String getGcCause(CompositeData cd) {
-        String gccause = getString(cd, GC_CAUSE);
-        if (gccause == null) {
-            throw new IllegalArgumentException("Invalid composite data: " +
-                "Attribute " + GC_CAUSE + " has null value");
-        }
-        return gccause;
-    }
-
-    public static GcInfo getGcInfo(CompositeData cd) {
-        CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
-        return GcInfo.from(gcInfoData);
-    }
-
-    /** Validate if the input CompositeData has the expected
-     * CompositeType (i.e. contain all attributes with expected
-     * names and types).
-     */
-    public static void validateCompositeData(CompositeData cd) {
-        if (cd == null) {
-            throw new NullPointerException("Null CompositeData");
-        }
-
-        if (!isTypeMatched( getBaseGcNotifInfoCompositeType(), cd.getCompositeType())) {
-            throw new IllegalArgumentException(
-                "Unexpected composite type for GarbageCollectionNotificationInfo");
-        }
-    }
-
-    // This is only used for validation.
-    private static CompositeType baseGcNotifInfoCompositeType = null;
-    private static synchronized CompositeType getBaseGcNotifInfoCompositeType() {
-        if (baseGcNotifInfoCompositeType == null) {
-            try {
-                OpenType<?>[] baseGcNotifInfoItemTypes = new OpenType<?>[] {
-                    SimpleType.STRING,
-                    SimpleType.STRING,
-                    SimpleType.STRING,
-                    GcInfoCompositeData.getBaseGcInfoCompositeType()
-                };
-                baseGcNotifInfoCompositeType =
-                    new CompositeType("sun.management.BaseGarbageCollectionNotifInfoCompositeType",
-                                      "CompositeType for Base GarbageCollectionNotificationInfo",
-                                      gcNotifInfoItemNames,
-                                      gcNotifInfoItemNames,
-                                      baseGcNotifInfoItemTypes);
-            } catch (OpenDataException e) {
-                // shouldn't reach here
-                throw Util.newException(e);
-            }
-        }
-        return baseGcNotifInfoCompositeType;
-    }
-
-    private static final long serialVersionUID = -1805123446483771292L;
-}
--- a/src/java.management/share/classes/sun/management/GarbageCollectorImpl.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/sun/management/GarbageCollectorImpl.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -25,168 +25,31 @@
 
 package sun.management;
 
-import com.sun.management.GarbageCollectorMXBean;
-import com.sun.management.GarbageCollectionNotificationInfo;
+import java.lang.management.GarbageCollectorMXBean;
 import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryPoolMXBean;
-import java.lang.management.MemoryUsage;
-
-import com.sun.management.GcInfo;
-import javax.management.openmbean.CompositeData;
-import javax.management.MBeanInfo;
-import javax.management.MBeanAttributeInfo;
 import javax.management.ObjectName;
-import javax.management.MBeanNotificationInfo;
-import javax.management.Notification;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ListenerNotFoundException;
-
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
 
 /**
  * Implementation class for the garbage collector.
- * Standard and committed hotspot-specific metrics if any.
  *
  * ManagementFactory.getGarbageCollectorMXBeans() returns a list
  * of instances of this class.
  */
-class GarbageCollectorImpl extends MemoryManagerImpl
+public class GarbageCollectorImpl extends MemoryManagerImpl
     implements GarbageCollectorMXBean {
 
-    GarbageCollectorImpl(String name) {
+    protected GarbageCollectorImpl(String name) {
         super(name);
     }
 
+    @Override
     public native long getCollectionCount();
+
+    @Override
     public native long getCollectionTime();
 
-
-    // The memory pools are static and won't be changed.
-    // TODO: If the hotspot implementation begins to have pools
-    // dynamically created and removed, this needs to be modified.
-    private String[] poolNames = null;
-    synchronized String[] getAllPoolNames() {
-        if (poolNames == null) {
-            List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
-            poolNames = new String[pools.size()];
-            int i = 0;
-            for (MemoryPoolMXBean m : pools) {
-                poolNames[i++] = m.getName();
-            }
-        }
-        return poolNames;
-    }
-
-    // Sun JDK extension
-    private GcInfoBuilder gcInfoBuilder;
-
-    private synchronized GcInfoBuilder getGcInfoBuilder() {
-        if(gcInfoBuilder == null) {
-            gcInfoBuilder = new GcInfoBuilder(this, getAllPoolNames());
-        }
-        return gcInfoBuilder;
-    }
-
-    public GcInfo getLastGcInfo() {
-        GcInfo info = getGcInfoBuilder().getLastGcInfo();
-        return info;
-    }
-
-    private final static String notifName =
-        "javax.management.Notification";
-
-    private final static String[] gcNotifTypes = {
-        GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION
-    };
-
-    private MBeanNotificationInfo[] notifInfo = null;
-    public MBeanNotificationInfo[] getNotificationInfo() {
-        synchronized (this) {
-            if (notifInfo == null) {
-                 notifInfo = new MBeanNotificationInfo[1];
-                 notifInfo[0] = new MBeanNotificationInfo(gcNotifTypes,
-                                                          notifName,
-                                                          "GC Notification");
-            }
-        }
-        return notifInfo;
-    }
-
-    private static long seqNumber = 0;
-    private static long getNextSeqNumber() {
-        return ++seqNumber;
-    }
-
-    void createGCNotification(long timestamp,
-                              String gcName,
-                              String gcAction,
-                              String gcCause,
-                              GcInfo gcInfo)  {
-
-        if (!hasListeners()) {
-            return;
-        }
-
-        Notification notif = new Notification(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION,
-                                              getObjectName(),
-                                              getNextSeqNumber(),
-                                              timestamp,
-                                              gcName);
-        GarbageCollectionNotificationInfo info =
-            new GarbageCollectionNotificationInfo(gcName,
-                                                  gcAction,
-                                                  gcCause,
-                                                  gcInfo);
-
-        CompositeData cd =
-            GarbageCollectionNotifInfoCompositeData.toCompositeData(info);
-        notif.setUserData(cd);
-        sendNotification(notif);
-    }
-
-    public synchronized void addNotificationListener(NotificationListener listener,
-                                                     NotificationFilter filter,
-                                                     Object handback)
-    {
-        boolean before = hasListeners();
-        super.addNotificationListener(listener, filter, handback);
-        boolean after = hasListeners();
-        if (!before && after) {
-            setNotificationEnabled(this, true);
-        }
-    }
-
-    public synchronized void removeNotificationListener(NotificationListener listener)
-        throws ListenerNotFoundException {
-        boolean before = hasListeners();
-        super.removeNotificationListener(listener);
-        boolean after = hasListeners();
-        if (before && !after) {
-            setNotificationEnabled(this,false);
-        }
-    }
-
-    public synchronized void removeNotificationListener(NotificationListener listener,
-                                                        NotificationFilter filter,
-                                                        Object handback)
-            throws ListenerNotFoundException
-    {
-        boolean before = hasListeners();
-        super.removeNotificationListener(listener,filter,handback);
-        boolean after = hasListeners();
-        if (before && !after) {
-            setNotificationEnabled(this,false);
-        }
-    }
-
+    @Override
     public ObjectName getObjectName() {
         return Util.newObjectName(ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE, getName());
     }
-
-    native void setNotificationEnabled(GarbageCollectorMXBean gc,
-                                       boolean enabled);
-
 }
--- a/src/java.management/share/classes/sun/management/GcInfoBuilder.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-/*
- * Copyright (c) 2003, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management;
-
-import java.lang.management.GarbageCollectorMXBean;
-import java.lang.management.MemoryUsage;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.SimpleType;
-import javax.management.openmbean.TabularType;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.OpenDataException;
-import com.sun.management.GcInfo;
-
-/**
- * Helper class to build composite data.
- */
-public class GcInfoBuilder {
-    private final GarbageCollectorMXBean gc;
-    private final String[] poolNames;
-    private String[] allItemNames;
-
-    // GC-specific composite type:
-    // Each GarbageCollectorMXBean may have different GC-specific attributes
-    // the CompositeType for the GcInfo could be different.
-    private CompositeType gcInfoCompositeType;
-
-    // GC-specific items
-    private final int gcExtItemCount;
-    private final String[] gcExtItemNames;
-    private final String[] gcExtItemDescs;
-    private final char[] gcExtItemTypes;
-
-    GcInfoBuilder(GarbageCollectorMXBean gc, String[] poolNames) {
-        this.gc = gc;
-        this.poolNames = poolNames;
-        this.gcExtItemCount = getNumGcExtAttributes(gc);
-        this.gcExtItemNames = new String[gcExtItemCount];
-        this.gcExtItemDescs = new String[gcExtItemCount];
-        this.gcExtItemTypes = new char[gcExtItemCount];
-
-        // Fill the information about extension attributes
-        fillGcAttributeInfo(gc, gcExtItemCount, gcExtItemNames,
-                            gcExtItemTypes, gcExtItemDescs);
-
-        // lazily build the CompositeType for the GcInfo
-        // including the GC-specific extension attributes
-        this.gcInfoCompositeType = null;
-    }
-
-    GcInfo getLastGcInfo() {
-        MemoryUsage[] usageBeforeGC = new MemoryUsage[poolNames.length];
-        MemoryUsage[] usageAfterGC = new MemoryUsage[poolNames.length];
-        Object[] values = new Object[gcExtItemCount];
-
-        return getLastGcInfo0(gc, gcExtItemCount, values, gcExtItemTypes,
-                              usageBeforeGC, usageAfterGC);
-    }
-
-    public String[] getPoolNames() {
-        return poolNames;
-    }
-
-    int getGcExtItemCount() {
-        return gcExtItemCount;
-    }
-
-    // Returns the CompositeType for the GcInfo including
-    // the extension attributes
-    synchronized CompositeType getGcInfoCompositeType() {
-        if (gcInfoCompositeType != null)
-            return gcInfoCompositeType;
-
-        // First, fill with the attributes in the GcInfo
-        String[] gcInfoItemNames = GcInfoCompositeData.getBaseGcInfoItemNames();
-        OpenType<?>[] gcInfoItemTypes = GcInfoCompositeData.getBaseGcInfoItemTypes();
-        int numGcInfoItems = gcInfoItemNames.length;
-
-        int itemCount = numGcInfoItems + gcExtItemCount;
-        allItemNames = new String[itemCount];
-        String[] allItemDescs = new String[itemCount];
-        OpenType<?>[] allItemTypes = new OpenType<?>[itemCount];
-
-        System.arraycopy(gcInfoItemNames, 0, allItemNames, 0, numGcInfoItems);
-        System.arraycopy(gcInfoItemNames, 0, allItemDescs, 0, numGcInfoItems);
-        System.arraycopy(gcInfoItemTypes, 0, allItemTypes, 0, numGcInfoItems);
-
-        // Then fill with the extension GC-specific attributes, if any.
-        if (gcExtItemCount > 0) {
-            fillGcAttributeInfo(gc, gcExtItemCount, gcExtItemNames,
-                                gcExtItemTypes, gcExtItemDescs);
-            System.arraycopy(gcExtItemNames, 0, allItemNames,
-                             numGcInfoItems, gcExtItemCount);
-            System.arraycopy(gcExtItemDescs, 0, allItemDescs,
-                             numGcInfoItems, gcExtItemCount);
-            for (int i = numGcInfoItems, j = 0; j < gcExtItemCount; i++, j++) {
-                switch (gcExtItemTypes[j]) {
-                    case 'Z':
-                        allItemTypes[i] = SimpleType.BOOLEAN;
-                        break;
-                    case 'B':
-                        allItemTypes[i] = SimpleType.BYTE;
-                        break;
-                    case 'C':
-                        allItemTypes[i] = SimpleType.CHARACTER;
-                        break;
-                    case 'S':
-                        allItemTypes[i] = SimpleType.SHORT;
-                        break;
-                    case 'I':
-                        allItemTypes[i] = SimpleType.INTEGER;
-                        break;
-                    case 'J':
-                        allItemTypes[i] = SimpleType.LONG;
-                        break;
-                    case 'F':
-                        allItemTypes[i] = SimpleType.FLOAT;
-                        break;
-                    case 'D':
-                        allItemTypes[i] = SimpleType.DOUBLE;
-                        break;
-                    default:
-                        throw new AssertionError(
-                            "Unsupported type [" + gcExtItemTypes[i] + "]");
-                }
-            }
-        }
-
-        CompositeType gict = null;
-        try {
-            final String typeName =
-                "sun.management." + gc.getName() + ".GcInfoCompositeType";
-
-            gict = new CompositeType(typeName,
-                                     "CompositeType for GC info for " +
-                                         gc.getName(),
-                                     allItemNames,
-                                     allItemDescs,
-                                     allItemTypes);
-        } catch (OpenDataException e) {
-            // shouldn't reach here
-            throw Util.newException(e);
-        }
-        gcInfoCompositeType = gict;
-
-        return gcInfoCompositeType;
-    }
-
-    synchronized String[] getItemNames() {
-        if (allItemNames == null) {
-            // initialize when forming the composite type
-            getGcInfoCompositeType();
-        }
-        return allItemNames;
-    }
-
-    // Retrieve information about extension attributes
-    private native int getNumGcExtAttributes(GarbageCollectorMXBean gc);
-    private native void fillGcAttributeInfo(GarbageCollectorMXBean gc,
-                                            int numAttributes,
-                                            String[] attributeNames,
-                                            char[] types,
-                                            String[] descriptions);
-
-    /**
-     * Returns the last GcInfo
-     *
-     * @param gc GarbageCollectorMXBean that the gc info is associated with.
-     * @param numExtAtts number of extension attributes
-     * @param extAttValues Values of extension attributes to be filled.
-     * @param before Memory usage before GC to be filled.
-     * @param after Memory usage after GC to be filled.
-     */
-    private native GcInfo getLastGcInfo0(GarbageCollectorMXBean gc,
-                                         int numExtAtts,
-                                         Object[] extAttValues,
-                                         char[] extAttTypes,
-                                         MemoryUsage[] before,
-                                         MemoryUsage[] after);
-}
--- a/src/java.management/share/classes/sun/management/GcInfoCompositeData.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,276 +0,0 @@
-/*
- * Copyright (c) 2004, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-import java.lang.management.MemoryUsage;
-import java.lang.reflect.Method;
-import java.lang.reflect.Field;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Collections;
-import java.io.InvalidObjectException;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.SimpleType;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.OpenDataException;
-import com.sun.management.GcInfo;
-import com.sun.management.GarbageCollectionNotificationInfo;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * A CompositeData for GcInfo for the local management support.
- * This class avoids the performance penalty paid to the
- * construction of a CompositeData use in the local case.
- */
-public class GcInfoCompositeData extends LazyCompositeData {
-    private final GcInfo info;
-    private final GcInfoBuilder builder;
-    private final Object[] gcExtItemValues;
-
-    public GcInfoCompositeData(GcInfo info,
-                        GcInfoBuilder builder,
-                        Object[] gcExtItemValues) {
-        this.info = info;
-        this.builder = builder;
-        this.gcExtItemValues = gcExtItemValues;
-    }
-
-    public GcInfo getGcInfo() {
-        return info;
-    }
-
-    public static CompositeData toCompositeData(final GcInfo info) {
-        final GcInfoBuilder builder = AccessController.doPrivileged (new PrivilegedAction<GcInfoBuilder>() {
-                        public GcInfoBuilder run() {
-                            try {
-                                Class<?> cl = Class.forName("com.sun.management.GcInfo");
-                                Field f = cl.getDeclaredField("builder");
-                                f.setAccessible(true);
-                                return (GcInfoBuilder)f.get(info);
-                            } catch(ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
-                                return null;
-                            }
-                        }
-                    });
-        final Object[] extAttr = AccessController.doPrivileged (new PrivilegedAction<Object[]>() {
-                        public Object[] run() {
-                            try {
-                                Class<?> cl = Class.forName("com.sun.management.GcInfo");
-                                Field f = cl.getDeclaredField("extAttributes");
-                                f.setAccessible(true);
-                                return (Object[])f.get(info);
-                            } catch(ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
-                                return null;
-                            }
-                        }
-                    });
-        GcInfoCompositeData gcicd =
-            new GcInfoCompositeData(info,builder,extAttr);
-        return gcicd.getCompositeData();
-    }
-
-    protected CompositeData getCompositeData() {
-        // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
-        // baseGcInfoItemNames!
-        final Object[] baseGcInfoItemValues;
-
-        try {
-            baseGcInfoItemValues = new Object[] {
-                info.getId(),
-                info.getStartTime(),
-                info.getEndTime(),
-                info.getDuration(),
-                memoryUsageMapType.toOpenTypeData(info.getMemoryUsageBeforeGc()),
-                memoryUsageMapType.toOpenTypeData(info.getMemoryUsageAfterGc()),
-            };
-        } catch (OpenDataException e) {
-            // Should never reach here
-            throw new AssertionError(e);
-        }
-
-        // Get the item values for the extension attributes
-        final int gcExtItemCount = builder.getGcExtItemCount();
-        if (gcExtItemCount == 0 &&
-            gcExtItemValues != null && gcExtItemValues.length != 0) {
-            throw new AssertionError("Unexpected Gc Extension Item Values");
-        }
-
-        if (gcExtItemCount > 0 && (gcExtItemValues == null ||
-             gcExtItemCount != gcExtItemValues.length)) {
-            throw new AssertionError("Unmatched Gc Extension Item Values");
-        }
-
-        Object[] values = new Object[baseGcInfoItemValues.length +
-                                     gcExtItemCount];
-        System.arraycopy(baseGcInfoItemValues, 0, values, 0,
-                         baseGcInfoItemValues.length);
-
-        if (gcExtItemCount > 0) {
-            System.arraycopy(gcExtItemValues, 0, values,
-                             baseGcInfoItemValues.length, gcExtItemCount);
-        }
-
-        try {
-            return new CompositeDataSupport(builder.getGcInfoCompositeType(),
-                                            builder.getItemNames(),
-                                            values);
-        } catch (OpenDataException e) {
-            // Should never reach here
-            throw new AssertionError(e);
-        }
-    }
-
-    private static final String ID                     = "id";
-    private static final String START_TIME             = "startTime";
-    private static final String END_TIME               = "endTime";
-    private static final String DURATION               = "duration";
-    private static final String MEMORY_USAGE_BEFORE_GC = "memoryUsageBeforeGc";
-    private static final String MEMORY_USAGE_AFTER_GC  = "memoryUsageAfterGc";
-
-    private static final String[] baseGcInfoItemNames = {
-        ID,
-        START_TIME,
-        END_TIME,
-        DURATION,
-        MEMORY_USAGE_BEFORE_GC,
-        MEMORY_USAGE_AFTER_GC,
-    };
-
-
-    private static MappedMXBeanType memoryUsageMapType;
-    static {
-        try {
-            Method m = GcInfo.class.getMethod("getMemoryUsageBeforeGc");
-            memoryUsageMapType =
-                MappedMXBeanType.getMappedType(m.getGenericReturnType());
-        } catch (NoSuchMethodException | OpenDataException e) {
-            // Should never reach here
-            throw new AssertionError(e);
-        }
-    }
-
-    static String[] getBaseGcInfoItemNames() {
-        return baseGcInfoItemNames;
-    }
-
-    private static OpenType<?>[] baseGcInfoItemTypes = null;
-    static synchronized OpenType<?>[] getBaseGcInfoItemTypes() {
-        if (baseGcInfoItemTypes == null) {
-            OpenType<?> memoryUsageOpenType = memoryUsageMapType.getOpenType();
-            baseGcInfoItemTypes = new OpenType<?>[] {
-                SimpleType.LONG,
-                SimpleType.LONG,
-                SimpleType.LONG,
-                SimpleType.LONG,
-
-                memoryUsageOpenType,
-                memoryUsageOpenType,
-            };
-        }
-        return baseGcInfoItemTypes;
-    }
-
-    public static long getId(CompositeData cd) {
-        return getLong(cd, ID);
-    }
-    public static long getStartTime(CompositeData cd) {
-        return getLong(cd, START_TIME);
-    }
-    public static long getEndTime(CompositeData cd) {
-        return getLong(cd, END_TIME);
-    }
-
-    public static Map<String, MemoryUsage>
-            getMemoryUsageBeforeGc(CompositeData cd) {
-        try {
-            TabularData td = (TabularData) cd.get(MEMORY_USAGE_BEFORE_GC);
-            return cast(memoryUsageMapType.toJavaTypeData(td));
-        } catch (InvalidObjectException | OpenDataException e) {
-            // Should never reach here
-            throw new AssertionError(e);
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public static Map<String, MemoryUsage> cast(Object x) {
-        return (Map<String, MemoryUsage>) x;
-    }
-    public static Map<String, MemoryUsage>
-            getMemoryUsageAfterGc(CompositeData cd) {
-        try {
-            TabularData td = (TabularData) cd.get(MEMORY_USAGE_AFTER_GC);
-            //return (Map<String,MemoryUsage>)
-            return cast(memoryUsageMapType.toJavaTypeData(td));
-        } catch (InvalidObjectException | OpenDataException e) {
-            // Should never reach here
-            throw new AssertionError(e);
-        }
-    }
-
-    /**
-     * Returns true if the input CompositeData has the expected
-     * CompositeType (i.e. contain all attributes with expected
-     * names and types).  Otherwise, return false.
-     */
-    public static void validateCompositeData(CompositeData cd) {
-        if (cd == null) {
-            throw new NullPointerException("Null CompositeData");
-        }
-
-        if (!isTypeMatched(getBaseGcInfoCompositeType(),
-                           cd.getCompositeType())) {
-           throw new IllegalArgumentException(
-                "Unexpected composite type for GcInfo");
-        }
-    }
-
-    // This is only used for validation.
-    private static CompositeType baseGcInfoCompositeType = null;
-    static synchronized CompositeType getBaseGcInfoCompositeType() {
-        if (baseGcInfoCompositeType == null) {
-            try {
-                baseGcInfoCompositeType =
-                    new CompositeType("sun.management.BaseGcInfoCompositeType",
-                                      "CompositeType for Base GcInfo",
-                                      getBaseGcInfoItemNames(),
-                                      getBaseGcInfoItemNames(),
-                                      getBaseGcInfoItemTypes());
-            } catch (OpenDataException e) {
-                // shouldn't reach here
-                throw Util.newException(e);
-            }
-        }
-        return baseGcInfoCompositeType;
-    }
-
-    private static final long serialVersionUID = -5716428894085882742L;
-}
--- a/src/java.management/share/classes/sun/management/HotSpotDiagnostic.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2005, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import javax.management.ObjectName;
-
-import com.sun.management.HotSpotDiagnosticMXBean;
-import com.sun.management.VMOption;
-
-/**
- * Implementation of the diagnostic MBean for Hotspot VM.
- */
-public class HotSpotDiagnostic implements HotSpotDiagnosticMXBean {
-    public HotSpotDiagnostic() {
-    }
-
-    @Override
-    public void dumpHeap(String outputFile, boolean live) throws IOException {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkWrite(outputFile);
-            Util.checkControlAccess();
-        }
-
-        dumpHeap0(outputFile, live);
-    }
-
-    private native void dumpHeap0(String outputFile, boolean live) throws IOException;
-
-    @Override
-    public List<VMOption> getDiagnosticOptions() {
-        List<Flag> allFlags = Flag.getAllFlags();
-        List<VMOption> result = new ArrayList<>();
-        for (Flag flag : allFlags) {
-            if (flag.isWriteable() && flag.isExternal()) {
-                result.add(flag.getVMOption());
-            }
-        }
-        return result;
-    }
-
-    @Override
-    public VMOption getVMOption(String name) {
-        if (name == null) {
-            throw new NullPointerException("name cannot be null");
-        }
-
-        Flag f = Flag.getFlag(name);
-        if (f == null) {
-            throw new IllegalArgumentException("VM option \"" +
-                name + "\" does not exist");
-        }
-        return f.getVMOption();
-    }
-
-    @Override
-    public void setVMOption(String name, String value) {
-        if (name == null) {
-            throw new NullPointerException("name cannot be null");
-        }
-        if (value == null) {
-            throw new NullPointerException("value cannot be null");
-        }
-
-        Util.checkControlAccess();
-        Flag flag = Flag.getFlag(name);
-        if (flag == null) {
-            throw new IllegalArgumentException("VM option \"" +
-                name + "\" does not exist");
-        }
-        if (!flag.isWriteable()){
-            throw new IllegalArgumentException("VM Option \"" +
-                name + "\" is not writeable");
-        }
-
-        // Check the type of the value
-        Object v = flag.getValue();
-        if (v instanceof Long) {
-            try {
-                long l = Long.parseLong(value);
-                Flag.setLongValue(name, l);
-            } catch (NumberFormatException e) {
-                throw new IllegalArgumentException("Invalid value:" +
-                        " VM Option \"" + name + "\"" +
-                        " expects numeric value", e);
-            }
-        } else if (v instanceof Double) {
-            try {
-                double d = Double.parseDouble(value);
-                Flag.setDoubleValue(name, d);
-            } catch (NumberFormatException e) {
-                throw new IllegalArgumentException("Invalid value:" +
-                        " VM Option \"" + name + "\"" +
-                        " expects numeric value", e);
-            }
-        } else if (v instanceof Boolean) {
-            if (!value.equalsIgnoreCase("true") &&
-                !value.equalsIgnoreCase("false")) {
-                throw new IllegalArgumentException("Invalid value:" +
-                    " VM Option \"" + name + "\"" +
-                    " expects \"true\" or \"false\".");
-            }
-            Flag.setBooleanValue(name, Boolean.parseBoolean(value));
-        } else if (v instanceof String) {
-            Flag.setStringValue(name, value);
-        } else {
-            throw new IllegalArgumentException("VM Option \"" +
-                name + "\" is of an unsupported type: " +
-                v.getClass().getName());
-        }
-    }
-
-    @Override
-    public ObjectName getObjectName() {
-        return Util.newObjectName("com.sun.management:type=HotSpotDiagnostic");
-    }
-}
--- a/src/java.management/share/classes/sun/management/LazyCompositeData.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/sun/management/LazyCompositeData.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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
@@ -115,28 +115,28 @@
     protected abstract CompositeData getCompositeData();
 
     // Helper methods
-    static String getString(CompositeData cd, String itemName) {
+    public static String getString(CompositeData cd, String itemName) {
         if (cd == null)
             throw new IllegalArgumentException("Null CompositeData");
 
         return (String) cd.get(itemName);
     }
 
-    static boolean getBoolean(CompositeData cd, String itemName) {
+    public static boolean getBoolean(CompositeData cd, String itemName) {
         if (cd == null)
             throw new IllegalArgumentException("Null CompositeData");
 
         return ((Boolean) cd.get(itemName)).booleanValue();
     }
 
-    static long getLong(CompositeData cd, String itemName) {
+    public static long getLong(CompositeData cd, String itemName) {
         if (cd == null)
             throw new IllegalArgumentException("Null CompositeData");
 
         return ((Long) cd.get(itemName)).longValue();
     }
 
-    static int getInt(CompositeData cd, String itemName) {
+    public static int getInt(CompositeData cd, String itemName) {
         if (cd == null)
             throw new IllegalArgumentException("Null CompositeData");
 
--- a/src/java.management/share/classes/sun/management/ManagementFactory.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2008, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-import java.lang.management.MemoryManagerMXBean;
-import java.lang.management.MemoryPoolMXBean;
-import java.lang.management.GarbageCollectorMXBean;
-
-/**
- * ManagementFactory class provides the methods that the HotSpot VM
- * will invoke. So the class and method names cannot be renamed.
- */
-class ManagementFactory {
-    private ManagementFactory() {};
-
-    // Invoked by the VM
-    private static MemoryPoolMXBean createMemoryPool
-        (String name, boolean isHeap, long uThreshold, long gcThreshold) {
-        return new MemoryPoolImpl(name, isHeap, uThreshold, gcThreshold);
-    }
-
-    private static MemoryManagerMXBean createMemoryManager(String name) {
-        return new MemoryManagerImpl(name);
-    }
-
-    private static GarbageCollectorMXBean
-        createGarbageCollector(String name, String type) {
-
-        // ignore type parameter which is for future extension
-        return new GarbageCollectorImpl(name);
-    }
-}
--- a/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -26,8 +26,6 @@
 package sun.management;
 
 import java.lang.management.*;
-
-import javax.management.DynamicMBean;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.MBeanServer;
@@ -38,30 +36,35 @@
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
-
 import sun.util.logging.LoggingSupport;
-
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import com.sun.management.DiagnosticCommandMBean;
-import com.sun.management.HotSpotDiagnosticMXBean;
 
 /**
  * ManagementFactoryHelper provides static factory methods to create
  * instances of the management interface.
  */
 public class ManagementFactoryHelper {
+    static {
+        // make sure that the management lib is loaded within
+        // java.lang.management.ManagementFactory
+        sun.misc.Unsafe.getUnsafe().ensureClassInitialized(ManagementFactory.class);
+    }
+
+    private static final VMManagement jvm = new VMManagementImpl();
+
     private ManagementFactoryHelper() {};
 
-    private static VMManagement jvm;
+    public static VMManagement getVMManagement() {
+        return jvm;
+    }
 
     private static ClassLoadingImpl    classMBean = null;
     private static MemoryImpl          memoryMBean = null;
     private static ThreadImpl          threadMBean = null;
     private static RuntimeImpl         runtimeMBean = null;
     private static CompilationImpl     compileMBean = null;
-    private static OperatingSystemImpl osMBean = null;
+    private static BaseOperatingSystemImpl osMBean = null;
 
     public static synchronized ClassLoadingMXBean getClassLoadingMXBean() {
         if (classMBean == null) {
@@ -100,7 +103,7 @@
 
     public static synchronized OperatingSystemMXBean getOperatingSystemMXBean() {
         if (osMBean == null) {
-            osMBean = new OperatingSystemImpl(jvm);
+            osMBean = new BaseOperatingSystemImpl(jvm);
         }
         return osMBean;
     }
@@ -123,7 +126,7 @@
         return result;
     }
 
-    public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans() {
+     public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans() {
         MemoryManagerMXBean[]  mgrs = MemoryImpl.getMemoryManagers();
         List<GarbageCollectorMXBean> result = new ArrayList<>(mgrs.length);
         for (MemoryManagerMXBean m : mgrs) {
@@ -257,20 +260,11 @@
         };
     }
 
-    private static HotSpotDiagnostic hsDiagMBean = null;
     private static HotspotRuntime hsRuntimeMBean = null;
     private static HotspotClassLoading hsClassMBean = null;
     private static HotspotThread hsThreadMBean = null;
     private static HotspotCompilation hsCompileMBean = null;
     private static HotspotMemory hsMemoryMBean = null;
-    private static DiagnosticCommandImpl hsDiagCommandMBean = null;
-
-    public static synchronized HotSpotDiagnosticMXBean getDiagnosticMXBean() {
-        if (hsDiagMBean == null) {
-            hsDiagMBean = new HotSpotDiagnostic();
-        }
-        return hsDiagMBean;
-    }
 
     /**
      * This method is for testing only.
@@ -312,14 +306,6 @@
         return hsMemoryMBean;
     }
 
-    public static synchronized DiagnosticCommandMBean getDiagnosticCommandMBean() {
-        // Remote Diagnostic Commands may not be supported
-        if (hsDiagCommandMBean == null && jvm.isRemoteDiagnosticCommandsSupported()) {
-            hsDiagCommandMBean = new DiagnosticCommandImpl(jvm);
-        }
-        return hsDiagCommandMBean;
-    }
-
     /**
      * This method is for testing only.
      */
@@ -374,18 +360,6 @@
     private final static String HOTSPOT_THREAD_MBEAN_NAME =
         "sun.management:type=HotspotThreading";
 
-    final static String HOTSPOT_DIAGNOSTIC_COMMAND_MBEAN_NAME =
-        "com.sun.management:type=DiagnosticCommand";
-
-    public static HashMap<ObjectName, DynamicMBean> getPlatformDynamicMBeans() {
-        HashMap<ObjectName, DynamicMBean> map = new HashMap<>();
-        DiagnosticCommandMBean diagMBean = getDiagnosticCommandMBean();
-        if (diagMBean != null) {
-            map.put(Util.newObjectName(HOTSPOT_DIAGNOSTIC_COMMAND_MBEAN_NAME), diagMBean);
-        }
-        return map;
-    }
-
     static void registerInternalMBeans(MBeanServer mbs) {
         // register all internal MBeans if not registered
         // No exception is thrown if a MBean with that object name
@@ -441,17 +415,6 @@
         }
     }
 
-    static {
-        AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() {
-                public Void run() {
-                    System.loadLibrary("management");
-                    return null;
-                }
-            });
-        jvm = new VMManagementImpl();
-    }
-
     public static boolean isThreadSuspended(int state) {
         return ((state & JMM_THREAD_STATE_FLAG_SUSPENDED) != 0);
     }
@@ -471,4 +434,20 @@
     private static final int JMM_THREAD_STATE_FLAG_SUSPENDED = 0x00100000;
     private static final int JMM_THREAD_STATE_FLAG_NATIVE = 0x00400000;
 
+    // Invoked by the VM
+    private static MemoryPoolMXBean createMemoryPool
+        (String name, boolean isHeap, long uThreshold, long gcThreshold) {
+        return new MemoryPoolImpl(name, isHeap, uThreshold, gcThreshold);
+    }
+
+    private static MemoryManagerMXBean createMemoryManager(String name) {
+        return new MemoryManagerImpl(name);
+    }
+
+    private static GarbageCollectorMXBean
+        createGarbageCollector(String name, String type) {
+
+        // ignore type parameter which is for future extension
+        return new GarbageCollectorImpl(name);
+    }
 }
--- a/src/java.management/share/classes/sun/management/MappedMXBeanType.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/sun/management/MappedMXBeanType.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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
@@ -38,10 +38,8 @@
 import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
-import javax.management.*;
 import javax.management.openmbean.*;
 import static javax.management.openmbean.SimpleType.*;
-import com.sun.management.VMOption;
 
 /**
  * A mapped mxbean type maps a Java type to an open type.
@@ -113,7 +111,7 @@
         return mt;
     }
 
-    static synchronized MappedMXBeanType getMappedType(Type t)
+    public static synchronized MappedMXBeanType getMappedType(Type t)
             throws OpenDataException {
         MappedMXBeanType mt = convertedTypes.get(t);
         if (mt == null) {
@@ -152,7 +150,7 @@
     }
 
     // Return the mapped open type
-    OpenType<?> getOpenType() {
+    public OpenType<?> getOpenType() {
         return openType;
     }
 
@@ -177,10 +175,10 @@
     // return name of the class or the generic type
     abstract String getName();
 
-    abstract Object toOpenTypeData(Object javaTypeData)
+    public abstract Object toOpenTypeData(Object javaTypeData)
         throws OpenDataException;
 
-    abstract Object toJavaTypeData(Object openTypeData)
+    public abstract Object toJavaTypeData(Object openTypeData)
         throws OpenDataException, InvalidObjectException;
 
     // Basic Types - Classes that do not require data conversion
@@ -208,11 +206,11 @@
             return basicType.getName();
         }
 
-        Object toOpenTypeData(Object data) throws OpenDataException {
+        public Object toOpenTypeData(Object data) throws OpenDataException {
             return data;
         }
 
-        Object toJavaTypeData(Object data)
+        public Object toJavaTypeData(Object data)
             throws OpenDataException, InvalidObjectException {
 
             return data;
@@ -243,11 +241,11 @@
             return enumClass.getName();
         }
 
-        Object toOpenTypeData(Object data) throws OpenDataException {
+        public Object toOpenTypeData(Object data) throws OpenDataException {
             return ((Enum) data).name();
         }
 
-        Object toJavaTypeData(Object data)
+        public Object toJavaTypeData(Object data)
             throws OpenDataException, InvalidObjectException {
 
             try {
@@ -315,7 +313,7 @@
             return arrayClass.getName();
         }
 
-        Object toOpenTypeData(Object data) throws OpenDataException {
+        public Object toOpenTypeData(Object data) throws OpenDataException {
             // If the base element type is a basic type
             // return the data as no conversion is needed.
             // Primitive types are not converted to wrappers.
@@ -340,7 +338,7 @@
         }
 
 
-        Object toJavaTypeData(Object data)
+        public Object toJavaTypeData(Object data)
             throws OpenDataException, InvalidObjectException {
 
             // If the base element type is a basic type
@@ -457,7 +455,7 @@
             return typeName;
         }
 
-        Object toOpenTypeData(Object data) throws OpenDataException {
+        public Object toOpenTypeData(Object data) throws OpenDataException {
             final List<Object> list = (List<Object>) data;
 
             final Object[] openArray = (Object[])
@@ -470,7 +468,7 @@
             return openArray;
         }
 
-        Object toJavaTypeData(Object data)
+        public Object toJavaTypeData(Object data)
             throws OpenDataException, InvalidObjectException {
 
             final Object[] openArray = (Object[]) data;
@@ -538,7 +536,7 @@
             return typeName;
         }
 
-        Object toOpenTypeData(Object data) throws OpenDataException {
+        public Object toOpenTypeData(Object data) throws OpenDataException {
             final Map<Object,Object> map = (Map<Object,Object>) data;
             final TabularType tabularType = (TabularType) openType;
             final TabularData table = new TabularDataSupport(tabularType);
@@ -556,7 +554,7 @@
             return table;
         }
 
-        Object toJavaTypeData(Object data)
+        public Object toJavaTypeData(Object data)
             throws OpenDataException, InvalidObjectException {
 
             final TabularData td = (TabularData) data;
@@ -605,8 +603,9 @@
     //
     static class CompositeDataMXBeanType extends MappedMXBeanType {
         final Class<?> javaClass;
-        final boolean isCompositeData;
+        boolean isCompositeData = false;
         Method fromMethod = null;
+        Method toMethod = null;
 
         CompositeDataMXBeanType(Class<?> c) throws OpenDataException {
             this.javaClass = c;
@@ -624,6 +623,26 @@
                 // that has no from method to be embeded in another class.
             }
 
+            // check if a static "toCompositeData" method exists
+            try {
+                toMethod = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>() {
+                    public Method run() throws NoSuchMethodException {
+                        Method m = javaClass.getDeclaredMethod("toCompositeData", javaClass);
+                        if (m != null
+                                && CompositeData.class.isAssignableFrom(m.getReturnType())
+                                && Modifier.isStatic(m.getModifiers())) {
+                            m.setAccessible(true);
+                            return m;
+                        } else {
+                            return null;
+                        }
+                    }
+                });
+            } catch (PrivilegedActionException e) {
+                // ignore NoSuchMethodException since we allow classes
+                // that has no from method to be embeded in another class.
+            }
+
             if (COMPOSITE_DATA_CLASS.isAssignableFrom(c)) {
                 // c implements CompositeData - set openType to null
                 // defer generating the CompositeType
@@ -636,16 +655,16 @@
                 // Make a CompositeData containing all the getters
                 final Method[] methods =
                     AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
-                        public Method[] run() {
-                            return javaClass.getMethods();
-                        }
-                    });
+                            public Method[] run() {
+                                return javaClass.getMethods();
+                            }
+                        });
                 final List<String> names = new ArrayList<>();
                 final List<OpenType<?>> types = new ArrayList<>();
 
                 /* Select public methods that look like "T getX()" or "boolean
-                   isX()", where T is not void and X is not the empty
-                   string.  Exclude "Class getClass()" inherited from Object.  */
+                 isX()", where T is not void and X is not the empty
+                 string.  Exclude "Class getClass()" inherited from Object.  */
                 for (int i = 0; i < methods.length; i++) {
                     final Method method = methods[i];
                     final String name = method.getName();
@@ -676,10 +695,10 @@
 
                 final String[] nameArray = names.toArray(new String[0]);
                 openType = new CompositeType(c.getName(),
-                                             c.getName(),
-                                             nameArray, // field names
-                                             nameArray, // field descriptions
-                                             types.toArray(new OpenType<?>[0]));
+                        c.getName(),
+                        nameArray, // field names
+                        nameArray, // field descriptions
+                        types.toArray(new OpenType<?>[0]));
             }
         }
 
@@ -691,7 +710,23 @@
             return javaClass.getName();
         }
 
-        Object toOpenTypeData(Object data) throws OpenDataException {
+        public Object toOpenTypeData(Object data) throws OpenDataException {
+            if (toMethod != null) {
+                try {
+                    return toMethod.invoke(null, data);
+                } catch (IllegalAccessException e) {
+                    // should never reach here
+                    throw new AssertionError(e);
+                } catch (InvocationTargetException e) {
+                    final OpenDataException ode
+                            = new OpenDataException("Failed to invoke "
+                                    + toMethod.getName() + " to convert " + javaClass.getName()
+                                    + " to CompositeData");
+                    ode.initCause(e);
+                    throw ode;
+                }
+            }
+
             if (data instanceof MemoryUsage) {
                 return MemoryUsageCompositeData.toCompositeData((MemoryUsage) data);
             }
@@ -712,10 +747,6 @@
                     toCompositeData((MemoryNotificationInfo) data);
             }
 
-            if (data instanceof VMOption) {
-                return VMOptionCompositeData.toCompositeData((VMOption) data);
-            }
-
             if (isCompositeData) {
                 // Classes that implement CompositeData
                 //
@@ -732,7 +763,7 @@
                 " is not supported for platform MXBeans");
         }
 
-        Object toJavaTypeData(Object data)
+        public Object toJavaTypeData(Object data)
             throws OpenDataException, InvalidObjectException {
 
             if (fromMethod == null) {
--- a/src/java.management/share/classes/sun/management/NotificationEmitterSupport.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/sun/management/NotificationEmitterSupport.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -34,13 +34,12 @@
 
 import java.util.List;
 import java.util.ArrayList;
-import java.util.ListIterator;
 import java.util.Collections;
 
 /**
  * Abstract helper class for notification emitter support.
  */
-abstract class NotificationEmitterSupport implements NotificationEmitter {
+public abstract class NotificationEmitterSupport implements NotificationEmitter {
 
     protected NotificationEmitterSupport() {
     }
@@ -135,7 +134,7 @@
         }
     }
 
-    void sendNotification(Notification notification) {
+    public void sendNotification(Notification notification) {
 
         if (notification == null) {
             return;
@@ -162,7 +161,7 @@
         }
     }
 
-    boolean hasListeners() {
+    public boolean hasListeners() {
         synchronized (listenerLock) {
             return !listenerList.isEmpty();
         }
--- a/src/java.management/share/classes/sun/management/ThreadImpl.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/sun/management/ThreadImpl.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -26,20 +26,18 @@
 package sun.management;
 
 import java.lang.management.ManagementFactory;
-
 import java.lang.management.ThreadInfo;
-
+import java.lang.management.ThreadMXBean;
 import javax.management.ObjectName;
 
 /**
- * Implementation class for the thread subsystem.
- * Standard and committed hotspot-specific metrics if any.
- *
- * ManagementFactory.getThreadMXBean() returns an instance
- * of this class.
+ * Implementation for java.lang.management.ThreadMXBean as well as providing the
+ * supporting method for com.sun.management.ThreadMXBean.
+ * The supporting method for com.sun.management.ThreadMXBean can be moved to
+ * jdk.management in the future.
  */
-class ThreadImpl implements com.sun.management.ThreadMXBean {
 
+public class ThreadImpl implements ThreadMXBean {
     private final VMManagement jvm;
 
     // default for thread contention monitoring is disabled.
@@ -50,32 +48,38 @@
     /**
      * Constructor of ThreadImpl class.
      */
-    ThreadImpl(VMManagement vm) {
+    protected ThreadImpl(VMManagement vm) {
         this.jvm = vm;
         this.cpuTimeEnabled = jvm.isThreadCpuTimeEnabled();
         this.allocatedMemoryEnabled = jvm.isThreadAllocatedMemoryEnabled();
     }
 
+    @Override
     public int getThreadCount() {
         return jvm.getLiveThreadCount();
     }
 
+    @Override
     public int getPeakThreadCount() {
         return jvm.getPeakThreadCount();
     }
 
+    @Override
     public long getTotalStartedThreadCount() {
         return jvm.getTotalThreadCount();
     }
 
+    @Override
     public int getDaemonThreadCount() {
         return jvm.getDaemonThreadCount();
     }
 
+    @Override
     public boolean isThreadContentionMonitoringSupported() {
         return jvm.isThreadContentionMonitoringSupported();
     }
 
+    @Override
     public synchronized boolean isThreadContentionMonitoringEnabled() {
        if (!isThreadContentionMonitoringSupported()) {
             throw new UnsupportedOperationException(
@@ -84,18 +88,21 @@
         return contentionMonitoringEnabled;
     }
 
+    @Override
     public boolean isThreadCpuTimeSupported() {
         return jvm.isOtherThreadCpuTimeSupported();
     }
 
+    @Override
     public boolean isCurrentThreadCpuTimeSupported() {
         return jvm.isCurrentThreadCpuTimeSupported();
     }
 
-    public boolean isThreadAllocatedMemorySupported() {
+    protected boolean isThreadAllocatedMemorySupported() {
         return jvm.isThreadAllocatedMemorySupported();
     }
 
+    @Override
     public boolean isThreadCpuTimeEnabled() {
         if (!isThreadCpuTimeSupported() &&
             !isCurrentThreadCpuTimeSupported()) {
@@ -105,7 +112,7 @@
         return cpuTimeEnabled;
     }
 
-    public boolean isThreadAllocatedMemoryEnabled() {
+    protected boolean isThreadAllocatedMemoryEnabled() {
         if (!isThreadAllocatedMemorySupported()) {
             throw new UnsupportedOperationException(
                 "Thread allocated memory measurement is not supported");
@@ -113,6 +120,7 @@
         return allocatedMemoryEnabled;
     }
 
+    @Override
     public long[] getAllThreadIds() {
         Util.checkMonitorAccess();
 
@@ -126,6 +134,7 @@
         return ids;
     }
 
+    @Override
     public ThreadInfo getThreadInfo(long id) {
         long[] ids = new long[1];
         ids[0] = id;
@@ -133,6 +142,7 @@
         return infos[0];
     }
 
+    @Override
     public ThreadInfo getThreadInfo(long id, int maxDepth) {
         long[] ids = new long[1];
         ids[0] = id;
@@ -140,6 +150,7 @@
         return infos[0];
     }
 
+    @Override
     public ThreadInfo[] getThreadInfo(long[] ids) {
         return getThreadInfo(ids, 0);
     }
@@ -157,6 +168,7 @@
         }
     }
 
+    @Override
     public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth) {
         verifyThreadIds(ids);
 
@@ -165,6 +177,10 @@
                 "Invalid maxDepth parameter: " + maxDepth);
         }
 
+        // ids has been verified to be non-null
+        // an empty array of ids should return an empty array of ThreadInfos
+        if (ids.length == 0) return new ThreadInfo[0];
+
         Util.checkMonitorAccess();
 
         ThreadInfo[] infos = new ThreadInfo[ids.length]; // nulls
@@ -176,6 +192,7 @@
         return infos;
     }
 
+    @Override
     public void setThreadContentionMonitoringEnabled(boolean enable) {
         if (!isThreadContentionMonitoringSupported()) {
             throw new UnsupportedOperationException(
@@ -209,6 +226,7 @@
         return isThreadCpuTimeEnabled();
     }
 
+    @Override
     public long getCurrentThreadCpuTime() {
         if (verifyCurrentThreadCpuTime()) {
             return getThreadTotalCpuTime0(0);
@@ -216,6 +234,7 @@
         return -1;
     }
 
+    @Override
     public long getThreadCpuTime(long id) {
         long[] ids = new long[1];
         ids[0] = id;
@@ -247,7 +266,7 @@
         return isThreadCpuTimeEnabled();
     }
 
-    public long[] getThreadCpuTime(long[] ids) {
+    protected long[] getThreadCpuTime(long[] ids) {
         boolean verified = verifyThreadCpuTime(ids);
 
         int length = ids.length;
@@ -268,6 +287,7 @@
         return times;
     }
 
+    @Override
     public long getCurrentThreadUserTime() {
         if (verifyCurrentThreadCpuTime()) {
             return getThreadUserCpuTime0(0);
@@ -275,6 +295,7 @@
         return -1;
     }
 
+    @Override
     public long getThreadUserTime(long id) {
         long[] ids = new long[1];
         ids[0] = id;
@@ -282,7 +303,7 @@
         return times[0];
     }
 
-    public long[] getThreadUserTime(long[] ids) {
+    protected long[] getThreadUserTime(long[] ids) {
         boolean verified = verifyThreadCpuTime(ids);
 
         int length = ids.length;
@@ -303,6 +324,7 @@
         return times;
     }
 
+    @Override
     public void setThreadCpuTimeEnabled(boolean enable) {
         if (!isThreadCpuTimeSupported() &&
             !isCurrentThreadCpuTimeSupported()) {
@@ -320,7 +342,7 @@
         }
     }
 
-    public long getThreadAllocatedBytes(long id) {
+    protected long getThreadAllocatedBytes(long id) {
         long[] ids = new long[1];
         ids[0] = id;
         final long[] sizes = getThreadAllocatedBytes(ids);
@@ -339,7 +361,7 @@
         return isThreadAllocatedMemoryEnabled();
     }
 
-    public long[] getThreadAllocatedBytes(long[] ids) {
+    protected long[] getThreadAllocatedBytes(long[] ids) {
         boolean verified = verifyThreadAllocatedMemory(ids);
 
         long[] sizes = new long[ids.length];
@@ -351,7 +373,7 @@
         return sizes;
     }
 
-    public void setThreadAllocatedMemoryEnabled(boolean enable) {
+    protected void setThreadAllocatedMemoryEnabled(boolean enable) {
         if (!isThreadAllocatedMemorySupported()) {
             throw new UnsupportedOperationException(
                 "Thread allocated memory measurement is not supported.");
@@ -367,6 +389,7 @@
         }
     }
 
+    @Override
     public long[] findMonitorDeadlockedThreads() {
         Util.checkMonitorAccess();
 
@@ -383,6 +406,7 @@
         return ids;
     }
 
+    @Override
     public long[] findDeadlockedThreads() {
         if (!isSynchronizerUsageSupported()) {
             throw new UnsupportedOperationException(
@@ -404,15 +428,18 @@
         return ids;
     }
 
+    @Override
     public void resetPeakThreadCount() {
         Util.checkControlAccess();
         resetPeakThreadCount0();
     }
 
+    @Override
     public boolean isObjectMonitorUsageSupported() {
         return jvm.isObjectMonitorUsageSupported();
     }
 
+    @Override
     public boolean isSynchronizerUsageSupported() {
         return jvm.isSynchronizerUsageSupported();
     }
@@ -432,14 +459,20 @@
         Util.checkMonitorAccess();
     }
 
+    @Override
     public ThreadInfo[] getThreadInfo(long[] ids,
                                       boolean lockedMonitors,
                                       boolean lockedSynchronizers) {
         verifyThreadIds(ids);
+        // ids has been verified to be non-null
+        // an empty array of ids should return an empty array of ThreadInfos
+        if (ids.length == 0) return new ThreadInfo[0];
+
         verifyDumpThreads(lockedMonitors, lockedSynchronizers);
         return dumpThreads0(ids, lockedMonitors, lockedSynchronizers);
     }
 
+    @Override
     public ThreadInfo[] dumpAllThreads(boolean lockedMonitors,
                                        boolean lockedSynchronizers) {
         verifyDumpThreads(lockedMonitors, lockedSynchronizers);
@@ -469,6 +502,7 @@
     // tid == 0 to reset contention times for all threads
     private static native void resetContentionTimes0(long tid);
 
+    @Override
     public ObjectName getObjectName() {
         return Util.newObjectName(ManagementFactory.THREAD_MXBEAN_NAME);
     }
--- a/src/java.management/share/classes/sun/management/Util.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/sun/management/Util.java	Tue May 05 13:29:31 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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,7 +81,7 @@
     static void checkMonitorAccess() throws SecurityException {
         checkAccess(monitorPermission);
     }
-    static void checkControlAccess() throws SecurityException {
+    public static void checkControlAccess() throws SecurityException {
         checkAccess(controlPermission);
     }
 }
--- a/src/java.management/share/classes/sun/management/VMOptionCompositeData.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2005, 2008, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-import com.sun.management.VMOption;
-import com.sun.management.VMOption.Origin;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.OpenDataException;
-
-/**
- * A CompositeData for VMOption for the local management support.
- * This class avoids the performance penalty paid to the
- * construction of a CompositeData use in the local case.
- */
-public class VMOptionCompositeData extends LazyCompositeData {
-    private final VMOption option;
-
-    private VMOptionCompositeData(VMOption option) {
-        this.option = option;
-    }
-
-    public VMOption getVMOption() {
-        return option;
-    }
-
-    public static CompositeData toCompositeData(VMOption option) {
-        VMOptionCompositeData vcd = new VMOptionCompositeData(option);
-        return vcd.getCompositeData();
-    }
-
-    protected CompositeData getCompositeData() {
-        // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
-        // vmOptionItemNames!
-        final Object[] vmOptionItemValues = {
-            option.getName(),
-            option.getValue(),
-            option.isWriteable(),
-            option.getOrigin().toString(),
-        };
-
-        try {
-            return new CompositeDataSupport(vmOptionCompositeType,
-                                            vmOptionItemNames,
-                                            vmOptionItemValues);
-        } catch (OpenDataException e) {
-            // Should never reach here
-            throw new AssertionError(e);
-        }
-    }
-
-    private static final CompositeType vmOptionCompositeType;
-    static {
-        try {
-            vmOptionCompositeType = (CompositeType)
-                MappedMXBeanType.toOpenType(VMOption.class);
-        } catch (OpenDataException e) {
-            // Should never reach here
-            throw new AssertionError(e);
-        }
-    }
-
-    static CompositeType getVMOptionCompositeType() {
-        return vmOptionCompositeType;
-    }
-
-    private static final String NAME      = "name";
-    private static final String VALUE     = "value";
-    private static final String WRITEABLE = "writeable";
-    private static final String ORIGIN    = "origin";
-
-    private static final String[] vmOptionItemNames = {
-        NAME,
-        VALUE,
-        WRITEABLE,
-        ORIGIN,
-    };
-
-    public static String getName(CompositeData cd) {
-        return getString(cd, NAME);
-    }
-    public static String getValue(CompositeData cd) {
-        return getString(cd, VALUE);
-    }
-    public static Origin getOrigin(CompositeData cd) {
-        String o = getString(cd, ORIGIN);
-        return Enum.valueOf(Origin.class, o);
-    }
-    public static boolean isWriteable(CompositeData cd) {
-        return getBoolean(cd, WRITEABLE);
-    }
-
-    /** Validate if the input CompositeData has the expected
-     * CompositeType (i.e. contain all attributes with expected
-     * names and types).
-     */
-    public static void validateCompositeData(CompositeData cd) {
-        if (cd == null) {
-            throw new NullPointerException("Null CompositeData");
-        }
-
-        if (!isTypeMatched(vmOptionCompositeType, cd.getCompositeType())) {
-            throw new IllegalArgumentException(
-                "Unexpected composite type for VMOption");
-        }
-    }
-
-    private static final long serialVersionUID = -2395573975093578470L;
-}
--- a/src/java.management/share/classes/sun/management/spi/PlatformMBeanProvider.java	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/classes/sun/management/spi/PlatformMBeanProvider.java	Tue May 05 13:29:31 2015 -0700
@@ -205,7 +205,7 @@
      * Instantiates a new PlatformMBeanProvider.
      *
      * @throws SecurityException if the subclass (and calling code) does not
-     *    have {@code RuntimePermission("sun.management.spi.PlatformMBeanProvider", "subclass")}
+     *    have {@code RuntimePermission("sun.management.spi.PlatformMBeanProvider.subclass")}
      */
     protected PlatformMBeanProvider () {
         this(checkSubclassPermission());
@@ -226,7 +226,7 @@
     private static Void checkSubclassPermission() {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkPermission(new RuntimePermission(PlatformMBeanProvider.class.getName(), "subclass"));
+            sm.checkPermission(new RuntimePermission(PlatformMBeanProvider.class.getName()+".subclass"));
         }
         return null;
     }
--- a/src/java.management/share/native/libmanagement/DiagnosticCommandImpl.c	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * 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) {
-        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
-Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommands
-  (JNIEnv *env, jobject dummy)
-{
-  return jmm_interface->GetDiagnosticCommands(env);
-}
-
-jobject getDiagnosticCommandArgumentInfoArray(JNIEnv *env, jstring command,
-                                              int num_arg) {
-  int i;
-  jobject obj;
-  jobjectArray result;
-  dcmdArgInfo* dcmd_arg_info_array;
-  jclass dcmdArgInfoCls;
-  jclass arraysCls;
-  jmethodID mid;
-  jobject resultList;
-
-  dcmd_arg_info_array = (dcmdArgInfo*) malloc(num_arg * sizeof(dcmdArgInfo));
-  /* According to ISO C it is perfectly legal for malloc to return zero if called with a zero argument */
-  if (dcmd_arg_info_array == NULL && num_arg != 0) {
-    return NULL;
-  }
-  jmm_interface->GetDiagnosticCommandArgumentsInfo(env, command,
-                                                   dcmd_arg_info_array);
-  dcmdArgInfoCls = (*env)->FindClass(env,
-                                     "sun/management/DiagnosticCommandArgumentInfo");
-  if ((*env)->ExceptionCheck(env)) {
-    free(dcmd_arg_info_array);
-    return NULL;
-  }
-
-  result = (*env)->NewObjectArray(env, num_arg, dcmdArgInfoCls, NULL);
-  if (result == NULL) {
-    free(dcmd_arg_info_array);
-    return NULL;
-  }
-  for (i=0; i<num_arg; i++) {
-    obj = JNU_NewObjectByName(env,
-                              "sun/management/DiagnosticCommandArgumentInfo",
-                              "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZI)V",
-                              (*env)->NewStringUTF(env,dcmd_arg_info_array[i].name),
-                              (*env)->NewStringUTF(env,dcmd_arg_info_array[i].description),
-                              (*env)->NewStringUTF(env,dcmd_arg_info_array[i].type),
-                              dcmd_arg_info_array[i].default_string == NULL ? NULL:
-                              (*env)->NewStringUTF(env, dcmd_arg_info_array[i].default_string),
-                              dcmd_arg_info_array[i].mandatory,
-                              dcmd_arg_info_array[i].option,
-                              dcmd_arg_info_array[i].multiple,
-                              dcmd_arg_info_array[i].position);
-    if (obj == NULL) {
-      free(dcmd_arg_info_array);
-      return NULL;
-    }
-    (*env)->SetObjectArrayElement(env, result, i, obj);
-  }
-  free(dcmd_arg_info_array);
-  arraysCls = (*env)->FindClass(env, "java/util/Arrays");
-  if ((*env)->ExceptionCheck(env)) {
-    return NULL;
-  }
-  mid = (*env)->GetStaticMethodID(env, arraysCls,
-                                  "asList", "([Ljava/lang/Object;)Ljava/util/List;");
-  resultList = (*env)->CallStaticObjectMethod(env, arraysCls, mid, result);
-  if ((*env)->ExceptionCheck(env)) {
-    // Make sure we return NULL in case of OOM inside Java
-    return NULL;
-  }
-  return resultList;
-}
-
-/* Throws IllegalArgumentException if at least one of the diagnostic command
- * passed in argument is not supported by the JVM
- */
-JNIEXPORT jobjectArray JNICALL
-Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo
-(JNIEnv *env, jobject dummy, jobjectArray commands)
-{
-  int i;
-  jclass dcmdInfoCls;
-  jobject result;
-  jobjectArray args;
-  jobject obj;
-  jmmOptionalSupport mos;
-  jint ret = jmm_interface->GetOptionalSupport(env, &mos);
-  jsize num_commands;
-  dcmdInfo* dcmd_info_array;
-
-  if (commands == NULL) {
-      JNU_ThrowNullPointerException(env, "Invalid String Array");
-      return NULL;
-  }
-  num_commands = (*env)->GetArrayLength(env, commands);
-  dcmdInfoCls = (*env)->FindClass(env,
-                                  "sun/management/DiagnosticCommandInfo");
-  if ((*env)->ExceptionCheck(env)) {
-    return NULL;
-  }
-
-  result = (*env)->NewObjectArray(env, num_commands, dcmdInfoCls, NULL);
-  if (result == NULL) {
-      JNU_ThrowOutOfMemoryError(env, 0);
-      return NULL;
-  }
-  if (num_commands == 0) {
-      /* Handle the 'zero commands' case specially to avoid calling 'malloc()' */
-      /* with a zero argument because that may legally return a NULL pointer.  */
-      return result;
-  }
-  dcmd_info_array = (dcmdInfo*) malloc(num_commands * sizeof(dcmdInfo));
-  if (dcmd_info_array == NULL) {
-      JNU_ThrowOutOfMemoryError(env, NULL);
-      return NULL;
-  }
-  jmm_interface->GetDiagnosticCommandInfo(env, commands, dcmd_info_array);
-  for (i=0; i<num_commands; i++) {
-      args = getDiagnosticCommandArgumentInfoArray(env,
-                                                   (*env)->GetObjectArrayElement(env,commands,i),
-                                                   dcmd_info_array[i].num_arguments);
-      if (args == NULL) {
-          free(dcmd_info_array);
-          JNU_ThrowOutOfMemoryError(env, 0);
-          return NULL;
-      }
-      obj = JNU_NewObjectByName(env,
-                                "sun/management/DiagnosticCommandInfo",
-                                "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/util/List;)V",
-                                (*env)->NewStringUTF(env,dcmd_info_array[i].name),
-                                (*env)->NewStringUTF(env,dcmd_info_array[i].description),
-                                (*env)->NewStringUTF(env,dcmd_info_array[i].impact),
-                                dcmd_info_array[i].permission_class==NULL?NULL:(*env)->NewStringUTF(env,dcmd_info_array[i].permission_class),
-                                dcmd_info_array[i].permission_name==NULL?NULL:(*env)->NewStringUTF(env,dcmd_info_array[i].permission_name),
-                                dcmd_info_array[i].permission_action==NULL?NULL:(*env)->NewStringUTF(env,dcmd_info_array[i].permission_action),
-                                dcmd_info_array[i].enabled,
-                                args);
-      if (obj == NULL) {
-          free(dcmd_info_array);
-          JNU_ThrowOutOfMemoryError(env, 0);
-          return NULL;
-      }
-      (*env)->SetObjectArrayElement(env, result, i, obj);
-  }
-  free(dcmd_info_array);
-  return result;
-}
-
-/* Throws IllegalArgumentException if the diagnostic command
- * passed in argument is not supported by the JVM
- */
-JNIEXPORT jstring JNICALL
-Java_sun_management_DiagnosticCommandImpl_executeDiagnosticCommand
-(JNIEnv *env, jobject dummy, jstring command) {
-  return jmm_interface->ExecuteDiagnosticCommand(env, command);
-}
--- a/src/java.management/share/native/libmanagement/Flag.c	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2003, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <jni.h>
-#include "management.h"
-#include "sun_management_Flag.h"
-
-static jobject default_origin = NULL;
-static jobject vm_creation_origin = NULL;
-static jobject mgmt_origin = NULL;
-static jobject envvar_origin = NULL;
-static jobject config_file_origin = NULL;
-static jobject ergo_origin = NULL;
-static jobject attach_origin = NULL;
-static jobject other_origin = NULL;
-
-JNIEXPORT jint JNICALL
-Java_sun_management_Flag_getInternalFlagCount
-  (JNIEnv *env, jclass cls)
-{
-    jlong count = jmm_interface->GetLongAttribute(env, NULL,
-                                                  JMM_VM_GLOBAL_COUNT);
-    return (jint) count;
-}
-
-JNIEXPORT jobjectArray JNICALL
-  Java_sun_management_Flag_getAllFlagNames
-(JNIEnv *env, jclass cls)
-{
-  return jmm_interface->GetVMGlobalNames(env);
-}
-
-static jobject find_origin_constant(JNIEnv* env, const char* enum_name) {
-    jvalue field;
-    field = JNU_GetStaticFieldByName(env,
-                                     NULL,
-                                     "com/sun/management/VMOption$Origin",
-                                     enum_name,
-                                     "Lcom/sun/management/VMOption$Origin;");
-    return (*env)->NewGlobalRef(env, field.l);
-}
-
-JNIEXPORT void JNICALL
-Java_sun_management_Flag_initialize
-  (JNIEnv *env, jclass cls)
-{
-    default_origin = find_origin_constant(env, "DEFAULT");
-    vm_creation_origin = find_origin_constant(env, "VM_CREATION");
-    mgmt_origin = find_origin_constant(env, "MANAGEMENT");
-    envvar_origin = find_origin_constant(env, "ENVIRON_VAR");
-    config_file_origin = find_origin_constant(env, "CONFIG_FILE");
-    ergo_origin = find_origin_constant(env, "ERGONOMIC");
-    attach_origin = find_origin_constant(env, "ATTACH_ON_DEMAND");
-    other_origin = find_origin_constant(env, "OTHER");
-}
-
-JNIEXPORT jint JNICALL
-Java_sun_management_Flag_getFlags
-  (JNIEnv *env, jclass cls, jobjectArray names, jobjectArray flags, jint count)
-{
-    jint num_flags, i, index;
-    jmmVMGlobal* globals;
-    size_t gsize;
-    const char* class_name = "sun/management/Flag";
-    const char* signature = "(Ljava/lang/String;Ljava/lang/Object;ZZLcom/sun/management/VMOption$Origin;)V";
-    jobject origin;
-    jobject valueObj;
-    jobject flag;
-
-    if (flags == NULL) {
-        JNU_ThrowNullPointerException(env, 0);
-        return 0;
-    }
-
-    if (count <= 0) {
-        JNU_ThrowIllegalArgumentException(env, 0);
-        return 0;
-    }
-
-    gsize = (size_t)count * sizeof(jmmVMGlobal);
-    globals = (jmmVMGlobal*) malloc(gsize);
-    if (globals == NULL) {
-        JNU_ThrowOutOfMemoryError(env, 0);
-        return 0;
-    }
-
-    memset(globals, 0, gsize);
-    num_flags = jmm_interface->GetVMGlobals(env, names, globals, count);
-    if (num_flags == 0) {
-        free(globals);
-        return 0;
-    }
-
-    index = 0;
-    for (i = 0; i < count; i++) {
-        if (globals[i].name == NULL) {
-            continue;
-        }
-        switch (globals[i].type) {
-        case JMM_VMGLOBAL_TYPE_JBOOLEAN:
-            valueObj = JNU_NewObjectByName(env, "java/lang/Boolean", "(Z)V",
-                                           globals[i].value.z);
-            break;
-        case JMM_VMGLOBAL_TYPE_JSTRING:
-            valueObj = globals[i].value.l;
-            break;
-        case JMM_VMGLOBAL_TYPE_JLONG:
-            valueObj = JNU_NewObjectByName(env, "java/lang/Long", "(J)V",
-                                           globals[i].value.j);
-            break;
-        case JMM_VMGLOBAL_TYPE_JDOUBLE:
-            valueObj = JNU_NewObjectByName(env, "java/lang/Double", "(D)V",
-                                           globals[i].value.d);
-            break;
-        default:
-            // ignore unsupported type
-            continue;
-        }
-        switch (globals[i].origin) {
-        case JMM_VMGLOBAL_ORIGIN_DEFAULT:
-            origin = default_origin;
-            break;
-        case JMM_VMGLOBAL_ORIGIN_COMMAND_LINE:
-            origin = vm_creation_origin;
-            break;
-        case JMM_VMGLOBAL_ORIGIN_MANAGEMENT:
-            origin = mgmt_origin;
-            break;
-        case JMM_VMGLOBAL_ORIGIN_ENVIRON_VAR:
-            origin = envvar_origin;
-            break;
-        case JMM_VMGLOBAL_ORIGIN_CONFIG_FILE:
-            origin = config_file_origin;
-            break;
-        case JMM_VMGLOBAL_ORIGIN_ERGONOMIC:
-            origin = ergo_origin;
-            break;
-        case JMM_VMGLOBAL_ORIGIN_ATTACH_ON_DEMAND:
-            origin = attach_origin;
-            break;
-        case JMM_VMGLOBAL_ORIGIN_OTHER:
-            origin = other_origin;
-            break;
-        default:
-            // unknown origin
-            origin = other_origin;
-            break;
-        }
-        flag = JNU_NewObjectByName(env, class_name, signature, globals[i].name,
-                                   valueObj, globals[i].writeable,
-                                   globals[i].external, origin);
-        if (flag == NULL) {
-            free(globals);
-            JNU_ThrowOutOfMemoryError(env, 0);
-            return 0;
-        }
-        (*env)->SetObjectArrayElement(env, flags, index, flag);
-        index++;
-    }
-
-    if (index != num_flags) {
-        JNU_ThrowInternalError(env, "Number of Flag objects created unmatched");
-        free(globals);
-        return 0;
-    }
-
-    free(globals);
-
-    /* return the number of Flag objects created */
-    return num_flags;
-}
-
-JNIEXPORT void JNICALL
-Java_sun_management_Flag_setLongValue
-  (JNIEnv *env, jclass cls, jstring name, jlong value)
-{
-   jvalue v;
-   v.j = value;
-
-   jmm_interface->SetVMGlobal(env, name, v);
-}
-
-JNIEXPORT void JNICALL
-Java_sun_management_Flag_setDoubleValue
-  (JNIEnv *env, jclass cls, jstring name, jdouble value)
-{
-   jvalue v;
-   v.d = value;
-
-   jmm_interface->SetVMGlobal(env, name, v);
-}
-
-JNIEXPORT void JNICALL
-Java_sun_management_Flag_setBooleanValue
-  (JNIEnv *env, jclass cls, jstring name, jboolean value)
-{
-   jvalue v;
-   v.z = value;
-
-   jmm_interface->SetVMGlobal(env, name, v);
-}
-
-JNIEXPORT void JNICALL
-Java_sun_management_Flag_setStringValue
-  (JNIEnv *env, jclass cls, jstring name, jstring value)
-{
-   jvalue v;
-   v.l = value;
-
-   jmm_interface->SetVMGlobal(env, name, v);
-}
--- a/src/java.management/share/native/libmanagement/GarbageCollectorImpl.c	Thu Apr 30 16:47:05 2015 +0300
+++ b/src/java.management/share/native/libmanagement/GarbageCollectorImpl.c	Tue May 05 13:29:31 2015 -0700
@@ -36,17 +36,3 @@
   (JNIEnv *env, jobject mgr) {
     return jmm_interface->GetLongAttribute(env, mgr, JMM_GC_TIME_MS);
 }
-
-
-JNIEXPORT void JNICALL Java_sun_management_GarbageCollectorImpl_setNotificationEnabled
-(JNIEnv *env, jobject dummy, jobject gc,jboolean enabled) {
-
-    if (gc == NULL) {
-        JNU_ThrowNullPointerException(env, "Invalid GarbageCollectorMBean");
-        return;
-    }
-    if((jmm_version > JMM_VERSION_1_2)
-       || (jmm_version == JMM_VERSION_1_2 && ((jmm_version&0xFF)>=1))) {
-      jmm_interface->SetGCNotificationEnabled(env, gc, enabled);
-    }
-}
--- a/src/java.management/share/native/libmanagement/GcInfoBuilder.c	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <jni.h>
-#include "management.h"
-#include "sun_management_GcInfoBuilder.h"
-
-JNIEXPORT jint JNICALL Java_sun_management_GcInfoBuilder_getNumGcExtAttributes
-  (JNIEnv *env, jobject dummy, jobject gc) {
-    jlong value;
-
-    if (gc == NULL) {
-        JNU_ThrowNullPointerException(env, "Invalid GarbageCollectorMBean");
-        return 0;
-    }
-    value = jmm_interface->GetLongAttribute(env, gc,
-                                            JMM_GC_EXT_ATTRIBUTE_INFO_SIZE);
-    return (jint) value;
-}
-
-JNIEXPORT void JNICALL Java_sun_management_GcInfoBuilder_fillGcAttributeInfo
-  (JNIEnv *env, jobject dummy, jobject gc,
-   jint num_attributes, jobjectArray attributeNames,
-   jcharArray types, jobjectArray descriptions) {
-
-    jmmExtAttributeInfo* ext_att_info;
-    jchar* nativeTypes;
-    jstring attName = NULL;
-    jstring desc = NULL;
-    jint ret = 0;
-    jint i;
-
-    if (gc == NULL) {
-        JNU_ThrowNullPointerException(env, "Invalid GarbageCollectorMBean");
-        return;
-    }
-
-    if (num_attributes <= 0) {
-        JNU_ThrowIllegalArgumentException(env, "Invalid num_attributes");
-        return;
-    }
-
-    ext_att_info = (jmmExtAttributeInfo*) malloc((size_t)num_attributes *
-                                                 sizeof(jmmExtAttributeInfo));
-    if (ext_att_info == NULL) {
-        JNU_ThrowOutOfMemoryError(env, 0);
-        return;
-    }
-    ret = jmm_interface->GetGCExtAttributeInfo(env, gc,
-                                               ext_att_info, num_attributes);
-    if (ret != num_attributes) {
-        JNU_ThrowInternalError(env, "Unexpected num_attributes");
-        free(ext_att_info);
-        return;
-    }
-
-    nativeTypes = (jchar*) malloc((size_t)num_attributes * sizeof(jchar));
-    if (nativeTypes == NULL) {
-        free(ext_att_info);
-        JNU_ThrowOutOfMemoryError(env, 0);
-        return;
-    }
-    for (i = 0; i < num_attributes; i++) {
-        nativeTypes[i] = ext_att_info[i].type;
-        attName = (*env)->NewStringUTF(env, ext_att_info[i].name);
-        desc = (*env)->NewStringUTF(env, ext_att_info[i].description);
-        (*env)->SetObjectArrayElement(env, attributeNames, i, attName);
-        (*env)->SetObjectArrayElement(env, descriptions, i, desc);
-    }
-    (*env)->SetCharArrayRegion(env, types, 0, num_attributes, nativeTypes);
-
-    if (ext_att_info != NULL) {
-        free(ext_att_info);
-    }
-    if (nativeTypes != NULL) {
-        free(nativeTypes);
-    }
-}
-
-static void setLongValueAtObjectArray(JNIEnv *env, jobjectArray array,
-                                      jsize index, jlong value) {
-    static const char* class_name = "java/lang/Long";
-    static const char* signature = "(J)V";
-    jobject obj = JNU_NewObjectByName(env, class_name, signature, value);
-
-    (*env)->SetObjectArrayElement(env, array, index, obj);
-}
-
-static void setBooleanValueAtObjectArray(JNIEnv *env, jobjectArray array,
-                                         jsize index, jboolean value) {
-    static const char* class_name = "java/lang/Boolean";
-    static const char* signature = "(Z)V";
-    jobject obj = JNU_NewObjectByName(env, class_name, signature, value);
-
-    (*env)->SetObjectArrayElement(env, array, index, obj);
-}
-
-static void setByteValueAtObjectArray(JNIEnv *env, jobjectArray array,
-                                      jsize index, jbyte value) {
-    static const char* class_name = "java/lang/Byte";
-    static const char* signature = "(B)V";
-    jobject obj = JNU_NewObjectByName(env, class_name, signature, value);
-
-    (*env)->SetObjectArrayElement(env, array, index, obj);
-}
-
-static void setIntValueAtObjectArray(JNIEnv *env, jobjectArray array,
-                                     jsize index, jint value) {
-    static const char* class_name = "java/lang/Integer";
-    static const char* signature = "(I)V";
-    jobject obj = JNU_NewObjectByName(env, class_name, signature, value);
-
-    (*env)->SetObjectArrayElement(env, array, index, obj);
-}
-
-static void setShortValueAtObjectArray(JNIEnv *env, jobjectArray array,
-                                       jsize index, jshort value) {
-    static const char* class_name = "java/lang/Short";
-    static const char* signature = "(S)V";
-    jobject obj = JNU_NewObjectByName(env, class_name, signature, value);
-
-    (*env)->SetObjectArrayElement(env, array, index, obj);
-}
-
-static void setDoubleValueAtObjectArray(JNIEnv *env, jobjectArray array,
-                                        jsize index, jdouble value) {
-    static const char* class_name = "java/lang/Double";
-    static const char* signature = "(D)V";
-    jobject obj = JNU_NewObjectByName(env, class_name, signature, value);
-
-    (*env)->SetObjectArrayElement(env, array, index, obj);
-}
-
-static void setFloatValueAtObjectArray(JNIEnv *env, jobjectArray array,
-                                       jsize index, jfloat value) {
-    static const char* class_name = "java/lang/Float";
-    static const char* signature = "(D)V";
-    jobject obj = JNU_NewObjectByName(env, class_name, signature, value);
-
-    (*env)->SetObjectArrayElement(env, array, index, obj);
-}
-
-static void setCharValueAtObjectArray(JNIEnv *env, jobjectArray array,
-                                      jsize index, jchar value) {
-    static const char* class_name = "java/lang/Character";
-    static const char* signature = "(C)V";
-    jobject obj = JNU_NewObjectByName(env, class_name, signature, value);
-
-    (*env)->SetObjectArrayElement(env, array, index, obj);
-}
-
-JNIEXPORT jobject JNICALL Java_sun_management_GcInfoBuilder_getLastGcInfo0
-  (JNIEnv *env, jobject builder, jobject gc,
-   jint ext_att_count, jobjectArray ext_att_values, jcharArray ext_att_types,
-   jobjectArray usageBeforeGC, jobjectArray usageAfterGC) {
-
-    jmmGCStat   gc_stat;
-    jchar*      nativeTypes;
-    jsize       i;
-    jvalue      v;
-
-    if (gc == NULL) {
-        JNU_ThrowNullPointerException(env, "Invalid GarbageCollectorMBean");
-        return 0;
-    }
-
-    if (ext_att_count <= 0) {
-        JNU_ThrowIllegalArgumentException(env, "Invalid ext_att_count");
-        return 0;
-    }
-
-    gc_stat.usage_before_gc = usageBeforeGC;
-    gc_stat.usage_after_gc = usageAfterGC;
-    gc_stat.gc_ext_attribute_values_size = ext_att_count;
-    if (ext_att_count > 0) {
-        gc_stat.gc_ext_attribute_values = (jvalue*) malloc((size_t)ext_att_count *
-                                                           sizeof(jvalue));
-        if (gc_stat.gc_ext_attribute_values == NULL) {
-            JNU_ThrowOutOfMemoryError(env, 0);
-            return 0;
-        }
-    } else {
-        gc_stat.gc_ext_attribute_values = NULL;
-    }
-
-
-    jmm_interface->GetLastGCStat(env, gc, &gc_stat);
-    if (gc_stat.gc_index == 0) {
-        if (gc_stat.gc_ext_attribute_values != NULL) {
-            free(gc_stat.gc_ext_attribute_values);
-        }
-        return 0;
-    }
-
-    // convert the ext_att_types to native types
-    nativeTypes = (jchar*) malloc((size_t)ext_att_count * sizeof(jchar));
-    if (nativeTypes == NULL) {
-        if (gc_stat.gc_ext_attribute_values != NULL) {
-            free(gc_stat.gc_ext_attribute_values);
-        }
-        JNU_ThrowOutOfMemoryError(env, 0);
-        return 0;
-    }
-    (*env)->GetCharArrayRegion(env, ext_att_types, 0, ext_att_count, nativeTypes);
-    for (i = 0; i < ext_att_count; i++) {
-       v = gc_stat.gc_ext_attribute_values[i];
-       switch (nativeTypes[i]) {
-            case 'Z':
-                setBooleanValueAtObjectArray(env, ext_att_values, i, v.z);
-                break;
-            case 'B':
-                setByteValueAtObjectArray(env, ext_att_values, i, v.b);
-                break;
-            case 'C':
-                setCharValueAtObjectArray(env, ext_att_values, i, v.c);
-                break;
-            case 'S':
-                setShortValueAtObjectArray(env, ext_att_values, i, v.s);
-                break;
-            case 'I':
-                setIntValueAtObjectArray(env, ext_att_values, i, v.i);
-                break;
-            case 'J':
-                setLongValueAtObjectArray(env, ext_att_values, i, v.j);
-                break;
-            case 'F':
-                setFloatValueAtObjectArray(env, ext_att_values, i, v.f);
-                break;
-            case 'D':
-                setDoubleValueAtObjectArray(env, ext_att_values, i, v.d);
-                break;
-            default:
-                if (gc_stat.gc_ext_attribute_values != NULL) {
-                    free(gc_stat.gc_ext_attribute_values);
-                }
-                if (nativeTypes != NULL) {
-                    free(nativeTypes);
-                }
-                JNU_ThrowInternalError(env, "Unsupported attribute type");
-                return 0;
-       }
-    }
-    if (gc_stat.gc_ext_attribute_values != NULL) {
-        free(gc_stat.gc_ext_attribute_values);
-    }
-    if (nativeTypes != NULL) {
-        free(nativeTypes);
-    }
-
-    return JNU_NewObjectByName(env,
-       "com/sun/management/GcInfo",
-       "(Lsun/management/GcInfoBuilder;JJJ[Ljava/lang/management/MemoryUsage;[Ljava/lang/management/MemoryUsage;[Ljava/lang/Object;)V",
-       builder,
-       gc_stat.gc_index,
-       gc_stat.start_time,
-       gc_stat.end_time,
-       usageBeforeGC,
-       usageAfterGC,
-       ext_att_values);
-}
--- a/src/java.management/share/native/libmanagement/HotSpotDiagnostic.c	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include <jni.h>
-#include "jvm.h"
-#include "management.h"
-#include "sun_management_HotSpotDiagnostic.h"
-
-JNIEXPORT void JNICALL
-Java_sun_management_HotSpotDiagnostic_dumpHeap0
-  (JNIEnv *env, jobject dummy, jstring outputfile, jboolean live)
-{
-    jmm_interface->DumpHeap0(env, outputfile, live);
-}
--- a/src/java.management/unix/classes/sun/management/OperatingSystemImpl.java	Thu Apr 30 16:47:05 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management;
-
-/**
- * Implementation class for the operating system.
- * Standard and committed hotspot-specific metrics if any.
- *
- * ManagementFactory.getOperatingSystemMXBean() returns an instance
- * of this class.
- */
<