changeset 9855:6697b0cfff92

Merge
author asaha
date Tue, 03 Jun 2014 08:32:34 -0700
parents d549550a942f ee535e148353
children cf26256d8cf1
files src/share/classes/sun/awt/image/BytePackedRaster.java test/java/lang/management/MemoryMXBean/LowMemoryTestConcMarkSweepGC.sh test/java/lang/management/MemoryMXBean/LowMemoryTestParallelGC.sh test/java/lang/management/MemoryMXBean/LowMemoryTestSerialGC.sh
diffstat 132 files changed, 4951 insertions(+), 753 deletions(-) [+]
line wrap: on
line diff
--- a/make/CopyFiles.gmk	Thu May 29 13:47:44 2014 -0700
+++ b/make/CopyFiles.gmk	Tue Jun 03 08:32:34 2014 -0700
@@ -183,9 +183,9 @@
 
 ##########################################################################################
 
-ifeq ($(OPENJDK_TARGET_OS), windows)
+ifneq ($(findstring $(OPENJDK_TARGET_OS), windows aix),)
 
-  TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
+  TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/lib
 
   $(LIBDIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings
 	$(call install-file)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/aix/lib/tzmappings	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,586 @@
+#
+#
+# Copyright (c) 1994, 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.
+#
+
+#
+# Portions Copyright (c) 2014 IBM Corporation
+#
+
+# This table describes mappings between AIX time zone IDs and Java time zone
+# IDs. Fields are separated by a single TAB ('\t'). Lines must be in the ascending
+# order in ASCII. (non-ASCII characters can't be used.)
+#                            NOTE
+# This table format is not a public interface of any Java
+# platforms. No applications should depend on this file in any form.
+# This file has been generated using programs. Do not edit this file manually.
+#
+# Solaris		Java
+
+ACST-9:30ACDT	Australia/Adelaide
+AST4	America/Curacao
+AST4ADT	America/Halifax
+AST9	Pacific/Gambier
+AST9ADT	America/Anchorage
+AZOREST1	Atlantic/Cape_Verde
+AZOREST1AZOREDT	Atlantic/Azores
+Africa/Abidjan	Africa/Abidjan
+Africa/Accra	Africa/Accra
+Africa/Addis_Ababa	Africa/Addis_Ababa
+Africa/Algiers	Africa/Algiers
+Africa/Asmera	Africa/Asmera
+Africa/Bamako	GMT
+Africa/Bangui	Africa/Bangui
+Africa/Banjul	Africa/Banjul
+Africa/Bissau	Africa/Bissau
+Africa/Blantyre	Africa/Blantyre
+Africa/Brazzaville	Africa/Luanda
+Africa/Bujumbura	Africa/Bujumbura
+Africa/Cairo	Africa/Cairo
+Africa/Casablanca	Africa/Casablanca
+Africa/Ceuta	Europe/Paris
+Africa/Conakry	Africa/Conakry
+Africa/Dakar	Africa/Dakar
+Africa/Dar_es_Salaam	Africa/Dar_es_Salaam
+Africa/Djibouti	Africa/Djibouti
+Africa/Douala	Africa/Douala
+Africa/El_Aaiun	Africa/Casablanca
+Africa/Freetown	Africa/Freetown
+Africa/Gaborone	Africa/Gaborone
+Africa/Harare	Africa/Harare
+Africa/Johannesburg	Africa/Johannesburg
+Africa/Kampala	Africa/Kampala
+Africa/Khartoum	Africa/Khartoum
+Africa/Kigali	Africa/Kigali
+Africa/Kinshasa	Africa/Kinshasa
+Africa/Lagos	Africa/Lagos
+Africa/Libreville	Africa/Libreville
+Africa/Lome	Africa/Lome
+Africa/Luanda	Africa/Luanda
+Africa/Lubumbashi	Africa/Lubumbashi
+Africa/Lusaka	Africa/Lusaka
+Africa/Malabo	Africa/Malabo
+Africa/Maputo	Africa/Maputo
+Africa/Maseru	Africa/Maseru
+Africa/Mbabane	Africa/Mbabane
+Africa/Mogadishu	Africa/Mogadishu
+Africa/Monrovia	Africa/Monrovia
+Africa/Nairobi	Africa/Nairobi
+Africa/Ndjamena	Africa/Ndjamena
+Africa/Niamey	Africa/Niamey
+Africa/Nouakchott	Africa/Nouakchott
+Africa/Ouagadougou	Africa/Ouagadougou
+Africa/Porto-Novo	Africa/Porto-Novo
+Africa/Sao_Tome	Africa/Sao_Tome
+Africa/Timbuktu	Africa/Timbuktu
+Africa/Tripoli	Africa/Tripoli
+Africa/Tunis	Africa/Tunis
+Africa/Windhoek	Africa/Windhoek
+America/Adak	America/Adak
+America/Anchorage	America/Anchorage
+America/Anguilla	America/Anguilla
+America/Antigua	America/Antigua
+America/Araguaina	America/Sao_Paulo
+America/Argentina/Buenos_Aires	America/Argentina/Buenos_Aires
+America/Argentina/Catamarca	America/Argentina/Catamarca
+America/Argentina/ComodRivadavia	America/Argentina/Catamarca
+America/Argentina/Cordoba	America/Argentina/Cordoba
+America/Argentina/Jujuy	America/Argentina/Jujuy
+America/Argentina/La_Rioja	America/Argentina/La_Rioja
+America/Argentina/Mendoza	America/Argentina/Mendoza
+America/Argentina/Rio_Gallegos	America/Argentina/Rio_Gallegos
+America/Argentina/Salta	America/Argentina/Salta
+America/Argentina/San_Juan	America/Argentina/San_Juan
+America/Argentina/San_Luis	America/Argentina/San_Luis
+America/Argentina/Tucuman	America/Argentina/Tucuman
+America/Argentina/Ushuaia	America/Argentina/Ushuaia
+America/Aruba	America/Aruba
+America/Asuncion	America/Asuncion
+America/Atka	America/Adak
+America/Barbados	America/Barbados
+America/Belize	America/Belize
+America/Bogota	America/Bogota
+America/Boise	America/Denver
+America/Buenos_Aires	America/Argentina/Buenos_Aires
+America/Cancun	America/Chicago
+America/Caracas	America/Caracas
+America/Catamarca	America/Argentina/Catamarca
+America/Cayenne	America/Cayenne
+America/Cayman	America/Cayman
+America/Chicago	America/Chicago
+America/Chihuahua	America/Denver
+America/Coral_Harbour	America/Atikokan
+America/Cordoba	America/Argentina/Cordoba
+America/Costa_Rica	America/Costa_Rica
+America/Cuiaba	America/Cuiaba
+America/Curacao	America/Curacao
+America/Dawson	America/Los_Angeles
+America/Dawson_Creek	America/Dawson_Creek
+America/Denver	America/Denver
+America/Detroit	America/New_York
+America/Dominica	America/Dominica
+America/Edmonton	America/Edmonton
+America/El_Salvador	America/El_Salvador
+America/Ensenada	America/Los_Angeles
+America/Fort_Wayne	America/Indiana/Indianapolis
+America/Fortaleza	America/Fortaleza
+America/Glace_Bay	America/Halifax
+America/Godthab	America/Godthab
+America/Goose_Bay	America/Thule
+America/Grand_Turk	America/Grand_Turk
+America/Grenada	America/Grenada
+America/Guadeloupe	America/Guadeloupe
+America/Guatemala	America/Guatemala
+America/Guayaquil	America/Guayaquil
+America/Guyana	America/Guyana
+America/Halifax	America/Halifax
+America/Havana	America/Havana
+America/Indiana/Indianapolis	America/Indianapolis
+America/Indianapolis	America/Indiana/Indianapolis
+America/Inuvik	America/Denver
+America/Iqaluit	America/New_York
+America/Jamaica	America/Jamaica
+America/Jujuy	America/Argentina/Jujuy
+America/Juneau	America/Anchorage
+America/Knox_IN	America/Indiana/Knox
+America/La_Paz	America/La_Paz
+America/Lima	America/Lima
+America/Los_Angeles	America/Los_Angeles
+America/Louisville	America/Kentucky/Louisville
+America/Managua	America/Managua
+America/Manaus	America/Manaus
+America/Marigot	America/Guadeloupe
+America/Martinique	America/Martinique
+America/Mazatlan	America/Mazatlan
+America/Mendoza	America/Argentina/Mendoza
+America/Menominee	America/Winnipeg
+America/Mexico_City	America/Mexico_City
+America/Miquelon	America/Miquelon
+America/Moncton	America/Moncton
+America/Montevideo	America/Montevideo
+America/Montreal	America/Montreal
+America/Montserrat	America/Montserrat
+America/Nassau	America/Nassau
+America/New_York	America/New_York
+America/Nipigon	America/New_York
+America/Nome	America/Anchorage
+America/Noronha	America/Noronha
+America/Panama	America/Panama
+America/Pangnirtung	America/Thule
+America/Paramaribo	America/Paramaribo
+America/Phoenix	America/Phoenix
+America/Port-au-Prince	America/Port-au-Prince
+America/Port_of_Spain	America/Port_of_Spain
+America/Porto_Acre	America/Rio_Branco
+America/Puerto_Rico	America/Puerto_Rico
+America/Rainy_River	America/Chicago
+America/Rankin_Inlet	America/Chicago
+America/Regina	America/Regina
+America/Rio_Branco	America/Rio_Branco
+America/Rosario	America/Argentina/Cordoba
+America/Santiago	America/Santiago
+America/Santo_Domingo	America/Santo_Domingo
+America/Sao_Paulo	America/Sao_Paulo
+America/Scoresbysund	America/Scoresbysund
+America/Shiprock	America/Denver
+America/St_Barthelemy	America/Guadeloupe
+America/St_Johns	America/St_Johns
+America/St_Kitts	America/St_Kitts
+America/St_Lucia	America/St_Lucia
+America/St_Thomas	America/St_Thomas
+America/St_Vincent	America/St_Vincent
+America/Tegucigalpa	America/Tegucigalpa
+America/Thule	America/Thule
+America/Thunder_Bay	America/New_York
+America/Tijuana	America/Tijuana
+America/Toronto	America/Toronto
+America/Tortola	America/Tortola
+America/Vancouver	America/Vancouver
+America/Virgin	America/St_Thomas
+America/Whitehorse	America/Los_Angeles
+America/Winnipeg	America/Winnipeg
+America/Yakutat	America/Anchorage
+America/Yellowknife	America/Denver
+Antarctica/Casey	Antarctica/Casey
+Antarctica/DumontDUrville	Antarctica/DumontDUrville
+Antarctica/Mawson	Antarctica/Mawson
+Antarctica/McMurdo	Antarctica/McMurdo
+Antarctica/Palmer	Antarctica/Palmer
+Antarctica/South_Pole	Antarctica/McMurdo
+Arctic/Longyearbyen	Europe/Oslo
+Asia/Aden	Asia/Aden
+Asia/Almaty	Asia/Almaty
+Asia/Amman	Asia/Amman
+Asia/Anadyr	Asia/Anadyr
+Asia/Aqtau	Asia/Aqtau
+Asia/Aqtobe	Asia/Aqtobe
+Asia/Ashkhabad	Asia/Ashkhabad
+Asia/Baghdad	Asia/Baghdad
+Asia/Bahrain	Asia/Bahrain
+Asia/Baku	Asia/Baku
+Asia/Bangkok	Asia/Bangkok
+Asia/Beirut	Asia/Beirut
+Asia/Bishkek	Asia/Bishkek
+Asia/Brunei	Asia/Brunei
+Asia/Calcutta	Asia/Calcutta
+Asia/Chungking	Asia/Shanghai
+Asia/Colombo	Asia/Colombo
+Asia/Dacca	Asia/Dacca
+Asia/Damascus	Asia/Damascus
+Asia/Dhaka	Asia/Dhaka
+Asia/Dubai	Asia/Dubai
+Asia/Dushanbe	Asia/Dushanbe
+Asia/Gaza	Asia/Amman
+Asia/Harbin	Asia/Shanghai
+Asia/Hong_Kong	Asia/Hong_Kong
+Asia/Irkutsk	Asia/Irkutsk
+Asia/Istanbul	Europe/Istanbul
+Asia/Jakarta	Asia/Jakarta
+Asia/Jayapura	Asia/Jayapura
+Asia/Jerusalem	Asia/Jerusalem
+Asia/Kabul	Asia/Kabul
+Asia/Kamchatka	Asia/Kamchatka
+Asia/Karachi	Asia/Karachi
+Asia/Kashgar	Asia/Shanghai
+Asia/Katmandu	Asia/Katmandu
+Asia/Kolkata	Asia/Kolkata
+Asia/Krasnoyarsk	Asia/Krasnoyarsk
+Asia/Kuala_Lumpur	Asia/Kuala_Lumpur
+Asia/Kuwait	Asia/Kuwait
+Asia/Macao	Asia/Macao
+Asia/Magadan	Asia/Magadan
+Asia/Manila	Asia/Manila
+Asia/Muscat	Asia/Muscat
+Asia/Nicosia	Asia/Nicosia
+Asia/Novosibirsk	Asia/Novosibirsk
+Asia/Omsk	Asia/Novosibirsk
+Asia/Phnom_Penh	Asia/Phnom_Penh
+Asia/Pyongyang	Asia/Pyongyang
+Asia/Qatar	Asia/Qatar
+Asia/Rangoon	Asia/Rangoon
+Asia/Riyadh	Asia/Riyadh
+Asia/Saigon	Asia/Ho_Chi_Minh
+Asia/Seoul	Asia/Seoul
+Asia/Shanghai	Asia/Shanghai
+Asia/Singapore	Asia/Singapore
+Asia/Taipei	Asia/Taipei
+Asia/Tashkent	Asia/Tashkent
+Asia/Tbilisi	Asia/Tbilisi
+Asia/Tehran	Asia/Tehran
+Asia/Tel_Aviv	Asia/Jerusalem
+Asia/Thimbu	Asia/Thimbu
+Asia/Tokyo	Asia/Tokyo
+Asia/Ujung_Pandang	Asia/Ujung_Pandang
+Asia/Ulan_Bator	Asia/Ulaanbaatar
+Asia/Urumqi	Asia/Shanghai
+Asia/Vientiane	Asia/Vientiane
+Asia/Vladivostok	Asia/Vladivostok
+Asia/Yakutsk	Asia/Yakutsk
+Asia/Yekaterinburg	Asia/Yekaterinburg
+Asia/Yerevan	Asia/Yerevan
+Atlantic/Azores	Atlantic/Azores
+Atlantic/Bermuda	Atlantic/Bermuda
+Atlantic/Canary	Atlantic/Canary
+Atlantic/Cape_Verde	Atlantic/Cape_Verde
+Atlantic/Faeroe	Atlantic/Faeroe
+Atlantic/Jan_Mayen	Atlantic/Jan_Mayen
+Atlantic/Madeira	Europe/London
+Atlantic/Reykjavik	Atlantic/Reykjavik
+Atlantic/South_Georgia	Atlantic/South_Georgia
+Atlantic/St_Helena	Atlantic/St_Helena
+Atlantic/Stanley	Atlantic/Stanley
+Australia/ACT	Australia/Sydney
+Australia/Adelaide	Australia/Adelaide
+Australia/Brisbane	Australia/Brisbane
+Australia/Broken_Hill	Australia/Broken_Hill
+Australia/Canberra	Australia/Sydney
+Australia/Darwin	Australia/Darwin
+Australia/Hobart	Australia/Hobart
+Australia/LHI	Australia/Lord_Howe
+Australia/Lord_Howe	Australia/Lord_Howe
+Australia/Melbourne	Australia/Sydney
+Australia/NSW	Australia/Sydney
+Australia/North	Australia/Darwin
+Australia/Perth	Australia/Perth
+Australia/Queensland	Australia/Brisbane
+Australia/South	Australia/Adelaide
+Australia/Sydney	Australia/Sydney
+Australia/Tasmania	Australia/Hobart
+Australia/Victoria	Australia/Melbourne
+Australia/West	Australia/Perth
+Australia/Yancowinna	Australia/Broken_Hill
+BRT3BRST	America/Sao_Paulo
+BST11	Pacific/Apia
+BST11BDT	Pacific/Apia
+Brazil/Acre	America/Rio_Branco
+Brazil/DeNoronha	America/Noronha
+Brazil/East	America/Sao_Paulo
+Brazil/West	America/Manaus
+CET	Europe/Paris
+CET-1CEST	Europe/Paris
+CET-1CEST-2	Europe/Berlin
+CET-1CET-2	Europe/Paris
+CST6	America/Costa_Rica
+CST6CDT	America/Chicago
+CUT0	UTC
+CUT0GDT	Europe/London
+Canada/Atlantic	America/Halifax
+Canada/Central	America/Winnipeg
+Canada/East-Saskatchewan	America/Regina
+Canada/Eastern	America/Montreal
+Canada/Mountain	America/Edmonton
+Canada/Newfoundland	America/St_Johns
+Canada/Pacific	America/Vancouver
+Canada/Saskatchewan	America/Regina
+Canada/Yukon	America/Whitehorse
+Chile/Continental	America/Santiago
+Chile/EasterIsland	Pacific/Easter
+Cuba	America/Havana
+EET	Europe/Istanbul
+EET-10	Australia/Brisbane
+EET-10EETDT	Australia/Sydney
+EST	America/Indianapolis
+EST5	America/Indianapolis
+EST5EDT	America/New_York
+Egypt	Africa/Cairo
+Eire	Europe/Dublin
+Etc/GMT	GMT
+Etc/GMT0	GMT
+Etc/Greenwich	GMT
+Etc/UCT	UTC
+Etc/UTC	UTC
+Etc/Universal	UTC
+Etc/Zulu	UTC
+Europe/Amsterdam	Europe/Amsterdam
+Europe/Andorra	Europe/Andorra
+Europe/Athens	Europe/Athens
+Europe/Belfast	Europe/London
+Europe/Belgrade	Europe/Belgrade
+Europe/Berlin	Europe/Berlin
+Europe/Bratislava	Europe/Prague
+Europe/Brussels	Europe/Brussels
+Europe/Bucharest	Europe/Bucharest
+Europe/Budapest	Europe/Budapest
+Europe/Chisinau	Europe/Chisinau
+Europe/Copenhagen	Europe/Copenhagen
+Europe/Dublin	Europe/Dublin
+Europe/Gibraltar	Europe/Gibraltar
+Europe/Guernsey	Europe/London
+Europe/Helsinki	Europe/Helsinki
+Europe/Isle_of_Man	Europe/London
+Europe/Istanbul	Europe/Istanbul
+Europe/Jersey	Europe/London
+Europe/Kaliningrad	Europe/Kaliningrad
+Europe/Kiev	Europe/Kiev
+Europe/Lisbon	Europe/Lisbon
+Europe/Ljubljana	Europe/Belgrade
+Europe/London	Europe/London
+Europe/Luxembourg	Europe/Luxembourg
+Europe/Madrid	Europe/Madrid
+Europe/Malta	Europe/Malta
+Europe/Mariehamn	Europe/Helsinki
+Europe/Minsk	Europe/Minsk
+Europe/Monaco	Europe/Monaco
+Europe/Moscow	Europe/Moscow
+Europe/Nicosia	Asia/Nicosia
+Europe/Oslo	Europe/Oslo
+Europe/Paris	Europe/Paris
+Europe/Podgorica	Europe/Belgrade
+Europe/Prague	Europe/Prague
+Europe/Riga	Europe/Riga
+Europe/Rome	Europe/Rome
+Europe/Samara	Europe/Samara
+Europe/San_Marino	Europe/Rome
+Europe/Sarajevo	Europe/Belgrade
+Europe/Simferopol	Europe/Simferopol
+Europe/Skopje	Europe/Belgrade
+Europe/Sofia	Europe/Sofia
+Europe/Stockholm	Europe/Stockholm
+Europe/Tallinn	Europe/Tallinn
+Europe/Tirane	Europe/Tirane
+Europe/Vaduz	Europe/Vaduz
+Europe/Vatican	Europe/Rome
+Europe/Vienna	Europe/Vienna
+Europe/Vilnius	Europe/Vilnius
+Europe/Warsaw	Europe/Warsaw
+Europe/Zagreb	Europe/Belgrade
+Europe/Zurich	Europe/Zurich
+FALKST2	Atlantic/South_Georgia
+FALKST2FALKDT	Atlantic/South_Georgia
+Factory	GMT
+GB	Europe/London
+GB-Eire	Europe/London
+GMT	GMT
+GMT0	GMT
+GMT0BST	Europe/London
+GMT0BST-1	Europe/London
+GMT0WET	Europe/Lisbon
+GRNLNDST3	America/Buenos_Aires
+GRNLNDST3GRNLNDDT	America/Godthab
+Greenwich	GMT
+HST	Pacific/Honolulu
+HST10	Pacific/Honolulu
+HST10HDT	America/Adak
+Hongkong	Asia/Hong_Kong
+Iceland	Atlantic/Reykjavik
+Indian/Antananarivo	Indian/Antananarivo
+Indian/Chagos	Indian/Chagos
+Indian/Christmas	Indian/Christmas
+Indian/Cocos	Indian/Cocos
+Indian/Comoro	Indian/Comoro
+Indian/Kerguelen	Indian/Kerguelen
+Indian/Mahe	Indian/Mahe
+Indian/Maldives	Indian/Maldives
+Indian/Mauritius	Indian/Mauritius
+Indian/Mayotte	Indian/Mayotte
+Indian/Reunion	Indian/Reunion
+Iran	Asia/Tehran
+Israel	Asia/Jerusalem
+JST-9	Asia/Tokyo
+JST-9JSTDT	Asia/Tokyo
+Jamaica	America/Jamaica
+Japan	Asia/Tokyo
+KORST-9	Asia/Seoul
+KORST-9KORDT	Asia/Seoul
+Kwajalein	Pacific/Kwajalein
+Libya	Africa/Tripoli
+MEST-2	Europe/Istanbul
+MEST-2MEDT	Europe/Istanbul
+MEST-3	Asia/Riyadh
+MEST-3MEDT	Europe/Moscow
+MET	Europe/Paris
+MET-11	Pacific/Guadalcanal
+MET-11METDT	Asia/Magadan
+MET-1MEST	Europe/Paris
+MET-1MST-2	Europe/Berlin
+MEZ-1MESZ	Europe/Berlin
+MEZ-1MESZ-2	Europe/Berlin
+MSK-3MSD	Europe/Moscow
+MST	America/Phoenix
+MST7	America/Phoenix
+MST7MDT	America/Denver
+Mexico/BajaNorte	America/Tijuana
+Mexico/BajaSur	America/Mazatlan
+Mexico/General	America/Mexico_City
+Mideast/Riyadh87	Asia/Riyadh87
+Mideast/Riyadh88	Asia/Riyadh88
+Mideast/Riyadh89	Asia/Riyadh89
+NFT-1	Africa/Algiers
+NFT-1DFT	Europe/Paris
+NFT-1DST	Europe/Paris
+NZ	Pacific/Auckland
+NZ-CHAT	Pacific/Chatham
+NZST-12	Pacific/Fiji
+NZST-12NZDT	Pacific/Auckland
+Navajo	America/Denver
+PAKST-5	Asia/Karachi
+PAKST-5PAKDT	Asia/Yekaterinburg
+PRC	Asia/Shanghai
+PST8	Pacific/Pitcairn
+PST8PDT	America/Los_Angeles
+PST8PDT7	America/Tijuana
+Pacific/Apia	Pacific/Apia
+Pacific/Auckland	Pacific/Auckland
+Pacific/Chatham	Pacific/Chatham
+Pacific/Easter	Pacific/Easter
+Pacific/Efate	Pacific/Efate
+Pacific/Enderbury	Pacific/Enderbury
+Pacific/Fakaofo	Pacific/Fakaofo
+Pacific/Fiji	Pacific/Fiji
+Pacific/Funafuti	Pacific/Funafuti
+Pacific/Galapagos	Pacific/Galapagos
+Pacific/Gambier	Pacific/Gambier
+Pacific/Guadalcanal	Pacific/Guadalcanal
+Pacific/Guam	Pacific/Guam
+Pacific/Honolulu	Pacific/Honolulu
+Pacific/Kiritimati	Pacific/Kiritimati
+Pacific/Kosrae	Pacific/Kosrae
+Pacific/Majuro	Pacific/Majuro
+Pacific/Marquesas	Pacific/Marquesas
+Pacific/Nauru	Pacific/Nauru
+Pacific/Niue	Pacific/Niue
+Pacific/Norfolk	Pacific/Norfolk
+Pacific/Noumea	Pacific/Noumea
+Pacific/Pago_Pago	Pacific/Pago_Pago
+Pacific/Palau	Pacific/Palau
+Pacific/Pitcairn	Pacific/Pitcairn
+Pacific/Ponape	Pacific/Ponape
+Pacific/Port_Moresby	Pacific/Port_Moresby
+Pacific/Rarotonga	Pacific/Rarotonga
+Pacific/Saipan	Pacific/Saipan
+Pacific/Samoa	Pacific/Pago_Pago
+Pacific/Tahiti	Pacific/Tahiti
+Pacific/Tarawa	Pacific/Tarawa
+Pacific/Tongatapu	Pacific/Tongatapu
+Pacific/Truk	Pacific/Truk
+Pacific/Wake	Pacific/Wake
+Pacific/Wallis	Pacific/Wallis
+Poland	Europe/Warsaw
+Portugal	Europe/Lisbon
+ROC	Asia/Taipei
+ROK	Asia/Seoul
+SAUST-3	Asia/Riyadh
+SAUST-3SAUDT	Europe/Moscow
+Singapore	Asia/Singapore
+SystemV/AST4ADT	America/Thule
+SystemV/CST6CDT	America/Chicago
+SystemV/EST5EDT	America/New_York
+SystemV/MST7MDT	America/Denver
+SystemV/PST8PDT	America/Los_Angeles
+SystemV/YST9YDT	America/Anchorage
+TAIST-8	Asia/Taipei
+TAIST-8TAIDT	Asia/Irkutsk
+TASHST-6	Asia/Dacca
+TASHST-6TASHDT	Asia/Novosibirsk
+THAIST-7	Asia/Bangkok
+THAIST-7THAIDT	Asia/Krasnoyarsk
+Turkey	Europe/Istanbul
+UCT	UTC
+US/Alaska	America/Anchorage
+US/Aleutian	America/Adak
+US/Arizona	America/Phoenix
+US/Central	America/Chicago
+US/East-Indiana	America/Indiana/Indianapolis
+US/Eastern	America/New_York
+US/Hawaii	Pacific/Honolulu
+US/Indiana-Starke	America/Indiana/Knox
+US/Michigan	America/New_York
+US/Mountain	America/Denver
+US/Pacific	America/Los_Angeles
+US/Pacific-New	America/Los_Angeles
+US/Samoa	Pacific/Pago_Pago
+USAST-2	Africa/Johannesburg
+USAST-2USADT	Europe/Istanbul
+UTC	UTC
+UYT3UYST	America/Montevideo
+Universal	UTC
+W-SU	Europe/Moscow
+WAUST-8	Australia/Perth
+WAUST-8WAUDT	Australia/Perth
+WET	WET
+WET-2	Africa/Johannesburg
+WET-2WET	Europe/Helsinki
+WST-4	Asia/Dubai
+WST-4WDT	Europe/Samara
+Zulu	UTC
--- a/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -510,15 +510,17 @@
         }
     };
 
-    private static Action hideAction = new AbstractAction() {
+    private final Action hideAction = new AbstractAction() {
         @Override
         public void actionPerformed(final ActionEvent e) {
             final JComboBox comboBox = (JComboBox)e.getSource();
+            comboBox.firePopupMenuCanceled();
+            comboBox.setPopupVisible(false);
+        }
 
-            if (comboBox.isPopupVisible()) {
-                comboBox.firePopupMenuCanceled();
-                comboBox.setPopupVisible(false);
-            }
+        @Override
+        public boolean isEnabled() {
+            return comboBox.isPopupVisible() && super.isEnabled();
         }
     };
 
--- a/src/macosx/lib/Info-privileged.plist	Thu May 29 13:47:44 2014 -0700
+++ b/src/macosx/lib/Info-privileged.plist	Tue Jun 03 08:32:34 2014 -0700
@@ -7,7 +7,7 @@
         <key>CFBundleInfoDictionaryVersion</key>
         <string>6.0</string>
         <key>CFBundleName</key>
-        <string>OpenJDK 7 Command</string>
+        <string>OpenJDK 8 Command</string>
         <key>CFBundleShortVersionString</key>
         <string>1.0</string>
         <key>CFBundleVersion</key>
--- a/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Thu May 29 13:47:44 2014 -0700
+++ b/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Tue Jun 03 08:32:34 2014 -0700
@@ -142,10 +142,9 @@
     splash->screenFormat.byteOrder = 1 ?  BYTE_ORDER_LSBFIRST : BYTE_ORDER_MSBFIRST;
     splash->screenFormat.depthBytes = 4;
 
-    dispatch_async(dispatch_get_main_queue(), ^(void) {
-            NSApplication * app = [NSApplicationAWT sharedApplication];
-            [NSApplicationAWT runAWTLoopWithApp: app];
-    });
+    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
+        [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
+    }];
 }
 
 void
--- a/src/share/bin/java.c	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/bin/java.c	Tue Jun 03 08:32:34 2014 -0700
@@ -732,6 +732,9 @@
     if (s == NULL)
         return;
     s = JLI_WildcardExpandClasspath(s);
+    if (sizeof(format) - 2 + JLI_StrLen(s) < JLI_StrLen(s))
+        // s is corrupted after wildcard expansion
+        return;
     def = JLI_MemAlloc(sizeof(format)
                        - 2 /* strlen("%s") */
                        + JLI_StrLen(s));
@@ -1351,9 +1354,11 @@
         if (s) {
             s = (char *) JLI_WildcardExpandClasspath(s);
             /* 40 for -Denv.class.path= */
-            envcp = (char *)JLI_MemAlloc(JLI_StrLen(s) + 40);
-            sprintf(envcp, "-Denv.class.path=%s", s);
-            AddOption(envcp, NULL);
+            if (JLI_StrLen(s) + 40 > JLI_StrLen(s)) { // Safeguard from overflow
+                envcp = (char *)JLI_MemAlloc(JLI_StrLen(s) + 40);
+                sprintf(envcp, "-Denv.class.path=%s", s);
+                AddOption(envcp, NULL);
+            }
         }
     }
 
--- a/src/share/classes/java/awt/MediaTracker.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/java/awt/MediaTracker.java	Tue Jun 03 08:32:34 2014 -0700
@@ -226,7 +226,9 @@
         addImageImpl(image, id, w, h);
         Image rvImage = getResolutionVariant(image);
         if (rvImage != null) {
-            addImageImpl(rvImage, id, 2 * w, 2 * h);
+            addImageImpl(rvImage, id,
+                    w == -1 ? -1 : 2 * w,
+                    h == -1 ? -1 : 2 * h);
         }
     }
 
@@ -810,8 +812,9 @@
         removeImageImpl(image, id, width, height);
         Image rvImage = getResolutionVariant(image);
         if (rvImage != null) {
-            removeImageImpl(rvImage, id, 2 * width, 2 * height);
-
+            removeImageImpl(rvImage, id,
+                    width == -1 ? -1 : 2 * width,
+                    height == -1 ? -1 : 2 * height);
         }
         notifyAll();    // Notify in case remaining images are "done".
     }
--- a/src/share/classes/java/awt/datatransfer/DataFlavor.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/java/awt/datatransfer/DataFlavor.java	Tue Jun 03 08:32:34 2014 -0700
@@ -25,13 +25,28 @@
 
 package java.awt.datatransfer;
 
-import java.io.*;
-import java.nio.*;
-import java.util.*;
-
 import sun.awt.datatransfer.DataTransferer;
 import sun.reflect.misc.ReflectUtil;
 
+import java.io.ByteArrayInputStream;
+import java.io.CharArrayReader;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.OptionalDataException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Objects;
+
 import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION;
 
 /**
@@ -501,7 +516,7 @@
     * @throws ClassNotFoundException
     * @throws  NullPointerException if <code>mimeType</code> is null
     *
-    * @see tryToLoadClass
+    * @see #tryToLoadClass
     */
     private void initialize(String mimeType, String humanPresentableName, ClassLoader classLoader) throws MimeTypeParseException, ClassNotFoundException {
         if (mimeType == null) {
@@ -990,14 +1005,8 @@
             return true;
         }
 
-        if (representationClass == null) {
-            if (that.getRepresentationClass() != null) {
-                return false;
-            }
-        } else {
-            if (!representationClass.equals(that.getRepresentationClass())) {
-                return false;
-            }
+        if (!Objects.equals(this.getRepresentationClass(), that.getRepresentationClass())) {
+            return false;
         }
 
         if (mimeType == null) {
@@ -1010,34 +1019,22 @@
             }
 
             if ("text".equals(getPrimaryType())) {
-                if (DataTransferer.doesSubtypeSupportCharset(this) &&
-                    representationClass != null &&
-                    !(isRepresentationClassReader() ||
-                        String.class.equals(representationClass) ||
-                        isRepresentationClassCharBuffer() ||
-                        char[].class.equals(representationClass)))
-                {
+                if (DataTransferer.doesSubtypeSupportCharset(this)
+                        && representationClass != null
+                        && !isStandardTextRepresentationClass()) {
                     String thisCharset =
-                        DataTransferer.canonicalName(getParameter("charset"));
+                            DataTransferer.canonicalName(this.getParameter("charset"));
                     String thatCharset =
-                        DataTransferer.canonicalName(that.getParameter("charset"));
-                    if (thisCharset == null) {
-                        if (thatCharset != null) {
-                            return false;
-                        }
-                    } else {
-                        if (!thisCharset.equals(thatCharset)) {
-                            return false;
-                        }
+                            DataTransferer.canonicalName(that.getParameter("charset"));
+                    if (!Objects.equals(thisCharset, thatCharset)) {
+                        return false;
                     }
                 }
 
-                if ("html".equals(getSubType()) &&
-                        this.getParameter("document") != null )
-                {
-                   if (!this.getParameter("document").
-                            equals(that.getParameter("document")))
-                    {
+                if ("html".equals(getSubType())) {
+                    String thisDocument = this.getParameter("document");
+                    String thatDocument = that.getParameter("document");
+                    if (!Objects.equals(thisDocument, thatDocument)) {
                         return false;
                     }
                 }
@@ -1094,18 +1091,21 @@
             // MimeType.match which reports a match if one or both of the
             // subTypes is '*', regardless of the other subType.
 
-            if ("text".equals(primaryType) &&
-                DataTransferer.doesSubtypeSupportCharset(this) &&
-                representationClass != null &&
-                !(isRepresentationClassReader() ||
-                  String.class.equals(representationClass) ||
-                  isRepresentationClassCharBuffer() ||
-                  char[].class.equals(representationClass)))
-            {
-                String charset =
-                    DataTransferer.canonicalName(getParameter("charset"));
-                if (charset != null) {
-                    total += charset.hashCode();
+            if ("text".equals(primaryType)) {
+                if (DataTransferer.doesSubtypeSupportCharset(this)
+                        && representationClass != null
+                        && !isStandardTextRepresentationClass()) {
+                    String charset = DataTransferer.canonicalName(getParameter("charset"));
+                    if (charset != null) {
+                        total += charset.hashCode();
+                    }
+                }
+
+                if ("html".equals(getSubType())) {
+                    String document = this.getParameter("document");
+                    if (document != null) {
+                        total += document.hashCode();
+                    }
                 }
             }
         }
@@ -1181,6 +1181,20 @@
         return mimeType.match(mtype);
     }
 
+    /**
+     * Checks if the representation class is one of the standard text
+     * representation classes.
+     *
+     * @return true if the representation class is one of the standard text
+     *              representation classes, otherwise false
+     */
+    private boolean isStandardTextRepresentationClass() {
+        return isRepresentationClassReader()
+                || String.class.equals(representationClass)
+                || isRepresentationClassCharBuffer()
+                || char[].class.equals(representationClass);
+    }
+
    /**
     * Does the <code>DataFlavor</code> represent a serialized object?
     */
--- a/src/share/classes/java/awt/dnd/DragSourceContext.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/java/awt/dnd/DragSourceContext.java	Tue Jun 03 08:32:34 2014 -0700
@@ -576,9 +576,9 @@
             throw new InvalidObjectException("Null trigger component");
         }
 
-        int DGRActions = newTrigger.getSourceAsDragGestureRecognizer().getSourceActions()
+        int newSourceActions = f.get("sourceActions", 0)
                 & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);
-        if (DGRActions == DnDConstants.ACTION_NONE) {
+        if (newSourceActions == DnDConstants.ACTION_NONE) {
             throw new InvalidObjectException("Invalid source actions");
         }
         int triggerActions = newTrigger.getDragAction();
@@ -591,8 +591,7 @@
 
         cursor = (Cursor)f.get("cursor", null);
         useCustomCursor = f.get("useCustomCursor", false);
-        sourceActions = f.get("sourceActions", 0)
-                & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);
+        sourceActions = newSourceActions;
 
         transferable = (Transferable)s.readObject();
         listener = (DragSourceListener)s.readObject();
--- a/src/share/classes/java/lang/ConditionalSpecialCasing.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/java/lang/ConditionalSpecialCasing.java	Tue Jun 03 08:32:34 2014 -0700
@@ -62,6 +62,7 @@
         //# Conditional mappings
         //# ================================================================================
         new Entry(0x03A3, new char[]{0x03C2}, new char[]{0x03A3}, null, FINAL_CASED), // # GREEK CAPITAL LETTER SIGMA
+        new Entry(0x0130, new char[]{0x0069, 0x0307}, new char[]{0x0130}, null, 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
 
         //# ================================================================================
         //# Locale-sensitive mappings
@@ -77,8 +78,8 @@
 
         //# ================================================================================
         //# Turkish and Azeri
-//      new Entry(0x0130, new char[]{0x0069}, new char[]{0x0130}, "tr", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
-//      new Entry(0x0130, new char[]{0x0069}, new char[]{0x0130}, "az", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
+        new Entry(0x0130, new char[]{0x0069}, new char[]{0x0130}, "tr", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
+        new Entry(0x0130, new char[]{0x0069}, new char[]{0x0130}, "az", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
         new Entry(0x0307, new char[]{}, new char[]{0x0307}, "tr", AFTER_I), // # COMBINING DOT ABOVE
         new Entry(0x0307, new char[]{}, new char[]{0x0307}, "az", AFTER_I), // # COMBINING DOT ABOVE
         new Entry(0x0049, new char[]{0x0131}, new char[]{0x0049}, "tr", NOT_BEFORE_DOT), // # LATIN CAPITAL LETTER I
@@ -148,21 +149,25 @@
 
     private static char[] lookUpTable(String src, int index, Locale locale, boolean bLowerCasing) {
         HashSet<Entry> set = entryTable.get(new Integer(src.codePointAt(index)));
+        char[] ret = null;
 
         if (set != null) {
             Iterator<Entry> iter = set.iterator();
             String currentLang = locale.getLanguage();
             while (iter.hasNext()) {
                 Entry entry = iter.next();
-                String conditionLang= entry.getLanguage();
+                String conditionLang = entry.getLanguage();
                 if (((conditionLang == null) || (conditionLang.equals(currentLang))) &&
                         isConditionMet(src, index, locale, entry.getCondition())) {
-                    return (bLowerCasing ? entry.getLowerCase() : entry.getUpperCase());
+                    ret = bLowerCasing ? entry.getLowerCase() : entry.getUpperCase();
+                    if (conditionLang != null) {
+                        break;
+                    }
                 }
             }
         }
 
-        return null;
+        return ret;
     }
 
     private static boolean isConditionMet(String src, int index, Locale locale, int condition) {
--- a/src/share/classes/java/lang/String.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/java/lang/String.java	Tue Jun 03 08:32:34 2014 -0700
@@ -2597,7 +2597,9 @@
             } else {
                 srcCount = 1;
             }
-            if (localeDependent || srcChar == '\u03A3') { // GREEK CAPITAL LETTER SIGMA
+            if (localeDependent ||
+                srcChar == '\u03A3' || // GREEK CAPITAL LETTER SIGMA
+                srcChar == '\u0130') { // LATIN CAPITAL LETTER I WITH DOT ABOVE
                 lowerChar = ConditionalSpecialCasing.toLowerCaseEx(this, i, locale);
             } else {
                 lowerChar = Character.toLowerCase(srcChar);
--- a/src/share/classes/java/util/Random.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/java/util/Random.java	Tue Jun 03 08:32:34 2014 -0700
@@ -874,7 +874,7 @@
      * (inclusive) and one (exclusive).
      *
      * <p>A pseudorandom {@code double} value is generated as if it's the result
-     * of calling the method {@link #nextDouble()}}.
+     * of calling the method {@link #nextDouble()}.
      *
      * @param streamSize the number of values to generate
      * @return a stream of {@code double} values
@@ -897,7 +897,7 @@
      * (exclusive).
      *
      * <p>A pseudorandom {@code double} value is generated as if it's the result
-     * of calling the method {@link #nextDouble()}}.
+     * of calling the method {@link #nextDouble()}.
      *
      * @implNote This method is implemented to be equivalent to {@code
      * doubles(Long.MAX_VALUE)}.
--- a/src/share/classes/javax/crypto/JceSecurity.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/crypto/JceSecurity.java	Tue Jun 03 08:32:34 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -216,26 +216,28 @@
             new WeakHashMap<>();
 
     /*
-     * Retuns the CodeBase for the given class.
+     * Returns the CodeBase for the given class.
      */
     static URL getCodeBase(final Class<?> clazz) {
-        URL url = codeBaseCacheRef.get(clazz);
-        if (url == null) {
-            url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
-                public URL run() {
-                    ProtectionDomain pd = clazz.getProtectionDomain();
-                    if (pd != null) {
-                        CodeSource cs = pd.getCodeSource();
-                        if (cs != null) {
-                            return cs.getLocation();
+        synchronized (codeBaseCacheRef) {
+            URL url = codeBaseCacheRef.get(clazz);
+            if (url == null) {
+                url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
+                    public URL run() {
+                        ProtectionDomain pd = clazz.getProtectionDomain();
+                        if (pd != null) {
+                            CodeSource cs = pd.getCodeSource();
+                            if (cs != null) {
+                                return cs.getLocation();
+                            }
                         }
+                        return NULL_URL;
                     }
-                    return NULL_URL;
-                }
-            });
-            codeBaseCacheRef.put(clazz, url);
+                });
+                codeBaseCacheRef.put(clazz, url);
+            }
+            return (url == NULL_URL) ? null : url;
         }
-        return (url == NULL_URL) ? null : url;
     }
 
     private static void setupJurisdictionPolicies() throws Exception {
--- a/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	Tue Jun 03 08:32:34 2014 -0700
@@ -379,15 +379,11 @@
         InternalFrameEvent e = new InternalFrameEvent(
             frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
         // Try posting event, unless there's a SecurityManager.
-        if (JInternalFrame.class.getClassLoader() == null) {
-            try {
-                Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
-                return;
-            } catch (SecurityException se) {
-                // Use dispatchEvent instead.
-            }
+        try {
+            Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
+        } catch (SecurityException se) {
+            frame.dispatchEvent(e);
         }
-        frame.dispatchEvent(e);
     }
 
 
--- a/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java	Tue Jun 03 08:32:34 2014 -0700
@@ -31,6 +31,7 @@
 import javax.swing.plaf.UIResource;
 import javax.swing.Painter;
 import java.awt.print.PrinterGraphics;
+import sun.reflect.misc.MethodUtil;
 
 /**
  * Convenient base class for defining Painter instances for rendering a
@@ -445,8 +446,8 @@
             } else {
                 String s = "get" + Character.toUpperCase(property.charAt(0)) + property.substring(1);
                 try {
-                    Method method = c.getClass().getMethod(s);
-                    color = (Color) method.invoke(c);
+                    Method method = MethodUtil.getMethod(c.getClass(), s, null);
+                    color = (Color) MethodUtil.invoke(method, c, null);
                 } catch (Exception e) {
                     //don't do anything, it just didn't work, that's all.
                     //This could be a normal occurance if you use a property
--- a/src/share/classes/javax/swing/plaf/nimbus/skin.laf	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/nimbus/skin.laf	Tue Jun 03 08:32:34 2014 -0700
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <!--
- Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1998, 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
@@ -13424,10 +13424,10 @@
             <state stateKeys="Selected">
                 <style>
                    <textForeground>
-                      <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                      <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textForeground>
                    <textBackground>
-                      <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                      <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textBackground>
                    <background/>
                    <inherit-textForeground>false</inherit-textForeground>
@@ -13453,7 +13453,7 @@
                 <style>
                    <textForeground/>
                    <textBackground>
-                       <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                       <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textBackground>
                    <background/>
                    <inherit-textBackground>false</inherit-textBackground>
@@ -13477,7 +13477,7 @@
             <state stateKeys="Disabled">
                 <style>
                    <textForeground>
-                      <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                      <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textForeground>
                    <textBackground/>
                    <background/>
@@ -13520,7 +13520,7 @@
                         </textForeground>
                         <textBackground/>
                         <background>
-                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                         </background>
                         <inherit-textForeground>false</inherit-textForeground>
                         <inherit-background>false</inherit-background>
--- a/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -138,9 +138,7 @@
     }
 
     SynthContext getContext(JComponent c, int state) {
-        Region region = SynthLookAndFeel.getRegion(c);
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -128,8 +128,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -208,8 +208,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthContext.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthContext.java	Tue Jun 03 08:32:34 2014 -0700
@@ -24,8 +24,9 @@
  */
 package javax.swing.plaf.synth;
 
-import javax.swing.*;
-import java.util.*;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import javax.swing.JComponent;
 
 /**
  * An immutable transient object containing contextual information about
@@ -39,59 +40,32 @@
  * @author Scott Violet
  */
 public class SynthContext {
-    private static final Map<Class, List<SynthContext>> contextMap;
+    private static final Queue<SynthContext> queue = new ConcurrentLinkedQueue<>();
 
     private JComponent component;
     private Region region;
     private SynthStyle style;
     private int state;
 
-
-    static {
-        contextMap = new HashMap<Class, List<SynthContext>>();
+    static SynthContext getContext(JComponent c, SynthStyle style, int state) {
+        return getContext(c, SynthLookAndFeel.getRegion(c), style, state);
     }
 
-
-    static SynthContext getContext(Class type, JComponent component,
+    static SynthContext getContext(JComponent component,
                                    Region region, SynthStyle style,
                                    int state) {
-        SynthContext context = null;
-
-        synchronized(contextMap) {
-            List<SynthContext> instances = contextMap.get(type);
-
-            if (instances != null) {
-                int size = instances.size();
-
-                if (size > 0) {
-                    context = instances.remove(size - 1);
-                }
-            }
-        }
+        SynthContext context = queue.poll();
         if (context == null) {
-            try {
-                context = (SynthContext)type.newInstance();
-            } catch (IllegalAccessException iae) {
-            } catch (InstantiationException ie) {
-            }
+            context = new SynthContext();
         }
         context.reset(component, region, style, state);
         return context;
     }
 
     static void releaseContext(SynthContext context) {
-        synchronized(contextMap) {
-            List<SynthContext> instances = contextMap.get(context.getClass());
-
-            if (instances == null) {
-                instances = new ArrayList<SynthContext>(5);
-                contextMap.put(context.getClass(), instances);
-            }
-            instances.add(context);
-        }
+        queue.offer(context);
     }
 
-
     SynthContext() {
     }
 
--- a/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -142,9 +142,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        Region region = SynthLookAndFeel.getRegion(c);
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -430,8 +430,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                     SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -139,8 +139,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java	Tue Jun 03 08:32:34 2014 -0700
@@ -67,8 +67,7 @@
     }
 
     public SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private Region getRegion(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -141,8 +141,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                            SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -91,8 +91,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthListUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthListUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -188,8 +188,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -116,8 +116,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -170,8 +170,7 @@
     }
 
     SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     SynthContext getContext(JComponent c, Region region) {
@@ -179,8 +178,7 @@
     }
 
     private SynthContext getContext(JComponent c, Region region, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                                       region, accStyle, state);
+        return SynthContext.getContext(c, region, accStyle, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -170,9 +170,7 @@
     }
 
     SynthContext getContext(JComponent c, int state) {
-        Region region = SynthLookAndFeel.getRegion(c);
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     SynthContext getContext(JComponent c, Region region) {
@@ -180,8 +178,7 @@
     }
 
     private SynthContext getContext(JComponent c, Region region, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                                       region, accStyle, state);
+        return SynthContext.getContext(c, region, accStyle, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -140,8 +140,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -127,8 +127,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Tue Jun 03 08:32:34 2014 -0700
@@ -67,6 +67,7 @@
 import org.xml.sax.helpers.DefaultHandler;
 
 import com.sun.beans.decoder.DocumentHandler;
+import sun.reflect.misc.ReflectUtil;
 
 class SynthParser extends DefaultHandler {
     //
@@ -648,7 +649,7 @@
                     }
                     else {
                         try {
-                            typeClass = Class.forName(typeName.substring(
+                            typeClass = ReflectUtil.forName(typeName.substring(
                                                       0, classIndex));
                         } catch (ClassNotFoundException cnfe) {
                             throw new SAXException("Unknown class: " +
--- a/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -123,8 +123,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -138,8 +138,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                            SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthRootPaneUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthRootPaneUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -80,8 +80,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -185,8 +185,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region region) {
@@ -199,8 +198,7 @@
         if (region == Region.SCROLL_BAR_THUMB) {
             style = thumbStyle;
         }
-        return SynthContext.getContext(SynthContext.class, c, region, style,
-                                       state);
+        return SynthContext.getContext(c, region, style, state);
     }
 
     private int getComponentState(JComponent c, Region region) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -211,8 +211,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -248,8 +248,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     public void propertyChange(PropertyChangeEvent evt) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -722,8 +722,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                            SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region subregion) {
@@ -732,14 +731,13 @@
 
     private SynthContext getContext(JComponent c, Region subregion, int state) {
         SynthStyle style = null;
-        Class klass = SynthContext.class;
 
         if (subregion == Region.SLIDER_TRACK) {
             style = sliderTrackStyle;
         } else if (subregion == Region.SLIDER_THUMB) {
             style = sliderThumbStyle;
         }
-        return SynthContext.getContext(klass, c, subregion, style, state);
+        return SynthContext.getContext(c, subregion, style, state);
     }
 
     private int getComponentState(JComponent c, Region region) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -278,8 +278,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -209,8 +209,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     SynthContext getContext(JComponent c, Region region) {
@@ -219,11 +218,9 @@
 
     private SynthContext getContext(JComponent c, Region region, int state) {
         if (region == Region.SPLIT_PANE_DIVIDER) {
-            return SynthContext.getContext(SynthContext.class, c, region,
-                                           dividerStyle, state);
+            return SynthContext.getContext(c, region, dividerStyle, state);
         }
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, region, style, state);
     }
 
     private int getComponentState(JComponent c, Region subregion) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -235,13 +235,11 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c),style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region subregion, int state){
         SynthStyle style = null;
-        Class klass = SynthContext.class;
 
         if (subregion == Region.TABBED_PANE_TAB) {
             style = tabStyle;
@@ -252,7 +250,7 @@
         else if (subregion == Region.TABBED_PANE_CONTENT) {
             style = tabContentStyle;
         }
-        return SynthContext.getContext(klass, c, subregion, style, state);
+        return SynthContext.getContext(c, subregion, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -193,8 +193,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -246,8 +246,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
 //
--- a/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -118,8 +118,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -156,8 +156,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -178,19 +178,17 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region region, SynthStyle style) {
-        return SynthContext.getContext(SynthContext.class, c, region,
+        return SynthContext.getContext(c, region,
                                        style, getComponentState(c, region));
     }
 
     private SynthContext getContext(JComponent c, Region region,
                                     SynthStyle style, int state) {
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, region, style, state);
     }
 
     private int getComponentState(JComponent c, Region region) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -107,8 +107,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -173,8 +173,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region region) {
@@ -182,8 +181,7 @@
     }
 
     private SynthContext getContext(JComponent c, Region region, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                                       region, cellStyle, state);
+        return SynthContext.getContext(c, region, cellStyle, state);
     }
 
     private int getComponentState(JComponent c, Region region) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java	Tue Jun 03 08:32:34 2014 -0700
@@ -141,8 +141,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                                       getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private Region getRegion(JComponent c) {
--- a/src/share/classes/sun/awt/SunToolkit.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/awt/SunToolkit.java	Tue Jun 03 08:32:34 2014 -0700
@@ -851,22 +851,30 @@
 
     private int checkResolutionVariant(Image img, int w, int h, ImageObserver o) {
         ToolkitImage rvImage = getResolutionVariant(img);
+        int rvw = getRVSize(w);
+        int rvh = getRVSize(h);
         // Ignore the resolution variant in case of error
         return (rvImage == null || rvImage.hasError()) ? 0xFFFF :
-                checkImage(rvImage, 2 * w, 2 * h, MultiResolutionToolkitImage.
+                checkImage(rvImage, rvw, rvh, MultiResolutionToolkitImage.
                                 getResolutionVariantObserver(
-                                        img, o, w, h, 2 * w, 2 * h));
+                                        img, o, w, h, rvw, rvh, true));
     }
 
     private boolean prepareResolutionVariant(Image img, int w, int h,
             ImageObserver o) {
 
         ToolkitImage rvImage = getResolutionVariant(img);
+        int rvw = getRVSize(w);
+        int rvh = getRVSize(h);
         // Ignore the resolution variant in case of error
         return rvImage == null || rvImage.hasError() || prepareImage(
-                rvImage, 2 * w, 2 * h,
+                rvImage, rvw, rvh,
                 MultiResolutionToolkitImage.getResolutionVariantObserver(
-                        img, o, w, h, 2 * w, 2 * h));
+                        img, o, w, h, rvw, rvh, true));
+    }
+
+    private static int getRVSize(int size){
+        return size == -1 ? -1 : 2 * size;
     }
 
     private static ToolkitImage getResolutionVariant(Image image) {
--- a/src/share/classes/sun/awt/image/ByteBandedRaster.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/awt/image/ByteBandedRaster.java	Tue Jun 03 08:32:34 2014 -0700
@@ -755,10 +755,22 @@
                     + scanlineStride);
         }
 
-        for (int i = 0; i < data.length; i++) {
-            if (scanlineStride > data[i].length) {
-                throw new RasterFormatException("Incorrect scanline stride: "
-                    + scanlineStride);
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            for (int i = 0; i < data.length; i++) {
+                if (scanlineStride > data[i].length) {
+                    throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+                }
             }
         }
 
--- a/src/share/classes/sun/awt/image/ByteComponentRaster.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/awt/image/ByteComponentRaster.java	Tue Jun 03 08:32:34 2014 -0700
@@ -885,15 +885,31 @@
             }
         }
 
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
         // we can be sure that width and height are greater than 0
         if (scanlineStride < 0 ||
-            scanlineStride > (Integer.MAX_VALUE / height) ||
-            scanlineStride > data.length)
+            scanlineStride > (Integer.MAX_VALUE / height))
         {
             // integer overflow
             throw new RasterFormatException("Incorrect scanline stride: "
                     + scanlineStride);
         }
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            if (scanlineStride > data.length) {
+                throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+            }
+        }
+
         int lastScanOffset = (height - 1) * scanlineStride;
 
         if (pixelStride < 0 ||
--- a/src/share/classes/sun/awt/image/BytePackedRaster.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/awt/image/BytePackedRaster.java	Tue Jun 03 08:32:34 2014 -0700
@@ -1386,13 +1386,28 @@
             throw new RasterFormatException("Invalid raster dimension");
         }
 
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
         if (scanlineStride < 0 ||
-            scanlineStride > (Integer.MAX_VALUE / height) ||
-            scanlineStride > data.length)
+            scanlineStride > (Integer.MAX_VALUE / height))
         {
             throw new RasterFormatException("Invalid scanline stride");
         }
 
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            if (scanlineStride > data.length) {
+                throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+            }
+        }
+
         long lastbit = (long) dataBitOffset
                        + (long) (height - 1) * (long) scanlineStride * 8
                        + (long) (width - 1) * (long) pixelBitStride
--- a/src/share/classes/sun/awt/image/IntegerComponentRaster.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/awt/image/IntegerComponentRaster.java	Tue Jun 03 08:32:34 2014 -0700
@@ -654,15 +654,31 @@
                                             ") must be >= 0");
         }
 
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
         // we can be sure that width and height are greater than 0
         if (scanlineStride < 0 ||
-            scanlineStride > (Integer.MAX_VALUE / height) ||
-            scanlineStride > data.length)
+            scanlineStride > (Integer.MAX_VALUE / height))
         {
             // integer overflow
             throw new RasterFormatException("Incorrect scanline stride: "
                     + scanlineStride);
         }
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            if (scanlineStride > data.length) {
+                throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+            }
+        }
+
         int lastScanOffset = (height - 1) * scanlineStride;
 
         if (pixelStride < 0 ||
--- a/src/share/classes/sun/awt/image/MultiResolutionToolkitImage.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/awt/image/MultiResolutionToolkitImage.java	Tue Jun 03 08:32:34 2014 -0700
@@ -66,6 +66,14 @@
             final Image image, final ImageObserver observer,
             final int imgWidth, final int imgHeight,
             final int rvWidth, final int rvHeight) {
+        return getResolutionVariantObserver(image, observer,
+                imgWidth, imgHeight, rvWidth, rvHeight, false);
+    }
+
+    public static ImageObserver getResolutionVariantObserver(
+            final Image image, final ImageObserver observer,
+            final int imgWidth, final int imgHeight,
+            final int rvWidth, final int rvHeight, boolean concatenateInfo) {
 
         if (observer == null) {
             return null;
@@ -92,6 +100,11 @@
                                 y /= 2;
                             }
 
+                            if(concatenateInfo){
+                                flags &= ((ToolkitImage) image).
+                                        getImageRep().check(null);
+                            }
+
                             return observer.imageUpdate(
                                     image, flags, x, y, width, height);
                         };
--- a/src/share/classes/sun/awt/image/ShortBandedRaster.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/awt/image/ShortBandedRaster.java	Tue Jun 03 08:32:34 2014 -0700
@@ -754,10 +754,21 @@
                     + scanlineStride);
         }
 
-        for (int i = 0; i < data.length; i++) {
-            if (scanlineStride > data[i].length) {
-                throw new RasterFormatException("Incorrect scanline stride: "
-                    + scanlineStride);
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            for (int i = 0; i < data.length; i++) {
+                if (scanlineStride > data[i].length) {
+                    throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+                }
             }
         }
 
--- a/src/share/classes/sun/awt/image/ShortComponentRaster.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/awt/image/ShortComponentRaster.java	Tue Jun 03 08:32:34 2014 -0700
@@ -819,15 +819,31 @@
             }
         }
 
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
         // we can be sure that width and height are greater than 0
         if (scanlineStride < 0 ||
-            scanlineStride > (Integer.MAX_VALUE / height) ||
-            scanlineStride > data.length)
+            scanlineStride > (Integer.MAX_VALUE / height))
         {
             // integer overflow
             throw new RasterFormatException("Incorrect scanline stride: "
                     + scanlineStride);
         }
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            if (scanlineStride > data.length) {
+                throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+            }
+        }
+
         int lastScanOffset = (height - 1) * scanlineStride;
 
         if (pixelStride < 0 ||
--- a/src/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Tue Jun 03 08:32:34 2014 -0700
@@ -34,8 +34,11 @@
 import java.util.Random;
 
 import sun.net.www.HeaderParser;
+import sun.net.NetProperties;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
 import static sun.net.www.protocol.http.HttpURLConnection.HTTP_CONNECT;
 
 /**
@@ -51,6 +54,23 @@
 
     private String authMethod;
 
+    private final static String compatPropName = "http.auth.digest." +
+                "quoteParameters";
+
+    // true if http.auth.digest.quoteParameters Net property is true
+    private static final boolean delimCompatFlag;
+
+    static {
+        Boolean b = AccessController.doPrivileged(
+            new PrivilegedAction<Boolean>() {
+                public Boolean run() {
+                    return NetProperties.getBoolean(compatPropName);
+                }
+            }
+        );
+        delimCompatFlag = (b == null) ? false : b.booleanValue();
+    }
+
     // Authentication parameters defined in RFC2617.
     // One instance of these may be shared among several DigestAuthentication
     // instances as a result of a single authorization (for multiple domains)
@@ -357,24 +377,34 @@
             ncfield = "\", nc=" + ncstring;
         }
 
+        String algoS, qopS;
+
+        if (delimCompatFlag) {
+            // Put quotes around these String value parameters
+            algoS = ", algorithm=\"" + algorithm + "\"";
+            qopS = ", qop=\"auth\"";
+        } else {
+            // Don't put quotes around them, per the RFC
+            algoS = ", algorithm=" + algorithm;
+            qopS = ", qop=auth";
+        }
+
         String value = authMethod
                         + " username=\"" + pw.getUserName()
                         + "\", realm=\"" + realm
                         + "\", nonce=\"" + nonce
                         + ncfield
                         + ", uri=\"" + uri
-                        + "\", response=\"" + response
-                        + "\", algorithm=" + algorithm;
+                        + "\", response=\"" + response + "\""
+                        + algoS;
         if (opaque != null) {
-            value = value + ", opaque=\"" + opaque;
-            value = value + "\"";
+            value += ", opaque=\"" + opaque + "\"";
         }
         if (cnonce != null) {
-            value = value + ", cnonce=\"" + cnonce;
-            value = value + "\"";
+            value += ", cnonce=\"" + cnonce + "\"";
         }
         if (qop) {
-            value = value + ", qop=auth";
+            value += qopS;
         }
         return value;
     }
--- a/src/share/classes/sun/nio/cs/UTF_8.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/nio/cs/UTF_8.java	Tue Jun 03 08:32:34 2014 -0700
@@ -111,12 +111,18 @@
                    (b4 & 0xc0) != 0x80;
         }
 
-        // only used when there is less than 4 bytes left in src buffer
+        // only used when there is less than 4 bytes left in src buffer.
+        // both b1 and b2 should be "& 0xff" before passed in.
         private static boolean isMalformed4_2(int b1, int b2) {
-            return (b1 == 0xf0 && b2 == 0x90) ||
+            return (b1 == 0xf0 && (b2  < 0x90 || b2 > 0xbf)) ||
+                   (b1 == 0xf4 && (b2 & 0xf0) != 0x80) ||
                    (b2 & 0xc0) != 0x80;
         }
 
+        // tests if b1 and b2 are malformed as the first 2 bytes of a
+        // legal`4-byte utf-8 byte sequence.
+        // only used when there is less than 4 bytes left in src buffer,
+        // after isMalformed4_2 has been invoked.
         private static boolean isMalformed4_3(int b3) {
             return (b3 & 0xc0) != 0x80;
         }
@@ -280,7 +286,9 @@
                     // 4 bytes, 21 bits: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
                     int srcRemaining = sl - sp;
                     if (srcRemaining < 4 || dl - dp < 2) {
-                        if (srcRemaining > 1 && isMalformed4_2(b1, sa[sp + 1]))
+                        b1 &= 0xff;
+                        if (b1 > 0xf4 ||
+                            srcRemaining > 1 && isMalformed4_2(b1, sa[sp + 1] & 0xff))
                             return malformedForLength(src, sp, dst, dp, 1);
                         if (srcRemaining > 2 && isMalformed4_3(sa[sp + 2]))
                             return malformedForLength(src, sp, dst, dp, 2);
@@ -363,7 +371,9 @@
                     // 4 bytes, 21 bits: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
                     int srcRemaining = limit - mark;
                     if (srcRemaining < 4 || dst.remaining() < 2) {
-                        if (srcRemaining > 1 && isMalformed4_2(b1, src.get()))
+                        b1 &= 0xff;
+                        if (b1 > 0xf4 ||
+                            srcRemaining > 1 && isMalformed4_2(b1, src.get() & 0xff))
                             return malformedForLength(src, mark, 1);
                         if (srcRemaining > 2 && isMalformed4_3(src.get()))
                             return malformedForLength(src, mark, 2);
@@ -518,8 +528,9 @@
                     }
                     if (malformedInputAction() != CodingErrorAction.REPLACE)
                         return -1;
-
-                    if (sp  < sl && isMalformed4_2(b1, sa[sp])) {
+                    b1 &= 0xff;
+                    if (b1 > 0xf4 ||
+                        sp  < sl && isMalformed4_2(b1, sa[sp] & 0xff)) {
                         da[dp++] = replacement().charAt(0);
                         continue;
                     }
--- a/src/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Tue Jun 03 08:32:34 2014 -0700
@@ -75,7 +75,7 @@
             if (ti.getTarget() == filter)
                 l.add(t);
         }
-        TypeAnnotation[] typeAnnotations = l.toArray(new TypeAnnotation[0]);
+        TypeAnnotation[] typeAnnotations = l.toArray(EMPTY_TYPE_ANNOTATION_ARRAY);
         return AnnotatedTypeFactory.buildAnnotatedType(type,
                                                        LocationInfo.BASE_LOCATION,
                                                        typeAnnotations,
@@ -245,7 +245,6 @@
         if (bounds != null) {
             int startIndex = 0;
             AnnotatedType[] res = new AnnotatedType[bounds.length];
-            Arrays.fill(res, AnnotatedTypeFactory.EMPTY_ANNOTATED_TYPE);
 
             // Adjust bounds index
             //
@@ -276,12 +275,12 @@
                             tInfo.getCount() == typeVarIndex) {
                         l.add(t);
                     }
-                    res[i] = AnnotatedTypeFactory.buildAnnotatedType(bounds[i],
-                                                                     loc,
-                                                                     l.toArray(new TypeAnnotation[0]),
-                                                                     candidates.toArray(new TypeAnnotation[0]),
-                                                                     (AnnotatedElement)decl);
                 }
+                res[i] = AnnotatedTypeFactory.buildAnnotatedType(bounds[i],
+                        loc,
+                        l.toArray(EMPTY_TYPE_ANNOTATION_ARRAY),
+                        candidates.toArray(EMPTY_TYPE_ANNOTATION_ARRAY),
+                        (AnnotatedElement)decl);
             }
             return res;
         }
--- a/src/share/native/sun/font/layout/IndicLayoutEngine.cpp	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/native/sun/font/layout/IndicLayoutEngine.cpp	Tue Jun 03 08:32:34 2014 -0700
@@ -151,7 +151,7 @@
     le_int32 outCharCount;
     if (fVersion2) {
         _LETRACE("v2process");
-        outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage);
+        outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage, success);
     } else {
         _LETRACE("reorder");
         outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage, &fMPreFixups, success);
--- a/src/share/native/sun/font/layout/IndicReordering.cpp	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/native/sun/font/layout/IndicReordering.cpp	Tue Jun 03 08:32:34 2014 -0700
@@ -1096,9 +1096,13 @@
 
 
 le_int32 IndicReordering::v2process(const LEUnicode *chars, le_int32 charCount, le_int32 scriptCode,
-                                  LEUnicode *outChars, LEGlyphStorage &glyphStorage)
+                                  LEUnicode *outChars, LEGlyphStorage &glyphStorage, LEErrorCode& success)
 {
     const IndicClassTable *classTable = IndicClassTable::getScriptClassTable(scriptCode);
+    if (classTable == NULL) {
+        success = LE_MEMORY_ALLOCATION_ERROR;
+        return 0;
+    }
 
     DynamicProperties dynProps[INDIC_BLOCK_SIZE];
     IndicReordering::getDynamicProperties(dynProps,classTable);
--- a/src/share/native/sun/font/layout/IndicReordering.h	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/native/sun/font/layout/IndicReordering.h	Tue Jun 03 08:32:34 2014 -0700
@@ -181,7 +181,7 @@
     static void adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage, LEErrorCode& success);
 
     static le_int32 v2process(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode,
-        LEUnicode *outChars, LEGlyphStorage &glyphStorage);
+        LEUnicode *outChars, LEGlyphStorage &glyphStorage, LEErrorCode& success);
 
     static const FeatureMap *getFeatureMap(le_int32 &count);
 
--- a/src/share/native/sun/font/layout/LEScripts.h	Thu May 29 13:47:44 2014 -0700
+++ b/src/share/native/sun/font/layout/LEScripts.h	Tue Jun 03 08:32:34 2014 -0700
@@ -263,12 +263,6 @@
     tirhScriptCode = 158,
 
 /**
- * @stable ICU 52
- */
-    aghbScriptCode = 159,
-    mahjScriptCode = 160,
-
-/**
  * @stable ICU 2.2
  */
     scriptCodeCount
--- a/src/solaris/native/java/util/TimeZone_md.c	Thu May 29 13:47:44 2014 -0700
+++ b/src/solaris/native/java/util/TimeZone_md.c	Tue Jun 03 08:32:34 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -56,6 +56,9 @@
 static const char *ZONEINFO_DIR = "/usr/share/zoneinfo";
 static const char *DEFAULT_ZONEINFO_FILE = "/etc/localtime";
 #else
+#ifdef _AIX
+static const char *ETC_ENVIRONMENT_FILE = "/etc/environment";
+#endif
 static const char *SYS_INIT_FILE = "/etc/default/init";
 static const char *ZONEINFO_DIR = "/usr/share/lib/zoneinfo";
 static const char *DEFAULT_ZONEINFO_FILE = "/usr/share/lib/zoneinfo/localtime";
@@ -619,8 +622,29 @@
 static char *
 getPlatformTimeZoneID()
 {
-    return NULL;
+    FILE *fp;
+    char *tz = NULL;
+    char *tz_key = "TZ=";
+    char line[256];
+    size_t tz_key_len = strlen(tz_key);
+
+    if ((fp = fopen(ETC_ENVIRONMENT_FILE, "r")) != NULL) {
+        while (fgets(line, sizeof(line), fp) != NULL) {
+            char *p = strchr(line, '\n');
+            if (p != NULL) {
+                *p = '\0';
+            }
+            if (0 == strncmp(line, tz_key, tz_key_len)) {
+                tz = strdup(line + tz_key_len);
+                break;
+            }
+        }
+        (void) fclose(fp);
+    }
+
+    return tz;
 }
+static char *mapPlatformToJavaTimezone(const char *java_home_dir, const char *tz);
 #endif
 
 /*
@@ -678,9 +702,19 @@
         if (freetz != NULL) {
             free((void *) freetz);
         }
+
+#ifdef _AIX
+        freetz = mapPlatformToJavaTimezone(java_home_dir, javatz);
+        if (javatz != NULL) {
+            free((void *) javatz);
+        }
+        javatz = freetz;
+#endif
     }
+
     return javatz;
 }
+
 /**
  * Returns a GMT-offset-based zone ID. (e.g., "GMT-08:00")
  */
@@ -747,3 +781,101 @@
     return strdup(buf);
 }
 #endif /* MACOSX */
+
+#ifdef _AIX
+static char *
+mapPlatformToJavaTimezone(const char *java_home_dir, const char *tz) {
+    FILE *tzmapf;
+    char mapfilename[PATH_MAX+1];
+    char line[256];
+    int linecount = 0;
+    char temp[100], *temp_tz;
+    char *javatz = NULL;
+    char *str_tmp = NULL;
+    size_t temp_tz_len = 0;
+
+    /* On AIX, the TZ environment variable may end with a comma
+     * followed by modifier fields. These are ignored here.
+     */
+    strncpy(temp, tz, 100);
+    temp_tz = strtok_r(temp, ",", &str_tmp);
+
+    if(temp_tz == NULL)
+        goto tzerr;
+
+    temp_tz_len = strlen(temp_tz);
+
+    if (strlen(java_home_dir) >= (PATH_MAX - 15)) {
+        jio_fprintf(stderr, "java.home longer than maximum path length \n");
+        goto tzerr;
+    }
+
+    strncpy(mapfilename, java_home_dir, PATH_MAX);
+    strcat(mapfilename, "/lib/tzmappings");
+
+    if ((tzmapf = fopen(mapfilename, "r")) == NULL) {
+        jio_fprintf(stderr, "can't open %s\n", mapfilename);
+        goto tzerr;
+    }
+
+    while (fgets(line, sizeof(line), tzmapf) != NULL) {
+        char *p = line;
+        char *sol = line;
+        char *java;
+        int result;
+
+        linecount++;
+        /*
+         * Skip comments and blank lines
+         */
+        if (*p == '#' || *p == '\n') {
+            continue;
+        }
+
+        /*
+         * Get the first field, platform zone ID
+         */
+        while (*p != '\0' && *p != '\t') {
+            p++;
+        }
+        if (*p == '\0') {
+            /* mapping table is broken! */
+            jio_fprintf(stderr, "tzmappings: Illegal format at near line %d.\n", linecount);
+            break;
+        }
+
+        *p++ = '\0';
+        if ((result = strncmp(temp_tz, sol, temp_tz_len)) == 0) {
+            /*
+             * If this is the current platform zone ID,
+             * take the Java time zone ID (2nd field).
+             */
+            java = p;
+            while (*p != '\0' && *p != '\n') {
+                p++;
+            }
+
+            if (*p == '\0') {
+                /* mapping table is broken! */
+                jio_fprintf(stderr, "tzmappings: Illegal format at line %d.\n", linecount);
+                break;
+            }
+
+            *p = '\0';
+            javatz = strdup(java);
+            break;
+        } else if (result < 0) {
+            break;
+        }
+    }
+    (void) fclose(tzmapf);
+
+tzerr:
+    if (javatz == NULL) {
+        return getGMTOffsetID();
+    }
+
+    return javatz;
+}
+#endif
+
--- a/src/windows/native/sun/windows/awt_TextField.cpp	Thu May 29 13:47:44 2014 -0700
+++ b/src/windows/native/sun/windows/awt_TextField.cpp	Tue Jun 03 08:32:34 2014 -0700
@@ -200,7 +200,10 @@
             si.cbSize = sizeof(si);
             si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
 
+            SendMessage(EM_SHOWSCROLLBAR, SB_HORZ, TRUE);
             VERIFY(::GetScrollInfo(GetHWnd(), SB_HORZ, &si));
+            SendMessage(EM_SHOWSCROLLBAR, SB_HORZ, FALSE);
+
             if (bScrollLeft == TRUE) {
                 si.nPos = si.nPos - si.nPage / 2;
                 si.nPos = max(si.nMin, si.nPos);
--- a/test/com/sun/jdi/BadHandshakeTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/com/sun/jdi/BadHandshakeTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -26,7 +26,7 @@
  * @summary Check that a bad handshake doesn't cause a debuggee to abort
  * @library /lib/testlibrary
  *
- * @build VMConnection BadHandshakeTest Exit0
+ * @build jdk.testlibrary.* VMConnection BadHandshakeTest Exit0
  * @run main BadHandshakeTest
  *
  */
--- a/test/com/sun/jdi/ExclusiveBind.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/com/sun/jdi/ExclusiveBind.java	Tue Jun 03 08:32:34 2014 -0700
@@ -27,8 +27,7 @@
  *          at the same time.
  * @library /lib/testlibrary
  *
- * @build jdk.testlibrary.ProcessTools jdk.testlibrary.JDKToolLauncher jdk.testlibrary.Utils
- * @build VMConnection ExclusiveBind HelloWorld
+ * @build jdk.testlibrary.* VMConnection ExclusiveBind HelloWorld
  * @run main ExclusiveBind
  */
 import java.net.ServerSocket;
--- a/test/com/sun/tools/attach/BasicTests.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/com/sun/tools/attach/BasicTests.java	Tue Jun 03 08:32:34 2014 -0700
@@ -38,7 +38,7 @@
  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  * @summary Basic unit tests for the VM attach mechanism.
  * @library /lib/testlibrary
- * @run build Agent BadAgent RedefineAgent Application Shutdown RedefineDummy
+ * @build jdk.testlibrary.* Agent BadAgent RedefineAgent Application Shutdown RedefineDummy
  * @run main BasicTests
  *
  * This test will perform a number of basic attach tests.
--- a/test/com/sun/tools/attach/PermissionTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/com/sun/tools/attach/PermissionTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -34,7 +34,7 @@
  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  * @summary Basic unit tests for the VM attach mechanism.
  * @library /lib/testlibrary
- * @run build Application Shutdown
+ * @build jdk.testlibrary.* Application Shutdown
  * @run main PermissionTest
  *
  * Unit test for Attach API -
--- a/test/com/sun/tools/attach/ProviderTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/com/sun/tools/attach/ProviderTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -33,7 +33,7 @@
  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  * @summary Basic unit tests for the VM attach mechanism.
  * @library /lib/testlibrary
- * @run build SimpleProvider
+ * @build jdk.testlibrary.* SimpleProvider
  * @run main ProviderTest
  *
  * The test will attach and detach to/from the running Application.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/SplashScreen/FullscreenAfterSplash/FullScreenAfterSplash.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,140 @@
+/*
+* 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.
+*
+* 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.
+*/
+
+import sun.awt.OSInfo;
+
+import java.awt.*;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.lang.InterruptedException;
+import java.lang.System;
+import java.lang.Thread;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import javax.swing.*;
+
+/*
+ * @test
+ * @bug 8024185
+ * @summary Native Mac OS X full screen does not work after showing the splash
+ * @library ../
+ * @build GenerateTestImage
+ * @run main GenerateTestImage
+ * @author Petr Pchelko area=awt.event
+ * @run main/othervm -splash:test.png FullScreenAfterSplash
+ */
+public class FullScreenAfterSplash {
+
+    private static JFrame frame;
+
+    private static volatile boolean windowEnteringFullScreen = false;
+    private static volatile boolean windowEnteredFullScreen = false;
+
+    public static void main(String[] args) throws Exception {
+
+        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
+            System.out.println("The test is applicable only to Mac OS X. Passed");
+            return;
+        }
+        try {
+            //Move the mouse out, because it could interfere with the test.
+            Robot r = new Robot();
+            r.mouseMove(0, 0);
+            sleep();
+
+            SwingUtilities.invokeAndWait(FullScreenAfterSplash::createAndShowGUI);
+            sleep();
+
+            Point fullScreenButtonPos = frame.getLocation();
+            fullScreenButtonPos.translate(frame.getWidth() - 10, 10);
+            r.mouseMove(fullScreenButtonPos.x, fullScreenButtonPos.y);
+
+            //Cant use waitForIdle for full screen transition.
+            int waitCount = 0;
+            while (!windowEnteringFullScreen) {
+                r.mousePress(InputEvent.BUTTON1_MASK);
+                r.mouseRelease(InputEvent.BUTTON1_MASK);
+                Thread.sleep(100);
+                if (waitCount++ > 10) {
+                    System.err.println("Can't enter full screen mode. Failed.");
+                    System.exit(1);
+                }
+            }
+
+            waitCount = 0;
+            while (!windowEnteredFullScreen) {
+                Thread.sleep(100);
+                if (waitCount++ > 10) {
+                    System.err.println("Can't enter full screen mode. Failed.");
+                    System.exit(1);
+                }
+            }
+        } finally {
+            if (frame != null) {
+                frame.dispose();
+            }
+        }
+    }
+
+    private static void createAndShowGUI() {
+        frame = new JFrame(" Fullscreen OSX Bug ");
+        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+        enableFullScreen(frame);
+        frame.setBounds(100, 100, 100, 100);
+        frame.pack();
+        frame.setVisible(true);
+    }
+
+    /*
+     *  Use reflection to make a test compilable on not Mac OS X
+     */
+    private static void enableFullScreen(Window window) {
+        try {
+            Class<?> fullScreenUtilities = Class.forName("com.apple.eawt.FullScreenUtilities");
+            Method setWindowCanFullScreen = fullScreenUtilities.getMethod("setWindowCanFullScreen", Window.class, boolean.class);
+            setWindowCanFullScreen.invoke(fullScreenUtilities, window, true);
+            Class fullScreenListener = Class.forName("com.apple.eawt.FullScreenListener");
+            Object listenerObject = Proxy.newProxyInstance(fullScreenListener.getClassLoader(), new Class[]{fullScreenListener}, (proxy, method, args) -> {
+                switch (method.getName()) {
+                    case "windowEnteringFullScreen":
+                        windowEnteringFullScreen = true;
+                        break;
+                    case "windowEnteredFullScreen":
+                        windowEnteredFullScreen = true;
+                        break;
+                }
+                return null;
+            });
+            Method addFullScreenListener = fullScreenUtilities.getMethod("addFullScreenListenerTo", Window.class, fullScreenListener);
+            addFullScreenListener.invoke(fullScreenUtilities, window, listenerObject);
+        } catch (Exception e) {
+            throw new RuntimeException("FullScreen utilities not available", e);
+        }
+    }
+
+    private static void sleep() {
+        try {
+            Thread.sleep(500);
+        } catch (InterruptedException ignored) { }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/SplashScreen/GenerateTestImage.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,49 @@
+/*
+* 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.
+*
+* 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.
+*/
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileOutputStream;
+
+/**
+ * A utility to generate a test image for the SplashScreen test
+ */
+public class GenerateTestImage {
+    private static final int IMAGE_SIZE = 20;
+
+    public static void main(String[] args) throws Exception {
+        String path = System.getProperty("test.classes") + File.separator + "test.png";
+
+        BufferedImage image = new BufferedImage(IMAGE_SIZE, IMAGE_SIZE, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D graphics2D = image.createGraphics();
+        graphics2D.setColor(Color.red);
+        graphics2D.fillOval(0, 0, IMAGE_SIZE, IMAGE_SIZE);
+        graphics2D.dispose();;
+
+        try(FileOutputStream fos = new FileOutputStream(path)) {
+            ImageIO.write(image, "png", fos);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TextField/SelectionInvisibleTest/SelectionInvisibleTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.Panel;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.TextField;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 8036110
+ * @author Alexander Scherbatiy
+ * @summary In TextField can only select text visible or to the left
+ * @run main SelectionInvisibleTest
+ */
+
+public class SelectionInvisibleTest {
+
+    private static final String TEXT = "One Two Three Four Five Six Seven Eight Nine ";
+    private static final String LAST_WORD = "Ten";
+
+    public static void main(String[] args) throws Exception {
+
+        Frame frame = new Frame();
+        frame.setSize(300, 200);
+        TextField textField = new TextField(TEXT + LAST_WORD, 30);
+        Panel panel = new Panel(new FlowLayout());
+        panel.add(textField);
+        frame.add(panel);
+        frame.setVisible(true);
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync();
+
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        Point point = textField.getLocationOnScreen();
+        int x = point.x + textField.getWidth() / 2;
+        int y = point.y + textField.getHeight() / 2;
+        robot.mouseMove(x, y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        toolkit.realSync();
+
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        int N = 10;
+        int dx = textField.getWidth() / N;
+        for (int i = 0; i < N; i++) {
+            x += dx;
+            robot.mouseMove(x, y);
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        toolkit.realSync();
+
+        if (!textField.getSelectedText().endsWith(LAST_WORD)) {
+            throw new RuntimeException("Last word is not selected!");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Window/AlwaysOnTop/TestAlwaysOnTopBeforeShow.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,472 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+/*
+@test
+@bug 6236247
+@summary Test that setting of always-on-top flags before showing window works
+@author dom@sparc.spb.su: area=awt.toplevel
+@run main TestAlwaysOnTopBeforeShow
+*/
+
+/**
+ * TestAlwaysOnTopBeforeShow.java
+ *
+ * summary:  Test that always-on-top works in the following situations:
+ * - when set on a window before showing
+ * - when set on a child dialog
+ * - that it doesn't generate focus event when set on an invisible window
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.concurrent.atomic.AtomicBoolean;
+import sun.awt.SunToolkit;
+
+
+//*** global search and replace TestAlwaysOnTopBeforeShow with name of the test ***
+
+public class TestAlwaysOnTopBeforeShow
+{
+
+    //*** test-writer defined static variables go here ***
+
+    private static AtomicBoolean focused = new AtomicBoolean();
+    private static AtomicBoolean pressed = new AtomicBoolean();
+    private static volatile Object pressedTarget;
+    private static void init()
+    {
+        //*** Create instructions for the user here ***
+
+        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+                public void eventDispatched(AWTEvent e) {
+                    if (e.getID() == MouseEvent.MOUSE_PRESSED) {
+                        synchronized(pressed) {
+                            pressed.set(true);
+                            pressedTarget = e.getSource();
+                            pressed.notifyAll();
+                        }
+                    }
+                }
+            }, AWTEvent.MOUSE_EVENT_MASK);
+
+        Frame f = new Frame("always-on-top");
+        f.setBounds(0, 0, 200, 200);
+        f.addFocusListener(new FocusAdapter() {
+                public void focusGained(FocusEvent e) {
+                    synchronized(focused) {
+                        focused.set(true);
+                        focused.notifyAll();
+                    }
+                }
+            });
+
+        f.setAlwaysOnTop(true);
+
+        waitForIdle(1000);
+        if (focused.get()) {
+            throw new RuntimeException("Always-on-top generated focus event");
+        }
+
+        f.setVisible(true);
+
+        waitFocused(f, focused);
+        focused.set(false);
+
+        Frame f2 = new Frame("auxilary");
+        f2.setBounds(100, 0, 200, 100);
+        f2.setVisible(true);
+        f2.toFront();
+        waitForIdle(1000);
+
+        Point location = f.getLocationOnScreen();
+        Dimension size = f.getSize();
+        checkOnTop(f, f2, location.x + size.width / 2, location.y + size.height / 2);
+
+        Dialog d = new Dialog(f, "Always-on-top");
+        d.pack();
+        d.setBounds(0, 0, 100, 100);
+
+        waitForIdle(1000);
+        checkOnTop(f, f2, location.x + size.width / 2, location.y + size.height / 2);
+        waitForIdle(1000);
+
+        focused.set(false);
+        f.setVisible(false);
+        f.setAlwaysOnTop(false);
+        waitForIdle(1000);
+        if (focused.get()) {
+            throw new RuntimeException("Always-on-top generated focus event");
+        }
+
+        TestAlwaysOnTopBeforeShow.pass();
+
+    }//End  init()
+
+    private static void waitForIdle(int mls) {
+        ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+        try {
+            Thread.sleep(mls);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+    }
+
+    static void waitFocused(Window w, AtomicBoolean b) {
+        try {
+            synchronized(b) {
+                if (w.isFocusOwner()) {
+                    return;
+                }
+                b.wait(3000);
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        if (!w.isFocusOwner()) {
+            throw new RuntimeException("Can't make " + w + " focus owner");
+        }
+    }
+
+    static void checkOnTop(Window ontop, Window under, int x, int y) {
+        under.toFront();
+        try {
+            Robot robot = new Robot();
+            robot.mouseMove(x, y);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            synchronized(pressed) {
+                if (pressed.get()) {
+                    if (pressedTarget != ontop) {
+                        throw new RuntimeException("Pressed at wrong location: " + pressedTarget);
+                    }
+                } else {
+                    pressed.wait(5000);
+                }
+            }
+            if (!pressed.get() || pressedTarget != ontop) {
+                throw new RuntimeException("Pressed at wrong location: " + pressedTarget);
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /*****************************************************
+     * Standard Test Machinery Section
+     * DO NOT modify anything in this section -- it's a
+     * standard chunk of code which has all of the
+     * synchronisation necessary for the test harness.
+     * By keeping it the same in all tests, it is easier
+     * to read and understand someone else's test, as
+     * well as insuring that all tests behave correctly
+     * with the test harness.
+     * There is a section following this for test-
+     * classes
+     ******************************************************/
+    private static boolean theTestPassed = false;
+    private static boolean testGeneratedInterrupt = false;
+    private static String failureMessage = "";
+
+    private static Thread mainThread = null;
+
+    private static int sleepTime = 300000;
+
+    // Not sure about what happens if multiple of this test are
+    //  instantiated in the same VM.  Being static (and using
+    //  static vars), it aint gonna work.  Not worrying about
+    //  it for now.
+    public static void main( String args[] ) throws InterruptedException
+    {
+        mainThread = Thread.currentThread();
+        try
+        {
+            init();
+        }
+        catch( TestPassedException e )
+        {
+            //The test passed, so just return from main and harness will
+            // interepret this return as a pass
+            return;
+        }
+        //At this point, neither test pass nor test fail has been
+        // called -- either would have thrown an exception and ended the
+        // test, so we know we have multiple threads.
+
+        //Test involves other threads, so sleep and wait for them to
+        // called pass() or fail()
+        try
+        {
+            Thread.sleep( sleepTime );
+            //Timed out, so fail the test
+            throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
+        }
+        catch (InterruptedException e)
+        {
+            //The test harness may have interrupted the test.  If so, rethrow the exception
+            // so that the harness gets it and deals with it.
+            if( ! testGeneratedInterrupt ) throw e;
+
+            //reset flag in case hit this code more than once for some reason (just safety)
+            testGeneratedInterrupt = false;
+
+            if ( theTestPassed == false )
+            {
+                throw new RuntimeException( failureMessage );
+            }
+        }
+
+    }//main
+
+    public static synchronized void setTimeoutTo( int seconds )
+    {
+        sleepTime = seconds * 1000;
+    }
+
+    public static synchronized void pass()
+    {
+        Sysout.println( "The test passed." );
+        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
+        //first check if this is executing in main thread
+        if ( mainThread == Thread.currentThread() )
+        {
+            //Still in the main thread, so set the flag just for kicks,
+            // and throw a test passed exception which will be caught
+            // and end the test.
+            theTestPassed = true;
+            throw new TestPassedException();
+        }
+        theTestPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }//pass()
+
+    public static synchronized void fail()
+    {
+        //test writer didn't specify why test failed, so give generic
+        fail( "it just plain failed! :-)" );
+    }
+
+    public static synchronized void fail( String whyFailed )
+    {
+        Sysout.println( "The test failed: " + whyFailed );
+        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
+        //check if this called from main thread
+        if ( mainThread == Thread.currentThread() )
+        {
+            //If main thread, fail now 'cause not sleeping
+            throw new RuntimeException( whyFailed );
+        }
+        theTestPassed = false;
+        testGeneratedInterrupt = true;
+        failureMessage = whyFailed;
+        mainThread.interrupt();
+    }//fail()
+
+}// class TestAlwaysOnTopBeforeShow
+
+//This exception is used to exit from any level of call nesting
+// when it's determined that the test has passed, and immediately
+// end the test.
+class TestPassedException extends RuntimeException
+{
+}
+
+//*********** End Standard Test Machinery Section **********
+
+
+//************ Begin classes defined for the test ****************
+
+// if want to make listeners, here is the recommended place for them, then instantiate
+//  them in init()
+
+/* Example of a class which may be written as part of a test
+class NewClass implements anInterface
+ {
+   static int newVar = 0;
+
+   public void eventDispatched(AWTEvent e)
+    {
+      //Counting events to see if we get enough
+      eventCount++;
+
+      if( eventCount == 20 )
+       {
+         //got enough events, so pass
+
+         TestAlwaysOnTopBeforeShow.pass();
+       }
+      else if( tries == 20 )
+       {
+         //tried too many times without getting enough events so fail
+
+         TestAlwaysOnTopBeforeShow.fail();
+       }
+
+    }// eventDispatched()
+
+ }// NewClass class
+
+*/
+
+
+//************** End classes defined for the test *******************
+
+
+
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+{
+    private static TestDialog dialog;
+
+    public static void createDialogWithInstructions( String[] instructions )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        dialog.printInstructions( instructions );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+    public static void createDialog( )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        String[] defInstr = { "Instructions will appear here. ", "" } ;
+        dialog.printInstructions( defInstr );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+
+    public static void printInstructions( String[] instructions )
+    {
+        dialog.printInstructions( instructions );
+    }
+
+
+    public static void println( String messageIn )
+    {
+        System.out.println(messageIn);
+    }
+
+}// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+{
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog( Frame frame, String name )
+    {
+        super( frame, name );
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+        add( "North", instructionsText );
+
+        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+        add("Center", messageText);
+
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions( String[] instructions )
+    {
+        //Clear out any current instructions
+        instructionsText.setText( "" );
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for( int i=0; i < instructions.length; i++ )
+        {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[ i ];
+            while( remainingStr.length() > 0 )
+            {
+                //if longer than max then chop off first max chars to print
+                if( remainingStr.length() >= maxStringLength )
+                {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.
+                        lastIndexOf( ' ', maxStringLength - 1 );
+
+                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
+                    remainingStr = remainingStr.substring( posOfSpace + 1 );
+                }
+                //else just print
+                else
+                {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append( printStr + "\n" );
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage( String messageIn )
+    {
+        messageText.append( messageIn + "\n" );
+        System.out.println(messageIn);
+    }
+
+}// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/EqualsHashCodeSymmetryTest/EqualsHashCodeSymmetryTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import java.awt.datatransfer.DataFlavor;
+
+/**
+ * @test
+ * @bug 8038999
+ * @summary DataFlavor.equals is not symmetric
+ * @author Petr Pchelko <petr.pchelko@oracle.com>
+ */
+public class EqualsHashCodeSymmetryTest {
+
+    private static final DataFlavor[] dataFlavors = {
+            DataFlavor.stringFlavor,
+            DataFlavor.imageFlavor,
+            DataFlavor.javaFileListFlavor,
+            DataFlavor.allHtmlFlavor,
+            DataFlavor.selectionHtmlFlavor,
+            DataFlavor.fragmentHtmlFlavor,
+            createFlavor("text/html; class=java.lang.String"),
+            new DataFlavor(String.class, "My test flavor number 1"),
+            new DataFlavor(String.class, "My test flavor number 2"),
+            new DataFlavor(StringBuilder.class, "My test flavor number 1")
+    };
+
+    public static void main(String[] args) {
+        testEqualsSymmetry();
+        testEqualsHashCodeConsistency();
+        testSimpleCollision();
+    }
+
+    private static void testEqualsSymmetry() {
+        for (DataFlavor flavor1 : dataFlavors) {
+            for (DataFlavor flavor2 : dataFlavors) {
+                if (flavor1.equals(flavor2) != flavor2.equals(flavor1)) {
+                    throw new RuntimeException(
+                            String.format("Equals is not symmetric for %s and %s", flavor1, flavor2));
+                }
+            }
+        }
+    }
+
+    private static void testEqualsHashCodeConsistency() {
+        for (DataFlavor flavor1 : dataFlavors) {
+            for (DataFlavor flavor2 : dataFlavors) {
+                if ((flavor1.equals(flavor2) && flavor1.hashCode() != flavor2.hashCode())) {
+                    throw new RuntimeException(
+                            String.format("Equals and hash code not consistent for %s and %s", flavor1, flavor2));
+                }
+            }
+        }
+    }
+
+    private static void testSimpleCollision() {
+        if (createFlavor("text/html; class=java.lang.String").hashCode() == DataFlavor.allHtmlFlavor.hashCode()) {
+            throw new RuntimeException("HashCode collision because the document parameter is not used");
+        }
+    }
+
+    private static DataFlavor createFlavor(String mime) {
+        try {
+            return new DataFlavor(mime);
+        } catch (ClassNotFoundException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.html	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,48 @@
+<!--
+ Copyright (c) 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.
+
+ 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.
+-->
+
+<html>
+<!--  
+  @test
+  @bug 6887703
+  @summary Unsigned applet can retrieve the dragged information before drop action occurs
+  @author : area=dnd
+  @library ../../regtesthelpers
+  @library ../../regtesthelpers/process
+  @build Util
+  @build ProcessResults ProcessCommunicator 
+  @run applet/othervm DragInterceptorAppletTest.html
+
+-->
+<head>
+<title> Unsigned applet can retrieve the dragged information before drop action occurs </title>
+</head>
+<body>
+
+<h1>DragInterceptorAppletTest<br>Bug ID: 6887703</h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="DragInterceptorAppletTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2007, 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.
+ *
+ * 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.
+ */
+
+/*
+  test
+  @bug 6887703
+  @summary Unsigned applet can retrieve the dragged information before drop action occurs
+  @author : area=dnd
+  @run applet DragInterceptorAppletTest.html
+*/
+
+/**
+ * DragInterceptorAppletTest.java
+ *
+ * summary: Unsigned applet can retrieve the dragged information before drop action occurs
+ */
+
+import static java.lang.Thread.sleep;
+
+import test.java.awt.regtesthelpers.process.ProcessCommunicator;
+import test.java.awt.regtesthelpers.process.ProcessResults;
+import test.java.awt.regtesthelpers.Util;
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.InputEvent;
+
+public class DragInterceptorAppletTest extends Applet {
+
+    public void init() {
+        setLayout(new BorderLayout());
+    }//End  init()
+
+    public void start() {
+
+        SourceFrame sourceFrame = new SourceFrame();
+
+        Util.waitForIdle(null);
+
+        String [] args = new String [] {
+            String.valueOf(sourceFrame.getNextLocationX()),
+            String.valueOf(sourceFrame.getNextLocationY()),
+            String.valueOf(sourceFrame.getDragSourcePointX()),
+            String.valueOf(sourceFrame.getDragSourcePointY()),
+        };
+        String classpath = System.getProperty("java.class.path");
+        ProcessResults processResults =
+            ProcessCommunicator.executeChildProcess(this.getClass(),classpath,args);
+
+        verifyTestResults(processResults);
+
+    }// start()
+
+    private static void verifyTestResults(ProcessResults processResults) {
+
+    switch (processResults.getExitValue()) {
+        case InterprocessMessages.DATA_WAS_INTERCEPTED_AND_EXCEPTION_HANDLER_WAS_NOT_TRIGGERED:
+            processResults.printProcessErrorOutput(System.err);
+            throw new RuntimeException("TEST IS FAILED: Target applet can intercept data " +
+                    "without a clipboard permission and an exception handler was not triggered.");
+            //Unreachable...
+
+        case InterprocessMessages.DATA_WAS_INTERCEPTED:
+            processResults.printProcessErrorOutput(System.err);
+            throw new RuntimeException("TEST IS FAILED: Target applet can intercept data " +
+                    "without a clipboard permission");
+            //Unreachable...
+
+        case InterprocessMessages.EXCEPTION_HANDLER_WAS_NOT_TRIGGERED:
+            processResults.printProcessErrorOutput(System.err);
+            throw new RuntimeException("TEST IS FAILED: An exception handler was not triggered.");
+            //Unreachable...
+
+    }
+
+        //    The child process throws an exception. do not look at the stderr.
+        processResults.verifyStdErr(System.err);
+        processResults.verifyProcessExitValue(System.err);
+        processResults.printProcessStandartOutput(System.out);
+    }
+
+    //We cannot make an instance of the applet without the default constructor
+    public DragInterceptorAppletTest() {
+        super();
+    }
+
+    //We need in this constructor to pass frame position between JVMs
+    public DragInterceptorAppletTest(Point targetFrameLocation, Point dragSourcePoint)
+            throws InterruptedException
+    {
+        DragInterceptorFrame targetFrame = new DragInterceptorFrame(targetFrameLocation);
+
+        Util.waitForIdle(null);
+
+        final Robot robot = Util.createRobot();
+
+        robot.mouseMove((int)dragSourcePoint.getX(),(int)dragSourcePoint.getY());
+        sleep(100);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        sleep(100);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        sleep(100);
+
+        Util.drag(robot, dragSourcePoint, targetFrame.getDropTargetPoint(),
+                InputEvent.BUTTON1_MASK);
+
+        sleep(2000);
+        ProcessCommunicator.destroyProcess();
+    }
+
+    enum InterprocessArguments {
+        TARGET_FRAME_X_POSITION_ARGUMENT,
+        TARGET_FRAME_Y_POSITION_ARGUMENT,
+        DRAG_SOURCE_POINT_X_ARGUMENT,
+        DRAG_SOURCE_POINT_Y_ARGUMENT;
+
+        int extract (String [] args) {
+            return Integer.parseInt(args[this.ordinal()]);
+        }
+    }
+
+    public static void main (String [] args) {
+        Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args),
+                InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args));
+        Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args),
+                InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args));
+        try {
+            new DragInterceptorAppletTest(targetFrameLocation, dragSourcePoint);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    }
+
+}// class DragInterceptorAppletTest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/DragInterceptorAppletTest/DragInterceptorFrame.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2007, 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.
+ *
+ * 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.
+ */
+
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.dnd.*;
+import java.io.IOException;
+import java.security.Permission;
+import java.security.AccessControlException;
+
+class DragInterceptorFrame extends Frame implements DropTargetListener {
+
+    private static int exitMessage = InterprocessMessages.TEST_PASSED;
+    private static boolean dataIsAccessible = false;
+    private static boolean exceptionHasBeenThrown = false;
+
+    DragInterceptorFrame(Point location) {
+        System.setSecurityManager(new ClipboardDefender());
+        initGUI(location);
+        setDropTarget(new DropTarget(this, DnDConstants.ACTION_COPY,
+                this));
+    }
+
+    private void initGUI(Point location) {
+        this.setLocation(location);
+        this.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {
+                DragInterceptorFrame.this.dispose();
+            }
+        });
+        setSize (200, 200);
+        this.setVisible(true);
+    }
+
+    public void dragEnter(DropTargetDragEvent dtde) {
+        // We want to set the exception handler on EDT
+        Thread.currentThread().setUncaughtExceptionHandler (
+            new Thread.UncaughtExceptionHandler() {
+                public void uncaughtException(Thread t, Throwable e) {
+                    exceptionHasBeenThrown = true;
+                }
+            }
+        );
+        examineTransferable(dtde);
+    }
+
+    public void dragOver(DropTargetDragEvent dtde) {
+        examineTransferable(dtde);
+    }
+
+    public void dropActionChanged(DropTargetDragEvent dtde) {
+        examineTransferable(dtde);
+    }
+
+    public void dragExit(DropTargetEvent dte) {}
+
+    public void drop(DropTargetDropEvent dtde) {
+
+        if (dataIsAccessible && !exceptionHasBeenThrown) {
+            exitMessage = InterprocessMessages.DATA_WAS_INTERCEPTED_AND_EXCEPTION_HANDLER_WAS_NOT_TRIGGERED;
+        } else if (dataIsAccessible) {
+            exitMessage = InterprocessMessages.DATA_WAS_INTERCEPTED;
+        } else if (!exceptionHasBeenThrown) {
+            exitMessage = InterprocessMessages.EXCEPTION_HANDLER_WAS_NOT_TRIGGERED;
+        }
+
+        // This returns the diagnostic code from the child VM
+        System.exit(exitMessage);
+    }
+
+    Point getDropTargetPoint() {
+        return new Point((int)getLocationOnScreen().getX()+(getWidth()/2),
+                (int)getLocationOnScreen().getY()+(getHeight()/2));
+    }
+
+    private void examineTransferable(DropTargetDragEvent dtde) {
+        if (dtde.getCurrentDataFlavorsAsList().contains(DataFlavor.stringFlavor)) {
+            dtde.acceptDrag(DnDConstants.ACTION_COPY);
+            try{
+                if (null != dtde.getTransferable().getTransferData(DataFlavor.stringFlavor)) {
+                    dataIsAccessible = true;
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+                exitMessage = InterprocessMessages.UNEXPECTED_IO_EXCEPTION;
+            } catch (UnsupportedFlavorException e) {
+                e.printStackTrace();
+                exitMessage = InterprocessMessages.UNEXPECTED_UNSUPPORTED_FLAVOR_EXCEPTION;
+            }
+        }
+    }
+
+    static class ClipboardDefender extends SecurityManager {
+        public void checkPermission(Permission p) {
+           if (p instanceof java.awt.AWTPermission &&
+                   p.getName().equals("accessClipboard")) {
+               throw new AccessControlException("access denied ");
+           }
+        }
+    }
+
+    public static void main(String[] args) {
+        new DragInterceptorFrame(new Point(200,200));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/DragInterceptorAppletTest/InterprocessMessages.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2007, 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.
+ *
+ * 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.
+ */
+
+public interface InterprocessMessages {
+    final static int TEST_PASSED = 0;
+    final static int DATA_WAS_INTERCEPTED = 212;
+    final static int EXCEPTION_HANDLER_WAS_NOT_TRIGGERED = 213;
+    final static int DATA_WAS_INTERCEPTED_AND_EXCEPTION_HANDLER_WAS_NOT_TRIGGERED  = 214;
+
+    final static int UNEXPECTED_IO_EXCEPTION = 400;
+    final static int UNEXPECTED_UNSUPPORTED_FLAVOR_EXCEPTION = 401;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/DragInterceptorAppletTest/SourceFrame.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 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.
+ *
+ * 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.
+ */
+
+import test.java.awt.regtesthelpers.Util;
+
+import java.awt.*;
+import java.awt.datatransfer.StringSelection;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+
+class SourceFrame extends Frame implements DragGestureListener {
+
+    SourceFrame() {
+        super("Source File List Frame");
+        initGUI();
+        new DragSource().createDefaultDragGestureRecognizer(this,
+                DnDConstants.ACTION_COPY,this);
+    }
+
+    private void initGUI() {
+        this.addWindowListener(Util.getClosingWindowAdapter());
+        this.setLocation(300,250);
+        this.setSize(200,200);
+        this.setVisible(true);
+    }
+
+    int getNextLocationX() {
+        return getX()+getWidth();
+    }
+
+    int getNextLocationY() {
+        return getY();
+    }
+
+    int getDragSourcePointX() {
+        return (int)getLocationOnScreen().getX()+(getWidth()/2);
+    }
+
+   int getDragSourcePointY() {
+        return (int)getLocationOnScreen().getY()+ (getHeight()/2);
+    }
+
+    public void dragGestureRecognized(DragGestureEvent dge) {
+        dge.startDrag(null, new StringSelection("A TEXT"));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/DragSourceListenerSerializationTest/DragSourceListenerSerializationTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug 4422345 8039083
+  @summary tests serialization of DragSourceListeners
+  @author das@sparc.spb.su area=dnd
+  @library ../../../../lib/testlibrary
+  @build jdk.testlibrary.Asserts
+  @run main/othervm DragSourceListenerSerializationTest
+*/
+
+import java.awt.Button;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureRecognizer;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceAdapter;
+import java.awt.dnd.DragSourceContext;
+import java.awt.dnd.DragSourceListener;
+import java.awt.dnd.DragSourceMotionListener;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseEvent;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.TooManyListenersException;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static jdk.testlibrary.Asserts.assertEquals;
+
+public class DragSourceListenerSerializationTest {
+    public static void main(String[] args) throws Exception {
+        DragSource ds = new DragSource();
+        TestDragSourceAdapter dsa1 = new TestDragSourceAdapter(1);
+        TestDragSourceAdapter dsa2 = new TestDragSourceAdapter(2);
+        Component c = new Button();
+        DragGestureRecognizer dgr = ds.createDefaultDragGestureRecognizer(c,
+                DnDConstants.ACTION_COPY,
+                e -> e.startDrag(null, null));
+        MouseEvent me = new MouseEvent(c, MouseEvent.MOUSE_PRESSED, 0,
+                InputEvent.CTRL_MASK, 100, 100, 0, false);
+        DragGestureEvent dge = new DragGestureEvent(dgr, DnDConstants.ACTION_COPY,
+                new Point(100, 100),
+                Arrays.asList(me));
+        DragSourceContext dsc = new DragSourceContext(
+                Toolkit.getDefaultToolkit().createDragSourceContextPeer(dge),
+                dge,
+                new Cursor(Cursor.HAND_CURSOR),
+                null, null, new StringSelection("TEXT"), null);
+
+        ds.addDragSourceListener(dsa1);
+        ds.addDragSourceListener(dsa2);
+        ds.addDragSourceListener(dsa2);
+        ds.addDragSourceMotionListener(dsa1);
+        ds.addDragSourceMotionListener(dsa1);
+        ds.addDragSourceMotionListener(dsa2);
+        dsc.addDragSourceListener(dsa2);
+
+        byte[] serialized;
+        try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
+             ObjectOutputStream oos = new ObjectOutputStream(bos)) {
+            oos.writeObject(dsc);
+            serialized = bos.toByteArray();
+        }
+
+        DragSourceContext dsc_copy;
+        try (ByteArrayInputStream bis = new ByteArrayInputStream(serialized);
+             ObjectInputStream ois = new ObjectInputStream(bis)) {
+            dsc_copy = (DragSourceContext) ois.readObject();
+        }
+
+        try {
+            dsc_copy.addDragSourceListener(dsa1);
+            throw new RuntimeException("Test failed. Listener addition succeeded");
+        } catch (TooManyListenersException ignored) {
+        }
+
+        try {
+            dsc_copy.addDragSourceListener(dsa2);
+            throw new RuntimeException("Test failed. Listener addition succeeded");
+        } catch (TooManyListenersException ignored) {
+        }
+
+        try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
+             ObjectOutputStream oos = new ObjectOutputStream(bos)) {
+            oos.writeObject(ds);
+            serialized = bos.toByteArray();
+        }
+
+        DragSource ds_copy;
+        try (ByteArrayInputStream bis = new ByteArrayInputStream(serialized);
+             ObjectInputStream ois = new ObjectInputStream(bis)) {
+             ds_copy = (DragSource) ois.readObject();
+        }
+
+        DragSourceListener[] dsls = ds_copy.getDragSourceListeners();
+        assertEquals(3, dsls.length, "DragSourceListeners number");
+        assertEquals(1, Stream.of(dsls).filter(dsa1::equals).collect(Collectors.counting()).intValue());
+        assertEquals(2, Stream.of(dsls).filter(dsa2::equals).collect(Collectors.counting()).intValue());
+
+        DragSourceMotionListener[] dsmls = ds_copy.getDragSourceMotionListeners();
+        assertEquals(3, dsmls.length, "DragSourceMotionListeners number");
+        assertEquals(2, Stream.of(dsmls).filter(dsa1::equals).collect(Collectors.counting()).intValue());
+        assertEquals(1, Stream.of(dsmls).filter(dsa2::equals).collect(Collectors.counting()).intValue());
+    }
+}
+
+class TestDragSourceAdapter extends DragSourceAdapter implements Serializable {
+    final int id;
+
+    TestDragSourceAdapter(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public boolean equals(Object obj) {
+        if (obj instanceof TestDragSourceAdapter) {
+            TestDragSourceAdapter tdsa = (TestDragSourceAdapter) obj;
+            return tdsa.getId() == getId();
+        }
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.html	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,43 @@
+<!--
+ Copyright (c) 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.
+
+ 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.
+-->
+
+<html>
+<!--  
+  @test
+  @bug 4658741
+  @summary verifies that getDropSuccess() returns correct value for inter-JVM DnD
+  @author das@sparc.spb.su area=dnd
+  @run applet InterJVMGetDropSuccessTest.html
+  -->
+<head>
+<title>  </title>
+</head>
+<body>
+
+<h1>InterJVMGetDropSuccessTest<br>Bug ID: 4658741</h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="InterJVMGetDropSuccessTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,499 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+  test
+  @bug 4658741
+  @summary verifies that getDropSuccess() returns correct value for inter-JVM DnD
+  @author das@sparc.spb.su area=dnd
+  @run applet InterJVMGetDropSuccessTest.html
+*/
+
+// Note there is no @ in front of test above.  This is so that the
+//  harness will not mistake this file as a test file.  It should
+//  only see the html file as a test file. (the harness runs all
+//  valid test files, so it would run this test twice if this file
+//  were valid as well as the html file.)
+// Also, note the area= after Your Name in the author tag.  Here, you
+//  should put which functional area the test falls in.  See the
+//  AWT-core home page -> test areas and/or -> AWT team  for a list of
+//  areas.
+// Note also the 'InterJVMGetDropSuccessTest.html' in the run tag.  This should
+//  be changed to the name of the test.
+
+
+/**
+ * InterJVMGetDropSuccessTest.java
+ *
+ * summary: verifies that getDropSuccess() returns correct value for inter-JVM DnD
+ */
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.datatransfer.*;
+import java.awt.dnd.*;
+import java.awt.event.*;
+import java.io.*;
+import javax.swing.*;
+
+
+//Automated tests should run as applet tests if possible because they
+// get their environments cleaned up, including AWT threads, any
+// test created threads, and any system resources used by the test
+// such as file descriptors.  (This is normally not a problem as
+// main tests usually run in a separate VM, however on some platforms
+// such as the Mac, separate VMs are not possible and non-applet
+// tests will cause problems).  Also, you don't have to worry about
+// synchronisation stuff in Applet tests they way you do in main
+// tests...
+
+
+public class InterJVMGetDropSuccessTest extends Applet {
+
+    private int returnCode = Util.CODE_NOT_RETURNED;
+    private boolean successCodes[] = { true, false };
+    private int dropCount = 0;
+
+    final Frame frame = new Frame("Target Frame");
+
+    final DropTargetListener dropTargetListener = new DropTargetAdapter() {
+            public void drop(DropTargetDropEvent dtde) {
+                dtde.acceptDrop(DnDConstants.ACTION_COPY);
+                dtde.dropComplete(successCodes[dropCount]);
+                dropCount++;
+            }
+        };
+    final DropTarget dropTarget = new DropTarget(frame, dropTargetListener);
+
+    public void init() {
+        //Create instructions for the user here, as well as set up
+        // the environment -- set the layout manager, add buttons,
+        // etc.
+
+        String[] instructions =
+        {
+            "This is an AUTOMATIC test",
+            "simply wait until it is done"
+        };
+        Sysout.createDialog( );
+        Sysout.printInstructions( instructions );
+
+        frame.setTitle("Test frame");
+        frame.setBounds(100, 100, 150, 150);
+    } // init()
+
+    public void start() {
+
+        frame.setVisible(true);
+
+        try {
+            Thread.sleep(Util.FRAME_ACTIVATION_TIMEOUT);
+
+            Point p = frame.getLocationOnScreen();
+            Dimension d = frame.getSize();
+
+            String javaPath = System.getProperty("java.home", "");
+            String command = javaPath + File.separator + "bin" +
+                File.separator + "java -cp " + System.getProperty("test.classes", ".") +
+                " Child " +
+                p.x + " " + p.y + " " + d.width + " " + d.height;
+
+            Process process = Runtime.getRuntime().exec(command);
+            returnCode = process.waitFor();
+
+            InputStream errorStream = process.getErrorStream();
+            int count = errorStream.available();
+            if (count > 0) {
+                byte[] b = new byte[count];
+                errorStream.read(b);
+                System.err.println("========= Child VM System.err ========");
+                System.err.print(new String(b));
+                System.err.println("======================================");
+            }
+
+            InputStream outputStream = process.getInputStream();
+            count = outputStream.available();
+            if (count > 0) {
+                byte[] b = new byte[count];
+                outputStream.read(b);
+                System.err.println("========= Child VM System.out ========");
+                System.err.print(new String(b));
+                System.err.println("======================================");
+            }
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        switch (returnCode) {
+        case Util.CODE_NOT_RETURNED:
+            throw new RuntimeException("Child VM: failed to start");
+        case Util.CODE_FAILURE:
+            throw new RuntimeException("Child VM: abnormal termination");
+        default:
+            if (dropCount == 2) {
+                int expectedRetCode = 0;
+                if (successCodes[0]) {
+                    expectedRetCode |= Util.CODE_FIRST_SUCCESS;
+                }
+                if (successCodes[1]) {
+                    expectedRetCode |= Util.CODE_SECOND_SUCCESS;
+                }
+                if (expectedRetCode != returnCode) {
+                    throw new RuntimeException("The test failed. Expected:" +
+                                               expectedRetCode + ". Returned:" +
+                                               returnCode);
+                }
+            }
+            break;
+        }
+    } // start()
+} // class InterJVMGetDropSuccessTest
+
+final class Util implements AWTEventListener {
+    public static final int CODE_NOT_RETURNED = -1;
+    public static final int CODE_FIRST_SUCCESS = 0x2;
+    public static final int CODE_SECOND_SUCCESS = 0x2;
+    public static final int CODE_FAILURE = 0x1;
+
+    public static final int FRAME_ACTIVATION_TIMEOUT = 3000;
+
+    static final Object SYNC_LOCK = new Object();
+    static final int MOUSE_RELEASE_TIMEOUT = 1000;
+
+    static final Util theInstance = new Util();
+
+    static {
+        Toolkit.getDefaultToolkit().addAWTEventListener(theInstance, AWTEvent.MOUSE_EVENT_MASK);
+    }
+
+    public static Point getCenterLocationOnScreen(Component c) {
+        Point p = c.getLocationOnScreen();
+        Dimension d = c.getSize();
+        p.translate(d.width / 2, d.height / 2);
+        return p;
+    }
+
+    public static int sign(int n) {
+        return n < 0 ? -1 : n == 0 ? 0 : 1;
+    }
+
+    private Component clickedComponent = null;
+
+    private void reset() {
+        clickedComponent = null;
+    }
+
+    public void eventDispatched(AWTEvent e) {
+        if (e.getID() == MouseEvent.MOUSE_RELEASED) {
+            clickedComponent = (Component)e.getSource();
+            synchronized (SYNC_LOCK) {
+                SYNC_LOCK.notifyAll();
+            }
+        }
+    }
+
+    public static boolean pointInComponent(Robot robot, Point p, Component comp)
+      throws InterruptedException {
+        return theInstance.pointInComponentImpl(robot, p, comp);
+    }
+
+    private boolean pointInComponentImpl(Robot robot, Point p, Component comp)
+      throws InterruptedException {
+        robot.waitForIdle();
+        reset();
+        robot.mouseMove(p.x, p.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        synchronized (SYNC_LOCK) {
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            SYNC_LOCK.wait(MOUSE_RELEASE_TIMEOUT);
+        }
+
+        Component c = clickedComponent;
+
+        while (c != null && c != comp) {
+            c = c.getParent();
+        }
+
+        return c == comp;
+    }
+}
+
+class Child {
+    static class DragSourceDropListener extends DragSourceAdapter {
+        private boolean finished = false;
+        private boolean dropSuccess = false;
+
+        public void reset() {
+            finished = false;
+            dropSuccess = false;
+        }
+
+        public boolean isDropFinished() {
+            return finished;
+        }
+
+        public boolean getDropSuccess() {
+            return dropSuccess;
+        }
+
+        public void dragDropEnd(DragSourceDropEvent dsde) {
+            finished = true;
+            dropSuccess = dsde.getDropSuccess();
+            synchronized (Util.SYNC_LOCK) {
+                Util.SYNC_LOCK.notifyAll();
+            }
+        }
+    }
+
+    final Frame frame = new Frame("Source Frame");
+    final DragSource dragSource = DragSource.getDefaultDragSource();
+    final DragSourceDropListener dragSourceListener = new DragSourceDropListener();
+    final Transferable transferable = new StringSelection("TEXT");
+    final DragGestureListener dragGestureListener = new DragGestureListener() {
+            public void dragGestureRecognized(DragGestureEvent dge) {
+                dge.startDrag(null, transferable, dragSourceListener);
+            }
+        };
+    final DragGestureRecognizer dragGestureRecognizer =
+        dragSource.createDefaultDragGestureRecognizer(frame, DnDConstants.ACTION_COPY,
+                                                      dragGestureListener);
+
+    public static void main(String[] args) {
+        Child child = new Child();
+        child.run(args);
+    }
+
+    public void run(String[] args) {
+        try {
+            if (args.length != 4) {
+                throw new RuntimeException("Incorrect command line arguments.");
+            }
+
+            int x = Integer.parseInt(args[0]);
+            int y = Integer.parseInt(args[1]);
+            int w = Integer.parseInt(args[2]);
+            int h = Integer.parseInt(args[3]);
+
+            frame.setBounds(300, 200, 150, 150);
+            frame.setVisible(true);
+
+            Thread.sleep(Util.FRAME_ACTIVATION_TIMEOUT);
+
+            Point sourcePoint = Util.getCenterLocationOnScreen(frame);
+
+            Point targetPoint = new Point(x + w / 2, y + h / 2);
+
+            Robot robot = new Robot();
+            robot.mouseMove(sourcePoint.x, sourcePoint.y);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            for (Point p = new Point(sourcePoint); !p.equals(targetPoint);
+                 p.translate(Util.sign(targetPoint.x - p.x),
+                             Util.sign(targetPoint.y - p.y))) {
+                robot.mouseMove(p.x, p.y);
+                Thread.sleep(50);
+            }
+
+            synchronized (Util.SYNC_LOCK) {
+                robot.mouseRelease(InputEvent.BUTTON1_MASK);
+                Util.SYNC_LOCK.wait(Util.FRAME_ACTIVATION_TIMEOUT);
+            }
+
+            if (!dragSourceListener.isDropFinished()) {
+                throw new RuntimeException("Drop not finished");
+            }
+
+            boolean success1 = dragSourceListener.getDropSuccess();
+
+            dragSourceListener.reset();
+            robot.mouseMove(sourcePoint.x, sourcePoint.y);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            for (Point p = new Point(sourcePoint); !p.equals(targetPoint);
+                 p.translate(Util.sign(targetPoint.x - p.x),
+                             Util.sign(targetPoint.y - p.y))) {
+                robot.mouseMove(p.x, p.y);
+                Thread.sleep(50);
+            }
+
+            synchronized (Util.SYNC_LOCK) {
+                robot.mouseRelease(InputEvent.BUTTON1_MASK);
+                Util.SYNC_LOCK.wait(Util.FRAME_ACTIVATION_TIMEOUT);
+            }
+
+            if (!dragSourceListener.isDropFinished()) {
+                throw new RuntimeException("Drop not finished");
+            }
+
+            boolean success2 = dragSourceListener.getDropSuccess();
+            int retCode = 0;
+
+            if (success1) {
+                retCode |= Util.CODE_FIRST_SUCCESS;
+            }
+            if (success2) {
+                retCode |= Util.CODE_SECOND_SUCCESS;
+            }
+            // This returns the diagnostic code from the child VM
+            System.exit(retCode);
+        } catch (Throwable e) {
+            e.printStackTrace();
+            // This returns the diagnostic code from the child VM
+            System.exit(Util.CODE_FAILURE);
+        }
+    } // run()
+} // class child
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+ {
+   private static TestDialog dialog;
+
+   public static void createDialogWithInstructions( String[] instructions )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      dialog.printInstructions( instructions );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+   public static void createDialog( )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      String[] defInstr = { "Instructions will appear here. ", "" } ;
+      dialog.printInstructions( defInstr );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+
+   public static void printInstructions( String[] instructions )
+    {
+      dialog.printInstructions( instructions );
+    }
+
+
+   public static void println( String messageIn )
+    {
+      dialog.displayMessage( messageIn );
+    }
+
+ }// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+ {
+
+   TextArea instructionsText;
+   TextArea messageText;
+   int maxStringLength = 80;
+
+   //DO NOT call this directly, go through Sysout
+   public TestDialog( Frame frame, String name )
+    {
+      super( frame, name );
+      int scrollBoth = TextArea.SCROLLBARS_BOTH;
+      instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+      add( "North", instructionsText );
+
+      messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+      add("South", messageText);
+
+      pack();
+
+      show();
+    }// TestDialog()
+
+   //DO NOT call this directly, go through Sysout
+   public void printInstructions( String[] instructions )
+    {
+      //Clear out any current instructions
+      instructionsText.setText( "" );
+
+      //Go down array of instruction strings
+
+      String printStr, remainingStr;
+      for( int i=0; i < instructions.length; i++ )
+       {
+         //chop up each into pieces maxSringLength long
+         remainingStr = instructions[ i ];
+         while( remainingStr.length() > 0 )
+          {
+            //if longer than max then chop off first max chars to print
+            if( remainingStr.length() >= maxStringLength )
+             {
+               //Try to chop on a word boundary
+               int posOfSpace = remainingStr.
+                  lastIndexOf( ' ', maxStringLength - 1 );
+
+               if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+               printStr = remainingStr.substring( 0, posOfSpace + 1 );
+               remainingStr = remainingStr.substring( posOfSpace + 1 );
+             }
+            //else just print
+            else
+             {
+               printStr = remainingStr;
+               remainingStr = "";
+             }
+
+            instructionsText.append( printStr + "\n" );
+
+          }// while
+
+       }// for
+
+    }//printInstructions()
+
+   //DO NOT call this directly, go through Sysout
+   public void displayMessage( String messageIn )
+    {
+      messageText.append( messageIn + "\n" );
+    }
+
+ }// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.html	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,45 @@
+<!--
+ Copyright (c) 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.
+
+ 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.
+-->
+
+<html>
+<!--  
+  @test
+  @bug 4870762
+  @summary tests that a drop target JVM doesn't crash if the source doesn't export 
+           data in native formats.
+  @author das@sparc.spb.su area=dnd
+  @run applet NoFormatsCrashTest.html
+  -->
+<head>
+<title>  </title>
+</head>
+<body>
+
+<h1>NoFormatsCrashTest<br>Bug ID: 4870762</h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="NoFormatsCrashTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,488 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+  test
+  @bug 4870762
+  @summary tests that a drop target JVM doesn't crash if the source doesn't export
+           data in native formats.
+  @author das@sparc.spb.su area=dnd
+  @compile NoFormatsCrashTest.java
+  @run applet NoFormatsCrashTest.html
+*/
+
+// Note there is no @ in front of test above.  This is so that the
+//  harness will not mistake this file as a test file.  It should
+//  only see the html file as a test file. (the harness runs all
+//  valid test files, so it would run this test twice if this file
+//  were valid as well as the html file.)
+// Also, note the area= after Your Name in the author tag.  Here, you
+//  should put which functional area the test falls in.  See the
+//  AWT-core home page -> test areas and/or -> AWT team  for a list of
+//  areas.
+// Note also the 'NoFormatsCrashTest.html' in the run tag.  This should
+//  be changed to the name of the test.
+
+
+/**
+ * NoFormatsCrashTest.java
+ *
+ * summary: tests that a drop target JVM doesn't crash if the source doesn't export
+ *          data in native formats.
+ */
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.datatransfer.*;
+import java.awt.dnd.*;
+import java.awt.event.*;
+import java.io.*;
+
+
+//Automated tests should run as applet tests if possible because they
+// get their environments cleaned up, including AWT threads, any
+// test created threads, and any system resources used by the test
+// such as file descriptors.  (This is normally not a problem as
+// main tests usually run in a separate VM, however on some platforms
+// such as the Mac, separate VMs are not possible and non-applet
+// tests will cause problems).  Also, you don't have to worry about
+// synchronisation stuff in Applet tests they way you do in main
+// tests...
+
+
+public class NoFormatsCrashTest extends Applet {
+
+    final Frame frame = new Frame();
+    private volatile Process process;
+
+    static final int FRAME_ACTIVATION_TIMEOUT = 2000;
+
+    public static void main(String[] args) {
+        NoFormatsCrashTest test = new NoFormatsCrashTest();
+        test.run(args);
+    }
+
+    public void run(String[] args) {
+        try {
+            if (args.length != 4) {
+                throw new RuntimeException("Incorrect command line arguments.");
+            }
+
+            int x = Integer.parseInt(args[0]);
+            int y = Integer.parseInt(args[1]);
+            int w = Integer.parseInt(args[2]);
+            int h = Integer.parseInt(args[3]);
+
+            Panel panel = new DragSourcePanel();
+
+            frame.setTitle("Drag source frame");
+            frame.setLocation(500, 200);
+            frame.add(panel);
+            frame.pack();
+            frame.setVisible(true);
+
+            Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
+
+            Point sourcePoint = panel.getLocationOnScreen();
+            Dimension d = panel.getSize();
+            sourcePoint.translate(d.width / 2, d.height / 2);
+
+            Point targetPoint = new Point(x + w / 2, y + h / 2);
+
+            Robot robot = new Robot();
+            robot.mouseMove(sourcePoint.x, sourcePoint.y);
+            robot.keyPress(KeyEvent.VK_CONTROL);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            for (; !sourcePoint.equals(targetPoint);
+                 sourcePoint.translate(sign(targetPoint.x - sourcePoint.x),
+                                       sign(targetPoint.y - sourcePoint.y))) {
+                robot.mouseMove(sourcePoint.x, sourcePoint.y);
+                Thread.sleep(50);
+            }
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            robot.keyRelease(KeyEvent.VK_CONTROL);
+
+            Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
+
+            if (process.isAlive()) {
+                process.destroy();
+            }
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    } // run()
+
+    public void init() {
+        //Create instructions for the user here, as well as set up
+        // the environment -- set the layout manager, add buttons,
+        // etc.
+
+        String[] instructions =
+        {
+            "This is an AUTOMATIC test",
+            "simply wait until it is done"
+        };
+        Sysout.createDialog( );
+        Sysout.printInstructions( instructions );
+
+        frame.setTitle("Drop target frame");
+        frame.setLocation(200, 200);
+
+    } // init()
+
+    public void start() {
+        DropTargetPanel panel = new DropTargetPanel();
+        frame.add(panel);
+        frame.pack();
+        frame.setVisible(true);
+
+        try {
+            Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
+
+            Point p = frame.getLocationOnScreen();
+            Dimension d = frame.getSize();
+
+            String javaPath = System.getProperty("java.home", "");
+            String command = javaPath + File.separator + "bin" +
+                File.separator + "java -cp " + System.getProperty("test.classes", ".") +
+                " NoFormatsCrashTest " +
+                p.x + " " + p.y + " " + d.width + " " + d.height;
+
+            process = Runtime.getRuntime().exec(command);
+            ProcessResults pres = ProcessResults.doWaitFor(process);
+            System.err.println("Child VM return code: " + pres.exitValue);
+
+            if (pres.stderr != null && pres.stderr.length() > 0) {
+                System.err.println("========= Child VM System.err ========");
+                System.err.print(pres.stderr);
+                System.err.println("======================================");
+            }
+
+            if (pres.stdout != null && pres.stdout.length() > 0) {
+                System.err.println("========= Child VM System.out ========");
+                System.err.print(pres.stdout);
+                System.err.println("======================================");
+            }
+
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+
+        if (panel.isTestFailed()) {
+            throw new RuntimeException();
+        }
+    } // start()
+
+    public static int sign(int n) {
+        return n < 0 ? -1 : n > 0 ? 1 : 0;
+    }
+} // class NoFormatsCrashTest
+
+class TestTransferable implements Transferable {
+
+    public static DataFlavor dataFlavor = null;
+    static final Object data = new Object();
+
+    static {
+        DataFlavor df = null;
+        try {
+            df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType +
+                                "; class=java.lang.Object");
+        } catch (ClassNotFoundException e) {
+            throw new ExceptionInInitializerError(e);
+        }
+        dataFlavor = df;
+    }
+
+    public DataFlavor[] getTransferDataFlavors() {
+        return new DataFlavor[] { dataFlavor };
+    }
+
+    public boolean isDataFlavorSupported(DataFlavor df) {
+        return dataFlavor.equals(df);
+    }
+
+    public Object getTransferData(DataFlavor df)
+      throws UnsupportedFlavorException, IOException {
+        if (!isDataFlavorSupported(df)) {
+            throw new UnsupportedFlavorException(df);
+        }
+        return data;
+    }
+}
+
+class DragSourcePanel extends Panel {
+    public DragSourcePanel() {
+        final Transferable t = new TestTransferable();
+        final DragSourceListener dsl = new DragSourceAdapter() {
+                public void dragDropEnd(DragSourceDropEvent dtde) {
+                    try {
+                        Thread.sleep(100);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    // This finishes child VM
+                    System.exit(0);
+                }
+            };
+        final DragGestureListener dgl = new DragGestureListener() {
+                public void dragGestureRecognized(DragGestureEvent dge) {
+                    dge.startDrag(null, t, dsl);
+                }
+            };
+        final DragSource ds = DragSource.getDefaultDragSource();
+        final DragGestureRecognizer dgr =
+            ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY,
+                                                  dgl);
+    }
+
+    public Dimension getPreferredSize() {
+        return new Dimension(100, 100);
+    }
+}
+
+class DropTargetPanel extends Panel {
+    private boolean testFailed = false;
+    public DropTargetPanel() {
+        final DropTargetListener dtl = new DropTargetAdapter() {
+                public void dragOver(DropTargetDragEvent dtde) {
+                    try {
+                        dtde.getCurrentDataFlavorsAsList();
+                    } catch (Exception e) {
+                        testFailed = true;
+                        e.printStackTrace();
+                    }
+                }
+                public void drop(DropTargetDropEvent dtde) {
+                    dtde.rejectDrop();
+                }
+            };
+        final DropTarget dt = new DropTarget(this, dtl);
+    }
+
+    public boolean isTestFailed() {
+        return testFailed;
+    }
+
+    public Dimension getPreferredSize() {
+        return new Dimension(100, 100);
+    }
+}
+
+class ProcessResults {
+    public int exitValue;
+    public String stdout;
+    public String stderr;
+
+    public ProcessResults() {
+        exitValue = -1;
+        stdout = "";
+        stderr = "";
+    }
+
+    /**
+     * Method to perform a "wait" for a process and return its exit value.
+     * This is a workaround for <code>Process.waitFor()</code> never returning.
+     */
+    public static ProcessResults doWaitFor(Process p) {
+        ProcessResults pres = new ProcessResults();
+
+        InputStream in = null;
+        InputStream err = null;
+
+        try {
+            in = p.getInputStream();
+            err = p.getErrorStream();
+
+            boolean finished = false;
+
+            while (!finished) {
+                try {
+                    while (in.available() > 0) {
+                        pres.stdout += (char)in.read();
+                    }
+                    while (err.available() > 0) {
+                        pres.stderr += (char)err.read();
+                    }
+                    // Ask the process for its exitValue. If the process
+                    // is not finished, an IllegalThreadStateException
+                    // is thrown. If it is finished, we fall through and
+                    // the variable finished is set to true.
+                    pres.exitValue = p.exitValue();
+                    finished  = true;
+                }
+                catch (IllegalThreadStateException e) {
+                    // Process is not finished yet;
+                    // Sleep a little to save on CPU cycles
+                    Thread.currentThread().sleep(500);
+                }
+            }
+            if (in != null) in.close();
+            if (err != null) err.close();
+        }
+        catch (Throwable e) {
+            System.err.println("doWaitFor(): unexpected exception");
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return pres;
+    }
+}
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+ {
+   private static TestDialog dialog;
+
+   public static void createDialogWithInstructions( String[] instructions )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      dialog.printInstructions( instructions );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+   public static void createDialog( )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      String[] defInstr = { "Instructions will appear here. ", "" } ;
+      dialog.printInstructions( defInstr );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+
+   public static void printInstructions( String[] instructions )
+    {
+      dialog.printInstructions( instructions );
+    }
+
+
+   public static void println( String messageIn )
+    {
+      dialog.displayMessage( messageIn );
+    }
+
+ }// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+ {
+
+   TextArea instructionsText;
+   TextArea messageText;
+   int maxStringLength = 80;
+
+   //DO NOT call this directly, go through Sysout
+   public TestDialog( Frame frame, String name )
+    {
+      super( frame, name );
+      int scrollBoth = TextArea.SCROLLBARS_BOTH;
+      instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+      add( "North", instructionsText );
+
+      messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+      add("South", messageText);
+
+      pack();
+
+      show();
+    }// TestDialog()
+
+   //DO NOT call this directly, go through Sysout
+   public void printInstructions( String[] instructions )
+    {
+      //Clear out any current instructions
+      instructionsText.setText( "" );
+
+      //Go down array of instruction strings
+
+      String printStr, remainingStr;
+      for( int i=0; i < instructions.length; i++ )
+       {
+         //chop up each into pieces maxSringLength long
+         remainingStr = instructions[ i ];
+         while( remainingStr.length() > 0 )
+          {
+            //if longer than max then chop off first max chars to print
+            if( remainingStr.length() >= maxStringLength )
+             {
+               //Try to chop on a word boundary
+               int posOfSpace = remainingStr.
+                  lastIndexOf( ' ', maxStringLength - 1 );
+
+               if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+               printStr = remainingStr.substring( 0, posOfSpace + 1 );
+               remainingStr = remainingStr.substring( posOfSpace + 1 );
+             }
+            //else just print
+            else
+             {
+               printStr = remainingStr;
+               remainingStr = "";
+             }
+
+            instructionsText.append( printStr + "\n" );
+
+          }// while
+
+       }// for
+
+    }//printInstructions()
+
+   //DO NOT call this directly, go through Sysout
+   public void displayMessage( String messageIn )
+    {
+      messageText.append( messageIn + "\n" );
+    }
+
+ }// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/multiresolution/MultiResolutionToolkitImageTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Toolkit;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import static java.awt.image.ImageObserver.ALLBITS;
+import java.io.File;
+import javax.imageio.ImageIO;
+import sun.awt.OSInfo;
+import sun.awt.SunToolkit;
+import sun.awt.image.MultiResolutionToolkitImage;
+
+/**
+ * @test
+ * @bug 8040291
+ * @author Alexander Scherbatiy
+ * @summary [macosx] Http-Images are not fully loaded when using ImageIcon
+ * @run main MultiResolutionToolkitImageTest
+ */
+public class MultiResolutionToolkitImageTest {
+
+    private static final int IMAGE_WIDTH = 300;
+    private static final int IMAGE_HEIGHT = 200;
+    private static final Color COLOR_1X = Color.GREEN;
+    private static final Color COLOR_2X = Color.BLUE;
+    private static final String IMAGE_NAME_1X = "image.png";
+    private static final String IMAGE_NAME_2X = "image@2x.png";
+    private static final int WAIT_TIME = 400;
+    private static volatile boolean isImageLoaded = false;
+    private static volatile boolean isRVObserverCalled = false;
+
+    public static void main(String[] args) throws Exception {
+
+        if (!checkOS()) {
+            return;
+        }
+        generateImages();
+        testToolkitMultiResolutionImageLoad();
+    }
+
+    static void testToolkitMultiResolutionImageLoad() throws Exception {
+        File imageFile = new File(IMAGE_NAME_1X);
+        String fileName = imageFile.getAbsolutePath();
+        Image image = Toolkit.getDefaultToolkit().getImage(fileName);
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.prepareImage(image, -1, -1, new LoadImageObserver());
+
+        final long time = WAIT_TIME + System.currentTimeMillis();
+        while ((!isImageLoaded || !isRVObserverCalled)
+                && System.currentTimeMillis() < time) {
+            Thread.sleep(50);
+        }
+
+        if(!isImageLoaded){
+            throw new RuntimeException("Image is not loaded!");
+        }
+
+        if(!isRVObserverCalled){
+            throw new RuntimeException("Resolution Variant observer is not called!");
+        }
+    }
+
+    static void generateImages() throws Exception {
+        if (!new File(IMAGE_NAME_1X).exists()) {
+            generateImage(1);
+        }
+
+        if (!new File(IMAGE_NAME_2X).exists()) {
+            generateImage(2);
+        }
+    }
+
+    static void generateImage(int scale) throws Exception {
+        BufferedImage image = new BufferedImage(scale * IMAGE_WIDTH, scale * IMAGE_HEIGHT,
+                BufferedImage.TYPE_INT_RGB);
+        Graphics g = image.getGraphics();
+        g.setColor(scale == 1 ? COLOR_1X : COLOR_2X);
+        g.fillRect(0, 0, scale * IMAGE_WIDTH, scale * IMAGE_HEIGHT);
+        File file = new File(scale == 1 ? IMAGE_NAME_1X : IMAGE_NAME_2X);
+        ImageIO.write(image, "png", file);
+    }
+
+    static boolean checkOS() {
+        return OSInfo.getOSType() == OSInfo.OSType.MACOSX;
+    }
+
+    static class LoadImageObserver implements ImageObserver {
+
+        @Override
+        public boolean imageUpdate(Image img, int infoflags, int x, int y,
+                int width, int height) {
+
+            if (isRVObserver()) {
+                isRVObserverCalled = true;
+                SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+                Image resolutionVariant = getResolutionVariant(img);
+                int rvFlags = toolkit.checkImage(resolutionVariant, width, height,
+                        new IdleImageObserver());
+                if (rvFlags < infoflags) {
+                    throw new RuntimeException("Info flags are greater than"
+                            + " resolution varint info flags");
+                }
+            } else if ((infoflags & ALLBITS) != 0) {
+                isImageLoaded = true;
+            }
+
+            return (infoflags & ALLBITS) == 0;
+        }
+    }
+
+    static boolean isRVObserver() {
+        Exception e = new Exception();
+
+        for (StackTraceElement elem : e.getStackTrace()) {
+            if (elem.getClassName().endsWith("MultiResolutionToolkitImage")) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    static class IdleImageObserver implements ImageObserver {
+
+        @Override
+        public boolean imageUpdate(Image img, int infoflags, int x, int y,
+                int width, int height) {
+            return false;
+        }
+    }
+
+    static Image getResolutionVariant(Image image) {
+        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
+    }
+}
--- a/test/java/awt/regtesthelpers/process/ProcessCommunicator.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/awt/regtesthelpers/process/ProcessCommunicator.java	Tue Jun 03 08:32:34 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -25,21 +25,22 @@
 
 import java.io.*;
 
-/** This class is created to solve interprocess communication problems.
+/**
+ *  This class is created to solve interprocess communication problems.
  *  When you need to write a regression test which should verify inter jvm
  *  behavior such as DnD data transfer, Clipboard data transfer, focus
  *  transfer etc., you could use the next scenario:
  *
  *  1. Write an implementation for the parent JVM, using applet test.
- *  2. Write an implimentation for the child JVM or native application, using
+ *  2. Write an implementation for the child JVM or native application, using
  *     main() function.
  *  3. Execute child process using  ProcessCommunicator.executeChildProcess()
  *     method.
- *  4. You can decide whetherthe test is passed on the basis of
+ *  4. You can decide whether the test is passed on the basis of
  *     ProcessResults class data.
  *
- *  Note: The class is not thread safe. You should access its methods only from the same
- *        thread.
+ *  Note: The class is not thread safe. You should access its methods only from
+ *        the same thread.
  */
 
 public class ProcessCommunicator {
@@ -48,31 +49,34 @@
     private static final String javaPath = javaHome + File.separator + "bin" +
             File.separator + "java ";
     private static String command = "";
+    private static volatile Process process;
 
     private ProcessCommunicator() {}
 
-    /** The same as {#link #executeChildProcess(Class,String)} except
-     *  the {@code classPathArgument} parameter. The class path
-     *  parameter is for the debug purposes
+    /**
+     * The same as {#link #executeChildProcess(Class,String)} except
+     * the {@code classPathArgument} parameter. The class path
+     * parameter is for the debug purposes
      *
-     *  @param classToExecute is passed to the child JVM
-     *  @param classPathArguments class path for the child JVM
-     *  @param args arguments that will be passed to the executed class
-     *  @return results of the executed {@code Process}
+     * @param classToExecute is passed to the child JVM
+     * @param classPathArguments class path for the child JVM
+     * @param args arguments that will be passed to the executed class
+     * @return results of the executed {@code Process}
      */
     public static ProcessResults executeChildProcess(final Class classToExecute,
                            final String classPathArguments, final String [] args)
     {
         try {
             String command = buildCommand(classToExecute, classPathArguments, args);
-            Process process = Runtime.getRuntime().exec(command);
+            process = Runtime.getRuntime().exec(command);
             return doWaitFor(process);
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
     }
 
-    /** Executes child {code Process}
+    /**
+     * Executes child {code Process}
      *
      * @param classToExecute class to be executed as a child java process
      * @param args args to be passed in to the child process
@@ -86,11 +90,11 @@
 
     /**
      * Waits for a process and return its results.
-     * This is a workaround for <code>Process.waitFor()</code> never returning.
+     * This is a workaround for {@code Process.waitFor()} never returning.
      *
      * @return results of the executed {@code Process}
      */
-    private static ProcessResults doWaitFor(final Process p) {
+    public static ProcessResults doWaitFor(final Process p) {
         ProcessResults pres = new ProcessResults();
 
         final InputStream in;
@@ -133,13 +137,14 @@
         return pres;
     }
 
-    /** Builds command on the basis of the passed class name,
-     *  class path and arguments.
+    /**
+     * Builds command on the basis of the passed class name,
+     * class path and arguments.
      *
      * @param classToExecute with class will be executed in the new JVM
      * @param classPathArguments java class path (only for test purposes)
      * @param args arguments for the new application. This could be used
-     *             to pass some information from the parnent to child JVM.
+     *             to pass some information from the parent to child JVM.
      * @return command to execute the {@code Process}
      */
     private static String buildCommand(final Class classToExecute,
@@ -162,11 +167,24 @@
         return command;
     }
 
-    /** Could be used for the debug purposes.
+    /**
+     * Could be used for the debug purposes.
      *
-      * @return command that was build to execute the child process
+     * @return command that was build to execute the child process
      */
     public static String getExecutionCommand () {
         return command;
     }
+
+    /**
+     * Terminates the process created by {@code executeChildProcess} methods.
+     */
+    public static void destroyProcess() {
+        if (process != null) {
+            if (process.isAlive()) {
+                process.destroy();
+            }
+            process = null;
+        }
+    }
 }
--- a/test/java/io/BufferedInputStream/LargeCopyWithMark.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/io/BufferedInputStream/LargeCopyWithMark.java	Tue Jun 03 08:32:34 2014 -0700
@@ -26,6 +26,7 @@
  * @summary BufferedInputStream calculates negative array size with large
  *          streams and mark
  * @library /lib/testlibrary
+ * @build jdk.testlibrary.*
  * @run main/othervm LargeCopyWithMark
  */
 
--- a/test/java/lang/String/ToLowerCase.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/lang/String/ToLowerCase.java	Tue Jun 03 08:32:34 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -23,7 +23,7 @@
 
 /*
     @test
-    @bug 4217441 4533872 4900935 8020037
+    @bug 4217441 4533872 4900935 8020037 8041791
     @summary toLowerCase should lower-case Greek Sigma correctly depending
              on the context (final/non-final).  Also it should handle
              Locale specific (lt, tr, and az) lowercasings and supplementary
@@ -72,8 +72,10 @@
         // I-dot tests
         test("\u0130", turkish, "i");
         test("\u0130", az, "i");
-        test("\u0130", lt, "i");
-        test("\u0130", Locale.US, "i");
+        test("\u0130", lt, "\u0069\u0307");
+        test("\u0130", Locale.US, "\u0069\u0307");
+        test("\u0130", Locale.JAPAN, "\u0069\u0307");
+        test("\u0130", Locale.ROOT, "\u0069\u0307");
 
         // Remove dot_above in the sequence I + dot_above (Turkish and Azeri)
         test("I\u0307", turkish, "i");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/annotation/TypeVariableBounds.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8038994
+ * @summary Test that getAnnotatedBounds().getType() match getBounds()
+ * @run testng TypeVariableBounds
+ */
+
+import java.io.Serializable;
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.concurrent.Callable;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.*;
+
+public class TypeVariableBounds {
+    @Test(dataProvider = "classData")
+    public void testClass(Class<?> c) throws Exception {
+        assertNotEquals(c.getTypeParameters().length, 0);
+
+        TypeVariable[] tv = c.getTypeParameters();
+
+        for(TypeVariable t : tv)
+            testTv(t);
+
+    }
+
+    @Test(dataProvider = "methodData")
+    public void testMethod(Class<?>c) throws Exception {
+        Method m = c.getMethod("aMethod");
+        TypeVariable[] tv = m.getTypeParameters();
+
+        for(TypeVariable t : tv)
+            testTv(t);
+
+    }
+
+    public void testTv(TypeVariable<?> tv) {
+        Type[] t = tv.getBounds();
+        AnnotatedType[] at = tv.getAnnotatedBounds();
+
+        assertEquals(t.length, at.length, Arrays.asList(t) + " and " + Arrays.asList(at) + " should be the same length");
+
+        for (int i = 0; i < t.length; i++)
+            assertSame(at[i].getType(), t[i], "T: " + t[i] + ", AT: " + at[i] + ", AT.getType(): " + at[i].getType() + "\n");
+    }
+
+    @DataProvider
+    public Object[][] classData() { return CLASS_TESTS; }
+
+    @DataProvider
+    public Object[][] methodData() { return METHOD_TESTS; }
+
+    public static final Object[][] CLASS_TESTS = {
+        { Case1.class, },
+        { Case2.class, },
+        { Case5.class, },
+        { Case6.class, },
+    };
+
+    public static final Object[][] METHOD_TESTS = {
+        { Case3.class, },
+        { Case4.class, },
+        { Case5.class, },
+        { Case6.class, },
+    };
+
+    // Class type var
+    public static class Case1<C1T1, C1T2 extends AnnotatedElement, C1T3 extends AnnotatedElement & Type & Serializable> {}
+    public static class Case2<C2T0, @TA C2T1 extends Type, C2T2 extends @TB AnnotatedElement, C2T3 extends AnnotatedElement & @TB Type & Serializable> {}
+
+    // Method type var
+    public static class Case3 { public <C3T1, C3T2 extends AnnotatedElement, C3T3 extends AnnotatedElement & Type & Serializable> void aMethod() {}}
+    public static class Case4 { public <C4T0, @TA C4T1 extends List, C4T2 extends @TB Set, C4T3 extends Set & @TB Callable & Serializable> void aMethod() {}}
+
+    // Both
+    public static class Case5 <C5CT1, C5CT2 extends Runnable> {
+        public <C5MT1,
+               C5MT2 extends AnnotatedElement,
+               C5MT3 extends AnnotatedElement & Type & Serializable,
+               C5MT4 extends C5CT2>
+                   void aMethod() {}}
+
+    public static class Case6 <@TA C6CT1, C6CT2 extends @TB Runnable> {
+        public <@TA C6MT1,
+               C6MT2 extends @TB AnnotatedElement,
+               C6MT3 extends @TB AnnotatedElement & @TB2 Type & Serializable,
+               C6MT4 extends @TB2 C6CT2>
+                   void aMethod() {}}
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.TYPE_PARAMETER)
+    public @interface TA {}
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.TYPE_USE)
+    public @interface TB {}
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.TYPE_USE)
+    public @interface TB2 {}
+}
--- a/test/java/lang/instrument/DaemonThread/TestDaemonThread.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/lang/instrument/DaemonThread/TestDaemonThread.java	Tue Jun 03 08:32:34 2014 -0700
@@ -26,7 +26,7 @@
  * @summary Assert in java.lang.instrument agents during shutdown when classloading occurs after shutdown
  * @library /lib/testlibrary
  *
- * @build DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread
+ * @build jdk.testlibrary.* DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread
  * @run shell ../MakeJAR3.sh DummyAgent
  * @run main TestDaemonThreadLauncher /timeout=240
  *
--- a/test/java/lang/instrument/PremainClass/NoPremainAgentTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/lang/instrument/PremainClass/NoPremainAgentTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -30,7 +30,7 @@
  * @bug 6289149
  * @summary test when the agent's class is missing the premain() function.
  * @library /lib/testlibrary
- * @run build DummyMain
+ * @build jdk.testlibrary.* DummyMain
  * @run shell ../MakeJAR3.sh NoPremainAgent
  * @run main NoPremainAgentTest
  */
--- a/test/java/lang/instrument/PremainClass/PremainClassTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/lang/instrument/PremainClass/PremainClassTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -30,7 +30,7 @@
  * @bug 5055293
  * @summary Test non ascii characters in the Premain-Class attribute.
  * @library /lib/testlibrary
- * @run build DummyMain
+ * @build jdk.testlibrary.* DummyMain
  * @run main PremainClassTest
  */
 public class PremainClassTest {
--- a/test/java/lang/instrument/PremainClass/ZeroArgPremainAgentTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/lang/instrument/PremainClass/ZeroArgPremainAgentTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -30,7 +30,7 @@
  * @bug 6289149
  * @summary test when the agent's class has a zero arg premain() function.
  * @library /lib/testlibrary
- * @run build DummyMain
+ * @build jdk.testlibrary.* DummyMain
  * @run shell ../MakeJAR3.sh ZeroArgPremainAgent
  * @run main ZeroArgPremainAgentTest
  */
--- a/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -37,6 +37,7 @@
 /* @test
  * @library /lib/testlibrary/jsr292 /lib/testlibrary/
  * @compile CatchExceptionTest.java
+ * @build jdk.testlibrary.*
  * @run main/othervm -esa test.java.lang.invoke.MethodHandles.CatchExceptionTest
  */
 public class CatchExceptionTest {
--- a/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java	Tue Jun 03 08:32:34 2014 -0700
@@ -30,11 +30,9 @@
  *
  * @author  Mandy Chung
  *
- * @build CollectionUsageThreshold MemoryUtil
- * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseSerialGC CollectionUsageThreshold
- * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseParallelGC CollectionUsageThreshold
- * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseG1GC CollectionUsageThreshold
- * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC CollectionUsageThreshold
+ * @library /lib/testlibrary/
+ * @build CollectionUsageThreshold MemoryUtil RunUtil
+ * @run main/timeout=300 CollectionUsageThreshold
  */
 
 import java.util.*;
@@ -61,6 +59,20 @@
     // finishes checking the low memory notification result
     private static final CyclicBarrier barrier = new CyclicBarrier(2);
 
+    /**
+     * Run the test multiple times with different GC versions.
+     * First with default command line specified by the framework.
+     * Then with GC versions specified by the test.
+     */
+    public static void main(String a[]) throws Throwable {
+        final String main = "CollectionUsageThreshold$TestMain";
+        RunUtil.runTestKeepGcOpts(main);
+        RunUtil.runTestClearGcOpts(main, "-XX:+UseSerialGC");
+        RunUtil.runTestClearGcOpts(main, "-XX:+UseParallelGC");
+        RunUtil.runTestClearGcOpts(main, "-XX:+UseG1GC");
+        RunUtil.runTestClearGcOpts(main, "-XX:+UseConcMarkSweepGC");
+    }
+
     static class PoolRecord {
         private final MemoryPoolMXBean pool;
         private final AtomicInteger listenerInvoked = new AtomicInteger(0);
@@ -110,88 +122,90 @@
         }
     }
 
-    public static void main(String args[]) throws Exception {
-        if (args.length > 0 && args[0].equals("trace")) {
-            trace = true;
+    private static class TestMain {
+        public static void main(String args[]) throws Exception {
+            if (args.length > 0 && args[0].equals("trace")) {
+                trace = true;
+            }
+
+            List<MemoryPoolMXBean> pools = getMemoryPoolMXBeans();
+            List<MemoryManagerMXBean> managers = getMemoryManagerMXBeans();
+
+            if (trace) {
+                MemoryUtil.printMemoryPools(pools);
+                MemoryUtil.printMemoryManagers(managers);
+            }
+
+            // Find the Old generation which supports low memory detection
+            for (MemoryPoolMXBean p : pools) {
+                if (p.isUsageThresholdSupported() && p.isCollectionUsageThresholdSupported()) {
+                    if (p.getName().toLowerCase().contains("perm")) {
+                        // if we have a "perm gen" pool increase the number of expected
+                        // memory pools by one.
+                        numMemoryPools++;
+                    }
+                    PoolRecord pr = new PoolRecord(p);
+                    result.put(p.getName(), pr);
+                    if (result.size() == numMemoryPools) {
+                        break;
+                    }
+                }
+            }
+            if (result.size() != numMemoryPools) {
+                throw new RuntimeException("Unexpected number of selected pools");
+            }
+
+            try {
+                // This test creates a checker thread responsible for checking
+                // the low memory notifications.  It blocks until a permit
+                // from the signals semaphore is available.
+                Checker checker = new Checker("Checker thread");
+                checker.setDaemon(true);
+                checker.start();
+
+                for (PoolRecord pr : result.values()) {
+                    pr.getPool().setCollectionUsageThreshold(THRESHOLD);
+                    System.out.println("Collection usage threshold of " +
+                        pr.getPool().getName() + " set to " + THRESHOLD);
+                }
+
+                SensorListener listener = new SensorListener();
+                NotificationEmitter emitter = (NotificationEmitter) mm;
+                emitter.addNotificationListener(listener, null, null);
+
+                // The main thread invokes GC to trigger the VM to perform
+                // low memory detection and then waits until the checker thread
+                // finishes its work to check for a low-memory notification.
+                //
+                // At GC time, VM will issue low-memory notification and invoke
+                // the listener which will release a permit to the signals semaphore.
+                // When the checker thread acquires the permit and finishes
+                // checking the low-memory notification, it will also call
+                // barrier.await() to signal the main thread to resume its work.
+                for (int i = 0; i < NUM_GCS; i++) {
+                    invokeGC();
+                    barrier.await();
+                }
+            } finally {
+                // restore the default
+                for (PoolRecord pr : result.values()) {
+                    pr.getPool().setCollectionUsageThreshold(0);
+                }
+            }
+            System.out.println(RunUtil.successMessage);
         }
 
-        List<MemoryPoolMXBean> pools = getMemoryPoolMXBeans();
-        List<MemoryManagerMXBean> managers = getMemoryManagerMXBeans();
 
-        if (trace) {
-            MemoryUtil.printMemoryPools(pools);
-            MemoryUtil.printMemoryManagers(managers);
-        }
+        private static void invokeGC() {
+            System.out.println("Calling System.gc()");
+            numGCs++;
+            mm.gc();
 
-        // Find the Old generation which supports low memory detection
-        for (MemoryPoolMXBean p : pools) {
-            if (p.isUsageThresholdSupported() && p.isCollectionUsageThresholdSupported()) {
-                if (p.getName().toLowerCase().contains("perm")) {
-                    // if we have a "perm gen" pool increase the number of expected
-                    // memory pools by one.
-                    numMemoryPools++;
+            if (trace) {
+                for (PoolRecord pr : result.values()) {
+                    System.out.println("Usage after GC for: " + pr.getPool().getName());
+                    MemoryUtil.printMemoryUsage(pr.getPool().getUsage());
                 }
-                PoolRecord pr = new PoolRecord(p);
-                result.put(p.getName(), pr);
-                if (result.size() == numMemoryPools) {
-                    break;
-                }
-            }
-        }
-        if (result.size() != numMemoryPools) {
-            throw new RuntimeException("Unexpected number of selected pools");
-        }
-
-        try {
-            // This test creates a checker thread responsible for checking
-            // the low memory notifications.  It blocks until a permit
-            // from the signals semaphore is available.
-            Checker checker = new Checker("Checker thread");
-            checker.setDaemon(true);
-            checker.start();
-
-            for (PoolRecord pr : result.values()) {
-                pr.getPool().setCollectionUsageThreshold(THRESHOLD);
-                System.out.println("Collection usage threshold of " +
-                    pr.getPool().getName() + " set to " + THRESHOLD);
-            }
-
-            SensorListener listener = new SensorListener();
-            NotificationEmitter emitter = (NotificationEmitter) mm;
-            emitter.addNotificationListener(listener, null, null);
-
-            // The main thread invokes GC to trigger the VM to perform
-            // low memory detection and then waits until the checker thread
-            // finishes its work to check for a low-memory notification.
-            //
-            // At GC time, VM will issue low-memory notification and invoke
-            // the listener which will release a permit to the signals semaphore.
-            // When the checker thread acquires the permit and finishes
-            // checking the low-memory notification, it will also call
-            // barrier.await() to signal the main thread to resume its work.
-            for (int i = 0; i < NUM_GCS; i++) {
-                invokeGC();
-                barrier.await();
-            }
-        } finally {
-            // restore the default
-            for (PoolRecord pr : result.values()) {
-                pr.getPool().setCollectionUsageThreshold(0);
-            }
-        }
-        System.out.println("Test passed.");
-    }
-
-
-    private static void invokeGC() {
-        System.out.println("Calling System.gc()");
-        numGCs++;
-        mm.gc();
-
-        if (trace) {
-            for (PoolRecord pr : result.values()) {
-                System.out.println("Usage after GC for: " + pr.getPool().getName());
-                MemoryUtil.printMemoryUsage(pr.getPool().getUsage());
             }
         }
     }
--- a/test/java/lang/management/MemoryMXBean/LowMemoryTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/lang/management/MemoryMXBean/LowMemoryTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -30,19 +30,21 @@
  *
  * @author  Mandy Chung
  *
- * @build LowMemoryTest MemoryUtil
- * @run main/othervm/timeout=600 LowMemoryTest
+ * @library /lib/testlibrary/
+ * @build LowMemoryTest MemoryUtil RunUtil
+ * @run main/timeout=600 LowMemoryTest
  */
 
 import java.lang.management.*;
 import java.util.*;
+import java.util.concurrent.Phaser;
 import javax.management.*;
 import javax.management.openmbean.CompositeData;
 
 public class LowMemoryTest {
-    private static MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
-    private static List pools = ManagementFactory.getMemoryPoolMXBeans();
-    private static List managers = ManagementFactory.getMemoryManagerMXBeans();
+    private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
+    private static final List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
+    private static final Phaser phaser = new Phaser(2);
     private static MemoryPoolMXBean mpool = null;
     private static boolean trace = false;
     private static boolean testFailed = false;
@@ -50,8 +52,23 @@
     private static final int NUM_CHUNKS = 2;
     private static long chunkSize;
 
-    private static boolean listenerInvoked = false;
+    /**
+     * Run the test multiple times with different GC versions.
+     * First with default command line specified by the framework.
+     * Then with GC versions specified by the test.
+     */
+    public static void main(String a[]) throws Throwable {
+        final String main = "LowMemoryTest$TestMain";
+        RunUtil.runTestKeepGcOpts(main);
+        RunUtil.runTestClearGcOpts(main, "-XX:+UseSerialGC");
+        RunUtil.runTestClearGcOpts(main, "-XX:+UseParallelGC");
+        RunUtil.runTestClearGcOpts(main, "-XX:+UseG1GC");
+        RunUtil.runTestClearGcOpts(main, "-XX:+UseConcMarkSweepGC");
+    }
+
+    private static volatile boolean listenerInvoked = false;
     static class SensorListener implements NotificationListener {
+        @Override
         public void handleNotification(Notification notif, Object handback) {
             String type = notif.getType();
             if (type.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED) ||
@@ -69,8 +86,9 @@
 
     static class TestListener implements NotificationListener {
         private int triggers = 0;
-        private long[] count = new long[NUM_TRIGGERS * 2];
-        private long[] usedMemory = new long[NUM_TRIGGERS * 2];
+        private final long[] count = new long[NUM_TRIGGERS * 2];
+        private final long[] usedMemory = new long[NUM_TRIGGERS * 2];
+        @Override
         public void handleNotification(Notification notif, Object handback) {
             MemoryNotificationInfo minfo = MemoryNotificationInfo.
                 from((CompositeData) notif.getUserData());
@@ -101,117 +119,97 @@
     }
 
     private static long newThreshold;
-    public static void main(String args[]) throws Exception {
-        if (args.length > 0 && args[0].equals("trace")) {
-            trace = true;
-        }
 
-        // Find the Old generation which supports low memory detection
-        ListIterator iter = pools.listIterator();
-        while (iter.hasNext()) {
-            MemoryPoolMXBean p = (MemoryPoolMXBean) iter.next();
-            if (p.getType() == MemoryType.HEAP &&
+    private static class TestMain {
+        public static void main(String args[]) throws Exception {
+            if (args.length > 0 && args[0].equals("trace")) {
+                trace = true;
+            }
+
+            // Find the Old generation which supports low memory detection
+            ListIterator iter = pools.listIterator();
+            while (iter.hasNext()) {
+                MemoryPoolMXBean p = (MemoryPoolMXBean) iter.next();
+                if (p.getType() == MemoryType.HEAP &&
                     p.isUsageThresholdSupported()) {
-                mpool = p;
-                if (trace) {
-                    System.out.println("Selected memory pool for low memory " +
-                        "detection.");
-                    MemoryUtil.printMemoryPool(mpool);
+                    mpool = p;
+                    if (trace) {
+                        System.out.println("Selected memory pool for low memory " +
+                            "detection.");
+                        MemoryUtil.printMemoryPool(mpool);
+                    }
+                    break;
                 }
-                break;
             }
-        }
 
-        TestListener listener = new TestListener();
-        SensorListener l2 = new SensorListener();
-        NotificationEmitter emitter = (NotificationEmitter) mm;
-        emitter.addNotificationListener(listener, null, null);
-        emitter.addNotificationListener(l2, null, null);
+            TestListener listener = new TestListener();
+            SensorListener l2 = new SensorListener();
+            NotificationEmitter emitter = (NotificationEmitter) mm;
+            emitter.addNotificationListener(listener, null, null);
+            emitter.addNotificationListener(l2, null, null);
 
-        Thread allocator = new AllocatorThread();
-        Thread sweeper = new SweeperThread();
+            Thread allocator = new AllocatorThread();
+            Thread sweeper = new SweeperThread();
 
-        // Now set threshold
-        MemoryUsage mu = mpool.getUsage();
-        chunkSize = (mu.getMax() - mu.getUsed()) / 20;
-        newThreshold = mu.getUsed() + (chunkSize * NUM_CHUNKS);
+            // Now set threshold
+            MemoryUsage mu = mpool.getUsage();
+            chunkSize = (mu.getMax() - mu.getUsed()) / 20;
+            newThreshold = mu.getUsed() + (chunkSize * NUM_CHUNKS);
 
-        System.out.println("Setting threshold for " + mpool.getName() +
-            " from " + mpool.getUsageThreshold() + " to " + newThreshold +
-            ".  Current used = " + mu.getUsed());
-        mpool.setUsageThreshold(newThreshold);
+            System.out.println("Setting threshold for " + mpool.getName() +
+                " from " + mpool.getUsageThreshold() + " to " + newThreshold +
+                ".  Current used = " + mu.getUsed());
+            mpool.setUsageThreshold(newThreshold);
 
-        if (mpool.getUsageThreshold() != newThreshold) {
-            throw new RuntimeException("TEST FAILED: " +
+            if (mpool.getUsageThreshold() != newThreshold) {
+                throw new RuntimeException("TEST FAILED: " +
                 "Threshold for Memory pool " + mpool.getName() +
                 "is " + mpool.getUsageThreshold() + " but expected to be" +
                 newThreshold);
+            }
+
+
+            allocator.start();
+            // Force Allocator start first
+            phaser.arriveAndAwaitAdvance();
+            sweeper.start();
+
+
+            try {
+                allocator.join();
+                // Wait until AllocatorThread's done
+                phaser.arriveAndAwaitAdvance();
+                sweeper.join();
+            } catch (InterruptedException e) {
+                System.out.println("Unexpected exception:" + e);
+                testFailed = true;
+            }
+
+            listener.checkResult();
+
+            if (testFailed)
+                throw new RuntimeException("TEST FAILED.");
+
+            System.out.println(RunUtil.successMessage);
+
         }
-
-        allocator.start();
-        sweeper.start();
-
-        try {
-            allocator.join();
-            sweeper.join();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-            System.out.println("Unexpected exception.");
-            testFailed = true;
-        }
-
-        listener.checkResult();
-
-        if (testFailed)
-            throw new RuntimeException("TEST FAILED.");
-
-        System.out.println("Test passed.");
-
     }
 
     private static void goSleep(long ms) {
         try {
             Thread.sleep(ms);
         } catch (InterruptedException e) {
-            e.printStackTrace();
-            System.out.println("Unexpected exception.");
+            System.out.println("Unexpected exception:" + e);
             testFailed = true;
         }
     }
 
-    private static Object go = new Object();
-    private static boolean waiting = false; // No thread is waiting.
-
-    // Synchronizes two thread. If no thread is waiting then wait
-    // for notification from a different thread  and if it is
-    // is waiting then send notification.
-    // In this test case this method is used to synchronize sweeper
-    // thread and alocater thread to reach a particular point.
-    private static void wait_or_notify() {
-        synchronized (go) {
-            if (waiting == false) {
-                waiting = true;
-                System.out.println(" Waiting ");
-                try {
-                    go.wait();
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                    testFailed = true;
-                }
-                waiting = false;
-            } else {
-                System.out.println(" Notify ");
-                go.notify();
-            }
-        }
-    }
-
-    private static List objectPool = new ArrayList();
+    private static final List<Object> objectPool = new ArrayList<>();
     static class AllocatorThread extends Thread {
         public void doTask() {
             int iterations = 0;
             int numElements = (int) (chunkSize / 4); // minimal object size
-            while (!listenerInvoked) {
+            while (!listenerInvoked || mpool.getUsage().getUsed() < mpool.getUsageThreshold()) {
                 iterations++;
                 if (trace) {
                     System.out.println("   Iteration " + iterations +
@@ -234,23 +232,25 @@
                 goSleep(100);
             }
         }
+        @Override
         public void run() {
             for (int i = 1; i <= NUM_TRIGGERS; i++) {
-                System.out.println("AllocatorThread is doing task " + i);
+                // Sync with SweeperThread's second phase.
+                phaser.arriveAndAwaitAdvance();
+                System.out.println("AllocatorThread is doing task " + i +
+                    " phase " + phaser.getPhase());
                 doTask();
-                synchronized (sweep) {
-                    sweep.notify();
+                // Sync with SweeperThread's first phase.
+                phaser.arriveAndAwaitAdvance();
+                System.out.println("AllocatorThread done task " + i +
+                    " phase " + phaser.getPhase());
+                if (testFailed) {
+                    return;
                 }
-                // System.out.print(" Allocater Thread ");
-                // If sweeper thread is waiting then send notify
-                // else wait for notification from sweeper thread.
-                wait_or_notify();
-                if (testFailed) return;
             }
         }
     }
 
-    private static Object sweep = new Object();
     static class SweeperThread extends Thread {
         private void doTask() {
             for (; mpool.getUsage().getUsed() >=
@@ -261,28 +261,21 @@
                 goSleep(100);
             }
         }
+        @Override
         public void run() {
             for (int i = 1; i <= NUM_TRIGGERS; i++) {
-                synchronized (sweep) {
-                    while (!listenerInvoked) {
-                        try {
-                            sweep.wait();
-                        } catch (InterruptedException e) {
-                            e.printStackTrace();
-                            System.out.println("Unexpected exception.");
-                            testFailed = true;
-                        }
-                    }
-                }
-                System.out.println("SweepThread is doing task " + i);
+                // Sync with AllocatorThread's first phase.
+                phaser.arriveAndAwaitAdvance();
+                System.out.println("SweepThread is doing task " + i +
+                    " phase " + phaser.getPhase());
                 doTask();
 
                 listenerInvoked = false;
 
-                // System.out.print(" Sweeper Thread ");
-                // If Allocater thread is waiting wait send notify
-                // else wait for notfication from allocater thread.
-                wait_or_notify();
+                // Sync with AllocatorThread's second phase.
+                phaser.arriveAndAwaitAdvance();
+                System.out.println("SweepThread done task " + i +
+                    " phase " + phaser.getPhase());
                 if (testFailed) return;
             }
         }
--- a/test/java/lang/management/MemoryMXBean/LowMemoryTestConcMarkSweepGC.sh	Thu May 29 13:47:44 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-#
-# Copyright (c) 2003, 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.
-#
-# 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.
-#
-
-#
-# @test
-# @bug     4530538
-# @summary Test LowMemoryTest with concurrent mark sweep GC
-# @author  Mandy Chung
-#
-# @run build LowMemoryTest
-# @run shell/timeout=600 LowMemoryTestConcMarkSweepGC.sh
-#
-
-#Set appropriate jdk
-
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
-     echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
-     exit 1
-fi
-
-runOne()
-{ 
-   echo "runOne $@"
-   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
-}
-
-# Test LowMemoryTest with concurrent collector
-runOne -XX:+UseConcMarkSweepGC LowMemoryTest 
-
-exit 0
--- a/test/java/lang/management/MemoryMXBean/LowMemoryTestParallelGC.sh	Thu May 29 13:47:44 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-#
-# Copyright (c) 2003, 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.
-#
-# 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.
-#
-
-#
-# @test
-# @bug     4530538
-# @summary Test LowMemoryTest with parallel GC
-# @author  Mandy Chung
-#
-# @run build LowMemoryTest
-# @run shell/timeout=600 LowMemoryTestParallelGC.sh
-#
-
-#Set appropriate jdk
-
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
-     echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
-     exit 1
-fi
-
-runOne()
-{ 
-   echo "runOne $@"
-   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
-}
-
-# Test LowMemoryTest with parallel scavenger collector
-runOne -XX:+UseParallelGC LowMemoryTest 
-
-exit 0
--- a/test/java/lang/management/MemoryMXBean/LowMemoryTestSerialGC.sh	Thu May 29 13:47:44 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-#
-# Copyright (c) 2003, 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.
-#
-# 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.
-#
-
-#
-# @test
-# @bug     4530538
-# @summary Test LowMemoryTest with Serial GC
-# @author  Mandy Chung
-#
-# @run build LowMemoryTest
-# @run shell/timeout=600 LowMemoryTestSerialGC.sh
-#
-
-#Set appropriate jdk
-
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
-     echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
-     exit 1
-fi
-
-runOne()
-{ 
-   echo "runOne $@"
-   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
-}
-
-# Test LowMemoryTest with serial collector
-runOne -XX:+UseSerialGC LowMemoryTest 
-
-exit 0
--- a/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Tue Jun 03 08:32:34 2014 -0700
@@ -32,11 +32,9 @@
  * @summary Basic Test for MemoryPool.resetPeakUsage()
  * @author  Mandy Chung
  *
- * @build ResetPeakMemoryUsage MemoryUtil
- * @run main/othervm -XX:+PrintGCDetails -XX:+UseSerialGC -Xms256m -XX:MarkSweepAlwaysCompactCount=1 -Xmn8m ResetPeakMemoryUsage
- * @run main/othervm -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -Xms256m -Xmn8m ResetPeakMemoryUsage
- * @run main/othervm -XX:+PrintGCDetails -XX:+UseParallelGC -Xms256m -Xmn8m ResetPeakMemoryUsage
- * @run main/othervm -XX:+PrintGCDetails -XX:+UseG1GC -Xms256m -Xmn8m -XX:G1HeapRegionSize=1m ResetPeakMemoryUsage
+ * @library /lib/testlibrary/
+ * @build ResetPeakMemoryUsage MemoryUtil RunUtil
+ * @run main ResetPeakMemoryUsage
  */
 
 import java.lang.management.*;
@@ -47,24 +45,42 @@
     // make public so that it can't be optimized away easily
     public static Object[] obj;
 
-    public static void main(String[] argv) {
-        List pools = ManagementFactory.getMemoryPoolMXBeans();
-        ListIterator iter = pools.listIterator();
-        boolean found = false;
-        while (iter.hasNext()) {
-            MemoryPoolMXBean p = (MemoryPoolMXBean) iter.next();
-            // only check heap pools that support usage threshold
-            // this is typically only the old generation space
-            // since the other spaces are expected to get filled up
-            if (p.getType() == MemoryType.HEAP &&
-                p.isUsageThresholdSupported())
-            {
-                found = true;
-                testPool(p);
+    /**
+     * Run the test multiple times with different GC versions.
+     * First with default command line specified by the framework.
+     * Then with all GC versions specified by the test.
+     */
+    public static void main(String a[]) throws Throwable {
+        final String main = "ResetPeakMemoryUsage$TestMain";
+        final String ms = "-Xms256m";
+        final String mn = "-Xmn8m";
+        RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseConcMarkSweepGC");
+        RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseParallelGC");
+        RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseG1GC", "-XX:G1HeapRegionSize=1m");
+        RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseSerialGC",
+                "-XX:MarkSweepAlwaysCompactCount=1");
+    }
+
+    private static class TestMain {
+        public static void main(String[] argv) {
+            List pools = ManagementFactory.getMemoryPoolMXBeans();
+            ListIterator iter = pools.listIterator();
+            boolean found = false;
+            while (iter.hasNext()) {
+                MemoryPoolMXBean p = (MemoryPoolMXBean) iter.next();
+                // only check heap pools that support usage threshold
+                // this is typically only the old generation space
+                // since the other spaces are expected to get filled up
+                if (p.getType() == MemoryType.HEAP &&
+                    p.isUsageThresholdSupported())
+                {
+                    found = true;
+                    testPool(p);
+                }
             }
-        }
-        if (!found) {
-            throw new RuntimeException("No heap pool found");
+            if (!found) {
+                throw new RuntimeException("No heap pool found");
+            }
         }
     }
 
@@ -142,7 +158,7 @@
                 formatSize("previous peak", peak2.getUsed()));
         }
 
-        System.out.println("Test passed.");
+        System.out.println(RunUtil.successMessage);
     }
 
     private static String INDENT = "    ";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/management/MemoryMXBean/RunUtil.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/**
+ * Utility class for launching a test in a separate JVM.
+ */
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.Utils;
+import jdk.testlibrary.ProcessTools;
+import jdk.testlibrary.JDKToolFinder;
+
+public class RunUtil {
+
+    // Used to mark that the test has passed successfully.
+    public static final String successMessage = "Test passed.";
+
+    public static void runTestClearGcOpts(String main, String... testOpts) throws Throwable {
+        runTest(main, true, testOpts);
+    }
+
+    public static void runTestKeepGcOpts(String main, String... testOpts) throws Throwable {
+        runTest(main, false, testOpts);
+    }
+
+    /**
+     * Runs a test in a separate JVM.
+     * command line like:
+     * {test_jdk}/bin/java {defaultopts} -cp {test.class.path} {testopts} main
+     *
+     * {defaultopts} are the default java options set by the framework.
+     * Default GC options in {defaultopts} may be removed.
+     * This is used when the test specifies its own GC options.
+     *
+     * @param main Name of the main class.
+     * @param clearGcOpts true if the default GC options should be removed.
+     * @param testOpts java options specified by the test.
+     */
+    private static void runTest(String main, boolean clearGcOpts, String... testOpts)
+                throws Throwable {
+        List<String> opts = new ArrayList<>();
+        opts.add(JDKToolFinder.getJDKTool("java"));
+        opts.addAll(Arrays.asList(Utils.getTestJavaOpts()));
+        opts.add("-cp");
+        opts.add(System.getProperty("test.class.path", "test.class.path"));
+        opts.add("-XX:+PrintGCDetails");
+
+        if (clearGcOpts) {
+            opts = Utils.removeGcOpts(opts);
+        }
+        opts.addAll(Arrays.asList(testOpts));
+        opts.add(main);
+
+        OutputAnalyzer output = ProcessTools.executeProcess(opts.toArray(new String[0]));
+        output.shouldHaveExitValue(0);
+        if (output.getStdout().indexOf(successMessage) < 0) {
+            throw new Exception("output missing '" + successMessage + "'");
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/Authenticator/B8034170.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+/**
+ * @test
+ * @bug 8034170
+ * @summary Digest authentication interop issue
+ * @run main/othervm B8034170 unquoted
+ * @run main/othervm -Dhttp.auth.digest.quoteParameters=true B8034170 quoted
+ */
+
+public class B8034170 {
+
+    static boolean expectQuotes;
+
+    static class BasicServer extends Thread {
+
+        ServerSocket server;
+
+        Socket s;
+        InputStream is;
+        OutputStream os;
+
+        static final String realm = "wallyworld";
+
+        String reply1 = "HTTP/1.1 401 Unauthorized\r\n"+
+            "WWW-Authenticate: Digest realm=\""+realm+"\", qop=\"auth\"" +
+            ", nonce=\"8989de95ea2402b64d73cecdb15da255\"" +
+            ", opaque=\"bbfb4c9ee92ddccc73521c3e6e841ba2\"\r\n\r\n";
+
+        String OKreply = "HTTP/1.1 200 OK\r\n"+
+            "Date: Mon, 15 Jan 2001 12:18:21 GMT\r\n" +
+            "Server: Apache/1.3.14 (Unix)\r\n" +
+            "Connection: close\r\n" +
+            "Content-Type: text/plain; charset=iso-8859-1\r\n" +
+            "Content-Length: 10\r\n\r\n";
+
+        String ERRreply = "HTTP/1.1 500 Internal server error\r\n"+
+            "Date: Mon, 15 Jan 2001 12:18:21 GMT\r\n" +
+            "Server: Apache/1.3.14 (Unix)\r\n" +
+            "Connection: close\r\n" +
+            "Content-Length: 0\r\n\r\n";
+
+        BasicServer (ServerSocket s) {
+            server = s;
+        }
+
+        int readAll (Socket s, byte[] buf) throws IOException {
+            int pos = 0;
+            InputStream is = s.getInputStream ();
+            // wait two seconds for request, as client doesn't close
+            // the connection
+            s.setSoTimeout(2000);
+            try {
+                int n;
+                while ((n=is.read(buf, pos, buf.length-pos)) > 0)
+                    pos +=n;
+            } catch (SocketTimeoutException x) { }
+            return pos;
+        }
+
+        public void run () {
+            byte[] buf = new byte[5000];
+            try {
+                System.out.println ("Server 1: accept");
+                s = server.accept ();
+                System.out.println ("accepted");
+                os = s.getOutputStream();
+                os.write (reply1.getBytes());
+                readAll (s, buf);
+                s.close ();
+
+                System.out.println ("Server 2: accept");
+                s = server.accept ();
+                System.out.println ("accepted");
+                os = s.getOutputStream();
+                int count = readAll (s, buf);
+                String reply = new String(buf, 0, count);
+
+                boolean error;
+
+                if (expectQuotes) {
+                    error = false;
+                    if (!reply.contains("qop=\"auth\"")) {
+                        System.out.println ("Expecting quoted qop. Not found");
+                        error = true;
+                    }
+                    if (!reply.contains("algorithm=\"MD5\"")) {
+                        System.out.println ("Expecting quoted algorithm. Not found");
+                        error = true;
+                    }
+                } else {
+                    error = false;
+                    if (!reply.contains("qop=auth")) {
+                        System.out.println ("Expecting unquoted qop. Not found");
+                        error = true;
+                    }
+                    if (!reply.contains("algorithm=MD5")) {
+                        System.out.println ("Expecting unquoted algorithm. Not found");
+                        error = true;
+                    }
+                }
+                if (error) {
+                    os.write(ERRreply.getBytes());
+                    os.flush();
+                    s.close();
+                } else {
+                    os.write((OKreply+"HelloWorld").getBytes());
+                    os.flush();
+                    s.close();
+                }
+            }
+            catch (Exception e) {
+                System.out.println (e);
+            }
+            finished ();
+        }
+
+        public synchronized void finished () {
+            notifyAll();
+        }
+
+    }
+
+    static class MyAuthenticator3 extends Authenticator {
+        PasswordAuthentication pw;
+        MyAuthenticator3 () {
+            super ();
+            pw = new PasswordAuthentication ("user", "passwordNotCheckedAnyway".toCharArray());
+        }
+
+        public PasswordAuthentication getPasswordAuthentication ()
+            {
+            System.out.println ("Auth called");
+            return pw;
+        }
+    }
+
+
+    static void read (InputStream is) throws IOException {
+        int c;
+        System.out.println ("reading");
+        while ((c=is.read()) != -1) {
+            System.out.write (c);
+        }
+        System.out.println ("");
+        System.out.println ("finished reading");
+    }
+
+    public static void main (String args[]) throws Exception {
+        expectQuotes = args[0].equals("quoted");
+
+        MyAuthenticator3 auth = new MyAuthenticator3 ();
+        Authenticator.setDefault (auth);
+        ServerSocket ss = new ServerSocket (0);
+        int port = ss.getLocalPort ();
+        BasicServer server = new BasicServer (ss);
+        synchronized (server) {
+            server.start();
+            System.out.println ("client 1");
+            URL url = new URL ("http://localhost:"+port+"/d1/d2/d3/foo.html");
+            URLConnection urlc = url.openConnection ();
+            InputStream is = urlc.getInputStream ();
+            read (is);
+            is.close ();
+        }
+    }
+}
--- a/test/java/net/URLClassLoader/closetest/CloseTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/net/URLClassLoader/closetest/CloseTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -26,7 +26,7 @@
  * @bug 4167874
  * @library ../../../../com/sun/net/httpserver
  * @library /lib/testlibrary
- * @build FileServerHandler jdk.testlibrary.FileUtils
+ * @build jdk.testlibrary.* FileServerHandler
  * @run shell build.sh
  * @run main/othervm CloseTest
  * @summary URL-downloaded jar files can consume all available file descriptors
--- a/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java	Tue Jun 03 08:32:34 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 6899919
  * @library /lib/testlibrary
- * @build jdk.testlibrary.FileUtils
+ * @build jdk.testlibrary.*
  * @run shell build2.sh
  * @run main/othervm GetResourceAsStream
  */
--- a/test/java/net/URLPermission/nstest/lookup.sh	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/net/URLPermission/nstest/lookup.sh	Tue Jun 03 08:32:34 2014 -0700
@@ -26,6 +26,7 @@
 # @library /lib/testlibrary
 # @compile -XDignore.symbol.file=true SimpleNameService.java
 #            LookupTest.java SimpleNameServiceDescriptor.java
+# @build jdk.testlibrary.*
 # @run shell/timeout=50 lookup.sh
 #
 
--- a/test/java/util/zip/ZipFile/MultiThreadedReadTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/java/util/zip/ZipFile/MultiThreadedReadTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -25,7 +25,7 @@
  * @bug 8038491
  * @summary Crash in ZipFile.read() when ZipFileInputStream is shared between threads
  * @library /lib/testlibrary
- * @build jdk.testlibrary.FileUtils
+ * @build jdk.testlibrary.*
  * @run main MultiThreadedReadTest
  */
 
--- a/test/javax/management/monitor/StartStopTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/javax/management/monitor/StartStopTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -28,9 +28,8 @@
  *          monitors are started and stopped in a loop.
  * @author Luis-Miguel Alventosa
  * @library /lib/testlibrary
- * @run build jdk.testlibrary.Utils
  * @run clean StartStopTest
- * @run build StartStopTest
+ * @run build jdk.testlibrary.* StartStopTest
  * @run main/othervm/timeout=300 StartStopTest 1
  * @run main/othervm/timeout=300 StartStopTest 2
  * @run main/othervm/timeout=300 StartStopTest 3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComboBox/ConsumedEscTest/ConsumedEscTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import sun.awt.SunToolkit;
+
+/*
+  @test
+  @bug 8031485
+  @summary Combo box consuming escape and enter key events
+  @author Petr Pchelko
+  @run main ConsumedEscTest
+*/
+public class ConsumedEscTest {
+    private static volatile JFrame frame;
+    private static volatile boolean passed = false;
+
+    public static void main(String... args) throws Exception {
+        try {
+            SwingUtilities.invokeAndWait(() -> {
+                frame = new JFrame();
+                JComboBox<String> combo = new JComboBox<>(new String[]{"one", "two", "three"});
+                JPanel panel = new JPanel();
+                panel.add(combo);
+                combo.requestFocusInWindow();
+                frame.setBounds(100, 150, 300, 100);
+                addAction(panel);
+                frame.add(panel);
+                frame.setVisible(true);
+            });
+
+            Robot robot = new Robot();
+            robot.waitForIdle();
+            ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+            robot.keyPress(KeyEvent.VK_ESCAPE);
+            robot.waitForIdle();
+            ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+            robot.keyRelease(KeyEvent.VK_ESCAPE);
+            robot.waitForIdle();
+            ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+            if (!passed) {
+                throw new RuntimeException("FAILED: ESC was consumed by combo box");
+            }
+        } finally {
+            if (frame != null) {
+                frame.dispose();
+            }
+        }
+    }
+
+    private static void addAction(JComponent comp) {
+        KeyStroke k = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
+        Object actionKey = "cancel";
+        comp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(k, actionKey);
+        Action cancelAction = new AbstractAction() {
+            @Override
+            public void actionPerformed(ActionEvent ev) {
+                passed = true;
+            }
+        };
+        comp.getActionMap().put(actionKey, cancelAction);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/plaf/nimbus/8041725/bug8041725.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/* @test
+   @bug 8041725
+   @summary JList selection colors are not UIResource instances in Nimbus L&F
+   @author Anton Litvinov
+*/
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.nimbus.*;
+
+public class bug8041725 {
+    public static void main(String[] args) throws Exception {
+        UIManager.setLookAndFeel(new NimbusLookAndFeel());
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                JFrame frame = new JFrame("bug8041725");
+                frame.setSize(200, 200);
+                JList list = new JList(new String[]{"Item1", "Item2", "Item3"});
+                frame.getContentPane().add(list);
+                frame.pack();
+                frame.setVisible(true);
+
+                System.err.println("Test #1: No items are selected, list is enabled.");
+                testSelectionColors(list);
+
+                System.err.println("Test #2: No items are selected, list is disabled.");
+                list.setEnabled(false);
+                testSelectionColors(list);
+
+                System.err.println("Test #3: One item is selected, list is disabled.");
+                list.setSelectedIndex(0);
+                testSelectionColors(list);
+
+                System.err.println("Test #4: One item is selected, list is enabled.");
+                list.setEnabled(true);
+                testSelectionColors(list);
+
+                frame.dispose();
+            }
+        });
+    }
+
+    private static void testSelectionColors(JList list) {
+        Color selBackColor = list.getSelectionBackground();
+        if (!(selBackColor instanceof UIResource)) {
+            throw new RuntimeException(String.format(
+                "JList.getSelectionBackground() returned instance of '%s' instead of UIResource.",
+                selBackColor.getClass()));
+        }
+        Color selForeColor = list.getSelectionForeground();
+        if (!(selForeColor instanceof UIResource)) {
+            throw new RuntimeException(String.format(
+                "JList.getSelectionForeground() returned instance of '%s' instead of UIResource.",
+                selForeColor.getClass()));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/plaf/synth/Test8043627.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import javax.swing.JButton;
+import javax.swing.plaf.synth.SynthButtonUI;
+
+/*
+ * @test
+ * @bug 8043627
+ * @summary Tests that SynthContext can be created with SecurityManager installed
+ * @author Sergey Malenkov
+ */
+
+public class Test8043627 {
+    public static void main(String[] args) {
+        System.setSecurityManager(new SecurityManager());
+        new SynthButtonUI().getContext(new JButton());
+    }
+}
--- a/test/lib/testlibrary/jdk/testlibrary/Utils.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/lib/testlibrary/jdk/testlibrary/Utils.java	Tue Jun 03 08:32:34 2014 -0700
@@ -118,6 +118,26 @@
     }
 
     /**
+     * Removes any options specifying which GC to use, for example "-XX:+UseG1GC".
+     * Removes any options matching: -XX:(+/-)Use*GC
+     * Used when a test need to set its own GC version. Then any
+     * GC specified by the framework must first be removed.
+     * @return A copy of given opts with all GC options removed.
+     */
+    private static final Pattern useGcPattern = Pattern.compile("\\-XX\\:[\\+\\-]Use.+GC");
+    public static List<String> removeGcOpts(List<String> opts) {
+        List<String> optsWithoutGC = new ArrayList<String>();
+        for (String opt : opts) {
+            if (useGcPattern.matcher(opt).matches()) {
+                System.out.println("removeGcOpts: removed " + opt);
+            } else {
+                optsWithoutGC.add(opt);
+            }
+        }
+        return optsWithoutGC;
+    }
+
+    /**
      * Splits a string by white space.
      * Works like String.split(), but returns an empty array
      * if the string is null or empty.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/awt/image/bug8038000.java	Tue Jun 03 08:32:34 2014 -0700
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug     8038000
+ *
+ * @summary Verifies that we could create different type of Rasters with height 1
+ * and strideline which exceeds raster width.
+ * Also checks that a set of RasterOp work correctly with such kind of Rasters.
+ *
+ * @run     main bug8038000
+ */
+
+import java.awt.*;
+import java.awt.color.ColorSpace;
+import java.awt.geom.AffineTransform;
+import java.awt.image.*;
+import java.util.Arrays;
+
+public class bug8038000 {
+
+    public static void main(String[] args) throws Exception {
+        new bug8038000().checkOps();
+
+        // No exceptions - Passed
+    }
+
+    private void checkOps() throws Exception {
+
+        RasterOp[] ops = new RasterOp[] {
+                new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                        ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), null),
+                new AffineTransformOp(AffineTransform.getScaleInstance(1, 1.1), null)
+        };
+
+
+        for (RasterOp op: ops) {
+            // Banded rasters
+            checkOp(Raster.createBandedRaster(DataBuffer.TYPE_BYTE, 10, 1, 10,
+                            new int[] {0, 1, 2}, new int[]{2,1,0}, null),
+                    Raster.createBandedRaster(DataBuffer.TYPE_BYTE, 10, 1, 1001,
+                            new int[] {0, 1, 2}, new int[]{2,1,0}, null), op);
+            checkOp(Raster.createBandedRaster(DataBuffer.TYPE_USHORT, 10, 1, 10,
+                    new int[] {0, 1, 2}, new int[]{2,1,0}, null),
+                    Raster.createBandedRaster(DataBuffer.TYPE_USHORT, 10, 1, 1001,
+                            new int[] {0, 1, 2}, new int[]{2,1,0}, null), op);
+            checkOp(Raster.createBandedRaster(DataBuffer.TYPE_INT, 10, 1, 10,
+                    new int[] {0, 1, 2}, new int[]{2,1,0}, null),
+                    Raster.createBandedRaster(DataBuffer.TYPE_INT, 10, 1, 1001,
+                            new int[] {0, 1, 2}, new int[]{2,1,0}, null), op);
+
+            // Interleaved rasters
+            checkOp(Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,
+                            10, 1, 30, 3, new int[]{0, 1, 2}, null),
+                    Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,
+                            10, 1, 1001, 3, new int[]{0, 1, 2}, null),
+                    op);
+
+            checkOp(Raster.createInterleavedRaster(DataBuffer.TYPE_USHORT,
+                            10, 1, 30, 3, new int[]{0, 1, 2}, null),
+                    Raster.createInterleavedRaster(DataBuffer.TYPE_USHORT,
+                            10, 1, 1001, 3, new int[]{0, 1, 2}, null),
+                    op);
+
+            // Packed rasters
+            checkOp(Raster.createPackedRaster(new DataBufferByte(10), 10, 1, 10,
+                            new int[] {0x01, 0x02, 0x04}, null),
+                    Raster.createPackedRaster(new DataBufferByte(10), 10, 1, 2000,
+                            new int[] {0x01, 0x02, 0x04}, null),
+                    op);
+            checkOp(Raster.createPackedRaster(new DataBufferInt(10), 10, 1, 10,
+                        new int[] {0xff0000, 0x00ff00, 0x0000ff}, null),
+                    Raster.createPackedRaster(new DataBufferInt(10), 10, 1, 20,
+                            new int[] {0xff0000, 0x00ff00, 0x0000ff}, null),
+                    op);
+
+        }
+    }
+
+    /**
+     *  Takes two identical rasters (identical with the exception of scanline stride)
+     *  fills their pixels with identical data, applies the RasterOp to both rasters
+     *  and checks that the result is the same
+     */
+    private void checkOp(WritableRaster wr1, WritableRaster wr2, RasterOp op) {
+        System.out.println("Checking " + op + " with rasters: \n    " + wr1 +
+                "\n    " + wr2);
+        try {
+            WritableRaster r1 = op.filter(fillRaster(wr1), null);
+            WritableRaster r2 = op.filter(fillRaster(wr2), null);
+            compareRasters(r1, r2);
+        } catch (ImagingOpException e) {
+            System.out.println("    Skip: Op is not supported: " + e);
+        }
+    }
+
+    private WritableRaster fillRaster(WritableRaster wr) {
+        int c = 0;
+        for(int x = wr.getMinX(); x < wr.getMinX() + wr.getWidth(); x++) {
+            for(int y = wr.getMinY(); y < wr.getMinY() + wr.getHeight(); y++) {
+                for (int b = 0; b < wr.getNumBands(); b++) {
+                    wr.setSample(x, y, b, c++);
+                }
+            }
+        }
+        return wr;
+    }
+
+    private void compareRasters(Raster r1, Raster r2) {
+        Rectangle bounds = r1.getBounds();
+        if (!bounds.equals(r2.getBounds())) {
+            throw new RuntimeException("Bounds differ.");
+        }
+
+        if (r1.getNumBands() != r2.getNumBands()) {
+            throw new RuntimeException("Bands differ.");
+        }
+
+        int[] b1 = new int[r1.getNumBands()];
+        int[] b2 = new int[r1.getNumBands()];
+
+        for (int x = (int) bounds.getX(); x < bounds.getMaxX(); x++) {
+            for (int y = (int) bounds.getY(); y < bounds.getMaxY(); y++) {
+                r1.getPixel(x,y, b1);
+                r2.getPixel(x,y, b2);
+                if (!Arrays.equals(b1, b2)) {
+                    throw new RuntimeException("Pixels differ.");
+                }
+            }
+        }
+    }
+}
--- a/test/sun/management/jdp/JdpDefaultsTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/management/jdp/JdpDefaultsTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -28,7 +28,7 @@
  * @test JdpDefaultsTest
  * @summary Assert that we can read JDP packets from a multicast socket connection, on default IP and port.
  * @library /lib/testlibrary
- * @build ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
+ * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
  * @run main JdpDefaultsTest
  */
 
--- a/test/sun/management/jdp/JdpOffTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/management/jdp/JdpOffTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -29,7 +29,7 @@
  * @test JdpOffTest.java
  * @summary Assert that no JDP packets are sent to the default address and port.
  * @library /lib/testlibrary
- * @build ClientConnection JdpTestUtil JdpTestCase JdpOffTestCase DynamicLauncher
+ * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOffTestCase DynamicLauncher
  * @run main JdpOffTest
  */
 
--- a/test/sun/management/jdp/JdpSpecificAddressTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/management/jdp/JdpSpecificAddressTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -28,7 +28,7 @@
  * @test JdpSpecificAddressTest
  * @summary Assert that we can read JDP packets from a multicast socket connection, on specific IP and port.
  * @library /lib/testlibrary
- * @build ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
+ * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
  * @run main JdpSpecificAddressTest
  */
 
--- a/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -44,6 +44,7 @@
 
     private static final SynchronousQueue<Exception> queue =
             new SynchronousQueue<Exception>();
+    private static volatile boolean isRunning = true;
 
     static final class Result extends Exception {
 
@@ -91,19 +92,23 @@
         Thread t = new Thread() {
 
             public void run() {
-                while (true) {
+                while (isRunning) {
                     Exception error = Result.SUCCESS;
                     try {
                         System.err.println("Accepting: ");
                         final Socket ss = s.accept();
                         System.err.println(ss.getInetAddress() + " accepted");
                     } catch (Exception x) {
-                        x.printStackTrace();
+                        if (isRunning) {
+                            x.printStackTrace();
+                        }
                         error = x;
                     } finally {
                         try {
-                            // wait for the client to get the exception.
-                            queue.put(error);
+                            if (isRunning) {
+                                // wait for the client to get the exception.
+                                queue.put(error);
+                            }
                         } catch (Exception x) {
                             // too bad!
                             System.err.println("Could't send result to client!");
@@ -114,32 +119,38 @@
                 }
             }
         };
-        t.setDaemon(true);
-        t.start();
 
-        System.err.println("new Socket((String)null, port)");
-        final Socket s1 = new Socket((String) null, port);
-        checkError("new Socket((String)null, port)");
-        s1.close();
-        System.err.println("new Socket((String)null, port): PASSED");
+        try {
+            t.start();
 
-        System.err.println("new Socket(InetAddress.getByName(null), port)");
-        final Socket s2 = new Socket(InetAddress.getByName(null), port);
-        checkError("new Socket(InetAddress.getByName(null), port)");
-        s2.close();
-        System.err.println("new Socket(InetAddress.getByName(null), port): PASSED");
+            System.err.println("new Socket((String)null, port)");
+            final Socket s1 = new Socket((String) null, port);
+            checkError("new Socket((String)null, port)");
+            s1.close();
+            System.err.println("new Socket((String)null, port): PASSED");
 
-        System.err.println("new Socket(localhost, port)");
-        final Socket s3 = new Socket("localhost", port);
-        checkError("new Socket(localhost, port)");
-        s3.close();
-        System.err.println("new Socket(localhost, port): PASSED");
+            System.err.println("new Socket(InetAddress.getByName(null), port)");
+            final Socket s2 = new Socket(InetAddress.getByName(null), port);
+            checkError("new Socket(InetAddress.getByName(null), port)");
+            s2.close();
+            System.err.println("new Socket(InetAddress.getByName(null), port): PASSED");
 
-        System.err.println("new Socket(127.0.0.1, port)");
-        final Socket s4 = new Socket("127.0.0.1", port);
-        checkError("new Socket(127.0.0.1, port)");
-        s4.close();
-        System.err.println("new Socket(127.0.0.1, port): PASSED");
+            System.err.println("new Socket(localhost, port)");
+            final Socket s3 = new Socket("localhost", port);
+            checkError("new Socket(localhost, port)");
+            s3.close();
+            System.err.println("new Socket(localhost, port): PASSED");
 
+            System.err.println("new Socket(127.0.0.1, port)");
+            final Socket s4 = new Socket("127.0.0.1", port);
+            checkError("new Socket(127.0.0.1, port)");
+            s4.close();
+            System.err.println("new Socket(127.0.0.1, port): PASSED");
+        }
+        finally {
+            isRunning = false;
+            s.close();
+            t.join();
+        }
     }
 }
--- a/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -41,8 +41,7 @@
  * @test
  * @bug 6434402 8004926
  * @library /lib/testlibrary
- * @build jdk.testlibrary.ProcessTools
- * @build TestManager TestApplication CustomLauncherTest
+ * @build jdk.testlibrary.* TestManager TestApplication CustomLauncherTest
  * @run main/othervm CustomLauncherTest
  * @author Jaroslav Bachorik
  */
--- a/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -42,8 +42,7 @@
  *          without connection or username/password details.
  *          TestManager will attempt a connection to the address obtained from
  *          both agent properties and jvmstat buffer.
- * @build jdk.testlibrary.ProcessTools
- * @build TestManager TestApplication
+ * @build jdk.testlibrary.* TestManager TestApplication
  * @run main/othervm/timeout=300 -XX:+UsePerfData LocalManagementTest
  */
 
--- a/test/sun/management/jmxremote/startstop/JMXStartStopTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/management/jmxremote/startstop/JMXStartStopTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -54,10 +54,7 @@
  * @test
  * @bug 7110104
  * @library /lib/testlibrary
- * @build jdk.testlibrary.ProcessTools
- * @build jdk.testlibrary.JDKToolLauncher
- * @build jdk.testlibrary.Utils
- * @build JMXStartStopTest JMXStartStopDoSomething
+ * @build jdk.testlibrary.* JMXStartStopTest JMXStartStopDoSomething
  * @run main/othervm JMXStartStopTest
  * @summary Makes sure that enabling/disabling the management agent through
  *          JCMD achieves the desired results
--- a/test/sun/nio/cs/TestUTF8.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/nio/cs/TestUTF8.java	Tue Jun 03 08:32:34 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4486841 7040220 7096080
+ * @bug 4486841 7040220 7096080 8039751
  * @summary Test UTF-8 charset
  */
 
@@ -291,14 +291,18 @@
         {1, (byte)0xE0, (byte)0xC0, (byte)0xBF }, // invalid second byte
         {2, (byte)0xE0, (byte)0xA0, (byte)0x7F }, // invalid third byte
         {2, (byte)0xE0, (byte)0xA0, (byte)0xC0 }, // invalid third byte
+        {2, (byte)0xE1, (byte)0x80, (byte)0x42},  // invalid third byte
+
         {1, (byte)0xFF, (byte)0xFF, (byte)0xFF }, // all ones
         {1, (byte)0xE0, (byte)0xC0, (byte)0x80 }, // invalid second byte
         {1, (byte)0xE0, (byte)0x80, (byte)0xC0 }, // invalid first byte
         {1, (byte)0xE0, (byte)0x41,},             // invalid second byte & 2 bytes
+        {1, (byte)0xE1, (byte)0x40,},             // invalid second byte & 2 bytes
         {3, (byte)0xED, (byte)0xAE, (byte)0x80 }, // 3 bytes surrogate
         {3, (byte)0xED, (byte)0xB0, (byte)0x80 }, // 3 bytes surrogate
 
 
+
         // Four-byte sequences
         {1, (byte)0xF0, (byte)0x80, (byte)0x80, (byte)0x80 }, // U+0000 zero-padded
         {1, (byte)0xF0, (byte)0x80, (byte)0x81, (byte)0xBF }, // U+007F zero-padded
@@ -323,6 +327,32 @@
         {1, (byte)0xF4, (byte)0xC0, (byte)0x80, (byte)0xC0 }, // out-range 4-byte
         {1, (byte)0xF5, (byte)0x80, (byte)0x80, (byte)0xC0 }, // out-range 4-byte
 
+        // #8039751
+        {1, (byte)0xF6, (byte)0x80, (byte)0x80, (byte)0x80 }, // out-range 1st byte
+        {1, (byte)0xF6, (byte)0x80, (byte)0x80,  },
+        {1, (byte)0xF6, (byte)0x80, },
+        {1, (byte)0xF6, },
+        {1, (byte)0xF5, (byte)0x80, (byte)0x80, (byte)0x80 }, // out-range 1st byte
+        {1, (byte)0xF5, (byte)0x80, (byte)0x80,  },
+        {1, (byte)0xF5, (byte)0x80,  },
+        {1, (byte)0xF5  },
+
+        {1, (byte)0xF4, (byte)0x90, (byte)0x80, (byte)0x80 }, // out-range 2nd byte
+        {1, (byte)0xF4, (byte)0x90, (byte)0x80 },
+        {1, (byte)0xF4, (byte)0x90 },
+
+        {1, (byte)0xF4, (byte)0x7f, (byte)0x80, (byte)0x80 }, // out-range/ascii 2nd byte
+        {1, (byte)0xF4, (byte)0x7f, (byte)0x80 },
+        {1, (byte)0xF4, (byte)0x7f },
+
+        {1, (byte)0xF0, (byte)0x80, (byte)0x80, (byte)0x80 }, // out-range 2nd byte
+        {1, (byte)0xF0, (byte)0x80, (byte)0x80 },
+        {1, (byte)0xF0, (byte)0x80 },
+
+        {1, (byte)0xF0, (byte)0xc0, (byte)0x80, (byte)0x80 }, // out-range 2nd byte
+        {1, (byte)0xF0, (byte)0xc0, (byte)0x80 },
+        {1, (byte)0xF0, (byte)0xc0 },
+
         // Five-byte sequences
         {1, (byte)0xF8, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80},  // invalid first byte
         {1, (byte)0xF8, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x80 }, // U+0000 zero-padded
@@ -553,7 +583,6 @@
         check4ByteSurrs("UTF-8");
         checkMalformed("UTF-8", malformed);
         checkUnderOverflow("UTF-8");
-
         checkRoundtrip("CESU-8");
         check6ByteSurrs("CESU-8");
         checkMalformed("CESU-8", malformed_cesu8);
--- a/test/sun/reflect/AnonymousNewInstance/ManyNewInstanceAnonTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/reflect/AnonymousNewInstance/ManyNewInstanceAnonTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -28,6 +28,7 @@
  * @author  Robert Field
  * @library /lib/testlibrary
  * @compile -XDignore.symbol.file ManyNewInstanceAnonTest.java
+ * @build jdk.testlibrary.*
  * @run main ClassFileInstaller ManyNewInstanceAnonTest
  * @run main/othervm -Xbootclasspath/a:. -Xverify:all ManyNewInstanceAnonTest
  * @run main/othervm -Xbootclasspath/a:. -Xverify:all -Dsun.reflection.noInflation=true ManyNewInstanceAnonTest
--- a/test/sun/tools/jstatd/JstatdTest.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/tools/jstatd/JstatdTest.java	Tue Jun 03 08:32:34 2014 -0700
@@ -27,6 +27,7 @@
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
 import java.util.Arrays;
+import java.util.regex.Pattern;
 
 import static jdk.testlibrary.Asserts.*;
 import jdk.testlibrary.JDKToolLauncher;
@@ -34,6 +35,7 @@
 import jdk.testlibrary.ProcessThread;
 import jdk.testlibrary.TestThread;
 import jdk.testlibrary.Utils;
+import jdk.testlibrary.ProcessTools;
 
 /**
  * The base class for tests of jstatd.
@@ -93,8 +95,11 @@
         if (tool == "rmiregistry") {
             processName = "registryimpl";
         }
+
+        Pattern toolInJpsPattern =
+                Pattern.compile("^\\d+\\s{1}" + processName + "\\s{1}.*-dparent\\.pid\\." + ProcessTools.getProcessId() + ".*");
         for (String line : lines) {
-            if (line.toLowerCase().matches("^\\d+\\s{1}" + processName + "$")) {
+            if (toolInJpsPattern.matcher(line.toLowerCase()).matches()) {
                 pid = line.split(" ")[0];
                 count++;
             }
@@ -167,6 +172,8 @@
     private OutputAnalyzer runJps() throws Exception {
         JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jps");
         launcher.addVMArg("-XX:+UsePerfData");
+        // Run jps with -v flag to obtain -Dparent.pid.<pid>
+        launcher.addToolArg("-v");
         launcher.addToolArg(getDestination());
 
         String[] cmd = launcher.getCommand();
@@ -286,7 +293,7 @@
      * jstatd -J-XX:+UsePerfData -J-Djava.security.policy=all.policy -n serverName
      * jstatd -J-XX:+UsePerfData -J-Djava.security.policy=all.policy -p port -n serverName
      */
-    private String[] getJstatdCmd() throws UnknownHostException {
+    private String[] getJstatdCmd() throws Exception {
         JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jstatd");
         launcher.addVMArg("-XX:+UsePerfData");
         String testSrc = System.getProperty("test.src");
@@ -294,6 +301,8 @@
         assertTrue(policy.exists() && policy.isFile(),
                 "Security policy " + policy.getAbsolutePath() + " does not exist or not a file");
         launcher.addVMArg("-Djava.security.policy=" + policy.getAbsolutePath());
+        // -Dparent.pid.<pid> will help to identify jstad process started by this test
+        launcher.addVMArg("-Dparent.pid." + ProcessTools.getProcessId());
         if (port != null) {
             launcher.addToolArg("-p");
             launcher.addToolArg(port);
--- a/test/sun/tools/jstatd/TestJstatdDefaults.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/tools/jstatd/TestJstatdDefaults.java	Tue Jun 03 08:32:34 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdDefaults
  */
 public class TestJstatdDefaults {
--- a/test/sun/tools/jstatd/TestJstatdExternalRegistry.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/tools/jstatd/TestJstatdExternalRegistry.java	Tue Jun 03 08:32:34 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825 7092186
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdExternalRegistry
  */
 public class TestJstatdExternalRegistry {
--- a/test/sun/tools/jstatd/TestJstatdPort.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/tools/jstatd/TestJstatdPort.java	Tue Jun 03 08:32:34 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdPort
  */
 public class TestJstatdPort {
--- a/test/sun/tools/jstatd/TestJstatdPortAndServer.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/tools/jstatd/TestJstatdPortAndServer.java	Tue Jun 03 08:32:34 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdPortAndServer
  */
 public class TestJstatdPortAndServer {
--- a/test/sun/tools/jstatd/TestJstatdServer.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/tools/jstatd/TestJstatdServer.java	Tue Jun 03 08:32:34 2014 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build JstatdTest JstatGCUtilParser
+ * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdServer
  */
 public class TestJstatdServer {
--- a/test/sun/tools/jstatd/TestJstatdUsage.java	Thu May 29 13:47:44 2014 -0700
+++ b/test/sun/tools/jstatd/TestJstatdUsage.java	Tue Jun 03 08:32:34 2014 -0700
@@ -28,7 +28,7 @@
  * @test
  * @bug 4990825
  * @library /lib/testlibrary
- * @build jdk.testlibrary.JDKToolLauncher jdk.testlibrary.OutputAnalyzer
+ * @build jdk.testlibrary.*
  * @run main TestJstatdUsage
  */
 public class TestJstatdUsage {