changeset 9433:a900dc31cc23

Merge
author lana
date Tue, 04 Feb 2014 16:24:39 -0800
parents 903396918a8b e6cea9981e0e
children 90daa7f1e0e3
files make/scripts/genCharsetProvider.sh src/share/classes/sun/misc/FpUtils.java src/share/classes/sun/nio/cs/standard-charsets src/share/classes/sun/swing/JLightweightFrame.java src/share/classes/sun/swing/SwingUtilities2.java src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java test/java/lang/Runtime/exec/CloseRace.java test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNamesTest.java test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_de.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_de_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_es.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_es_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_fr.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_fr_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_it.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_it_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_ja.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_ja_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_ko.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_ko_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_pt_BR.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_pt_BR_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_sv.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_sv_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_zh_CN.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_zh_CN_short.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_zh_TW.properties test/sun/util/resources/TimeZone/TimeZoneNames/TimeZoneNames_zh_TW_short.properties
diffstat 207 files changed, 5162 insertions(+), 29172 deletions(-) [+]
line wrap: on
line diff
--- a/make/GenerateSources.gmk	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/GenerateSources.gmk	Tue Feb 04 16:24:39 2014 -0800
@@ -29,6 +29,7 @@
 include MakeBase.gmk
 include JavaCompilation.gmk
 include NativeCompilation.gmk
+include TextFileProcessing.gmk
 
 # Setup the java compilers for the JDK build.
 include Setup.gmk
--- a/make/Tools.gmk	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/Tools.gmk	Tue Feb 04 16:24:39 2014 -0800
@@ -102,7 +102,7 @@
 
 # TODO: Lots of files in jdk/make/tools/CharsetMapping dir
 TOOL_CHARSETMAPPING = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
-    build.tools.charsetmapping.Main
+    build.tools.charsetmapping.Main $(LOG_INFO)
 
 TOOL_SPP = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses build.tools.spp.Spp
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/standard-charsets	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,337 @@
+#
+# Copyright (c) 2000, 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.
+#
+
+# Standard charsets provided by StandardCharsets provider.
+#
+# Note that these "standard" charsets listed here are not
+# necessary to be the "Standard charsets" defined in the
+# specification of java.nio.charset.Charset. Instead these
+# are the charsets that this implementation believes should
+# be packaged into the charsets provider class "StandardCharsets"
+# which is initialized at startup time by java.nio.charset.Charset,
+# compared to the charsets packaged in "ExtendedCharsets" provider,
+# which is lazy initialized.
+
+charset US-ASCII US_ASCII
+
+    # IANA aliases
+    alias iso-ir-6
+    alias ANSI_X3.4-1986
+    alias ISO_646.irv:1991
+    alias ASCII
+    alias ISO646-US
+    alias us
+    alias IBM367
+    alias cp367
+    alias csASCII
+    alias default
+
+    # Other aliases
+    alias 646				# Solaris POSIX locale
+    alias iso_646.irv:1983
+    alias ANSI_X3.4-1968		# Linux POSIX locale (RedHat)
+    alias ascii7
+
+charset UTF-8 UTF_8
+    alias UTF8				# JDK historical
+    alias unicode-1-1-utf-8
+
+charset CESU-8 CESU_8
+    alias CESU8
+    alias csCESU-8
+
+charset UTF-16 UTF_16
+    alias UTF_16			# JDK historical
+    alias utf16
+    alias unicode
+    alias UnicodeBig
+
+charset UTF-16BE UTF_16BE
+    alias UTF_16BE
+    alias ISO-10646-UCS-2
+    alias X-UTF-16BE
+    alias UnicodeBigUnmarked
+
+charset UTF-16LE UTF_16LE
+    alias UTF_16LE
+    alias X-UTF-16LE
+    alias UnicodeLittleUnmarked
+
+charset x-UTF-16LE-BOM UTF_16LE_BOM
+    alias UnicodeLittle
+
+charset UTF-32 UTF_32
+    alias UTF_32
+    alias UTF32
+
+charset UTF-32LE UTF_32LE
+    alias UTF_32LE
+    alias X-UTF-32LE
+
+charset UTF-32BE UTF_32BE
+    alias UTF_32BE
+    alias X-UTF-32BE
+
+charset X-UTF-32LE-BOM UTF_32LE_BOM
+    alias UTF_32LE_BOM
+    alias UTF-32LE-BOM
+
+charset X-UTF-32BE-BOM UTF_32BE_BOM
+    alias UTF_32BE_BOM
+    alias UTF-32BE-BOM
+
+charset ISO-8859-1 ISO_8859_1
+
+    # IANA aliases
+    alias iso-ir-100
+    alias ISO_8859-1
+    alias latin1
+    alias l1
+    alias IBM819
+    alias cp819
+    alias csISOLatin1
+
+    # Other aliases
+    alias 819
+    alias IBM-819
+    alias ISO8859_1
+    alias ISO_8859-1:1987
+    alias ISO_8859_1
+    alias 8859_1
+    alias ISO8859-1
+
+charset ISO-8859-2 ISO_8859_2
+    alias iso8859_2			# JDK historical
+    alias 8859_2
+    alias iso-ir-101
+    alias ISO_8859-2
+    alias ISO_8859-2:1987
+    alias ISO8859-2
+    alias latin2
+    alias l2
+    alias ibm912
+    alias ibm-912
+    alias cp912
+    alias 912
+    alias csISOLatin2
+
+charset ISO-8859-4 ISO_8859_4
+    alias iso8859_4			# JDK historical
+    alias iso8859-4
+    alias 8859_4
+    alias iso-ir-110
+    alias ISO_8859-4
+    alias ISO_8859-4:1988
+    alias latin4
+    alias l4
+    alias ibm914
+    alias ibm-914
+    alias cp914
+    alias 914
+    alias csISOLatin4
+
+charset ISO-8859-5 ISO_8859_5
+    alias iso8859_5			# JDK historical
+    alias 8859_5
+    alias iso-ir-144
+    alias ISO_8859-5
+    alias ISO_8859-5:1988
+    alias ISO8859-5
+    alias cyrillic
+    alias ibm915
+    alias ibm-915
+    alias cp915
+    alias 915
+    alias csISOLatinCyrillic
+
+charset ISO-8859-7 ISO_8859_7
+    alias iso8859_7			# JDK historical
+    alias 8859_7
+    alias iso-ir-126
+    alias ISO_8859-7
+    alias ISO_8859-7:1987
+    alias ELOT_928
+    alias ECMA-118
+    alias greek
+    alias greek8
+    alias csISOLatinGreek
+    alias sun_eu_greek			# Solaris 7/8 compatibility
+    alias ibm813
+    alias ibm-813
+    alias 813
+    alias cp813
+    alias iso8859-7			# Solaris 9 compatibility
+
+charset ISO-8859-9 ISO_8859_9
+    alias iso8859_9			# JDK historical
+    alias 8859_9
+    alias iso-ir-148
+    alias ISO_8859-9
+    alias ISO_8859-9:1989
+    alias ISO8859-9
+    alias latin5
+    alias l5
+    alias ibm920
+    alias ibm-920
+    alias 920
+    alias cp920
+    alias csISOLatin5
+
+charset ISO-8859-13 ISO_8859_13
+    alias iso8859_13			# JDK historical
+    alias 8859_13
+    alias iso_8859-13
+    alias ISO8859-13
+
+charset ISO-8859-15 ISO_8859_15
+
+    # IANA alias
+    alias ISO_8859-15
+
+    # Other aliases
+    alias 8859_15
+    alias ISO-8859-15
+    alias ISO8859_15
+    alias ISO8859-15
+    alias IBM923
+    alias IBM-923
+    alias cp923
+    alias 923
+    alias LATIN0
+    alias LATIN9
+    alias L9
+    alias csISOlatin0
+    alias csISOlatin9
+    alias ISO8859_15_FDIS
+
+charset KOI8-R KOI8_R
+    alias koi8_r			# JDK historical
+    alias koi8
+    alias cskoi8r
+
+charset KOI8-U KOI8_U
+    alias koi8_u
+
+charset windows-1250 MS1250
+    alias cp1250			# JDK historical
+    alias cp5346			# Euro IBM CCSID
+
+charset windows-1251 MS1251
+    alias cp1251			# JDK historical
+    alias cp5347			# Euro IBM CCSID
+    alias ansi-1251			# Solaris compatibility
+
+charset windows-1252 MS1252
+    alias cp1252			# JDK historical
+    alias cp5348			# Euro IBM CCSID
+
+charset windows-1253 MS1253
+    alias cp1253			# JDK historical
+    alias cp5349			# Euro IBM CCSID
+
+charset windows-1254 MS1254
+    alias cp1254			# JDK historical
+    alias cp5350			# Euro IBM CCSID
+
+charset windows-1257 MS1257
+    alias cp1257			# JDK historical
+    alias cp5353			# Euro IBM CCSID
+
+
+charset IBM437 IBM437
+    alias cp437                         #JDK historical
+    alias ibm437
+    alias ibm-437
+    alias 437
+    alias cspc8codepage437
+    alias windows-437
+
+charset x-IBM737 IBM737
+    alias cp737                         #JDK historical
+    alias ibm737
+    alias ibm-737
+    alias 737
+
+charset IBM775 IBM775
+    alias cp775                         #JDK historical
+    alias ibm775
+    alias ibm-775
+    alias 775
+
+charset IBM850 IBM850
+    alias cp850                         #JDK historical
+    alias ibm-850
+    alias ibm850
+    alias 850
+    alias cspc850multilingual
+
+charset IBM852 IBM852
+    alias cp852                         #JDK historical
+    alias ibm852
+    alias ibm-852
+    alias 852
+    alias csPCp852
+
+charset IBM855 IBM855
+    alias cp855                         #JDK historical
+    alias ibm-855
+    alias ibm855
+    alias 855
+    alias cspcp855
+
+charset IBM857 IBM857
+    alias cp857                         #JDK historical
+    alias ibm857
+    alias ibm-857
+    alias 857
+    alias csIBM857
+
+charset IBM00858 IBM858
+    alias cp858                         #JDK historical
+    alias ccsid00858
+    alias cp00858
+    alias 858
+    alias PC-Multilingual-850+euro
+
+charset IBM862 IBM862
+    alias cp862                         #JDK historical
+    alias ibm862
+    alias ibm-862
+    alias 862
+    alias csIBM862
+    alias cspc862latinhebrew
+
+charset IBM866 IBM866
+    alias cp866                         #JDK historical
+    alias ibm866
+    alias ibm-866
+    alias 866
+    alias csIBM866
+
+charset x-IBM874 IBM874
+    alias cp874                         #JDK historical
+    alias ibm874
+    alias ibm-874
+    alias 874
--- a/make/data/tzdata/VERSION	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/data/tzdata/VERSION	Tue Feb 04 16:24:39 2014 -0800
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2013h
+tzdata2013i
--- a/make/data/tzdata/africa	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/data/tzdata/africa	Tue Feb 04 16:24:39 2014 -0800
@@ -500,14 +500,13 @@
 Rule	Libya	1997	only	-	Oct	 4	0:00	0	-
 Rule	Libya	2013	only	-	Mar	lastFri	1:00	1:00	S
 Rule	Libya	2013	only	-	Oct	lastFri	2:00	0	-
-
-# The 1996 and 1997 entries are from Shanks & Pottenger;
-# the IATA SSIM data contain some obvious errors.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Tripoli	0:52:44 -	LMT	1920
 			1:00	Libya	CE%sT	1959
 			2:00	-	EET	1982
 			1:00	Libya	CE%sT	1990 May  4
+# The 1996 and 1997 entries are from Shanks & Pottenger;
+# the IATA SSIM data contain some obvious errors.
 			2:00	-	EET	1996 Sep 30
 			1:00	Libya	CE%sT	1997 Oct  4
 			2:00	-	EET	2012 Nov 10 2:00
--- a/make/data/tzdata/asia	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/data/tzdata/asia	Tue Feb 04 16:24:39 2014 -0800
@@ -1403,12 +1403,22 @@
 # switch back to standard time this winter, so the will stay on DST
 # until about the same time next year (at least).
 # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950
-#
-# From Paul Eggert (2013-09-21):
-# It's looking like this change will be permanent; see
-# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20)
-# <http://www.albawaba.com/business/jordan-winter-electricity--472005>.
-# So move Jordan to UTC+3 as of the abovementioned date.
+
+# From Steffen Thorsen (2013-12-11):
+# Jordan Times and other sources say that Jordan is going back to
+# UTC+2 on 2013-12-19 at midnight:
+# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime
+# Official, in Arabic:
+# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14
+# ... Our background/permalink about it
+# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
+# ...
+# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P
+# ... says midnight for the coming one and 1:00 for the ones in the future
+# (and they will use DST again next year, using the normal schedule).
+
+# From Paul Eggert (2013-12-11):
+# As Steffen suggested, consider the past 21-month experiment to be DST.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Jordan	1973	only	-	Jun	6	0:00	1:00	S
@@ -1438,11 +1448,13 @@
 Rule	Jordan	2003	only	-	Oct	24	0:00s	0	-
 Rule	Jordan	2004	only	-	Oct	15	0:00s	0	-
 Rule	Jordan	2005	only	-	Sep	lastFri	0:00s	0	-
-Rule	Jordan	2006	2012	-	Oct	lastFri	0:00s	0	-
+Rule	Jordan	2006	2011	-	Oct	lastFri	0:00s	0	-
+Rule	Jordan	2013	only	-	Dec	20	0:00	0	-
+Rule	Jordan	2014	max	-	Mar	lastThu	24:00	1:00	S
+Rule	Jordan	2014	max	-	Oct	lastFri	0:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Amman	2:23:44 -	LMT	1931
-			2:00	Jordan	EE%sT	2012 Oct 26 0:00s
-			3:00	-	AST
+			2:00	Jordan	EE%sT
 
 
 # Kazakhstan
--- a/make/data/tzdata/northamerica	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/data/tzdata/northamerica	Tue Feb 04 16:24:39 2014 -0800
@@ -2688,6 +2688,11 @@
 # to DST--and one more hour on 1999-04-04--when the announcers will have
 # returned to Baltimore, which switches on that date.)
 
+# From Steffen Thorsen (2013-11-11):
+# DST start in Cuba in 2004 ... does not follow the same rules as the
+# years before.  The correct date should be Sunday 2004-03-28 00:00 ...
+# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html
+
 # From Evert van der Veer via Steffen Thorsen (2004-10-28):
 # Cuba is not going back to standard time this year.
 # From Paul Eggert (2006-03-22):
@@ -2877,7 +2882,8 @@
 Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
 Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
 Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
-Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
+Rule	Cuba	2000	2003	-	Apr	Sun>=1	0:00s	1:00	D
+Rule	Cuba	2004	only	-	Mar	lastSun	0:00s	1:00	D
 Rule	Cuba	2006	2010	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
--- a/make/gensrc/GensrcCharsetMapping.gmk	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/gensrc/GensrcCharsetMapping.gmk	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,80 +25,151 @@
 
 GENSRC_CHARSETMAPPING :=
 
-GENSRC_TMP := $(JDK_OUTPUTDIR)/gensrc
-GENSRC_DST := $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs
-
-GENSRC_DATA := $(JDK_TOPDIR)/make/data/charsetmapping
-GENSRC_JAVA_SRC := $(JDK_TOPDIR)/make/src/classes/build/tools/charsetmapping
-
-GENSRC_TEMPLATES := $(GENSRC_DATA)/SingleByte-X.java.template $(GENSRC_DATA)/DoubleByte-X.java.template
+CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping
 
 ###
+### Generate files using the charsetmapping tool
+###
 
-$(GENSRC_TMP)/_the.charsetmapping.dir:
-	$(ECHO) Generating charsetmapping classes
-	$(MKDIR) -p $(GENSRC_DST)/ext
-	$(TOUCH) $@
+CHARSET_GENSRC_JAVA_DIR := $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs
+CHARSET_DONE := $(CHARSET_GENSRC_JAVA_DIR)/_the.charsetmapping
+CHARSET_COPYRIGHT_HEADER_BASE := $(JDK_TOPDIR)/make/src/classes/build/tools/charsetmapping
+CHARSET_TEMPLATES := \
+    $(CHARSET_DATA_DIR)/SingleByte-X.java.template \
+    $(CHARSET_DATA_DIR)/DoubleByte-X.java.template
+
+# This target should be referenced using the order-only operator (|)
+$(CHARSET_GENSRC_JAVA_DIR)/ext:
+	$(ECHO)	"Generating charset mappings"
+	$(MKDIR) -p $(CHARSET_GENSRC_JAVA_DIR)/ext
+
+$(CHARSET_DONE)-sbcs: $(CHARSET_DATA_DIR)/sbcs \
+    $(CHARSET_TEMPLATES) $(BUILD_TOOLS) | $(CHARSET_GENSRC_JAVA_DIR)/ext
+	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR) sbcs
+	$(TOUCH) '$@'
+
+$(CHARSET_DONE)-extsbcs: $(CHARSET_DATA_DIR)/extsbcs  \
+    $(CHARSET_DONE)-sbcs $(CHARSET_TEMPLATES) $(BUILD_TOOLS) 
+	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR)/ext extsbcs
+	$(TOUCH) '$@'
+
+$(CHARSET_DONE)-dbcs: $(CHARSET_DATA_DIR)/dbcs \
+    $(CHARSET_DONE)-sbcs $(CHARSET_TEMPLATES) $(BUILD_TOOLS) 
+	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR)/ext dbcs
+	$(TOUCH) '$@'
+
+$(CHARSET_DONE)-hkscs: $(CHARSET_COPYRIGHT_HEADER_BASE)/HKSCS.java \
+    $(CHARSET_DONE)-sbcs $(BUILD_TOOLS)
+	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR)/ext hkscs '$<'
+	$(TOUCH) '$@'
+
+$(CHARSET_DONE)-euctw: $(CHARSET_COPYRIGHT_HEADER_BASE)/EUC_TW.java \
+    $(CHARSET_DONE)-sbcs $(BUILD_TOOLS)
+	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR)/ext euctw '$<'
+	$(TOUCH) '$@'
+
+$(CHARSET_GENSRC_JAVA_DIR)/ext/sjis0213.dat: $(CHARSET_DATA_DIR)/sjis0213.map \
+    $(CHARSET_DONE)-sbcs $(BUILD_TOOLS)
+	$(TOOL_CHARSETMAPPING) '$<' '$@' sjis0213
+
+GENSRC_CHARSETMAPPING += \
+    $(CHARSET_DONE)-sbcs \
+    $(CHARSET_DONE)-extsbcs \
+    $(CHARSET_DONE)-dbcs \
+    $(CHARSET_DONE)-hkscs \
+    $(CHARSET_DONE)-euctw \
+    $(CHARSET_GENSRC_JAVA_DIR)/ext/sjis0213.dat \
+    #
 
 ###
-
-GENSRC_SB := $(GENSRC_TMP)/_the.charsetmapping.sbcs
-
-$(GENSRC_SB): $(GENSRC_DATA)/sbcs $(GENSRC_TEMPLATES) $(GENSRC_TMP)/_the.charsetmapping.dir
-	$(TOOL_CHARSETMAPPING) $(LOG_INFO) $(GENSRC_DATA) $(GENSRC_DST) sbcs
-	$(TOUCH) $@
-
-GENSRC_CHARSETMAPPING += $(GENSRC_SB)
-
+### Generate the sun/nio/cs/StandardCharsets.java file
 ###
 
-$(GENSRC_DST)/ext/sjis0213.dat: $(GENSRC_DATA)/sjis0213.map $(GENSRC_SB)
-	$(TOOL_CHARSETMAPPING) $(LOG_INFO) $< $@ sjis0213
+CHARSET_STANDARD_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc/standardcharsets
+CHARSET_STANDARD_DATA := $(CHARSET_DATA_DIR)/standard-charsets
+CHARSET_STANDARD_JAVA :=  sun/nio/cs/StandardCharsets.java
 
-GENSRC_CHARSETMAPPING += $(GENSRC_DST)/ext/sjis0213.dat
+CHARSET_ALIASES_TABLES_AWK := ' \
+    BEGIN { n = 1; m = 1; } \
+    /^[ \t]*charset / { \
+      csn = $$2; cln = $$3; \
+      lcsn = tolower(csn); \
+      lcsns[n++] = lcsn; \
+      csns[lcsn] = csn; \
+      classMap[lcsn] = cln; \
+      if (n > 2) \
+        printf "    };\n\n"; \
+      printf "    static final String[] aliases_%s = new String[] {\n", cln; \
+    } \
+    /^[ \t]*alias / { \
+      acsns[m++] = tolower($$2); \
+      aliasMap[tolower($$2)] = lcsn; \
+      printf "        \"%s\",\n", $$2; \
+    } \
+    END { \
+      printf "    };\n\n"; \
+    } '
 
-###
+CHARSET_ALIASES_MAP_AWK := ' \
+    /^[ \t]*charset / { \
+      csn = $$2; \
+      lcsn = tolower(csn); \
+    } \
+    /^[ \t]*alias / { \
+      an = tolower($$2); \
+      printf "%-20s \"%s\"\n", an, lcsn; \
+    } '
 
-$(GENSRC_DST)/ext/EUC_TWMapping.java: $(GENSRC_JAVA_SRC)/EUC_TW.java $(GENSRC_SB)
-	$(TOOL_CHARSETMAPPING) $(LOG_INFO) $(GENSRC_DATA) $(GENSRC_DST)/ext euctw $(GENSRC_JAVA_SRC)/EUC_TW.java
+CHARSET_CLASSES_MAP_AWK := ' \
+    /^[ \t]*charset / { \
+      csn = $$2; cln = $$3; \
+      lcsn = tolower(csn); \
+      printf "%-20s \"%s\"\n", lcsn, cln; \
+    } '
 
-GENSRC_CHARSETMAPPING += $(GENSRC_DST)/ext/EUC_TWMapping.java
+# This target should be referenced using the order-only operator (|)
+$(CHARSET_STANDARD_GENSRC_DIR):
+	$(MKDIR) -p '$@'
 
-###
+$(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet: $(CHARSET_STANDARD_DATA) \
+    | $(CHARSET_STANDARD_GENSRC_DIR)
+	$(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_TABLES_AWK)
 
-$(GENSRC_DST)/ext/HKSCSMapping.java: $(GENSRC_JAVA_SRC)/HKSCS.java $(GENSRC_SB)
-	$(TOOL_CHARSETMAPPING) $(LOG_INFO) $(GENSRC_DATA) $(GENSRC_DST)/ext hkscs $(GENSRC_JAVA_SRC)/HKSCS.java
+$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map: $(CHARSET_STANDARD_DATA) \
+    | $(CHARSET_STANDARD_GENSRC_DIR)
+	$(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_MAP_AWK)
 
-GENSRC_CHARSETMAPPING += $(GENSRC_DST)/ext/HKSCSMapping.java
+$(CHARSET_STANDARD_GENSRC_DIR)/classes-map: $(CHARSET_STANDARD_DATA) \
+    | $(CHARSET_STANDARD_GENSRC_DIR)
+	$(NAWK) < '$<' > '$@' $(CHARSET_CLASSES_MAP_AWK)
 
-###
+$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map \
+    $(BUILD_TOOLS) | $(CHARSET_STANDARD_GENSRC_DIR)
+	$(TOOL_HASHER) -i Aliases < '$<' > '$@'
 
-$(GENSRC_TMP)/gensrc_the.charsetmapping.extsbcs: $(GENSRC_DATA)/extsbcs $(GENSRC_TEMPLATES) $(GENSRC_SB)
-	$(TOOL_CHARSETMAPPING) $(GENSRC_DATA) $(LOG_INFO) $(GENSRC_DST)/ext extsbcs
-	$(TOUCH) $@
+$(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \
+    $(BUILD_TOOLS) | $(CHARSET_STANDARD_GENSRC_DIR)
+	$(TOOL_HASHER) -i Classes < '$<' > '$@'
 
-GENSRC_CHARSETMAPPING += $(GENSRC_TMP)/gensrc_the.charsetmapping.extsbcs
+$(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \
+    $(BUILD_TOOLS) | $(CHARSET_STANDARD_GENSRC_DIR)
+	$(TOOL_HASHER) -i -e Cache -t Charset < '$<' > '$@'
 
-###
+$(eval $(call SetupTextFileProcessing, BUILD_CHARSET_STANDARD, \
+    SOURCE_FILES := $(JDK_TOPDIR)/src/share/classes/$(CHARSET_STANDARD_JAVA).template, \
+    OUTPUT_FILE := $(JDK_OUTPUTDIR)/gensrc/$(CHARSET_STANDARD_JAVA), \
+    INCLUDES := \
+        _INCLUDE_ALIASES_TABLES_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet ; \
+        _INCLUDE_ALIASES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet ; \
+        _INCLUDE_CLASSES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet ; \
+        _INCLUDE_CACHE_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet ; , \
+))
 
-$(GENSRC_TMP)/gensrc_the.charsetmapping.dbcs: $(GENSRC_DATA)/dbcs $(GENSRC_TEMPLATES) $(GENSRC_SB)
-	$(TOOL_CHARSETMAPPING) $(GENSRC_DATA) $(LOG_INFO) $(GENSRC_DST)/ext dbcs
-	$(TOUCH) $@
+# Processing of template depends on the snippets being generated first
+$(BUILD_CHARSET_STANDARD): \
+    $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet \
+    $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet \
+    $(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet \
+    $(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet
 
-GENSRC_CHARSETMAPPING += $(GENSRC_TMP)/gensrc_the.charsetmapping.dbcs
-
-###
-
-GENSRC_CHARSET_PROVIDER_CMD := $(JDK_TOPDIR)/make/scripts/genCharsetProvider.sh
-
-$(GENSRC_DST)/StandardCharsets.java: $(JDK_TOPDIR)/src/share/classes/sun/nio/cs/standard-charsets \
-    $(GENSRC_CHARSET_PROVIDER_CMD) \
-    $(GENSRC_TMP)/_the.charsetmapping.dir
-	NAWK="$(NAWK)" TEMPDIR="$(GENSRC_TMP)" SH="$(SH)" \
-	    HASHER="$(TOOL_HASHER)" \
-	    SCRIPTS="$(JDK_TOPDIR)/make/scripts" \
-	    $(SH) -e $(GENSRC_CHARSET_PROVIDER_CMD) $(LOG_INFO) $< $(@D)
-
-GENSRC_CHARSETMAPPING += $(GENSRC_DST)/StandardCharsets.java
-
-$(GENSRC_CHARSETMAPPING): $(BUILD_TOOLS)
+GENSRC_CHARSETMAPPING += $(BUILD_CHARSET_STANDARD)
--- a/make/gensrc/GensrcLocaleDataMetaInfo.gmk	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/gensrc/GensrcLocaleDataMetaInfo.gmk	Tue Feb 04 16:24:39 2014 -0800
@@ -53,8 +53,8 @@
 # The EN locales
 EN_LOCALES := en%
 
-# ja-JP-JP and th-TH-TH need to be manually added, as they don't have any resource files.
-ALL_NON_EN_LOCALES := ja-JP-JP th-TH-TH
+# Locales that don't have any resource files should be included here.
+ALL_NON_EN_LOCALES := ja-JP-JP nb-NO nn-NO th-TH-TH
 
 SED_ARGS := -e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g'
 
--- a/make/mapfiles/libnet/mapfile-vers	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/mapfiles/libnet/mapfile-vers	Tue Feb 04 16:24:39 2014 -0800
@@ -105,6 +105,7 @@
 		NET_MapSocketOption;
 		NET_Wait;
                 ipv6_available;
+                initInetAddressIDs;
 
 	local:
 		*;
--- a/make/scripts/genCharsetProvider.sh	Fri Jan 31 18:49:58 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-#! /bin/sh
-
-#
-# Copyright (c) 2004, 2012, 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.
-#
-
-# Generate a charset provider class
-
-# Required environment variables
-#   NAWK    awk tool
-#   TEMPDIR temporary directory
-#   HASHER  Hasher program
-
-SPEC=$1; shift
-DST=$1; shift
-
-eval `$NAWK <$SPEC '
-    /^[ \t]*copyright / { printf "COPYRIGHT_YEARS=\"%s %s\"\n", $2, $3; }
-    /^[ \t]*package / { printf "PKG=%s\n", $2; }
-    /^[ \t]*class / { printf "CLASS=%s\n", $2; }
-'`
-
-OUT=$DST/$CLASS.java
-echo '-->' $OUT
-
-
-# Header
-#
-
-$SH ${SCRIPTS}/addNotices.sh "$COPYRIGHT_YEARS" > $OUT
-
-cat <<__END__ >>$OUT
-
-// -- This file was mechanically generated: Do not edit! -- //
-
-package $PKG;
-
-import java.nio.charset.*;
-
-
-public class $CLASS
-    extends FastCharsetProvider
-{
-
-__END__
-
-
-# Alias tables
-#
-$NAWK <$SPEC >>$OUT '
-    BEGIN { n = 1; m = 1; }
-
-    /^[ \t]*charset / {
-      csn = $2; cln = $3;
-      lcsn = tolower(csn);
-      lcsns[n++] = lcsn;
-      csns[lcsn] = csn;
-      classMap[lcsn] = cln;
-      if (n > 2)
-        printf "    };\n\n";
-      printf "    static final String[] aliases_%s = new String[] {\n", cln;
-    }
-
-    /^[ \t]*alias / {
-      acsns[m++] = tolower($2);
-      aliasMap[tolower($2)] = lcsn;
-      printf "        \"%s\",\n", $2;
-    }
-
-    END {
-      printf "    };\n\n";
-    }
-'
-
-
-# Prehashed alias and class maps
-#
-$NAWK <$SPEC >$TEMPDIR/aliases '
-    /^[ \t]*charset / {
-      csn = $2;
-      lcsn = tolower(csn);
-    }
-    /^[ \t]*alias / {
-      an = tolower($2);
-      printf "%-20s \"%s\"\n", an, lcsn;
-    }
-'
-
-$NAWK <$SPEC >$TEMPDIR/classes '
-    /^[ \t]*charset / {
-      csn = $2; cln = $3;
-      lcsn = tolower(csn);
-      printf "%-20s \"%s\"\n", lcsn, cln;
-    }
-'
-
-${HASHER} -i Aliases <$TEMPDIR/aliases >>$OUT
-${HASHER} -i Classes <$TEMPDIR/classes >>$OUT
-${HASHER} -i -e Cache -t Charset <$TEMPDIR/classes >>$OUT
-
-
-# Constructor
-#
-cat <<__END__ >>$OUT
-    public $CLASS() {
-        super("$PKG", new Aliases(), new Classes(), new Cache());
-    }
-
-}
-__END__
--- a/make/src/classes/build/tools/hasher/Hasher.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/make/src/classes/build/tools/hasher/Hasher.java	Tue Feb 04 16:24:39 2014 -0800
@@ -43,9 +43,6 @@
 
 public class Hasher {
 
-    // This class cannot, sadly, make use of 1.5 features since it must be
-    // compiled and run with the bootstrap JDK, which is 1.4.2.
-
     static final PrintStream out = System.out;
     static final PrintStream err = System.err;
 
@@ -184,11 +181,13 @@
                 if (md <= maxDepth) {
                     // Success
                     out.flush();
-                    if (cln != null)
-                        err.print(cln + ": ");
-                    err.println("Table size " + (1 << nb) + " (" + nb + " bits)"
-                                + ", shift " + shift
-                                + ", max chain depth " + md);
+                    if (verbose) {
+                        if (cln != null)
+                            err.print(cln + ": ");
+                        err.println("Table size " + (1 << nb) + " (" + nb + " bits)"
+                                    + ", shift " + shift
+                                    + ", max chain depth " + md);
+                    }
                     return this;
                 }
             }
--- a/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java	Tue Feb 04 16:24:39 2014 -0800
@@ -43,7 +43,7 @@
     static native UnixMountEntry[] getmntctl() throws UnixException;
 
     // initialize
-    private static native int init();
+    private static native void init();
 
     static {
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/src/aix/native/sun/nio/fs/AixNativeDispatcher.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/aix/native/sun/nio/fs/AixNativeDispatcher.c	Tue Feb 04 16:24:39 2014 -0800
@@ -56,23 +56,26 @@
 /**
  * Initialization
  */
-JNIEXPORT jint JNICALL
+JNIEXPORT void JNICALL
 Java_sun_nio_fs_AixNativeDispatcher_init(JNIEnv* env, jclass this)
 {
-    jint flags = 0;
     jclass clazz;
 
     clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
-    if (clazz == NULL) {
-        return 0;
+    CHECK_NULL(clazz);
+    entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
+    CHECK_NULL(entry_name);
+    entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
+    CHECK_NULL(entry_dir);
+    entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
+    CHECK_NULL(entry_fstype);
+    entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
+    CHECK_NULL(entry_options);
+    entry_cls = (*env)->NewGlobalRef(env, clazz);
+    if (entry_cls == NULL) {
+        JNU_ThrowOutOfMemoryError(env, NULL);
+        return;
     }
-    entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
-    entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
-    entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
-    entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
-    entry_cls = (*env)->NewGlobalRef(env, clazz);
-
-    return 0;
 }
 
 /**
--- a/src/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 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
@@ -31,6 +31,7 @@
  * A dummy <code>ColorSpace</code> to enable <code>ColorModel</code>
  * for image data which do not have an innate color representation.
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public class BogusColorSpace extends ColorSpace {
     /**
      * Return the type given the number of components.
--- a/src/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java	Tue Feb 04 16:24:39 2014 -0800
@@ -558,6 +558,7 @@
 
     // Could put reason codes in here to be parsed in writeJFXXSegment
     // in order to provide more meaningful warnings.
+    @SuppressWarnings("serial") // JDK-implementation class
     private class IllegalThumbException extends Exception {}
 
     /**
--- a/src/share/classes/java/awt/im/InputContext.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/awt/im/InputContext.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, 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
@@ -87,6 +87,7 @@
 
     /**
      * Returns a new InputContext instance.
+     * @return a new InputContext instance
      */
     public static InputContext getInstance() {
         return new sun.awt.im.InputMethodContext();
--- a/src/share/classes/java/awt/im/InputMethodHighlight.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/awt/im/InputMethodHighlight.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, 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
@@ -157,6 +157,7 @@
 
     /**
      * Returns whether the text range is selected.
+     * @return whether the text range is selected
      */
     public boolean isSelected() {
         return selected;
@@ -174,6 +175,7 @@
 
     /**
      * Returns the variation of the text range.
+     * @return the variation of the text range
      */
     public int getVariation() {
         return variation;
@@ -181,6 +183,7 @@
 
     /**
      * Returns the rendering style attributes for the text range, or null.
+     * @return the rendering style attributes for the text range, or null
      * @since 1.3
      */
     public Map<TextAttribute,?> getStyle() {
--- a/src/share/classes/java/awt/im/spi/InputMethodContext.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/awt/im/spi/InputMethodContext.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, 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
@@ -52,6 +52,14 @@
      * Creates an input method event from the arguments given
      * and dispatches it to the client component. For arguments,
      * see {@link java.awt.event.InputMethodEvent#InputMethodEvent}.
+     * @param id the event type
+     * @param text the combined committed and composed text
+     * @param committedCharacterCount the number of committed characters in the text
+     * @param caret the caret (a.k.a. insertion point); null if
+     * there's no caret within current composed text
+     * @param visiblePosition the position that's most important to be
+     * visible; null if there's no recommendation for a visible
+     * position within current composed text
      */
     public void dispatchInputMethodEvent(int id,
                 AttributedCharacterIterator text, int committedCharacterCount,
--- a/src/share/classes/java/awt/im/spi/InputMethodDescriptor.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/awt/im/spi/InputMethodDescriptor.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 1999, 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
@@ -72,6 +72,8 @@
      * Returns whether the list of available locales can change
      * at runtime. This may be the case, for example, for adapters
      * that access real input methods over the network.
+     * @return whether the list of available locales can change at
+     * runtime
      */
     boolean hasDynamicLocaleList();
 
@@ -92,6 +94,9 @@
      *
      * @param inputLocale the locale for which text input is supported, or null
      * @param displayLanguage the language in which the name will be displayed
+     * @return the user-visible name of the corresponding input method
+     * for the given input locale in the language in which the name
+     * will be displayed
      */
     String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage);
 
--- a/src/share/classes/java/awt/peer/CanvasPeer.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/awt/peer/CanvasPeer.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -42,6 +42,8 @@
      * from the requested GC passed as the argument to this method. This method
      * must return a non-null value (given the argument is non-null as well).
      *
+     * @param gc the requested graphics configuration
+     * @return a graphics configuration that best suits this Canvas
      * @since 1.7
      */
     GraphicsConfiguration getAppropriateGraphicsConfiguration(
--- a/src/share/classes/java/awt/peer/ComponentPeer.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/awt/peer/ComponentPeer.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -516,6 +516,7 @@
 
     /**
      * Applies the shape to the native component window.
+     * @param shape the shape to apply
      * @since 1.7
      *
      * @see Component#applyCompoundShape
@@ -525,12 +526,13 @@
     /**
      * Lowers this component at the bottom of the above HW peer. If the above parameter
      * is null then the method places this component at the top of the Z-order.
+     * @param above the peer to lower this component with respect to
      */
     void setZOrder(ComponentPeer above);
 
     /**
      * Updates internal data structures related to the component's GC.
-     *
+     * @param gc the reference graphics configuration
      * @return if the peer needs to be recreated for the changes to take effect
      * @since 1.7
      */
--- a/src/share/classes/java/awt/peer/MouseInfoPeer.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/awt/peer/MouseInfoPeer.java	Tue Feb 04 16:24:39 2014 -0800
@@ -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
@@ -55,6 +55,10 @@
      * is located.
      * See java.awt.GraphicsConfiguration documentation for more
      * details about virtual screen devices.
+     * @param point holder for the current coordinates of the mouse
+     * cursor
+     * @return the number of the screen device where the pointer is
+     * located
      */
     int fillPointWithCoords(Point point);
 
@@ -63,6 +67,9 @@
      * pointer. The window is considered to be under the mouse pointer
      * if it is showing on the screen, and the mouse pointer is above
      * the part of the window that is not obscured by any other windows.
+     * @param w the window to check
+     * @return whether or not the window is located under the mouse
+     * pointer
      */
     boolean isWindowUnderMouse(Window w);
 
--- a/src/share/classes/java/awt/peer/WindowPeer.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/awt/peer/WindowPeer.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -94,14 +94,15 @@
 
     /**
      * Sets the level of opacity for the window.
-     *
+     * @param opacity the level of opacity
      * @see Window#setOpacity(float)
      */
     void setOpacity(float opacity);
 
     /**
      * Enables the per-pixel alpha support for the window.
-     *
+     * @param isOpaque whether or not per-pixel alpha support is
+     * enabled
      * @see Window#setBackground(Color)
      */
     void setOpaque(boolean isOpaque);
--- a/src/share/classes/java/lang/Double.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/lang/Double.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -26,7 +26,6 @@
 package java.lang;
 
 import sun.misc.FloatingDecimal;
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 
 /**
--- a/src/share/classes/java/lang/ref/Reference.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/lang/ref/Reference.java	Tue Feb 04 16:24:39 2014 -0800
@@ -111,7 +111,7 @@
      * therefore critical that any code holding this lock complete as quickly
      * as possible, allocate no new objects, and avoid calling user code.
      */
-    static private class Lock { };
+    static private class Lock { }
     private static Lock lock = new Lock();
 
 
@@ -126,6 +126,22 @@
      */
     private static class ReferenceHandler extends Thread {
 
+        private static void ensureClassInitialized(Class<?> clazz) {
+            try {
+                Class.forName(clazz.getName(), true, clazz.getClassLoader());
+            } catch (ClassNotFoundException e) {
+                throw (Error) new NoClassDefFoundError(e.getMessage()).initCause(e);
+            }
+        }
+
+        static {
+            // pre-load and initialize InterruptedException and Cleaner classes
+            // so that we don't get into trouble later in the run loop if there's
+            // memory shortage while loading/initializing them lazily.
+            ensureClassInitialized(InterruptedException.class);
+            ensureClassInitialized(Cleaner.class);
+        }
+
         ReferenceHandler(ThreadGroup g, String name) {
             super(g, name);
         }
@@ -133,37 +149,40 @@
         public void run() {
             for (;;) {
                 Reference<Object> r;
-                synchronized (lock) {
-                    if (pending != null) {
-                        r = pending;
-                        pending = r.discovered;
-                        r.discovered = null;
-                    } else {
-                        // The waiting on the lock may cause an OOME because it may try to allocate
-                        // exception objects, so also catch OOME here to avoid silent exit of the
-                        // reference handler thread.
-                        //
-                        // Explicitly define the order of the two exceptions we catch here
-                        // when waiting for the lock.
-                        //
-                        // We do not want to try to potentially load the InterruptedException class
-                        // (which would be done if this was its first use, and InterruptedException
-                        // were checked first) in this situation.
-                        //
-                        // This may lead to the VM not ever trying to load the InterruptedException
-                        // class again.
-                        try {
-                            try {
-                                lock.wait();
-                            } catch (OutOfMemoryError x) { }
-                        } catch (InterruptedException x) { }
-                        continue;
+                Cleaner c;
+                try {
+                    synchronized (lock) {
+                        if (pending != null) {
+                            r = pending;
+                            // 'instanceof' might throw OutOfMemoryError sometimes
+                            // so do this before un-linking 'r' from the 'pending' chain...
+                            c = r instanceof Cleaner ? (Cleaner) r : null;
+                            // unlink 'r' from 'pending' chain
+                            pending = r.discovered;
+                            r.discovered = null;
+                        } else {
+                            // The waiting on the lock may cause an OutOfMemoryError
+                            // because it may try to allocate exception objects.
+                            lock.wait();
+                            continue;
+                        }
                     }
+                } catch (OutOfMemoryError x) {
+                    // Give other threads CPU time so they hopefully drop some live references
+                    // and GC reclaims some space.
+                    // Also prevent CPU intensive spinning in case 'r instanceof Cleaner' above
+                    // persistently throws OOME for some time...
+                    Thread.yield();
+                    // retry
+                    continue;
+                } catch (InterruptedException x) {
+                    // retry
+                    continue;
                 }
 
                 // Fast path for cleaners
-                if (r instanceof Cleaner) {
-                    ((Cleaner)r).clean();
+                if (c != null) {
+                    c.clean();
                     continue;
                 }
 
--- a/src/share/classes/java/net/SocketPermission.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/net/SocketPermission.java	Tue Feb 04 16:24:39 2014 -0800
@@ -235,13 +235,11 @@
     private static Debug debug = null;
     private static boolean debugInit = false;
 
-    // ephemeral port range for this system
-    private static final int ephemeralLow = initEphemeralPorts(
-        "low", DEF_EPH_LOW
-    );
-    private static final int ephemeralHigh = initEphemeralPorts(
-        "high", PORT_MAX
-    );
+    // lazy initializer
+    private static class EphemeralRange {
+        static final int low = initEphemeralPorts("low", DEF_EPH_LOW);
+            static final int high = initEphemeralPorts("high", PORT_MAX);
+    };
 
     static {
         Boolean tmp = java.security.AccessController.doPrivileged(
@@ -1235,6 +1233,9 @@
         int policyLow, int policyHigh, int targetLow, int targetHigh
     )
     {
+        final int ephemeralLow = EphemeralRange.low;
+        final int ephemeralHigh = EphemeralRange.high;
+
         if (targetLow == 0) {
             // check policy includes ephemeral range
             if (!inRange(policyLow, policyHigh, ephemeralLow, ephemeralHigh)) {
--- a/src/share/classes/java/util/Date.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/util/Date.java	Tue Feb 04 16:24:39 2014 -0800
@@ -41,20 +41,20 @@
 import sun.util.calendar.ZoneInfo;
 
 /**
- * The class <code>Date</code> represents a specific instant
+ * The class {@code Date} represents a specific instant
  * in time, with millisecond precision.
  * <p>
- * Prior to JDK&nbsp;1.1, the class <code>Date</code> had two additional
+ * Prior to JDK&nbsp;1.1, the class {@code Date} had two additional
  * functions.  It allowed the interpretation of dates as year, month, day, hour,
  * minute, and second values.  It also allowed the formatting and parsing
  * of date strings.  Unfortunately, the API for these functions was not
  * amenable to internationalization.  As of JDK&nbsp;1.1, the
- * <code>Calendar</code> class should be used to convert between dates and time
- * fields and the <code>DateFormat</code> class should be used to format and
+ * {@code Calendar} class should be used to convert between dates and time
+ * fields and the {@code DateFormat} class should be used to format and
  * parse date strings.
- * The corresponding methods in <code>Date</code> are deprecated.
+ * The corresponding methods in {@code Date} are deprecated.
  * <p>
- * Although the <code>Date</code> class is intended to reflect
+ * Although the {@code Date} class is intended to reflect
  * coordinated universal time (UTC), it may not do so exactly,
  * depending on the host environment of the Java Virtual Machine.
  * Nearly all modern operating systems assume that 1&nbsp;day&nbsp;=
@@ -93,12 +93,12 @@
  *     <a href=http://tycho.usno.navy.mil/systime.html>http://tycho.usno.navy.mil/systime.html</a>
  * </pre></blockquote>
  * <p>
- * In all methods of class <code>Date</code> that accept or return
+ * In all methods of class {@code Date} that accept or return
  * year, month, date, hours, minutes, and seconds values, the
  * following representations are used:
  * <ul>
  * <li>A year <i>y</i> is represented by the integer
- *     <i>y</i>&nbsp;<code>-&nbsp;1900</code>.
+ *     <i>y</i>&nbsp;{@code - 1900}.
  * <li>A month is represented by an integer from 0 to 11; 0 is January,
  *     1 is February, and so forth; thus 11 is December.
  * <li>A date (day of month) is represented by an integer from 1 to 31
@@ -155,7 +155,7 @@
     private static final long serialVersionUID = 7523967970034938905L;
 
     /**
-     * Allocates a <code>Date</code> object and initializes it so that
+     * Allocates a {@code Date} object and initializes it so that
      * it represents the time at which it was allocated, measured to the
      * nearest millisecond.
      *
@@ -166,7 +166,7 @@
     }
 
     /**
-     * Allocates a <code>Date</code> object and initializes it to
+     * Allocates a {@code Date} object and initializes it to
      * represent the specified number of milliseconds since the
      * standard base time known as "the epoch", namely January 1,
      * 1970, 00:00:00 GMT.
@@ -179,18 +179,18 @@
     }
 
     /**
-     * Allocates a <code>Date</code> object and initializes it so that
+     * Allocates a {@code Date} object and initializes it so that
      * it represents midnight, local time, at the beginning of the day
-     * specified by the <code>year</code>, <code>month</code>, and
-     * <code>date</code> arguments.
+     * specified by the {@code year}, {@code month}, and
+     * {@code date} arguments.
      *
      * @param   year    the year minus 1900.
      * @param   month   the month between 0-11.
      * @param   date    the day of the month between 1-31.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(year + 1900, month, date)</code>
-     * or <code>GregorianCalendar(year + 1900, month, date)</code>.
+     * replaced by {@code Calendar.set(year + 1900, month, date)}
+     * or {@code GregorianCalendar(year + 1900, month, date)}.
      */
     @Deprecated
     public Date(int year, int month, int date) {
@@ -198,10 +198,10 @@
     }
 
     /**
-     * Allocates a <code>Date</code> object and initializes it so that
+     * Allocates a {@code Date} object and initializes it so that
      * it represents the instant at the start of the minute specified by
-     * the <code>year</code>, <code>month</code>, <code>date</code>,
-     * <code>hrs</code>, and <code>min</code> arguments, in the local
+     * the {@code year}, {@code month}, {@code date},
+     * {@code hrs}, and {@code min} arguments, in the local
      * time zone.
      *
      * @param   year    the year minus 1900.
@@ -211,9 +211,8 @@
      * @param   min     the minutes between 0-59.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(year + 1900, month, date,
-     * hrs, min)</code> or <code>GregorianCalendar(year + 1900,
-     * month, date, hrs, min)</code>.
+     * replaced by {@code Calendar.set(year + 1900, month, date, hrs, min)}
+     * or {@code GregorianCalendar(year + 1900, month, date, hrs, min)}.
      */
     @Deprecated
     public Date(int year, int month, int date, int hrs, int min) {
@@ -221,10 +220,10 @@
     }
 
     /**
-     * Allocates a <code>Date</code> object and initializes it so that
+     * Allocates a {@code Date} object and initializes it so that
      * it represents the instant at the start of the second specified
-     * by the <code>year</code>, <code>month</code>, <code>date</code>,
-     * <code>hrs</code>, <code>min</code>, and <code>sec</code> arguments,
+     * by the {@code year}, {@code month}, {@code date},
+     * {@code hrs}, {@code min}, and {@code sec} arguments,
      * in the local time zone.
      *
      * @param   year    the year minus 1900.
@@ -235,9 +234,8 @@
      * @param   sec     the seconds between 0-59.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(year + 1900, month, date,
-     * hrs, min, sec)</code> or <code>GregorianCalendar(year + 1900,
-     * month, date, hrs, min, sec)</code>.
+     * replaced by {@code Calendar.set(year + 1900, month, date, hrs, min, sec)}
+     * or {@code GregorianCalendar(year + 1900, month, date, hrs, min, sec)}.
      */
     @Deprecated
     public Date(int year, int month, int date, int hrs, int min, int sec) {
@@ -258,16 +256,16 @@
     }
 
     /**
-     * Allocates a <code>Date</code> object and initializes it so that
+     * Allocates a {@code Date} object and initializes it so that
      * it represents the date and time indicated by the string
-     * <code>s</code>, which is interpreted as if by the
+     * {@code s}, which is interpreted as if by the
      * {@link Date#parse} method.
      *
      * @param   s   a string representation of the date.
      * @see     java.text.DateFormat
      * @see     java.util.Date#parse(java.lang.String)
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>DateFormat.parse(String s)</code>.
+     * replaced by {@code DateFormat.parse(String s)}.
      */
     @Deprecated
     public Date(String s) {
@@ -292,7 +290,7 @@
      * Determines the date and time based on the arguments. The
      * arguments are interpreted as a year, month, day of the month,
      * hour of the day, minute within the hour, and second within the
-     * minute, exactly as for the <tt>Date</tt> constructor with six
+     * minute, exactly as for the {@code Date} constructor with six
      * arguments, except that the arguments are interpreted relative
      * to UTC rather than to the local time zone. The time indicated is
      * returned represented as the distance, measured in milliseconds,
@@ -308,10 +306,9 @@
      *          the date and time specified by the arguments.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(year + 1900, month, date,
-     * hrs, min, sec)</code> or <code>GregorianCalendar(year + 1900,
-     * month, date, hrs, min, sec)</code>, using a UTC
-     * <code>TimeZone</code>, followed by <code>Calendar.getTime().getTime()</code>.
+     * replaced by {@code Calendar.set(year + 1900, month, date, hrs, min, sec)}
+     * or {@code GregorianCalendar(year + 1900, month, date, hrs, min, sec)}, using a UTC
+     * {@code TimeZone}, followed by {@code Calendar.getTime().getTime()}.
      */
     @Deprecated
     public static long UTC(int year, int month, int date,
@@ -338,12 +335,12 @@
     }
 
     /**
-     * Attempts to interpret the string <tt>s</tt> as a representation
+     * Attempts to interpret the string {@code s} as a representation
      * of a date and time. If the attempt is successful, the time
      * indicated is returned represented as the distance, measured in
      * milliseconds, of that time from the epoch (00:00:00 GMT on
      * January 1, 1970). If the attempt fails, an
-     * <tt>IllegalArgumentException</tt> is thrown.
+     * {@code IllegalArgumentException} is thrown.
      * <p>
      * It accepts many syntaxes; in particular, it recognizes the IETF
      * standard date syntax: "Sat, 12 Aug 1995 13:30:00 GMT". It also
@@ -353,11 +350,11 @@
      * meridian). If no time zone is specified, the local time zone is
      * assumed. GMT and UTC are considered equivalent.
      * <p>
-     * The string <tt>s</tt> is processed from left to right, looking for
-     * data of interest. Any material in <tt>s</tt> that is within the
-     * ASCII parenthesis characters <tt>(</tt> and <tt>)</tt> is ignored.
+     * The string {@code s} is processed from left to right, looking for
+     * data of interest. Any material in {@code s} that is within the
+     * ASCII parenthesis characters {@code (} and {@code )} is ignored.
      * Parentheses may be nested. Otherwise, the only characters permitted
-     * within <tt>s</tt> are these ASCII characters:
+     * within {@code s} are these ASCII characters:
      * <blockquote><pre>
      * abcdefghijklmnopqrstuvwxyz
      * ABCDEFGHIJKLMNOPQRSTUVWXYZ
@@ -365,18 +362,18 @@
      * and whitespace characters.<p>
      * A consecutive sequence of decimal digits is treated as a decimal
      * number:<ul>
-     * <li>If a number is preceded by <tt>+</tt> or <tt>-</tt> and a year
+     * <li>If a number is preceded by {@code +} or {@code -} and a year
      *     has already been recognized, then the number is a time-zone
      *     offset. If the number is less than 24, it is an offset measured
      *     in hours. Otherwise, it is regarded as an offset in minutes,
      *     expressed in 24-hour time format without punctuation. A
-     *     preceding <tt>-</tt> means a westward offset. Time zone offsets
+     *     preceding {@code -} means a westward offset. Time zone offsets
      *     are always relative to UTC (Greenwich). Thus, for example,
-     *     <tt>-5</tt> occurring in the string would mean "five hours west
-     *     of Greenwich" and <tt>+0430</tt> would mean "four hours and
+     *     {@code -5} occurring in the string would mean "five hours west
+     *     of Greenwich" and {@code +0430} would mean "four hours and
      *     thirty minutes east of Greenwich." It is permitted for the
-     *     string to specify <tt>GMT</tt>, <tt>UT</tt>, or <tt>UTC</tt>
-     *     redundantly-for example, <tt>GMT-5</tt> or <tt>utc+0430</tt>.
+     *     string to specify {@code GMT}, {@code UT}, or {@code UTC}
+     *     redundantly-for example, {@code GMT-5} or {@code utc+0430}.
      * <li>The number is regarded as a year number if one of the
      *     following conditions is true:
      * <ul>
@@ -399,8 +396,8 @@
      *     unless an hour has already been recognized, in which case it is
      *     regarded as a minute.
      * <li>If the number is followed by a slash, it is regarded as a month
-     *     (it is decreased by 1 to produce a number in the range <tt>0</tt>
-     *     to <tt>11</tt>), unless a month has already been recognized, in
+     *     (it is decreased by 1 to produce a number in the range {@code 0}
+     *     to {@code 11}), unless a month has already been recognized, in
      *     which case it is regarded as a day of the month.
      * <li>If the number is followed by whitespace, a comma, a hyphen, or
      *     end of string, then if an hour has been recognized but not a
@@ -409,31 +406,31 @@
      *     otherwise, it is regarded as a day of the month. </ul><p>
      * A consecutive sequence of letters is regarded as a word and treated
      * as follows:<ul>
-     * <li>A word that matches <tt>AM</tt>, ignoring case, is ignored (but
+     * <li>A word that matches {@code AM}, ignoring case, is ignored (but
      *     the parse fails if an hour has not been recognized or is less
-     *     than <tt>1</tt> or greater than <tt>12</tt>).
-     * <li>A word that matches <tt>PM</tt>, ignoring case, adds <tt>12</tt>
+     *     than {@code 1} or greater than {@code 12}).
+     * <li>A word that matches {@code PM}, ignoring case, adds {@code 12}
      *     to the hour (but the parse fails if an hour has not been
-     *     recognized or is less than <tt>1</tt> or greater than <tt>12</tt>).
-     * <li>Any word that matches any prefix of <tt>SUNDAY, MONDAY, TUESDAY,
-     *     WEDNESDAY, THURSDAY, FRIDAY</tt>, or <tt>SATURDAY</tt>, ignoring
-     *     case, is ignored. For example, <tt>sat, Friday, TUE</tt>, and
-     *     <tt>Thurs</tt> are ignored.
-     * <li>Otherwise, any word that matches any prefix of <tt>JANUARY,
+     *     recognized or is less than {@code 1} or greater than {@code 12}).
+     * <li>Any word that matches any prefix of {@code SUNDAY, MONDAY, TUESDAY,
+     *     WEDNESDAY, THURSDAY, FRIDAY}, or {@code SATURDAY}, ignoring
+     *     case, is ignored. For example, {@code sat, Friday, TUE}, and
+     *     {@code Thurs} are ignored.
+     * <li>Otherwise, any word that matches any prefix of {@code JANUARY,
      *     FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER,
-     *     OCTOBER, NOVEMBER</tt>, or <tt>DECEMBER</tt>, ignoring case, and
+     *     OCTOBER, NOVEMBER}, or {@code DECEMBER}, ignoring case, and
      *     considering them in the order given here, is recognized as
-     *     specifying a month and is converted to a number (<tt>0</tt> to
-     *     <tt>11</tt>). For example, <tt>aug, Sept, april</tt>, and
-     *     <tt>NOV</tt> are recognized as months. So is <tt>Ma</tt>, which
-     *     is recognized as <tt>MARCH</tt>, not <tt>MAY</tt>.
-     * <li>Any word that matches <tt>GMT, UT</tt>, or <tt>UTC</tt>, ignoring
+     *     specifying a month and is converted to a number ({@code 0} to
+     *     {@code 11}). For example, {@code aug, Sept, april}, and
+     *     {@code NOV} are recognized as months. So is {@code Ma}, which
+     *     is recognized as {@code MARCH}, not {@code MAY}.
+     * <li>Any word that matches {@code GMT, UT}, or {@code UTC}, ignoring
      *     case, is treated as referring to UTC.
-     * <li>Any word that matches <tt>EST, CST, MST</tt>, or <tt>PST</tt>,
+     * <li>Any word that matches {@code EST, CST, MST}, or {@code PST},
      *     ignoring case, is recognized as referring to the time zone in
      *     North America that is five, six, seven, or eight hours west of
-     *     Greenwich, respectively. Any word that matches <tt>EDT, CDT,
-     *     MDT</tt>, or <tt>PDT</tt>, ignoring case, is recognized as
+     *     Greenwich, respectively. Any word that matches {@code EDT, CDT,
+     *     MDT}, or {@code PDT}, ignoring case, is recognized as
      *     referring to the same time zone, respectively, during daylight
      *     saving time.</ul><p>
      * Once the entire string s has been scanned, it is converted to a time
@@ -448,7 +445,7 @@
      *          represented by the string argument.
      * @see     java.text.DateFormat
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>DateFormat.parse(String s)</code>.
+     * replaced by {@code DateFormat.parse(String s)}.
      */
     @Deprecated
     public static long parse(String s) {
@@ -638,13 +635,13 @@
     /**
      * Returns a value that is the result of subtracting 1900 from the
      * year that contains or begins with the instant in time represented
-     * by this <code>Date</code> object, as interpreted in the local
+     * by this {@code Date} object, as interpreted in the local
      * time zone.
      *
      * @return  the year represented by this date, minus 1900.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.get(Calendar.YEAR) - 1900</code>.
+     * replaced by {@code Calendar.get(Calendar.YEAR) - 1900}.
      */
     @Deprecated
     public int getYear() {
@@ -652,8 +649,8 @@
     }
 
     /**
-     * Sets the year of this <tt>Date</tt> object to be the specified
-     * value plus 1900. This <code>Date</code> object is modified so
+     * Sets the year of this {@code Date} object to be the specified
+     * value plus 1900. This {@code Date} object is modified so
      * that it represents a point in time within the specified year,
      * with the month, date, hour, minute, and second the same as
      * before, as interpreted in the local time zone. (Of course, if
@@ -664,7 +661,7 @@
      * @param   year    the year value.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(Calendar.YEAR, year + 1900)</code>.
+     * replaced by {@code Calendar.set(Calendar.YEAR, year + 1900)}.
      */
     @Deprecated
     public void setYear(int year) {
@@ -673,14 +670,14 @@
 
     /**
      * Returns a number representing the month that contains or begins
-     * with the instant in time represented by this <tt>Date</tt> object.
-     * The value returned is between <code>0</code> and <code>11</code>,
-     * with the value <code>0</code> representing January.
+     * with the instant in time represented by this {@code Date} object.
+     * The value returned is between {@code 0} and {@code 11},
+     * with the value {@code 0} representing January.
      *
      * @return  the month represented by this date.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.get(Calendar.MONTH)</code>.
+     * replaced by {@code Calendar.get(Calendar.MONTH)}.
      */
     @Deprecated
     public int getMonth() {
@@ -689,7 +686,7 @@
 
     /**
      * Sets the month of this date to the specified value. This
-     * <tt>Date</tt> object is modified so that it represents a point
+     * {@code Date} object is modified so that it represents a point
      * in time within the specified month, with the year, date, hour,
      * minute, and second the same as before, as interpreted in the
      * local time zone. If the date was October 31, for example, and
@@ -699,7 +696,7 @@
      * @param   month   the month value between 0-11.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(Calendar.MONTH, int month)</code>.
+     * replaced by {@code Calendar.set(Calendar.MONTH, int month)}.
      */
     @Deprecated
     public void setMonth(int month) {
@@ -719,16 +716,16 @@
     }
 
     /**
-     * Returns the day of the month represented by this <tt>Date</tt> object.
-     * The value returned is between <code>1</code> and <code>31</code>
+     * Returns the day of the month represented by this {@code Date} object.
+     * The value returned is between {@code 1} and {@code 31}
      * representing the day of the month that contains or begins with the
-     * instant in time represented by this <tt>Date</tt> object, as
+     * instant in time represented by this {@code Date} object, as
      * interpreted in the local time zone.
      *
      * @return  the day of the month represented by this date.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.get(Calendar.DAY_OF_MONTH)</code>.
+     * replaced by {@code Calendar.get(Calendar.DAY_OF_MONTH)}.
      * @deprecated
      */
     @Deprecated
@@ -737,8 +734,8 @@
     }
 
     /**
-     * Sets the day of the month of this <tt>Date</tt> object to the
-     * specified value. This <tt>Date</tt> object is modified so that
+     * Sets the day of the month of this {@code Date} object to the
+     * specified value. This {@code Date} object is modified so that
      * it represents a point in time within the specified day of the
      * month, with the year, month, hour, minute, and second the same
      * as before, as interpreted in the local time zone. If the date
@@ -749,7 +746,7 @@
      * @param   date   the day of the month value between 1-31.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(Calendar.DAY_OF_MONTH, int date)</code>.
+     * replaced by {@code Calendar.set(Calendar.DAY_OF_MONTH, int date)}.
      */
     @Deprecated
     public void setDate(int date) {
@@ -758,17 +755,17 @@
 
     /**
      * Returns the day of the week represented by this date. The
-     * returned value (<tt>0</tt> = Sunday, <tt>1</tt> = Monday,
-     * <tt>2</tt> = Tuesday, <tt>3</tt> = Wednesday, <tt>4</tt> =
-     * Thursday, <tt>5</tt> = Friday, <tt>6</tt> = Saturday)
+     * returned value ({@code 0} = Sunday, {@code 1} = Monday,
+     * {@code 2} = Tuesday, {@code 3} = Wednesday, {@code 4} =
+     * Thursday, {@code 5} = Friday, {@code 6} = Saturday)
      * represents the day of the week that contains or begins with
-     * the instant in time represented by this <tt>Date</tt> object,
+     * the instant in time represented by this {@code Date} object,
      * as interpreted in the local time zone.
      *
      * @return  the day of the week represented by this date.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.get(Calendar.DAY_OF_WEEK)</code>.
+     * replaced by {@code Calendar.get(Calendar.DAY_OF_WEEK)}.
      */
     @Deprecated
     public int getDay() {
@@ -776,16 +773,16 @@
     }
 
     /**
-     * Returns the hour represented by this <tt>Date</tt> object. The
-     * returned value is a number (<tt>0</tt> through <tt>23</tt>)
+     * Returns the hour represented by this {@code Date} object. The
+     * returned value is a number ({@code 0} through {@code 23})
      * representing the hour within the day that contains or begins
-     * with the instant in time represented by this <tt>Date</tt>
+     * with the instant in time represented by this {@code Date}
      * object, as interpreted in the local time zone.
      *
      * @return  the hour represented by this date.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.get(Calendar.HOUR_OF_DAY)</code>.
+     * replaced by {@code Calendar.get(Calendar.HOUR_OF_DAY)}.
      */
     @Deprecated
     public int getHours() {
@@ -793,8 +790,8 @@
     }
 
     /**
-     * Sets the hour of this <tt>Date</tt> object to the specified value.
-     * This <tt>Date</tt> object is modified so that it represents a point
+     * Sets the hour of this {@code Date} object to the specified value.
+     * This {@code Date} object is modified so that it represents a point
      * in time within the specified hour of the day, with the year, month,
      * date, minute, and second the same as before, as interpreted in the
      * local time zone.
@@ -802,7 +799,7 @@
      * @param   hours   the hour value.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(Calendar.HOUR_OF_DAY, int hours)</code>.
+     * replaced by {@code Calendar.set(Calendar.HOUR_OF_DAY, int hours)}.
      */
     @Deprecated
     public void setHours(int hours) {
@@ -812,12 +809,12 @@
     /**
      * Returns the number of minutes past the hour represented by this date,
      * as interpreted in the local time zone.
-     * The value returned is between <code>0</code> and <code>59</code>.
+     * The value returned is between {@code 0} and {@code 59}.
      *
      * @return  the number of minutes past the hour represented by this date.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.get(Calendar.MINUTE)</code>.
+     * replaced by {@code Calendar.get(Calendar.MINUTE)}.
      */
     @Deprecated
     public int getMinutes() {
@@ -825,8 +822,8 @@
     }
 
     /**
-     * Sets the minutes of this <tt>Date</tt> object to the specified value.
-     * This <tt>Date</tt> object is modified so that it represents a point
+     * Sets the minutes of this {@code Date} object to the specified value.
+     * This {@code Date} object is modified so that it represents a point
      * in time within the specified minute of the hour, with the year, month,
      * date, hour, and second the same as before, as interpreted in the
      * local time zone.
@@ -834,7 +831,7 @@
      * @param   minutes   the value of the minutes.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(Calendar.MINUTE, int minutes)</code>.
+     * replaced by {@code Calendar.set(Calendar.MINUTE, int minutes)}.
      */
     @Deprecated
     public void setMinutes(int minutes) {
@@ -843,14 +840,14 @@
 
     /**
      * Returns the number of seconds past the minute represented by this date.
-     * The value returned is between <code>0</code> and <code>61</code>. The
-     * values <code>60</code> and <code>61</code> can only occur on those
+     * The value returned is between {@code 0} and {@code 61}. The
+     * values {@code 60} and {@code 61} can only occur on those
      * Java Virtual Machines that take leap seconds into account.
      *
      * @return  the number of seconds past the minute represented by this date.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.get(Calendar.SECOND)</code>.
+     * replaced by {@code Calendar.get(Calendar.SECOND)}.
      */
     @Deprecated
     public int getSeconds() {
@@ -858,8 +855,8 @@
     }
 
     /**
-     * Sets the seconds of this <tt>Date</tt> to the specified value.
-     * This <tt>Date</tt> object is modified so that it represents a
+     * Sets the seconds of this {@code Date} to the specified value.
+     * This {@code Date} object is modified so that it represents a
      * point in time within the specified second of the minute, with
      * the year, month, date, hour, and minute the same as before, as
      * interpreted in the local time zone.
@@ -867,7 +864,7 @@
      * @param   seconds   the seconds value.
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>Calendar.set(Calendar.SECOND, int seconds)</code>.
+     * replaced by {@code Calendar.set(Calendar.SECOND, int seconds)}.
      */
     @Deprecated
     public void setSeconds(int seconds) {
@@ -876,7 +873,7 @@
 
     /**
      * Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT
-     * represented by this <tt>Date</tt> object.
+     * represented by this {@code Date} object.
      *
      * @return  the number of milliseconds since January 1, 1970, 00:00:00 GMT
      *          represented by this date.
@@ -893,8 +890,8 @@
     }
 
     /**
-     * Sets this <code>Date</code> object to represent a point in time that is
-     * <code>time</code> milliseconds after January 1, 1970 00:00:00 GMT.
+     * Sets this {@code Date} object to represent a point in time that is
+     * {@code time} milliseconds after January 1, 1970 00:00:00 GMT.
      *
      * @param   time   the number of milliseconds.
      */
@@ -907,11 +904,11 @@
      * Tests if this date is before the specified date.
      *
      * @param   when   a date.
-     * @return  <code>true</code> if and only if the instant of time
-     *            represented by this <tt>Date</tt> object is strictly
-     *            earlier than the instant represented by <tt>when</tt>;
-     *          <code>false</code> otherwise.
-     * @exception NullPointerException if <code>when</code> is null.
+     * @return  {@code true} if and only if the instant of time
+     *            represented by this {@code Date} object is strictly
+     *            earlier than the instant represented by {@code when};
+     *          {@code false} otherwise.
+     * @exception NullPointerException if {@code when} is null.
      */
     public boolean before(Date when) {
         return getMillisOf(this) < getMillisOf(when);
@@ -921,11 +918,11 @@
      * Tests if this date is after the specified date.
      *
      * @param   when   a date.
-     * @return  <code>true</code> if and only if the instant represented
-     *          by this <tt>Date</tt> object is strictly later than the
-     *          instant represented by <tt>when</tt>;
-     *          <code>false</code> otherwise.
-     * @exception NullPointerException if <code>when</code> is null.
+     * @return  {@code true} if and only if the instant represented
+     *          by this {@code Date} object is strictly later than the
+     *          instant represented by {@code when};
+     *          {@code false} otherwise.
+     * @exception NullPointerException if {@code when} is null.
      */
     public boolean after(Date when) {
         return getMillisOf(this) > getMillisOf(when);
@@ -933,17 +930,17 @@
 
     /**
      * Compares two dates for equality.
-     * The result is <code>true</code> if and only if the argument is
-     * not <code>null</code> and is a <code>Date</code> object that
+     * The result is {@code true} if and only if the argument is
+     * not {@code null} and is a {@code Date} object that
      * represents the same point in time, to the millisecond, as this object.
      * <p>
-     * Thus, two <code>Date</code> objects are equal if and only if the
-     * <code>getTime</code> method returns the same <code>long</code>
+     * Thus, two {@code Date} objects are equal if and only if the
+     * {@code getTime} method returns the same {@code long}
      * value for both.
      *
      * @param   obj   the object to compare with.
-     * @return  <code>true</code> if the objects are the same;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the objects are the same;
+     *          {@code false} otherwise.
      * @see     java.util.Date#getTime()
      */
     public boolean equals(Object obj) {
@@ -951,7 +948,7 @@
     }
 
     /**
-     * Returns the millisecond value of this <code>Date</code> object
+     * Returns the millisecond value of this {@code Date} object
      * without affecting its internal state.
      */
     static final long getMillisOf(Date date) {
@@ -965,13 +962,13 @@
     /**
      * Compares two Dates for ordering.
      *
-     * @param   anotherDate   the <code>Date</code> to be compared.
-     * @return  the value <code>0</code> if the argument Date is equal to
-     *          this Date; a value less than <code>0</code> if this Date
+     * @param   anotherDate   the {@code Date} to be compared.
+     * @return  the value {@code 0} if the argument Date is equal to
+     *          this Date; a value less than {@code 0} if this Date
      *          is before the Date argument; and a value greater than
-     *      <code>0</code> if this Date is after the Date argument.
+     *      {@code 0} if this Date is after the Date argument.
      * @since   1.2
-     * @exception NullPointerException if <code>anotherDate</code> is null.
+     * @exception NullPointerException if {@code anotherDate} is null.
      */
     public int compareTo(Date anotherDate) {
         long thisTime = getMillisOf(this);
@@ -981,7 +978,7 @@
 
     /**
      * Returns a hash code value for this object. The result is the
-     * exclusive OR of the two halves of the primitive <tt>long</tt>
+     * exclusive OR of the two halves of the primitive {@code long}
      * value returned by the {@link Date#getTime}
      * method. That is, the hash code is the value of the expression:
      * <blockquote><pre>{@code
@@ -996,29 +993,29 @@
     }
 
     /**
-     * Converts this <code>Date</code> object to a <code>String</code>
+     * Converts this {@code Date} object to a {@code String}
      * of the form:
      * <blockquote><pre>
      * dow mon dd hh:mm:ss zzz yyyy</pre></blockquote>
      * where:<ul>
-     * <li><tt>dow</tt> is the day of the week (<tt>Sun, Mon, Tue, Wed,
-     *     Thu, Fri, Sat</tt>).
-     * <li><tt>mon</tt> is the month (<tt>Jan, Feb, Mar, Apr, May, Jun,
-     *     Jul, Aug, Sep, Oct, Nov, Dec</tt>).
-     * <li><tt>dd</tt> is the day of the month (<tt>01</tt> through
-     *     <tt>31</tt>), as two decimal digits.
-     * <li><tt>hh</tt> is the hour of the day (<tt>00</tt> through
-     *     <tt>23</tt>), as two decimal digits.
-     * <li><tt>mm</tt> is the minute within the hour (<tt>00</tt> through
-     *     <tt>59</tt>), as two decimal digits.
-     * <li><tt>ss</tt> is the second within the minute (<tt>00</tt> through
-     *     <tt>61</tt>, as two decimal digits.
-     * <li><tt>zzz</tt> is the time zone (and may reflect daylight saving
+     * <li>{@code dow} is the day of the week ({@code Sun, Mon, Tue, Wed,
+     *     Thu, Fri, Sat}).
+     * <li>{@code mon} is the month ({@code Jan, Feb, Mar, Apr, May, Jun,
+     *     Jul, Aug, Sep, Oct, Nov, Dec}).
+     * <li>{@code dd} is the day of the month ({@code 01} through
+     *     {@code 31}), as two decimal digits.
+     * <li>{@code hh} is the hour of the day ({@code 00} through
+     *     {@code 23}), as two decimal digits.
+     * <li>{@code mm} is the minute within the hour ({@code 00} through
+     *     {@code 59}), as two decimal digits.
+     * <li>{@code ss} is the second within the minute ({@code 00} through
+     *     {@code 61}, as two decimal digits.
+     * <li>{@code zzz} is the time zone (and may reflect daylight saving
      *     time). Standard time zone abbreviations include those
-     *     recognized by the method <tt>parse</tt>. If time zone
-     *     information is not available, then <tt>zzz</tt> is empty -
+     *     recognized by the method {@code parse}. If time zone
+     *     information is not available, then {@code zzz} is empty -
      *     that is, it consists of no characters at all.
-     * <li><tt>yyyy</tt> is the year, as four decimal digits.
+     * <li>{@code yyyy} is the year, as four decimal digits.
      * </ul>
      *
      * @return  a string representation of this date.
@@ -1053,7 +1050,7 @@
     /**
      * Converts the given name to its 3-letter abbreviation (e.g.,
      * "monday" -> "Mon") and stored the abbreviation in the given
-     * <code>StringBuilder</code>.
+     * {@code StringBuilder}.
      */
     private static final StringBuilder convertToAbbr(StringBuilder sb, String name) {
         sb.append(Character.toUpperCase(name.charAt(0)));
@@ -1062,11 +1059,11 @@
     }
 
     /**
-     * Creates a string representation of this <tt>Date</tt> object in an
+     * Creates a string representation of this {@code Date} object in an
      * implementation-dependent form. The intent is that the form should
      * be familiar to the user of the Java application, wherever it may
      * happen to be running. The intent is comparable to that of the
-     * "<code>%c</code>" format supported by the <code>strftime()</code>
+     * "{@code %c}" format supported by the {@code strftime()}
      * function of ISO&nbsp;C.
      *
      * @return  a string representation of this date, using the locale
@@ -1075,7 +1072,7 @@
      * @see     java.util.Date#toString()
      * @see     java.util.Date#toGMTString()
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>DateFormat.format(Date date)</code>.
+     * replaced by {@code DateFormat.format(Date date)}.
      */
     @Deprecated
     public String toLocaleString() {
@@ -1084,23 +1081,23 @@
     }
 
     /**
-     * Creates a string representation of this <tt>Date</tt> object of
+     * Creates a string representation of this {@code Date} object of
      * the form:
      * <blockquote><pre>
      * d mon yyyy hh:mm:ss GMT</pre></blockquote>
      * where:<ul>
-     * <li><i>d</i> is the day of the month (<tt>1</tt> through <tt>31</tt>),
+     * <li><i>d</i> is the day of the month ({@code 1} through {@code 31}),
      *     as one or two decimal digits.
-     * <li><i>mon</i> is the month (<tt>Jan, Feb, Mar, Apr, May, Jun, Jul,
-     *     Aug, Sep, Oct, Nov, Dec</tt>).
+     * <li><i>mon</i> is the month ({@code Jan, Feb, Mar, Apr, May, Jun, Jul,
+     *     Aug, Sep, Oct, Nov, Dec}).
      * <li><i>yyyy</i> is the year, as four decimal digits.
-     * <li><i>hh</i> is the hour of the day (<tt>00</tt> through <tt>23</tt>),
+     * <li><i>hh</i> is the hour of the day ({@code 00} through {@code 23}),
      *     as two decimal digits.
-     * <li><i>mm</i> is the minute within the hour (<tt>00</tt> through
-     *     <tt>59</tt>), as two decimal digits.
-     * <li><i>ss</i> is the second within the minute (<tt>00</tt> through
-     *     <tt>61</tt>), as two decimal digits.
-     * <li><i>GMT</i> is exactly the ASCII letters "<tt>GMT</tt>" to indicate
+     * <li><i>mm</i> is the minute within the hour ({@code 00} through
+     *     {@code 59}), as two decimal digits.
+     * <li><i>ss</i> is the second within the minute ({@code 00} through
+     *     {@code 61}), as two decimal digits.
+     * <li><i>GMT</i> is exactly the ASCII letters "{@code GMT}" to indicate
      *     Greenwich Mean Time.
      * </ul><p>
      * The result does not depend on the local time zone.
@@ -1111,8 +1108,8 @@
      * @see     java.util.Date#toString()
      * @see     java.util.Date#toLocaleString()
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>DateFormat.format(Date date)</code>, using a
-     * GMT <code>TimeZone</code>.
+     * replaced by {@code DateFormat.format(Date date)}, using a
+     * GMT {@code TimeZone}.
      */
     @Deprecated
     public String toGMTString() {
@@ -1135,7 +1132,7 @@
     /**
      * Returns the offset, measured in minutes, for the local time zone
      * relative to UTC that is appropriate for the time represented by
-     * this <code>Date</code> object.
+     * this {@code Date} object.
      * <p>
      * For example, in Massachusetts, five time zones west of Greenwich:
      * <blockquote><pre>
@@ -1161,8 +1158,8 @@
      * @see     java.util.Calendar#DST_OFFSET
      * @see     java.util.TimeZone#getDefault
      * @deprecated As of JDK version 1.1,
-     * replaced by <code>-(Calendar.get(Calendar.ZONE_OFFSET) +
-     * Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000)</code>.
+     * replaced by {@code -(Calendar.get(Calendar.ZONE_OFFSET) +
+     * Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000)}.
      */
     @Deprecated
     public int getTimezoneOffset() {
@@ -1313,7 +1310,7 @@
     /**
      * Save the state of this object to a stream (i.e., serialize it).
      *
-     * @serialData The value returned by <code>getTime()</code>
+     * @serialData The value returned by {@code getTime()}
      *             is emitted (long).  This represents the offset from
      *             January 1, 1970, 00:00:00 GMT in milliseconds.
      */
@@ -1336,7 +1333,7 @@
      * Obtains an instance of {@code Date} from an {@code Instant} object.
      * <p>
      * {@code Instant} uses a precision of nanoseconds, whereas {@code Date}
-     * uses a precision of milliseconds.  The conversion will trancate any
+     * uses a precision of milliseconds.  The conversion will truncate any
      * excess precision information as though the amount in nanoseconds was
      * subject to integer division by one million.
      * <p>
--- a/src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1400,7 +1400,7 @@
             lock.lock();
             try {
                 checkForComodification();
-                if (fromIndex < 0 || toIndex > size)
+                if (fromIndex < 0 || toIndex > size || fromIndex > toIndex)
                     throw new IndexOutOfBoundsException();
                 return new COWSubList<E>(l, fromIndex + offset,
                                          toIndex + offset);
--- a/src/share/classes/sun/awt/CustomCursor.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/CustomCursor.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1999, 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
@@ -33,6 +33,7 @@
  *
  * @author      ThomasBall
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public abstract class CustomCursor extends Cursor {
 
     protected Image image;
--- a/src/share/classes/sun/awt/FontConfiguration.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/FontConfiguration.java	Tue Feb 04 16:24:39 2014 -0800
@@ -2109,6 +2109,7 @@
             return ret;
         }
 
+        @SuppressWarnings("serial") // JDK-implementation class
         class FontProperties extends Properties {
             public synchronized Object put(Object k, Object v) {
                 parseProperty((String)k, (String)v);
--- a/src/share/classes/sun/awt/TimedWindowEvent.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/TimedWindowEvent.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -28,6 +28,7 @@
 import java.awt.event.WindowEvent;
 import java.awt.Window;
 
+@SuppressWarnings("serial") // JDK-implementation class
 public class TimedWindowEvent extends WindowEvent {
 
     private long time;
--- a/src/share/classes/sun/awt/dnd/SunDropTargetEvent.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/dnd/SunDropTargetEvent.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -29,6 +29,7 @@
 import java.awt.dnd.InvalidDnDOperationException;
 import java.awt.event.MouseEvent;
 
+@SuppressWarnings("serial") // JDK-implementation class
 public class SunDropTargetEvent extends MouseEvent {
 
     public static final int MOUSE_DROPPED = MouseEvent.MOUSE_RELEASED;
--- a/src/share/classes/sun/awt/event/IgnorePaintEvent.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/event/IgnorePaintEvent.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
  * Look at <code>javax.swing.SwingPaintEventDispatcher</code> for more.
  *
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public class IgnorePaintEvent extends PaintEvent {
     public IgnorePaintEvent(Component source, int id, Rectangle updateRect) {
         super(source, id, updateRect);
--- a/src/share/classes/sun/awt/image/BadDepthException.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/image/BadDepthException.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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,6 +25,7 @@
 
 package sun.awt.image;
 
+@SuppressWarnings("serial") // JDK-implementation class
 public class BadDepthException extends Exception {
     public BadDepthException() {
     }
--- a/src/share/classes/sun/awt/image/ImageAccessException.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/image/ImageAccessException.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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,6 +25,7 @@
 
 package sun.awt.image;
 
+@SuppressWarnings("serial") // JDK-implementation class
 public class ImageAccessException extends Exception {
     public ImageAccessException(String s) {
         super(s);
--- a/src/share/classes/sun/awt/image/ImageFormatException.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/image/ImageFormatException.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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,6 +25,7 @@
 
 package sun.awt.image;
 
+@SuppressWarnings("serial") // JDK-implementation class
 public class ImageFormatException extends Exception {
     public ImageFormatException(String s) {
         super(s);
--- a/src/share/classes/sun/awt/image/PNGImageDecoder.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/image/PNGImageDecoder.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, 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
@@ -231,6 +231,7 @@
         }
         return true;
     }
+    @SuppressWarnings("serial") // JDK-implementation class
     public class PNGException extends IOException {
         PNGException(String s) { super(s); }
     }
--- a/src/share/classes/sun/awt/shell/DefaultShellFolder.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/shell/DefaultShellFolder.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -34,7 +34,7 @@
  * @author Michael Martak
  * @since 1.4
  */
-
+@SuppressWarnings("serial") // JDK-implementation class
 class DefaultShellFolder extends ShellFolder {
 
     /**
--- a/src/share/classes/sun/awt/shell/ShellFolder.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/awt/shell/ShellFolder.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -37,7 +37,7 @@
  * @author Michael Martak
  * @since 1.4
  */
-
+@SuppressWarnings("serial") // JDK-implementation class
 public abstract class ShellFolder extends File {
     private static final String COLUMN_NAME = "FileChooser.fileNameHeaderText";
     private static final String COLUMN_SIZE = "FileChooser.fileSizeHeaderText";
--- a/src/share/classes/sun/font/FontScalerException.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/font/FontScalerException.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 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,6 +25,7 @@
 
 package sun.font;
 
+@SuppressWarnings("serial") // JDK-implementation class
 public class FontScalerException extends Exception {
     public FontScalerException() {
       super("Font scaler encountered runtime problem.");
--- a/src/share/classes/sun/java2d/InvalidPipeException.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/java2d/InvalidPipeException.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 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
@@ -34,6 +34,7 @@
  * windows which toggle the need to use platform graphics or direct
  * graphics access.
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public class InvalidPipeException extends IllegalStateException {
     /**
      * Constructs an InvalidPipeException with no detail message.
--- a/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 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
@@ -376,6 +376,7 @@
         return (int)res;
     }
 
+    @SuppressWarnings("serial") // JDK-implementation class
     public static class ImageLayoutException extends Exception {
         public ImageLayoutException(String message) {
             super(message);
--- a/src/share/classes/sun/misc/DoubleConsts.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/misc/DoubleConsts.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 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
@@ -77,9 +77,7 @@
 
     /**
      * The exponent the smallest positive <code>double</code>
-     * subnormal value would have if it could be normalized.  It is
-     * equal to the value returned by
-     * <code>FpUtils.ilogb(Double.MIN_VALUE)</code>.
+     * subnormal value would have if it could be normalized..
      */
     public static final int     MIN_SUB_EXPONENT = MIN_EXPONENT -
                                                    (SIGNIFICAND_WIDTH - 1);
--- a/src/share/classes/sun/misc/FloatConsts.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/misc/FloatConsts.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 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
@@ -73,8 +73,7 @@
 
     /**
      * The exponent the smallest positive <code>float</code> subnormal
-     * value would have if it could be normalized.  It is equal to the
-     * value returned by <code>FpUtils.ilogb(Float.MIN_VALUE)</code>.
+     * value would have if it could be normalized.
      */
     public static final int     MIN_SUB_EXPONENT = MIN_EXPONENT -
                                                    (SIGNIFICAND_WIDTH - 1);
--- a/src/share/classes/sun/misc/FpUtils.java	Fri Jan 31 18:49:58 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,931 +0,0 @@
-/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-import sun.misc.FloatConsts;
-import sun.misc.DoubleConsts;
-
-/**
- * The class {@code FpUtils} contains static utility methods for
- * manipulating and inspecting {@code float} and
- * {@code double} floating-point numbers.  These methods include
- * functionality recommended or required by the IEEE 754
- * floating-point standard.
- *
- * @author Joseph D. Darcy
- */
-
-public class FpUtils {
-    /*
-     * The methods in this class are reasonably implemented using
-     * direct or indirect bit-level manipulation of floating-point
-     * values.  However, having access to the IEEE 754 recommended
-     * functions would obviate the need for most programmers to engage
-     * in floating-point bit-twiddling.
-     *
-     * An IEEE 754 number has three fields, from most significant bit
-     * to to least significant, sign, exponent, and significand.
-     *
-     *  msb                                lsb
-     * [sign|exponent|  fractional_significand]
-     *
-     * Using some encoding cleverness, explained below, the high order
-     * bit of the logical significand does not need to be explicitly
-     * stored, thus "fractional_significand" instead of simply
-     * "significand" in the figure above.
-     *
-     * For finite normal numbers, the numerical value encoded is
-     *
-     * (-1)^sign * 2^(exponent)*(1.fractional_significand)
-     *
-     * Most finite floating-point numbers are normalized; the exponent
-     * value is reduced until the leading significand bit is 1.
-     * Therefore, the leading 1 is redundant and is not explicitly
-     * stored.  If a numerical value is so small it cannot be
-     * normalized, it has a subnormal representation. Subnormal
-     * numbers don't have a leading 1 in their significand; subnormals
-     * are encoding using a special exponent value.  In other words,
-     * the high-order bit of the logical significand can be elided in
-     * from the representation in either case since the bit's value is
-     * implicit from the exponent value.
-     *
-     * The exponent field uses a biased representation; if the bits of
-     * the exponent are interpreted as a unsigned integer E, the
-     * exponent represented is E - E_bias where E_bias depends on the
-     * floating-point format.  E can range between E_min and E_max,
-     * constants which depend on the floating-point format.  E_min and
-     * E_max are -126 and +127 for float, -1022 and +1023 for double.
-     *
-     * The 32-bit float format has 1 sign bit, 8 exponent bits, and 23
-     * bits for the significand (which is logically 24 bits wide
-     * because of the implicit bit).  The 64-bit double format has 1
-     * sign bit, 11 exponent bits, and 52 bits for the significand
-     * (logically 53 bits).
-     *
-     * Subnormal numbers and zero have the special exponent value
-     * E_min -1; the numerical value represented by a subnormal is:
-     *
-     * (-1)^sign * 2^(E_min)*(0.fractional_significand)
-     *
-     * Zero is represented by all zero bits in the exponent and all
-     * zero bits in the significand; zero can have either sign.
-     *
-     * Infinity and NaN are encoded using the exponent value E_max +
-     * 1.  Signed infinities have all significand bits zero; NaNs have
-     * at least one non-zero significand bit.
-     *
-     * The details of IEEE 754 floating-point encoding will be used in
-     * the methods below without further comment.  For further
-     * exposition on IEEE 754 numbers, see "IEEE Standard for Binary
-     * Floating-Point Arithmetic" ANSI/IEEE Std 754-1985 or William
-     * Kahan's "Lecture Notes on the Status of IEEE Standard 754 for
-     * Binary Floating-Point Arithmetic",
-     * http://www.cs.berkeley.edu/~wkahan/ieee754status/ieee754.ps.
-     *
-     * Many of this class's methods are members of the set of IEEE 754
-     * recommended functions or similar functions recommended or
-     * required by IEEE 754R.  Discussion of various implementation
-     * techniques for these functions have occurred in:
-     *
-     * W.J. Cody and Jerome T. Coonen, "Algorithm 772 Functions to
-     * Support the IEEE Standard for Binary Floating-Point
-     * Arithmetic," ACM Transactions on Mathematical Software,
-     * vol. 19, no. 4, December 1993, pp. 443-451.
-     *
-     * Joseph D. Darcy, "Writing robust IEEE recommended functions in
-     * ``100% Pure Java''(TM)," University of California, Berkeley
-     * technical report UCB//CSD-98-1009.
-     */
-
-    /**
-     * Don't let anyone instantiate this class.
-     */
-    private FpUtils() {}
-
-    // Helper Methods
-
-    // The following helper methods are used in the implementation of
-    // the public recommended functions; they generally omit certain
-    // tests for exception cases.
-
-    /**
-     * Returns unbiased exponent of a {@code double}.
-     * @deprecated Use Math.getExponent.
-     */
-    @Deprecated
-    public static int getExponent(double d){
-        return Math.getExponent(d);
-    }
-
-    /**
-     * Returns unbiased exponent of a {@code float}.
-     * @deprecated Use Math.getExponent.
-     */
-    @Deprecated
-    public static int getExponent(float f){
-        return Math.getExponent(f);
-    }
-
-
-    /**
-     * Returns the first floating-point argument with the sign of the
-     * second floating-point argument.  Note that unlike the {@link
-     * FpUtils#copySign(double, double) copySign} method, this method
-     * does not require NaN {@code sign} arguments to be treated
-     * as positive values; implementations are permitted to treat some
-     * NaN arguments as positive and other NaN arguments as negative
-     * to allow greater performance.
-     *
-     * @param magnitude  the parameter providing the magnitude of the result
-     * @param sign   the parameter providing the sign of the result
-     * @return a value with the magnitude of {@code magnitude}
-     * and the sign of {@code sign}.
-     * @author Joseph D. Darcy
-     * @deprecated Use Math.copySign.
-     */
-    @Deprecated
-    public static double rawCopySign(double magnitude, double sign) {
-        return Math.copySign(magnitude, sign);
-    }
-
-    /**
-     * Returns the first floating-point argument with the sign of the
-     * second floating-point argument.  Note that unlike the {@link
-     * FpUtils#copySign(float, float) copySign} method, this method
-     * does not require NaN {@code sign} arguments to be treated
-     * as positive values; implementations are permitted to treat some
-     * NaN arguments as positive and other NaN arguments as negative
-     * to allow greater performance.
-     *
-     * @param magnitude  the parameter providing the magnitude of the result
-     * @param sign   the parameter providing the sign of the result
-     * @return a value with the magnitude of {@code magnitude}
-     * and the sign of {@code sign}.
-     * @author Joseph D. Darcy
-     * @deprecated Use Math.copySign.
-     */
-    @Deprecated
-    public static float rawCopySign(float magnitude, float sign) {
-        return Math.copySign(magnitude, sign);
-    }
-
-    /* ***************************************************************** */
-
-    /**
-     * Returns {@code true} if the argument is a finite
-     * floating-point value; returns {@code false} otherwise (for
-     * NaN and infinity arguments).
-     *
-     * @param d the {@code double} value to be tested
-     * @return {@code true} if the argument is a finite
-     * floating-point value, {@code false} otherwise.
-     * @deprecated Use Double.isFinite.
-     */
-    @Deprecated
-    public static boolean isFinite(double d) {
-        return Double.isFinite(d);
-    }
-
-    /**
-     * Returns {@code true} if the argument is a finite
-     * floating-point value; returns {@code false} otherwise (for
-     * NaN and infinity arguments).
-     *
-     * @param f the {@code float} value to be tested
-     * @return {@code true} if the argument is a finite
-     * floating-point value, {@code false} otherwise.
-     * @deprecated Use Float.isFinite.
-     */
-     @Deprecated
-     public static boolean isFinite(float f) {
-         return Float.isFinite(f);
-    }
-
-    /**
-     * Returns {@code true} if the specified number is infinitely
-     * large in magnitude, {@code false} otherwise.
-     *
-     * <p>Note that this method is equivalent to the {@link
-     * Double#isInfinite(double) Double.isInfinite} method; the
-     * functionality is included in this class for convenience.
-     *
-     * @param   d   the value to be tested.
-     * @return  {@code true} if the value of the argument is positive
-     *          infinity or negative infinity; {@code false} otherwise.
-     */
-    public static boolean isInfinite(double d) {
-        return Double.isInfinite(d);
-    }
-
-    /**
-     * Returns {@code true} if the specified number is infinitely
-     * large in magnitude, {@code false} otherwise.
-     *
-     * <p>Note that this method is equivalent to the {@link
-     * Float#isInfinite(float) Float.isInfinite} method; the
-     * functionality is included in this class for convenience.
-     *
-     * @param   f   the value to be tested.
-     * @return  {@code true} if the argument is positive infinity or
-     *          negative infinity; {@code false} otherwise.
-     */
-     public static boolean isInfinite(float f) {
-         return Float.isInfinite(f);
-    }
-
-    /**
-     * Returns {@code true} if the specified number is a
-     * Not-a-Number (NaN) value, {@code false} otherwise.
-     *
-     * <p>Note that this method is equivalent to the {@link
-     * Double#isNaN(double) Double.isNaN} method; the functionality is
-     * included in this class for convenience.
-     *
-     * @param   d   the value to be tested.
-     * @return  {@code true} if the value of the argument is NaN;
-     *          {@code false} otherwise.
-     */
-    public static boolean isNaN(double d) {
-        return Double.isNaN(d);
-    }
-
-    /**
-     * Returns {@code true} if the specified number is a
-     * Not-a-Number (NaN) value, {@code false} otherwise.
-     *
-     * <p>Note that this method is equivalent to the {@link
-     * Float#isNaN(float) Float.isNaN} method; the functionality is
-     * included in this class for convenience.
-     *
-     * @param   f   the value to be tested.
-     * @return  {@code true} if the argument is NaN;
-     *          {@code false} otherwise.
-     */
-     public static boolean isNaN(float f) {
-        return Float.isNaN(f);
-    }
-
-    /**
-     * Returns {@code true} if the unordered relation holds
-     * between the two arguments.  When two floating-point values are
-     * unordered, one value is neither less than, equal to, nor
-     * greater than the other.  For the unordered relation to be true,
-     * at least one argument must be a {@code NaN}.
-     *
-     * @param arg1      the first argument
-     * @param arg2      the second argument
-     * @return {@code true} if at least one argument is a NaN,
-     * {@code false} otherwise.
-     */
-    public static boolean isUnordered(double arg1, double arg2) {
-        return isNaN(arg1) || isNaN(arg2);
-    }
-
-    /**
-     * Returns {@code true} if the unordered relation holds
-     * between the two arguments.  When two floating-point values are
-     * unordered, one value is neither less than, equal to, nor
-     * greater than the other.  For the unordered relation to be true,
-     * at least one argument must be a {@code NaN}.
-     *
-     * @param arg1      the first argument
-     * @param arg2      the second argument
-     * @return {@code true} if at least one argument is a NaN,
-     * {@code false} otherwise.
-     */
-     public static boolean isUnordered(float arg1, float arg2) {
-        return isNaN(arg1) || isNaN(arg2);
-    }
-
-    /**
-     * Returns unbiased exponent of a {@code double}; for
-     * subnormal values, the number is treated as if it were
-     * normalized.  That is for all finite, non-zero, positive numbers
-     * <i>x</i>, <code>scalb(<i>x</i>, -ilogb(<i>x</i>))</code> is
-     * always in the range [1, 2).
-     * <p>
-     * Special cases:
-     * <ul>
-     * <li> If the argument is NaN, then the result is 2<sup>30</sup>.
-     * <li> If the argument is infinite, then the result is 2<sup>28</sup>.
-     * <li> If the argument is zero, then the result is -(2<sup>28</sup>).
-     * </ul>
-     *
-     * @param d floating-point number whose exponent is to be extracted
-     * @return unbiased exponent of the argument.
-     * @author Joseph D. Darcy
-     */
-    public static int ilogb(double d) {
-        int exponent = getExponent(d);
-
-        switch (exponent) {
-        case DoubleConsts.MAX_EXPONENT+1:       // NaN or infinity
-            if( isNaN(d) )
-                return (1<<30);         // 2^30
-            else // infinite value
-                return (1<<28);         // 2^28
-
-        case DoubleConsts.MIN_EXPONENT-1:       // zero or subnormal
-            if(d == 0.0) {
-                return -(1<<28);        // -(2^28)
-            }
-            else {
-                long transducer = Double.doubleToRawLongBits(d);
-
-                /*
-                 * To avoid causing slow arithmetic on subnormals,
-                 * the scaling to determine when d's significand
-                 * is normalized is done in integer arithmetic.
-                 * (there must be at least one "1" bit in the
-                 * significand since zero has been screened out.
-                 */
-
-                // isolate significand bits
-                transducer &= DoubleConsts.SIGNIF_BIT_MASK;
-                assert(transducer != 0L);
-
-                // This loop is simple and functional. We might be
-                // able to do something more clever that was faster;
-                // e.g. number of leading zero detection on
-                // (transducer << (# exponent and sign bits).
-                while (transducer <
-                       (1L << (DoubleConsts.SIGNIFICAND_WIDTH - 1))) {
-                    transducer *= 2;
-                    exponent--;
-                }
-                exponent++;
-                assert( exponent >=
-                        DoubleConsts.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1) &&
-                        exponent < DoubleConsts.MIN_EXPONENT);
-                return exponent;
-            }
-
-        default:
-            assert( exponent >= DoubleConsts.MIN_EXPONENT &&
-                    exponent <= DoubleConsts.MAX_EXPONENT);
-            return exponent;
-        }
-    }
-
-    /**
-     * Returns unbiased exponent of a {@code float}; for
-     * subnormal values, the number is treated as if it were
-     * normalized.  That is for all finite, non-zero, positive numbers
-     * <i>x</i>, <code>scalb(<i>x</i>, -ilogb(<i>x</i>))</code> is
-     * always in the range [1, 2).
-     * <p>
-     * Special cases:
-     * <ul>
-     * <li> If the argument is NaN, then the result is 2<sup>30</sup>.
-     * <li> If the argument is infinite, then the result is 2<sup>28</sup>.
-     * <li> If the argument is zero, then the result is -(2<sup>28</sup>).
-     * </ul>
-     *
-     * @param f floating-point number whose exponent is to be extracted
-     * @return unbiased exponent of the argument.
-     * @author Joseph D. Darcy
-     */
-     public static int ilogb(float f) {
-        int exponent = getExponent(f);
-
-        switch (exponent) {
-        case FloatConsts.MAX_EXPONENT+1:        // NaN or infinity
-            if( isNaN(f) )
-                return (1<<30);         // 2^30
-            else // infinite value
-                return (1<<28);         // 2^28
-
-        case FloatConsts.MIN_EXPONENT-1:        // zero or subnormal
-            if(f == 0.0f) {
-                return -(1<<28);        // -(2^28)
-            }
-            else {
-                int transducer = Float.floatToRawIntBits(f);
-
-                /*
-                 * To avoid causing slow arithmetic on subnormals,
-                 * the scaling to determine when f's significand
-                 * is normalized is done in integer arithmetic.
-                 * (there must be at least one "1" bit in the
-                 * significand since zero has been screened out.
-                 */
-
-                // isolate significand bits
-                transducer &= FloatConsts.SIGNIF_BIT_MASK;
-                assert(transducer != 0);
-
-                // This loop is simple and functional. We might be
-                // able to do something more clever that was faster;
-                // e.g. number of leading zero detection on
-                // (transducer << (# exponent and sign bits).
-                while (transducer <
-                       (1 << (FloatConsts.SIGNIFICAND_WIDTH - 1))) {
-                    transducer *= 2;
-                    exponent--;
-                }
-                exponent++;
-                assert( exponent >=
-                        FloatConsts.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1) &&
-                        exponent < FloatConsts.MIN_EXPONENT);
-                return exponent;
-            }
-
-        default:
-            assert( exponent >= FloatConsts.MIN_EXPONENT &&
-                    exponent <= FloatConsts.MAX_EXPONENT);
-            return exponent;
-        }
-    }
-
-
-    /*
-     * The scalb operation should be reasonably fast; however, there
-     * are tradeoffs in writing a method to minimize the worst case
-     * performance and writing a method to minimize the time for
-     * expected common inputs.  Some processors operate very slowly on
-     * subnormal operands, taking hundreds or thousands of cycles for
-     * one floating-point add or multiply as opposed to, say, four
-     * cycles for normal operands.  For processors with very slow
-     * subnormal execution, scalb would be fastest if written entirely
-     * with integer operations; in other words, scalb would need to
-     * include the logic of performing correct rounding of subnormal
-     * values.  This could be reasonably done in at most a few hundred
-     * cycles.  However, this approach may penalize normal operations
-     * since at least the exponent of the floating-point argument must
-     * be examined.
-     *
-     * The approach taken in this implementation is a compromise.
-     * Floating-point multiplication is used to do most of the work;
-     * but knowingly multiplying by a subnormal scaling factor is
-     * avoided.  However, the floating-point argument is not examined
-     * to see whether or not it is subnormal since subnormal inputs
-     * are assumed to be rare.  At most three multiplies are needed to
-     * scale from the largest to smallest exponent ranges (scaling
-     * down, at most two multiplies are needed if subnormal scaling
-     * factors are allowed).  However, in this implementation an
-     * expensive integer remainder operation is avoided at the cost of
-     * requiring five floating-point multiplies in the worst case,
-     * which should still be a performance win.
-     *
-     * If scaling of entire arrays is a concern, it would probably be
-     * more efficient to provide a double[] scalb(double[], int)
-     * version of scalb to avoid having to recompute the needed
-     * scaling factors for each floating-point value.
-     */
-
-    /**
-     * Return {@code d} &times;
-     * 2<sup>{@code scale_factor}</sup> rounded as if performed
-     * by a single correctly rounded floating-point multiply to a
-     * member of the double value set.  See section 4.2.3 of
-     * <cite>The Java&trade; Language Specification</cite>
-     * for a discussion of floating-point
-     * value sets.  If the exponent of the result is between the
-     * {@code double}'s minimum exponent and maximum exponent,
-     * the answer is calculated exactly.  If the exponent of the
-     * result would be larger than {@code doubles}'s maximum
-     * exponent, an infinity is returned.  Note that if the result is
-     * subnormal, precision may be lost; that is, when {@code scalb(x,
-     * n)} is subnormal, {@code scalb(scalb(x, n), -n)} may
-     * not equal <i>x</i>.  When the result is non-NaN, the result has
-     * the same sign as {@code d}.
-     *
-     *<p>
-     * Special cases:
-     * <ul>
-     * <li> If the first argument is NaN, NaN is returned.
-     * <li> If the first argument is infinite, then an infinity of the
-     * same sign is returned.
-     * <li> If the first argument is zero, then a zero of the same
-     * sign is returned.
-     * </ul>
-     *
-     * @param d number to be scaled by a power of two.
-     * @param scale_factor power of 2 used to scale {@code d}
-     * @return {@code d * }2<sup>{@code scale_factor}</sup>
-     * @author Joseph D. Darcy
-     * @deprecated Use Math.scalb.
-     */
-    @Deprecated
-    public static double scalb(double d, int scale_factor) {
-        return Math.scalb(d, scale_factor);
-    }
-
-    /**
-     * Return {@code f} &times;
-     * 2<sup>{@code scale_factor}</sup> rounded as if performed
-     * by a single correctly rounded floating-point multiply to a
-     * member of the float value set.  See section 4.2.3 of
-     * <cite>The Java&trade; Language Specification</cite>
-     * for a discussion of floating-point
-     * value sets. If the exponent of the result is between the
-     * {@code float}'s minimum exponent and maximum exponent, the
-     * answer is calculated exactly.  If the exponent of the result
-     * would be larger than {@code float}'s maximum exponent, an
-     * infinity is returned.  Note that if the result is subnormal,
-     * precision may be lost; that is, when {@code scalb(x, n)}
-     * is subnormal, {@code scalb(scalb(x, n), -n)} may not equal
-     * <i>x</i>.  When the result is non-NaN, the result has the same
-     * sign as {@code f}.
-     *
-     *<p>
-     * Special cases:
-     * <ul>
-     * <li> If the first argument is NaN, NaN is returned.
-     * <li> If the first argument is infinite, then an infinity of the
-     * same sign is returned.
-     * <li> If the first argument is zero, then a zero of the same
-     * sign is returned.
-     * </ul>
-     *
-     * @param f number to be scaled by a power of two.
-     * @param scale_factor power of 2 used to scale {@code f}
-     * @return {@code f * }2<sup>{@code scale_factor}</sup>
-     * @author Joseph D. Darcy
-     * @deprecated Use Math.scalb.
-     */
-    @Deprecated
-    public static float scalb(float f, int scale_factor) {
-        return Math.scalb(f, scale_factor);
-    }
-
-    /**
-     * Returns the floating-point number adjacent to the first
-     * argument in the direction of the second argument.  If both
-     * arguments compare as equal the second argument is returned.
-     *
-     * <p>
-     * Special cases:
-     * <ul>
-     * <li> If either argument is a NaN, then NaN is returned.
-     *
-     * <li> If both arguments are signed zeros, {@code direction}
-     * is returned unchanged (as implied by the requirement of
-     * returning the second argument if the arguments compare as
-     * equal).
-     *
-     * <li> If {@code start} is
-     * &plusmn;{@code Double.MIN_VALUE} and {@code direction}
-     * has a value such that the result should have a smaller
-     * magnitude, then a zero with the same sign as {@code start}
-     * is returned.
-     *
-     * <li> If {@code start} is infinite and
-     * {@code direction} has a value such that the result should
-     * have a smaller magnitude, {@code Double.MAX_VALUE} with the
-     * same sign as {@code start} is returned.
-     *
-     * <li> If {@code start} is equal to &plusmn;
-     * {@code Double.MAX_VALUE} and {@code direction} has a
-     * value such that the result should have a larger magnitude, an
-     * infinity with same sign as {@code start} is returned.
-     * </ul>
-     *
-     * @param start     starting floating-point value
-     * @param direction value indicating which of
-     * {@code start}'s neighbors or {@code start} should
-     * be returned
-     * @return The floating-point number adjacent to {@code start} in the
-     * direction of {@code direction}.
-     * @author Joseph D. Darcy
-     * @deprecated Use Math.nextAfter
-     */
-    @Deprecated
-    public static double nextAfter(double start, double direction) {
-        return Math.nextAfter(start, direction);
-    }
-
-    /**
-     * Returns the floating-point number adjacent to the first
-     * argument in the direction of the second argument.  If both
-     * arguments compare as equal, the second argument is returned.
-     *
-     * <p>
-     * Special cases:
-     * <ul>
-     * <li> If either argument is a NaN, then NaN is returned.
-     *
-     * <li> If both arguments are signed zeros, a {@code float}
-     * zero with the same sign as {@code direction} is returned
-     * (as implied by the requirement of returning the second argument
-     * if the arguments compare as equal).
-     *
-     * <li> If {@code start} is
-     * &plusmn;{@code Float.MIN_VALUE} and {@code direction}
-     * has a value such that the result should have a smaller
-     * magnitude, then a zero with the same sign as {@code start}
-     * is returned.
-     *
-     * <li> If {@code start} is infinite and
-     * {@code direction} has a value such that the result should
-     * have a smaller magnitude, {@code Float.MAX_VALUE} with the
-     * same sign as {@code start} is returned.
-     *
-     * <li> If {@code start} is equal to &plusmn;
-     * {@code Float.MAX_VALUE} and {@code direction} has a
-     * value such that the result should have a larger magnitude, an
-     * infinity with same sign as {@code start} is returned.
-     * </ul>
-     *
-     * @param start     starting floating-point value
-     * @param direction value indicating which of
-     * {@code start}'s neighbors or {@code start} should
-     * be returned
-     * @return The floating-point number adjacent to {@code start} in the
-     * direction of {@code direction}.
-     * @author Joseph D. Darcy
-     * @deprecated Use Math.nextAfter.
-     */
-    @Deprecated
-    public static float nextAfter(float start, double direction) {
-        return Math.nextAfter(start, direction);
-    }
-
-    /**
-     * Returns the floating-point value adjacent to {@code d} in
-     * the direction of positive infinity.  This method is
-     * semantically equivalent to {@code nextAfter(d,
-     * Double.POSITIVE_INFINITY)}; however, a {@code nextUp}
-     * implementation may run faster than its equivalent
-     * {@code nextAfter} call.
-     *
-     * <p>Special Cases:
-     * <ul>
-     * <li> If the argument is NaN, the result is NaN.
-     *
-     * <li> If the argument is positive infinity, the result is
-     * positive infinity.
-     *
-     * <li> If the argument is zero, the result is
-     * {@code Double.MIN_VALUE}
-     *
-     * </ul>
-     *
-     * @param d  starting floating-point value
-     * @return The adjacent floating-point value closer to positive
-     * infinity.
-     * @author Joseph D. Darcy
-     * @deprecated use Math.nextUp.
-     */
-    @Deprecated
-    public static double nextUp(double d) {
-        return Math.nextUp(d);
-    }
-
-    /**
-     * Returns the floating-point value adjacent to {@code f} in
-     * the direction of positive infinity.  This method is
-     * semantically equivalent to {@code nextAfter(f,
-     * Double.POSITIVE_INFINITY)}; however, a {@code nextUp}
-     * implementation may run faster than its equivalent
-     * {@code nextAfter} call.
-     *
-     * <p>Special Cases:
-     * <ul>
-     * <li> If the argument is NaN, the result is NaN.
-     *
-     * <li> If the argument is positive infinity, the result is
-     * positive infinity.
-     *
-     * <li> If the argument is zero, the result is
-     * {@code Float.MIN_VALUE}
-     *
-     * </ul>
-     *
-     * @param f  starting floating-point value
-     * @return The adjacent floating-point value closer to positive
-     * infinity.
-     * @author Joseph D. Darcy
-     * @deprecated Use Math.nextUp.
-     */
-    @Deprecated
-    public static float nextUp(float f) {
-        return Math.nextUp(f);
-    }
-
-    /**
-     * Returns the floating-point value adjacent to {@code d} in
-     * the direction of negative infinity.  This method is
-     * semantically equivalent to {@code nextAfter(d,
-     * Double.NEGATIVE_INFINITY)}; however, a
-     * {@code nextDown} implementation may run faster than its
-     * equivalent {@code nextAfter} call.
-     *
-     * <p>Special Cases:
-     * <ul>
-     * <li> If the argument is NaN, the result is NaN.
-     *
-     * <li> If the argument is negative infinity, the result is
-     * negative infinity.
-     *
-     * <li> If the argument is zero, the result is
-     * {@code -Double.MIN_VALUE}
-     *
-     * </ul>
-     *
-     * @param d  starting floating-point value
-     * @return The adjacent floating-point value closer to negative
-     * infinity.
-     * @author Joseph D. Darcy
-     * @deprecated Use Math.nextDown.
-     */
-    @Deprecated
-    public static double nextDown(double d) {
-        return Math.nextDown(d);
-    }
-
-    /**
-     * Returns the floating-point value adjacent to {@code f} in
-     * the direction of negative infinity.  This method is
-     * semantically equivalent to {@code nextAfter(f,
-     * Float.NEGATIVE_INFINITY)}; however, a
-     * {@code nextDown} implementation may run faster than its
-     * equivalent {@code nextAfter} call.
-     *
-     * <p>Special Cases:
-     * <ul>
-     * <li> If the argument is NaN, the result is NaN.
-     *
-     * <li> If the argument is negative infinity, the result is
-     * negative infinity.
-     *
-     * <li> If the argument is zero, the result is
-     * {@code -Float.MIN_VALUE}
-     *
-     * </ul>
-     *
-     * @param f  starting floating-point value
-     * @return The adjacent floating-point value closer to negative
-     * infinity.
-     * @author Joseph D. Darcy
-     * @deprecated Use Math.nextDown.
-     */
-    @Deprecated
-    public static double nextDown(float f) {
-        return Math.nextDown(f);
-    }
-
-    /**
-     * Returns the first floating-point argument with the sign of the
-     * second floating-point argument.  For this method, a NaN
-     * {@code sign} argument is always treated as if it were
-     * positive.
-     *
-     * @param magnitude  the parameter providing the magnitude of the result
-     * @param sign   the parameter providing the sign of the result
-     * @return a value with the magnitude of {@code magnitude}
-     * and the sign of {@code sign}.
-     * @author Joseph D. Darcy
-     * @since 1.5
-     * @deprecated Use StrictMath.copySign.
-     */
-    @Deprecated
-    public static double copySign(double magnitude, double sign) {
-        return StrictMath.copySign(magnitude, sign);
-    }
-
-    /**
-     * Returns the first floating-point argument with the sign of the
-     * second floating-point argument.  For this method, a NaN
-     * {@code sign} argument is always treated as if it were
-     * positive.
-     *
-     * @param magnitude  the parameter providing the magnitude of the result
-     * @param sign   the parameter providing the sign of the result
-     * @return a value with the magnitude of {@code magnitude}
-     * and the sign of {@code sign}.
-     * @author Joseph D. Darcy
-     * @deprecated Use StrictMath.copySign.
-     */
-    @Deprecated
-    public static float copySign(float magnitude, float sign) {
-        return StrictMath.copySign(magnitude, sign);
-    }
-
-    /**
-     * Returns the size of an ulp of the argument.  An ulp of a
-     * {@code double} value is the positive distance between this
-     * floating-point value and the {@code double} value next
-     * larger in magnitude.  Note that for non-NaN <i>x</i>,
-     * <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
-     *
-     * <p>Special Cases:
-     * <ul>
-     * <li> If the argument is NaN, then the result is NaN.
-     * <li> If the argument is positive or negative infinity, then the
-     * result is positive infinity.
-     * <li> If the argument is positive or negative zero, then the result is
-     * {@code Double.MIN_VALUE}.
-     * <li> If the argument is &plusmn;{@code Double.MAX_VALUE}, then
-     * the result is equal to 2<sup>971</sup>.
-     * </ul>
-     *
-     * @param d the floating-point value whose ulp is to be returned
-     * @return the size of an ulp of the argument
-     * @author Joseph D. Darcy
-     * @since 1.5
-     * @deprecated Use Math.ulp.
-     */
-    @Deprecated
-    public static double ulp(double d) {
-        return Math.ulp(d);
-    }
-
-    /**
-     * Returns the size of an ulp of the argument.  An ulp of a
-     * {@code float} value is the positive distance between this
-     * floating-point value and the {@code float} value next
-     * larger in magnitude.  Note that for non-NaN <i>x</i>,
-     * <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
-     *
-     * <p>Special Cases:
-     * <ul>
-     * <li> If the argument is NaN, then the result is NaN.
-     * <li> If the argument is positive or negative infinity, then the
-     * result is positive infinity.
-     * <li> If the argument is positive or negative zero, then the result is
-     * {@code Float.MIN_VALUE}.
-     * <li> If the argument is &plusmn;{@code Float.MAX_VALUE}, then
-     * the result is equal to 2<sup>104</sup>.
-     * </ul>
-     *
-     * @param f the floating-point value whose ulp is to be returned
-     * @return the size of an ulp of the argument
-     * @author Joseph D. Darcy
-     * @since 1.5
-     * @deprecated Use Math.ulp.
-     */
-     @Deprecated
-     public static float ulp(float f) {
-        return Math.ulp(f);
-     }
-
-    /**
-     * Returns the signum function of the argument; zero if the argument
-     * is zero, 1.0 if the argument is greater than zero, -1.0 if the
-     * argument is less than zero.
-     *
-     * <p>Special Cases:
-     * <ul>
-     * <li> If the argument is NaN, then the result is NaN.
-     * <li> If the argument is positive zero or negative zero, then the
-     *      result is the same as the argument.
-     * </ul>
-     *
-     * @param d the floating-point value whose signum is to be returned
-     * @return the signum function of the argument
-     * @author Joseph D. Darcy
-     * @since 1.5
-     * @deprecated Use Math.signum.
-     */
-    @Deprecated
-    public static double signum(double d) {
-        return Math.signum(d);
-    }
-
-    /**
-     * Returns the signum function of the argument; zero if the argument
-     * is zero, 1.0f if the argument is greater than zero, -1.0f if the
-     * argument is less than zero.
-     *
-     * <p>Special Cases:
-     * <ul>
-     * <li> If the argument is NaN, then the result is NaN.
-     * <li> If the argument is positive zero or negative zero, then the
-     *      result is the same as the argument.
-     * </ul>
-     *
-     * @param f the floating-point value whose signum is to be returned
-     * @return the signum function of the argument
-     * @author Joseph D. Darcy
-     * @since 1.5
-     * @deprecated Use Math.signum.
-     */
-    @Deprecated
-    public static float signum(float f) {
-        return Math.signum(f);
-    }
-}
--- a/src/share/classes/sun/nio/ch/Reflect.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/nio/ch/Reflect.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -75,7 +75,7 @@
 
     static Method lookupMethod(String className,
                                String methodName,
-                               Class... paramTypes)
+                               Class<?>... paramTypes)
     {
         try {
             Class<?> cl = Class.forName(className);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/nio/cs/StandardCharsets.java.template	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2000, 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.
+ *
+ */
+
+// -- This file was mechanically generated: Do not edit! -- //
+
+package sun.nio.cs;
+
+import java.nio.charset.*;
+
+
+public class StandardCharsets
+    extends FastCharsetProvider
+{
+
+    _INCLUDE_ALIASES_TABLES_
+    _INCLUDE_ALIASES_MAP_
+    _INCLUDE_CLASSES_MAP_
+    _INCLUDE_CACHE_MAP_
+
+    public StandardCharsets() {
+        super("sun.nio.cs", new Aliases(), new Classes(), new Cache());
+    }
+
+}
--- a/src/share/classes/sun/nio/cs/standard-charsets	Fri Jan 31 18:49:58 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-#
-# Copyright (c) 2000, 2011, 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.
-#
-
-# Standard charsets provided by StandardCharsets provider.
-#
-# Note that these "standard" charsets listed here are not
-# necessary to be the "Standard charsets" defined in the
-# specification of java.nio.charset.Charset. Instead these
-# are the charsets that this implementation believes should
-# be packaged into the charsets provider class "StandardCharsets"
-# which is initialized at startup time by java.nio.charset.Charset,
-# compared to the charsets packaged in "ExtendedCharsets" provider,
-# which is lazy initialized.
-
-# This year should only change if the generated source is modified.
-copyright 2000, 2007,
-package sun.nio.cs
-class StandardCharsets
-
-charset US-ASCII US_ASCII
-
-    # IANA aliases
-    alias iso-ir-6
-    alias ANSI_X3.4-1986
-    alias ISO_646.irv:1991
-    alias ASCII
-    alias ISO646-US
-    alias us
-    alias IBM367
-    alias cp367
-    alias csASCII
-    alias default
-
-    # Other aliases
-    alias 646				# Solaris POSIX locale
-    alias iso_646.irv:1983
-    alias ANSI_X3.4-1968		# Linux POSIX locale (RedHat)
-    alias ascii7
-
-charset UTF-8 UTF_8
-    alias UTF8				# JDK historical
-    alias unicode-1-1-utf-8
-
-charset CESU-8 CESU_8
-    alias CESU8
-    alias csCESU-8
-
-charset UTF-16 UTF_16
-    alias UTF_16			# JDK historical
-    alias utf16
-    alias unicode
-    alias UnicodeBig
-
-charset UTF-16BE UTF_16BE
-    alias UTF_16BE
-    alias ISO-10646-UCS-2
-    alias X-UTF-16BE
-    alias UnicodeBigUnmarked
-
-charset UTF-16LE UTF_16LE
-    alias UTF_16LE
-    alias X-UTF-16LE
-    alias UnicodeLittleUnmarked
-
-charset x-UTF-16LE-BOM UTF_16LE_BOM
-    alias UnicodeLittle
-
-charset UTF-32 UTF_32
-    alias UTF_32
-    alias UTF32
-
-charset UTF-32LE UTF_32LE
-    alias UTF_32LE
-    alias X-UTF-32LE
-
-charset UTF-32BE UTF_32BE
-    alias UTF_32BE
-    alias X-UTF-32BE
-
-charset X-UTF-32LE-BOM UTF_32LE_BOM
-    alias UTF_32LE_BOM
-    alias UTF-32LE-BOM
-
-charset X-UTF-32BE-BOM UTF_32BE_BOM
-    alias UTF_32BE_BOM
-    alias UTF-32BE-BOM
-
-charset ISO-8859-1 ISO_8859_1
-
-    # IANA aliases
-    alias iso-ir-100
-    alias ISO_8859-1
-    alias latin1
-    alias l1
-    alias IBM819
-    alias cp819
-    alias csISOLatin1
-
-    # Other aliases
-    alias 819
-    alias IBM-819
-    alias ISO8859_1
-    alias ISO_8859-1:1987
-    alias ISO_8859_1
-    alias 8859_1
-    alias ISO8859-1
-
-charset ISO-8859-2 ISO_8859_2
-    alias iso8859_2			# JDK historical
-    alias 8859_2
-    alias iso-ir-101
-    alias ISO_8859-2
-    alias ISO_8859-2:1987
-    alias ISO8859-2
-    alias latin2
-    alias l2
-    alias ibm912
-    alias ibm-912
-    alias cp912
-    alias 912
-    alias csISOLatin2
-
-charset ISO-8859-4 ISO_8859_4
-    alias iso8859_4			# JDK historical
-    alias iso8859-4
-    alias 8859_4
-    alias iso-ir-110
-    alias ISO_8859-4
-    alias ISO_8859-4:1988
-    alias latin4
-    alias l4
-    alias ibm914
-    alias ibm-914
-    alias cp914
-    alias 914
-    alias csISOLatin4
-
-charset ISO-8859-5 ISO_8859_5
-    alias iso8859_5			# JDK historical
-    alias 8859_5
-    alias iso-ir-144
-    alias ISO_8859-5
-    alias ISO_8859-5:1988
-    alias ISO8859-5
-    alias cyrillic
-    alias ibm915
-    alias ibm-915
-    alias cp915
-    alias 915
-    alias csISOLatinCyrillic
-
-charset ISO-8859-7 ISO_8859_7
-    alias iso8859_7			# JDK historical
-    alias 8859_7
-    alias iso-ir-126
-    alias ISO_8859-7
-    alias ISO_8859-7:1987
-    alias ELOT_928
-    alias ECMA-118
-    alias greek
-    alias greek8
-    alias csISOLatinGreek
-    alias sun_eu_greek			# Solaris 7/8 compatibility
-    alias ibm813
-    alias ibm-813
-    alias 813
-    alias cp813
-    alias iso8859-7			# Solaris 9 compatibility
-
-charset ISO-8859-9 ISO_8859_9
-    alias iso8859_9			# JDK historical
-    alias 8859_9
-    alias iso-ir-148
-    alias ISO_8859-9
-    alias ISO_8859-9:1989
-    alias ISO8859-9
-    alias latin5
-    alias l5
-    alias ibm920
-    alias ibm-920
-    alias 920
-    alias cp920
-    alias csISOLatin5
-
-charset ISO-8859-13 ISO_8859_13
-    alias iso8859_13			# JDK historical
-    alias 8859_13
-    alias iso_8859-13
-    alias ISO8859-13
-
-charset ISO-8859-15 ISO_8859_15
-
-    # IANA alias
-    alias ISO_8859-15
-
-    # Other aliases
-    alias 8859_15
-    alias ISO-8859-15
-    alias ISO8859_15
-    alias ISO8859-15
-    alias IBM923
-    alias IBM-923
-    alias cp923
-    alias 923
-    alias LATIN0
-    alias LATIN9
-    alias L9
-    alias csISOlatin0
-    alias csISOlatin9
-    alias ISO8859_15_FDIS
-
-charset KOI8-R KOI8_R
-    alias koi8_r			# JDK historical
-    alias koi8
-    alias cskoi8r
-
-charset KOI8-U KOI8_U
-    alias koi8_u
-
-charset windows-1250 MS1250
-    alias cp1250			# JDK historical
-    alias cp5346			# Euro IBM CCSID
-
-charset windows-1251 MS1251
-    alias cp1251			# JDK historical
-    alias cp5347			# Euro IBM CCSID
-    alias ansi-1251			# Solaris compatibility
-
-charset windows-1252 MS1252
-    alias cp1252			# JDK historical
-    alias cp5348			# Euro IBM CCSID
-
-charset windows-1253 MS1253
-    alias cp1253			# JDK historical
-    alias cp5349			# Euro IBM CCSID
-
-charset windows-1254 MS1254
-    alias cp1254			# JDK historical
-    alias cp5350			# Euro IBM CCSID
-
-charset windows-1257 MS1257
-    alias cp1257			# JDK historical
-    alias cp5353			# Euro IBM CCSID
-
-
-charset IBM437 IBM437
-    alias cp437                         #JDK historical
-    alias ibm437
-    alias ibm-437
-    alias 437
-    alias cspc8codepage437
-    alias windows-437
-
-charset x-IBM737 IBM737
-    alias cp737                         #JDK historical
-    alias ibm737
-    alias ibm-737
-    alias 737
-
-charset IBM775 IBM775
-    alias cp775                         #JDK historical
-    alias ibm775
-    alias ibm-775
-    alias 775
-
-charset IBM850 IBM850
-    alias cp850                         #JDK historical
-    alias ibm-850
-    alias ibm850
-    alias 850
-    alias cspc850multilingual
-
-charset IBM852 IBM852
-    alias cp852                         #JDK historical
-    alias ibm852
-    alias ibm-852
-    alias 852
-    alias csPCp852
-
-charset IBM855 IBM855
-    alias cp855                         #JDK historical
-    alias ibm-855
-    alias ibm855
-    alias 855
-    alias cspcp855
-
-charset IBM857 IBM857
-    alias cp857                         #JDK historical
-    alias ibm857
-    alias ibm-857
-    alias 857
-    alias csIBM857
-
-charset IBM00858 IBM858
-    alias cp858                         #JDK historical
-    alias ccsid00858
-    alias cp00858
-    alias 858
-    alias PC-Multilingual-850+euro
-
-charset IBM862 IBM862
-    alias cp862                         #JDK historical
-    alias ibm862
-    alias ibm-862
-    alias 862
-    alias csIBM862
-    alias cspc862latinhebrew
-
-charset IBM866 IBM866
-    alias cp866                         #JDK historical
-    alias ibm866
-    alias ibm-866
-    alias 866
-    alias csIBM866
-
-charset x-IBM874 IBM874
-    alias cp874                         #JDK historical
-    alias ibm874
-    alias ibm-874
-    alias 874
--- a/src/share/classes/sun/rmi/server/Activation.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/rmi/server/Activation.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -299,7 +299,7 @@
 
         private static final String NAME = ActivationSystem.class.getName();
         private static final long serialVersionUID = 4877330021609408794L;
-        private final ActivationSystem systemStub;
+        private ActivationSystem systemStub = null;
 
         SystemRegistryImpl(int port,
                            RMIClientSocketFactory csf,
@@ -308,7 +308,39 @@
             throws RemoteException
         {
             super(port, csf, ssf);
-            this.systemStub = systemStub;
+            assert systemStub != null;
+            synchronized (this) {
+                this.systemStub = systemStub;
+                notifyAll();
+            }
+        }
+
+        /**
+         * Waits for systemStub to be initialized and returns its
+         * initialized value. Any remote call that uses systemStub must
+         * call this method to get it instead of using direct field
+         * access. This is necessary because the super() call in the
+         * constructor exports this object before systemStub is initialized
+         * (see JDK-8023541), allowing remote calls to come in during this
+         * time. We can't use checkShutdown() like other nested classes
+         * because this is a static class.
+         */
+        private synchronized ActivationSystem getSystemStub() {
+            boolean interrupted = false;
+
+            while (systemStub == null) {
+                try {
+                    wait();
+                } catch (InterruptedException ie) {
+                    interrupted = true;
+                }
+            }
+
+            if (interrupted) {
+                Thread.currentThread().interrupt();
+            }
+
+            return systemStub;
         }
 
         /**
@@ -321,7 +353,7 @@
             throws RemoteException, NotBoundException
         {
             if (name.equals(NAME)) {
-                return systemStub;
+                return getSystemStub();
             } else {
                 return super.lookup(name);
             }
--- a/src/share/classes/sun/swing/BakedArrayList.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/BakedArrayList.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 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
@@ -43,7 +43,8 @@
  *
  * @author Scott Violet
  */
-public class BakedArrayList extends ArrayList {
+@SuppressWarnings("serial") // JDK-implementation class
+public class BakedArrayList extends ArrayList<Object> {
     /**
      * The cached hashCode.
      */
@@ -53,7 +54,7 @@
         super(size);
     }
 
-    public BakedArrayList(java.util.List data) {
+    public BakedArrayList(java.util.List<?> data) {
         this(data.size());
         for (int counter = 0, max = data.size(); counter < max; counter++){
             add(data.get(counter));
--- a/src/share/classes/sun/swing/FilePane.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/FilePane.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, 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
@@ -58,6 +58,7 @@
  *
  * @author Leif Samuelsson
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public class FilePane extends JPanel implements PropertyChangeListener {
     // Constants for actions. These are used for the actions' ACTION_COMMAND_KEY
     // and as keys in the action maps for FilePane and the corresponding UI classes
@@ -239,7 +240,7 @@
             }
         }
 
-        private void repaintListSelection(JList list) {
+        private void repaintListSelection(JList<?> list) {
             int[] indices = list.getSelectedIndices();
             for (int i : indices) {
                 Rectangle bounds = list.getCellBounds(i, i);
@@ -271,7 +272,7 @@
     private boolean fullRowSelection = false;
 
     private ListSelectionModel listSelectionModel;
-    private JList list;
+    private JList<?> list;
     private JTable detailsTable;
 
     private static final int COLUMN_FILENAME = 0;
@@ -331,7 +332,7 @@
                     createdViewPanel = createList();
                 }
 
-                list = (JList) findChildComponent(createdViewPanel, JList.class);
+                list = findChildComponent(createdViewPanel, JList.class);
                 if (listSelectionModel == null) {
                     listSelectionModel = list.getSelectionModel();
                     if (detailsTable != null) {
@@ -352,7 +353,7 @@
                     createdViewPanel = createDetailsView();
                 }
 
-                detailsTable = (JTable) findChildComponent(createdViewPanel, JTable.class);
+                detailsTable = findChildComponent(createdViewPanel, JTable.class);
                 detailsTable.setRowHeight(Math.max(detailsTable.getFont().getSize() + 4, 16 + 1));
                 if (listSelectionModel != null) {
                     detailsTable.setSelectionModel(listSelectionModel);
@@ -391,6 +392,7 @@
         firePropertyChange("viewType", oldValue, viewType);
     }
 
+    @SuppressWarnings("serial") // JDK-implementation class
     class ViewTypeAction extends AbstractAction {
         private int viewType;
 
@@ -470,6 +472,7 @@
      */
     public Action[] getActions() {
         if (actions == null) {
+            @SuppressWarnings("serial") // JDK-implementation class
             class FilePaneAction extends AbstractAction {
                 FilePaneAction(String name) {
                     this(name, name);
@@ -566,7 +569,7 @@
     }
 
 
-    private void updateListRowCount(JList list) {
+    private void updateListRowCount(JList<?> list) {
         if (smallIconsView) {
             list.setVisibleRowCount(getModel().getSize() / 3);
         } else {
@@ -577,9 +580,11 @@
     public JPanel createList() {
         JPanel p = new JPanel(new BorderLayout());
         final JFileChooser fileChooser = getFileChooser();
+
+        @SuppressWarnings("serial") // anonymous class
         final JList<Object> list = new JList<Object>() {
             public int getNextMatch(String prefix, int startIndex, Position.Bias bias) {
-                ListModel model = getModel();
+                ListModel<?> model = getModel();
                 int max = model.getSize();
                 if (prefix == null || startIndex < 0 || startIndex >= max) {
                     throw new IllegalArgumentException();
@@ -651,6 +656,7 @@
     /**
      * This model allows for sorting JList
      */
+    @SuppressWarnings("serial") // JDK-implementation class
     private class SortableListModel extends AbstractListModel<Object>
             implements TableModelListener, RowSorterListener {
 
@@ -684,6 +690,7 @@
         return detailsTableModel;
     }
 
+    @SuppressWarnings("serial") // JDK-implementation class
     class DetailsTableModel extends AbstractTableModel implements ListDataListener {
         JFileChooser chooser;
         BasicDirectoryModel directoryModel;
@@ -911,7 +918,7 @@
 
         public void updateComparators(ShellFolderColumnInfo [] columns) {
             for (int i = 0; i < columns.length; i++) {
-                Comparator c = columns[i].getComparator();
+                Comparator<?> c = columns[i].getComparator();
                 if (c != null) {
                     c = new DirectoriesFirstComparatorWrapper(i, c);
                 }
@@ -962,12 +969,13 @@
      * directory and file to file using the wrapped comparator.
      */
     private class DirectoriesFirstComparatorWrapper implements Comparator<File> {
-        private Comparator comparator;
+        private Comparator<Object> comparator;
         private int column;
 
-        public DirectoriesFirstComparatorWrapper(int column, Comparator comparator) {
+        @SuppressWarnings("unchecked")
+        public DirectoriesFirstComparatorWrapper(int column, Comparator<?> comparator) {
             this.column = column;
-            this.comparator = comparator;
+            this.comparator = (Comparator<Object>)comparator;
         }
 
         public int compare(File f1, File f2) {
@@ -1003,6 +1011,7 @@
         return tableCellEditor;
     }
 
+    @SuppressWarnings("serial") // JDK-implementation class
     private class DetailsTableCellEditor extends DefaultCellEditor {
         private final JTextField tf;
 
@@ -1025,7 +1034,7 @@
         }
     }
 
-
+    @SuppressWarnings("serial") // JDK-implementation class
     class DetailsTableCellRenderer extends DefaultTableCellRenderer {
         JFileChooser chooser;
         DateFormat df;
@@ -1129,6 +1138,7 @@
 
         JPanel p = new JPanel(new BorderLayout());
 
+        @SuppressWarnings("serial") // anonymous class
         final JTable detailsTable = new JTable(getDetailsTableModel()) {
             // Handle Escape key events here
             protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
@@ -1447,6 +1457,7 @@
 
     protected Action newFolderAction;
 
+    @SuppressWarnings("serial") // anonymous class inside
     public Action getNewFolderAction() {
         if (!readOnly && newFolderAction == null) {
             newFolderAction = new AbstractAction(newFolderActionLabelText) {
@@ -1479,9 +1490,10 @@
         return newFolderAction;
     }
 
+    @SuppressWarnings("serial") // JDK-implementation class
     protected class FileRenderer extends DefaultListCellRenderer  {
 
-        public Component getListCellRendererComponent(JList list, Object value,
+        public Component getListCellRendererComponent(JList<?> list, Object value,
                                                       int index, boolean isSelected,
                                                       boolean cellHasFocus) {
 
@@ -1957,14 +1969,14 @@
         return fileChooserUIAccessor.getDirectory();
     }
 
-    private Component findChildComponent(Container container, Class cls) {
+    private <T> T findChildComponent(Container container, Class<T> cls) {
         int n = container.getComponentCount();
         for (int i = 0; i < n; i++) {
             Component comp = container.getComponent(i);
             if (cls.isInstance(comp)) {
-                return comp;
+                return cls.cast(comp);
             } else if (comp instanceof Container) {
-                Component c = findChildComponent((Container)comp, cls);
+                T c = findChildComponent((Container)comp, cls);
                 if (c != null) {
                     return c;
                 }
@@ -2018,7 +2030,7 @@
         public Action getApproveSelectionAction();
         public Action getChangeToParentDirectoryAction();
         public Action getNewFolderAction();
-        public MouseListener createDoubleClickListener(JList list);
+        public MouseListener createDoubleClickListener(JList<?> list);
         public ListSelectionListener createListSelectionListener();
     }
 }
--- a/src/share/classes/sun/swing/ImageIconUIResource.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/ImageIconUIResource.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
  * @author Shannon Hickey
  *
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public class ImageIconUIResource extends ImageIcon implements UIResource {
 
     /**
--- a/src/share/classes/sun/swing/JLightweightFrame.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/JLightweightFrame.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,6 +68,7 @@
  * @author Artem Ananiev
  * @author Anton Tarasov
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public final class JLightweightFrame extends LightweightFrame implements RootPaneContainer {
 
     private final JRootPane rootPane = new JRootPane();
@@ -245,6 +246,7 @@
         content.imageUpdated(x, y, width, height);
     }
 
+    @SuppressWarnings("serial") // anonymous class inside
     private void initInterior() {
         contentPane = new JPanel() {
             @Override
--- a/src/share/classes/sun/swing/PrintColorUIResource.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/PrintColorUIResource.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
  * @author Shannon Hickey
  *
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public class PrintColorUIResource extends ColorUIResource {
 
     /** The color to use during printing */
--- a/src/share/classes/sun/swing/PrintingStatus.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/PrintingStatus.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,7 @@
     private final AtomicBoolean isAborted = new AtomicBoolean(false);
 
     // the action that will abort printing
+    @SuppressWarnings("serial") // anonymous class
     private final Action abortAction = new AbstractAction() {
         public void actionPerformed(ActionEvent ae) {
             if (!isAborted.get()) {
--- a/src/share/classes/sun/swing/SwingLazyValue.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/SwingLazyValue.java	Tue Feb 04 16:24:39 2014 -0800
@@ -67,13 +67,13 @@
             ReflectUtil.checkPackageAccess(className);
             Class<?> c = Class.forName(className, true, null);
             if (methodName != null) {
-                Class[] types = getClassArray(args);
+                Class<?>[] types = getClassArray(args);
                 Method m = c.getMethod(methodName, types);
                 makeAccessible(m);
                 return m.invoke(c, args);
             } else {
-                Class[] types = getClassArray(args);
-                Constructor constructor = c.getConstructor(types);
+                Class<?>[] types = getClassArray(args);
+                Constructor<?> constructor = c.getConstructor(types);
                 makeAccessible(constructor);
                 return constructor.newInstance(args);
             }
@@ -96,10 +96,10 @@
         });
     }
 
-    private Class[] getClassArray(Object[] args) {
-        Class[] types = null;
+    private Class<?>[] getClassArray(Object[] args) {
+        Class<?>[] types = null;
         if (args!=null) {
-            types = new Class[args.length];
+            types = new Class<?>[args.length];
             for (int i = 0; i< args.length; i++) {
                 /* PENDING(ges): At present only the primitive types
                    used are handled correctly; this should eventually
--- a/src/share/classes/sun/swing/SwingUtilities2.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/SwingUtilities2.java	Tue Feb 04 16:24:39 2014 -0800
@@ -127,7 +127,7 @@
      */
     public static class AATextInfo {
 
-        private static AATextInfo getAATextInfoFromMap(Map hints) {
+        private static AATextInfo getAATextInfoFromMap(Map<java.awt.RenderingHints.Key, Object> hints) {
 
             Object aaHint   = hints.get(KEY_TEXT_ANTIALIASING);
             Object contHint = hints.get(KEY_TEXT_LCD_CONTRAST);
@@ -141,12 +141,13 @@
             }
         }
 
+        @SuppressWarnings("unchecked")
         public static AATextInfo getAATextInfo(boolean lafCondition) {
             SunToolkit.setAAFontSettingsCondition(lafCondition);
             Toolkit tk = Toolkit.getDefaultToolkit();
             Object map = tk.getDesktopProperty(SunToolkit.DESKTOPFONTHINTS);
             if (map instanceof Map) {
-                return getAATextInfoFromMap((Map)map);
+                return getAATextInfoFromMap((Map<java.awt.RenderingHints.Key, Object>)map);
             } else {
                 return null;
             }
@@ -663,7 +664,7 @@
      * Otherwise, this method returns -1.
      * This is used to make WindowsL&F JFileChooser act like native dialogs.
      */
-    public static int loc2IndexFileList(JList list, Point point) {
+    public static int loc2IndexFileList(JList<?> list, Point point) {
         int index = list.locationToIndex(point);
         if (index != -1) {
             Object bySize = list.getClientProperty("List.isFileList");
@@ -680,11 +681,10 @@
      * Returns true if the given point is within the actual bounds of the
      * JList item at index (not just inside the cell).
      */
-    private static boolean pointIsInActualBounds(JList list, int index,
+    private static <T> boolean pointIsInActualBounds(JList<T> list, int index,
                                                 Point point) {
-        ListCellRenderer renderer = list.getCellRenderer();
-        ListModel dataModel = list.getModel();
-        Object value = dataModel.getElementAt(index);
+        ListCellRenderer<? super T> renderer = list.getCellRenderer();
+        T value = list.getModel().getElementAt(index);
         Component item = renderer.getListCellRendererComponent(list,
                           value, index, false, false);
         Dimension itemSize = item.getPreferredSize();
--- a/src/share/classes/sun/swing/WindowsPlacesBar.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/WindowsPlacesBar.java	Tue Feb 04 16:24:39 2014 -0800
@@ -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
@@ -47,6 +47,7 @@
  *
  * @author Leif Samuelsson
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public class WindowsPlacesBar extends JToolBar
                               implements ActionListener, PropertyChangeListener {
     JFileChooser fc;
--- a/src/share/classes/sun/swing/icon/SortArrowIcon.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/icon/SortArrowIcon.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
  * Sorting icon.
  *
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public class SortArrowIcon implements Icon, UIResource, Serializable {
     // Height of the arrow, the width is ARROW_HEIGHT
     private static final int ARROW_HEIGHT = 5;
--- a/src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
     /**
      * User specific data.
      */
-    private Map data;
+    private Map<Object, Object> data;
 
     /**
      * Font to use if there is no matching StateInfo, or the StateInfo doesn't
@@ -106,7 +106,7 @@
             }
         }
         if (style.data != null) {
-            data = new HashMap();
+            data = new HashMap<>();
             data.putAll(style.data);
         }
         font = style.font;
@@ -124,7 +124,7 @@
      * @param data Style specific data.
      */
     public DefaultSynthStyle(Insets insets, boolean opaque,
-                             StateInfo[] states, Map data) {
+                             StateInfo[] states, Map<Object, Object> data) {
         this.insets = insets;
         this.opaque = opaque;
         this.states = states;
@@ -366,7 +366,7 @@
      *
      * @param data Style specific values
      */
-    public void setData(Map data) {
+    public void setData(Map<Object, Object> data) {
         this.data = data;
     }
 
@@ -375,7 +375,7 @@
      *
      * @return Style specific data.
      */
-    public Map getData() {
+    public Map<Object, Object> getData() {
         return data;
     }
 
@@ -402,7 +402,7 @@
     }
 
 
-    private Object getKeyFromData(Map stateData, Object key) {
+    private Object getKeyFromData(Map<Object, Object> stateData, Object key) {
           Object value = null;
           if (stateData != null) {
 
@@ -462,7 +462,7 @@
             }
         }
         if (data != null) {
-            style.data = new HashMap();
+            style.data = new HashMap<>();
             style.data.putAll(data);
         }
         return style;
@@ -570,7 +570,7 @@
         }
         if (data != null) {
             if (style.data == null) {
-                style.data = new HashMap();
+                style.data = new HashMap<>();
             }
             style.data.putAll(data);
         }
@@ -708,7 +708,7 @@
      * a component.
      */
     public static class StateInfo {
-        private Map data;
+        private Map<Object, Object> data;
         private Font font;
         private Color[] colors;
         private int state;
@@ -746,7 +746,7 @@
             this.font = info.font;
             if(info.data != null) {
                if(data == null) {
-                  data = new HashMap();
+                  data = new HashMap<>();
                }
                data.putAll(info.data);
             }
@@ -756,11 +756,11 @@
             }
         }
 
-        public Map getData() {
+        public Map<Object, Object> getData() {
             return data;
         }
 
-        public void setData(Map data) {
+        public void setData(Map<Object, Object> data) {
             this.data = data;
         }
 
@@ -836,7 +836,7 @@
             }
             if(data != null) {
                 if(info.data == null) {
-                    info.data = new HashMap();
+                    info.data = new HashMap<>();
                 }
                 info.data.putAll(data);
             }
--- a/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -303,6 +303,7 @@
     /**
      * Responds to a File Name completion request (e.g. Tab)
      */
+    @SuppressWarnings("serial") // JDK-implementation class
     private class FileNameCompletionAction extends AbstractAction {
         protected FileNameCompletionAction() {
             super("fileNameCompletion");
@@ -538,6 +539,7 @@
     public void clearIconCache() { }
 
     // Copied as SynthBorder is package private in synth
+    @SuppressWarnings("serial") // JDK-implementation clas
     private class UIBorder extends AbstractBorder implements UIResource {
         private Insets _insets;
         UIBorder(Insets insets) {
--- a/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, 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
@@ -175,7 +175,7 @@
             return SynthFileChooserUIImpl.this.getNewFolderAction();
         }
 
-        public MouseListener createDoubleClickListener(JList list) {
+        public MouseListener createDoubleClickListener(JList<?> list) {
             return SynthFileChooserUIImpl.this.createDoubleClickListener(getFileChooser(),
                                                                      list);
         }
@@ -190,6 +190,7 @@
         readOnly = UIManager.getBoolean("FileChooser.readOnly");
     }
 
+    @SuppressWarnings("serial") // anonymous classes inside
     public void installComponents(JFileChooser fc) {
         super.installComponents(fc);
 
@@ -562,7 +563,7 @@
         if (currentDirectory != null) {
             JComponent cb = getDirectoryComboBox();
             if (cb instanceof JComboBox) {
-                ComboBoxModel model = ((JComboBox)cb).getModel();
+                ComboBoxModel<?> model = ((JComboBox)cb).getModel();
                 if (model instanceof DirectoryComboBoxModel) {
                     ((DirectoryComboBoxModel)model).addItem(currentDirectory);
                 }
@@ -734,6 +735,7 @@
     /**
      * Data model for a type-face selection combo-box.
      */
+    @SuppressWarnings("serial") // JDK-implementation class
     protected class DirectoryComboBoxModel extends AbstractListModel<File> implements ComboBoxModel<File> {
         Vector<File> directories = new Vector<File>();
         int[] depths = null;
@@ -863,6 +865,7 @@
     /**
      * Acts when DirectoryComboBox has changed the selected item.
      */
+    @SuppressWarnings("serial") // JDK-implementation class
     protected class DirectoryComboBoxAction extends AbstractAction {
         protected DirectoryComboBoxAction() {
             super("DirectoryComboBoxAction");
@@ -923,6 +926,7 @@
     /**
      * Data model for a type-face selection combo-box.
      */
+    @SuppressWarnings("serial") // JDK-implementation class
     protected class FilterComboBoxModel extends AbstractListModel<FileFilter> implements ComboBoxModel<FileFilter>,
             PropertyChangeListener {
         protected FileFilter[] filters;
@@ -1073,6 +1077,7 @@
         }
     }
 
+    @SuppressWarnings("serial") // JDK-implementation class
     private class AlignedLabel extends JLabel {
         private AlignedLabel[] group;
         private int maxWidth = 0;
--- a/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
  * Classic sort icons.
  *
  */
+@SuppressWarnings("serial") // JDK-implementation class
 public class ClassicSortArrowIcon implements Icon, UIResource, Serializable{
     private static final int X_OFFSET = 9;
     private boolean ascending;
--- a/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 import javax.swing.border.Border;
 import javax.swing.table.*;
 
+@SuppressWarnings("serial") // JDK-implementation class
 public class DefaultTableCellHeaderRenderer extends DefaultTableCellRenderer
         implements UIResource {
     private boolean horizontalTextPositionSet;
@@ -187,6 +188,7 @@
         return new Point(x, y);
     }
 
+    @SuppressWarnings("serial") // JDK-implementation class
     private class EmptyIcon implements Icon, Serializable {
         int width = 0;
         int height = 0;
--- a/src/share/classes/sun/swing/text/TextComponentPrintable.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/swing/text/TextComponentPrintable.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -324,6 +324,7 @@
             }
         }
     }
+    @SuppressWarnings("serial") // anonymous class inside
     private JTextComponent createPrintShellOnEDT(final JTextComponent textComponent) {
         assert SwingUtilities.isEventDispatchThread();
 
--- a/src/share/classes/sun/util/resources/TimeZoneNames.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/TimeZoneNames.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"Alma-Ata Time", "ALMT",
                                           "Alma-Ata Summer Time", "ALMST",
                                           "Alma-Ata Time", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"Anadyr Time", "ANAT",
                                           "Anadyr Summer Time", "ANAST",
                                           "Anadyr Time", "ANAT"}},
--- a/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"Alma Ata Zeit", "ALMT",
                                           "Alma-Ata Sommerzeit", "ALMST",
                                           "Alma Ata Zeit", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"Anadyr Zeit", "ANAT",
                                           "Anadyr Sommerzeit", "ANAST",
                                           "Anadyr Zeit", "ANAT"}},
--- a/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"Hora de Alma-Ata", "ALMT",
                                           "Hora de verano de Alma-Ata", "ALMST",
                                           "Hora de Alma-Ata", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"Hora de Anadyr", "ANAT",
                                           "Hora de verano de Anadyr", "ANAST",
                                           "Hora de Anadyr", "ANAT"}},
--- a/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"Heure d'Alma-Ata", "ALMT",
                                           "Heure d'\u00e9t\u00e9 d'Alma-Ata", "ALMST",
                                           "Heure d'Alma-Ata", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"Heure d'Anadyr", "ANAT",
                                           "Heure d'\u00e9t\u00e9 d'Anadyr", "ANAST",
                                           "Heure d'Anadyr", "ANAT"}},
--- a/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"Ora di Alma-Ata", "ALMT",
                                           "Ora estiva di Alma-Ata", "ALMST",
                                           "Ora di Alma-Ata", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"Ora di Anadyr", "ANAT",
                                           "Ora estiva di Anadyr", "ANAST",
                                           "Ora di Anadyr", "ANAT"}},
--- a/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"\u30a2\u30eb\u30de\u30a2\u30bf\u6642\u9593", "ALMT",
                                           "\u30a2\u30eb\u30de\u30a2\u30bf\u590f\u6642\u9593", "ALMST",
                                           "\u30A2\u30EB\u30DE\u30A2\u30BF\u6642\u9593", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"\u30a2\u30ca\u30c9\u30a5\u30a4\u30ea\u6642\u9593", "ANAT",
                                           "\u30a2\u30ca\u30c9\u30a5\u30a4\u30ea\u590f\u6642\u9593", "ANAST",
                                           "\u30A2\u30CA\u30C7\u30A3\u30EA\u6642\u9593", "ANAT"}},
--- a/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"\uc54c\ub9c8\uc544\ud0c0 \uc2dc\uac04", "ALMT",
                                           "\uc54c\ub9c8\uc544\ud0c0 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ALMST",
                                           "\uC54C\uB9C8\uC544\uD0C0 \uD45C\uC900\uC2DC", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"\uc544\ub098\ub514\ub974 \uc2dc\uac04", "ANAT",
                                           "\uc544\ub098\ub514\ub974 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ANAST",
                                           "\uC544\uB098\uB514\uB9AC \uD45C\uC900\uC2DC", "ANAT"}},
--- a/src/share/classes/sun/util/resources/no/LocaleNames_no.properties	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/no/LocaleNames_no.properties	Tue Feb 04 16:24:39 2014 -0800
@@ -38,6 +38,8 @@
 # language names
 # key is ISO 639 language code
 
+nb=bokm\u00e5l
+nn=nynorsk
 no=norsk
 
 # country names
--- a/src/share/classes/sun/util/resources/no/LocaleNames_no_NO_NY.properties	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/no/LocaleNames_no_NO_NY.properties	Tue Feb 04 16:24:39 2014 -0800
@@ -38,12 +38,14 @@
 # language names
 # key is ISO 639 language code
 
+nb=bokm\u00e5l
+nn=nynorsk
 no=norsk
 
 # country names
 # key is ISO 3166 country code
 
-NO=Norge
+NO=Noreg
 
 
 # variant names
--- a/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"Fuso hor\u00e1rio de Alma-Ata", "ALMT",
                                           "Fuso hor\u00e1rio de ver\u00e3o de Alma-Ata", "ALMST",
                                           "Hor\u00E1rio de Alma-Ata", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"Fuso hor\u00e1rio de Anadyr", "ANAT",
                                           "Fuso hor\u00e1rio de ver\u00e3o de Anadyr", "ANAST",
                                           "Hor\u00E1rio de Anadyr", "ANAT"}},
--- a/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"Alma-Ata, normaltid", "ALMT",
                                           "Alma-Ata, sommartid", "ALMST",
                                           "Alma-Ata-tid", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"Anadyr, normaltid", "ANAT",
                                           "Anadyr, sommartid", "ANAST",
                                           "Anadyr-tid", "ANAT"}},
--- a/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"Alma-Ata \u65f6\u95f4", "ALMT",
                                           "Alma-Ata \u590f\u4ee4\u65f6", "ALMST",
                                           "Alma-Ata \u65F6\u95F4", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"\u963f\u90a3\u5e95\u6cb3\u65f6\u95f4", "ANAT",
                                           "\u963f\u90a3\u5e95\u6cb3\u590f\u4ee4\u65f6", "ANAST",
                                           "\u963F\u90A3\u5E95\u6CB3\u65F6\u95F4", "ANAT"}},
--- a/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -578,7 +578,7 @@
             {"Asia/Almaty", new String[] {"Alma-Ata \u6642\u9593", "ALMT",
                                           "Alma-Ata \u590f\u4ee4\u6642\u9593", "ALMST",
                                           "\u963F\u62C9\u6728\u5716\u6642\u9593", "ALMT"}},
-            {"Asia/Amman", ARAST},
+            {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"\u963f\u90a3\u5e95\u6cb3\u6642\u9593", "ANAT",
                                           "\u963f\u90a3\u5e95\u6cb3\u590f\u4ee4\u6642\u9593", "ANAST",
                                           "\u963F\u90A3\u5E95\u6CB3\u6642\u9593", "ANAT"}},
--- a/src/share/native/common/jni_util.h	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/common/jni_util.h	Tue Feb 04 16:24:39 2014 -0800
@@ -279,14 +279,37 @@
 #define JNU_IsNull(env,obj) ((obj) == NULL)
 
 /************************************************************************
- * Miscellaneous utilities used by the class libraries to check for exceptions
+ * Miscellaneous utilities used by the class libraries to return from
+ * a function if a value is NULL or an exception is pending.
  */
 
-#define CHECK_NULL(x) if ((x) == NULL) return;
-#define CHECK_NULL_RETURN(x, y) if ((x) == NULL) return (y);
+#define CHECK_NULL(x)                           \
+    do {                                        \
+        if ((x) == NULL) {                      \
+            return;                             \
+        }                                       \
+    } while (0)                                 \
 
-#define CHECK_EXCEPTION(env) if ((*env)->ExceptionCheck(env)) return;
-#define CHECK_EXCEPTION_RETURN(env, y) if ((*env)->ExceptionCheck(env)) return (y);
+#define CHECK_NULL_RETURN(x, y)                 \
+    do {                                        \
+        if ((x) == NULL) {                      \
+            return (y);                         \
+        }                                       \
+    } while (0)                                 \
+
+#define JNU_CHECK_EXCEPTION(env)                \
+    do {                                        \
+        if ((*env)->ExceptionCheck(env)) {      \
+            return;                             \
+        }                                       \
+    } while (0)                                 \
+
+#define JNU_CHECK_EXCEPTION_RETURN(env, y)      \
+    do {                                        \
+        if ((*env)->ExceptionCheck(env)) {      \
+            return (y);                         \
+        }                                       \
+    } while (0)
 
 /************************************************************************
  * Debugging utilities
--- a/src/share/native/java/io/io_util.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/io/io_util.c	Tue Feb 04 16:24:39 2014 -0800
@@ -216,6 +216,7 @@
 #else
         why = JNU_NewStringPlatform(env, buf);
 #endif
+        CHECK_NULL(why);
     }
     x = JNU_NewObjectByName(env,
                             "java/io/FileNotFoundException",
--- a/src/share/native/java/lang/ClassLoader.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/lang/ClassLoader.c	Tue Feb 04 16:24:39 2014 -0800
@@ -132,7 +132,6 @@
     if (name != NULL) {
         utfName = getUTF(env, name, buf, sizeof(buf));
         if (utfName == NULL) {
-            JNU_ThrowOutOfMemoryError(env, NULL);
             goto free_body;
         }
         VerifyFixClassname(utfName);
@@ -143,7 +142,6 @@
     if (source != NULL) {
         utfSource = getUTF(env, source, sourceBuf, sizeof(sourceBuf));
         if (utfSource == NULL) {
-            JNU_ThrowOutOfMemoryError(env, NULL);
             goto free_utfName;
         }
     } else {
@@ -519,7 +517,6 @@
     procHandle = getProcessHandle();
     cname = JNU_GetStringPlatformChars(env, name, 0);
     if (cname == NULL) {
-        JNU_ThrowOutOfMemoryError(env, NULL);
         return NULL;
     }
     // Copy name Skipping PREFIX
--- a/src/share/native/java/lang/System.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/lang/System.c	Tue Feb 04 16:24:39 2014 -0800
@@ -56,44 +56,56 @@
     return JVM_IHashCode(env, x);
 }
 
-#define PUTPROP(props, key, val) \
-    if (1) { \
-        jstring jkey = (*env)->NewStringUTF(env, key); \
-        jstring jval = (*env)->NewStringUTF(env, val); \
-        jobject r = (*env)->CallObjectMethod(env, props, putID, jkey, jval); \
-        if ((*env)->ExceptionOccurred(env)) return NULL; \
-        (*env)->DeleteLocalRef(env, jkey); \
-        (*env)->DeleteLocalRef(env, jval); \
-        (*env)->DeleteLocalRef(env, r); \
+#define PUTPROP(props, key, val)                                     \
+    if (1) {                                                         \
+        jstring jkey, jval;                                          \
+        jobject r;                                                   \
+        jkey = (*env)->NewStringUTF(env, key);                       \
+        if (jkey == NULL) return NULL;                               \
+        jval = (*env)->NewStringUTF(env, val);                       \
+        if (jval == NULL) return NULL;                               \
+        r = (*env)->CallObjectMethod(env, props, putID, jkey, jval); \
+        if ((*env)->ExceptionOccurred(env)) return NULL;             \
+        (*env)->DeleteLocalRef(env, jkey);                           \
+        (*env)->DeleteLocalRef(env, jval);                           \
+        (*env)->DeleteLocalRef(env, r);                              \
     } else ((void) 0)
 
 /*  "key" is a char type string with only ASCII character in it.
     "val" is a nchar (typedefed in java_props.h) type string  */
 
-#define PUTPROP_ForPlatformNString(props, key, val) \
-    if (1) { \
-        jstring jkey = (*env)->NewStringUTF(env, key);  \
-        jstring jval = GetStringPlatform(env, val); \
-        jobject r = (*env)->CallObjectMethod(env, props, putID, jkey, jval); \
-        if ((*env)->ExceptionOccurred(env)) return NULL; \
-        (*env)->DeleteLocalRef(env, jkey); \
-        (*env)->DeleteLocalRef(env, jval); \
-        (*env)->DeleteLocalRef(env, r); \
+#define PUTPROP_ForPlatformNString(props, key, val)                  \
+    if (1) {                                                         \
+        jstring jkey, jval;                                          \
+        jobject r;                                                   \
+        jkey = (*env)->NewStringUTF(env, key);                       \
+        if (jkey == NULL) return NULL;                               \
+        jval = GetStringPlatform(env, val);                          \
+        if (jval == NULL) return NULL;                               \
+        r = (*env)->CallObjectMethod(env, props, putID, jkey, jval); \
+        if ((*env)->ExceptionOccurred(env)) return NULL;             \
+        (*env)->DeleteLocalRef(env, jkey);                           \
+        (*env)->DeleteLocalRef(env, jval);                           \
+        (*env)->DeleteLocalRef(env, r);                              \
     } else ((void) 0)
-#define REMOVEPROP(props, key) \
-    if (1) { \
-        jstring jkey = JNU_NewStringPlatform(env, key); \
-        jobject r = (*env)->CallObjectMethod(env, props, removeID, jkey); \
-        if ((*env)->ExceptionOccurred(env)) return NULL; \
-        (*env)->DeleteLocalRef(env, jkey); \
-        (*env)->DeleteLocalRef(env, r); \
+#define REMOVEPROP(props, key)                                    \
+    if (1) {                                                      \
+        jstring jkey;                                             \
+        jobject r;                                                \
+        jkey = JNU_NewStringPlatform(env, key);                   \
+        if (jkey == NULL) return NULL;                            \
+        r = (*env)->CallObjectMethod(env, props, removeID, jkey); \
+        if ((*env)->ExceptionOccurred(env)) return NULL;          \
+        (*env)->DeleteLocalRef(env, jkey);                        \
+        (*env)->DeleteLocalRef(env, r);                           \
     } else ((void) 0)
-#define GETPROP(props, key, jret) \
-    if (1) { \
-        jstring jkey = JNU_NewStringPlatform(env, key); \
+#define GETPROP(props, key, jret)                                     \
+    if (1) {                                                          \
+        jstring jkey = JNU_NewStringPlatform(env, key);               \
+        if (jkey == NULL) return NULL;                                \
         jret = (*env)->CallObjectMethod(env, props, getPropID, jkey); \
-        if ((*env)->ExceptionOccurred(env)) return NULL; \
-        (*env)->DeleteLocalRef(env, jkey); \
+        if ((*env)->ExceptionOccurred(env)) return NULL;              \
+        (*env)->DeleteLocalRef(env, jkey);                            \
     } else ((void) 0)
 
 #ifndef VENDOR /* Third party may overwrite this. */
@@ -169,23 +181,31 @@
 Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
 {
     char buf[128];
-    java_props_t *sprops = GetJavaProperties(env);
-    jmethodID putID = (*env)->GetMethodID(env,
-                                          (*env)->GetObjectClass(env, props),
-                                          "put",
-            "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
-    jmethodID removeID = (*env)->GetMethodID(env,
-                                          (*env)->GetObjectClass(env, props),
-                                          "remove",
-            "(Ljava/lang/Object;)Ljava/lang/Object;");
-    jmethodID getPropID = (*env)->GetMethodID(env,
-                                          (*env)->GetObjectClass(env, props),
-                                          "getProperty",
-            "(Ljava/lang/String;)Ljava/lang/String;");
+    java_props_t *sprops;
+    jmethodID putID, removeID, getPropID;
     jobject ret = NULL;
     jstring jVMVal = NULL;
 
-    if (sprops == NULL || putID == NULL ) return NULL;
+    sprops = GetJavaProperties(env);
+    CHECK_NULL_RETURN(sprops, NULL);
+
+    putID = (*env)->GetMethodID(env,
+                                (*env)->GetObjectClass(env, props),
+                                "put",
+            "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
+    CHECK_NULL_RETURN(putID, NULL);
+
+    removeID = (*env)->GetMethodID(env,
+                                   (*env)->GetObjectClass(env, props),
+                                   "remove",
+            "(Ljava/lang/Object;)Ljava/lang/Object;");
+    CHECK_NULL_RETURN(removeID, NULL);
+
+    getPropID = (*env)->GetMethodID(env,
+                                    (*env)->GetObjectClass(env, props),
+                                    "getProperty",
+            "(Ljava/lang/String;)Ljava/lang/String;");
+    CHECK_NULL_RETURN(getPropID, NULL);
 
     PUTPROP(props, "java.specification.version",
             JDK_MAJOR_VERSION "." JDK_MINOR_VERSION);
@@ -382,6 +402,7 @@
     GETPROP(props, "sun.locale.formatasdefault", jVMVal);
     if (jVMVal) {
         const char * val = (*env)->GetStringUTFChars(env, jVMVal, 0);
+        CHECK_NULL_RETURN(val, NULL);
         fmtdefault = !strcmp(val, "true");
         (*env)->ReleaseStringUTFChars(env, jVMVal, val);
         (*env)->DeleteLocalRef(env, jVMVal);
--- a/src/share/native/java/net/Inet4Address.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/net/Inet4Address.c	Tue Feb 04 16:24:39 2014 -0800
@@ -34,6 +34,8 @@
 jclass ia4_class;
 jmethodID ia4_ctrID;
 
+static int ia4_initialized = 0;
+
 /*
  * Class:     java_net_Inet4Address
  * Method:    init
@@ -41,9 +43,13 @@
  */
 JNIEXPORT void JNICALL
 Java_java_net_Inet4Address_init(JNIEnv *env, jclass cls) {
-    jclass c = (*env)->FindClass(env, "java/net/Inet4Address");
-    CHECK_NULL(c);
-    ia4_class = (*env)->NewGlobalRef(env, c);
-    CHECK_NULL(ia4_class);
-    ia4_ctrID = (*env)->GetMethodID(env, ia4_class, "<init>", "()V");
+    if (!ia4_initialized) {
+        jclass c = (*env)->FindClass(env, "java/net/Inet4Address");
+        CHECK_NULL(c);
+        ia4_class = (*env)->NewGlobalRef(env, c);
+        CHECK_NULL(ia4_class);
+        ia4_ctrID = (*env)->GetMethodID(env, ia4_class, "<init>", "()V");
+        CHECK_NULL(ia4_ctrID);
+        ia4_initialized = 1;
+    }
 }
--- a/src/share/native/java/net/Inet6Address.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/net/Inet6Address.c	Tue Feb 04 16:24:39 2014 -0800
@@ -42,6 +42,8 @@
 jfieldID ia6_scopeifnameID;
 jmethodID ia6_ctrID;
 
+static int ia6_initialized = 0;
+
 /*
  * Class:     java_net_Inet6Address
  * Method:    init
@@ -49,24 +51,28 @@
  */
 JNIEXPORT void JNICALL
 Java_java_net_Inet6Address_init(JNIEnv *env, jclass cls) {
-    jclass ia6h_class;
-    jclass c = (*env)->FindClass(env, "java/net/Inet6Address");
-    CHECK_NULL(c);
-    ia6_class = (*env)->NewGlobalRef(env, c);
-    CHECK_NULL(ia6_class);
-    ia6h_class = (*env)->FindClass(env, "java/net/Inet6Address$Inet6AddressHolder");
-    CHECK_NULL(ia6h_class);
-    ia6_holder6ID = (*env)->GetFieldID(env, ia6_class, "holder6", "Ljava/net/Inet6Address$Inet6AddressHolder;");
-    CHECK_NULL(ia6_holder6ID);
-    ia6_ipaddressID = (*env)->GetFieldID(env, ia6h_class, "ipaddress", "[B");
-    CHECK_NULL(ia6_ipaddressID);
-    ia6_scopeidID = (*env)->GetFieldID(env, ia6h_class, "scope_id", "I");
-    CHECK_NULL(ia6_scopeidID);
-    ia6_cachedscopeidID = (*env)->GetFieldID(env, ia6_class, "cached_scope_id", "I");
-    CHECK_NULL(ia6_cachedscopeidID);
-    ia6_scopeidsetID = (*env)->GetFieldID(env, ia6h_class, "scope_id_set", "Z");
-    CHECK_NULL(ia6_scopeidsetID);
-    ia6_scopeifnameID = (*env)->GetFieldID(env, ia6h_class, "scope_ifname", "Ljava/net/NetworkInterface;");
-    CHECK_NULL(ia6_scopeifnameID);
-    ia6_ctrID = (*env)->GetMethodID(env, ia6_class, "<init>", "()V");
+    if (!ia6_initialized) {
+        jclass ia6h_class;
+        jclass c = (*env)->FindClass(env, "java/net/Inet6Address");
+        CHECK_NULL(c);
+        ia6_class = (*env)->NewGlobalRef(env, c);
+        CHECK_NULL(ia6_class);
+        ia6h_class = (*env)->FindClass(env, "java/net/Inet6Address$Inet6AddressHolder");
+        CHECK_NULL(ia6h_class);
+        ia6_holder6ID = (*env)->GetFieldID(env, ia6_class, "holder6", "Ljava/net/Inet6Address$Inet6AddressHolder;");
+        CHECK_NULL(ia6_holder6ID);
+        ia6_ipaddressID = (*env)->GetFieldID(env, ia6h_class, "ipaddress", "[B");
+        CHECK_NULL(ia6_ipaddressID);
+        ia6_scopeidID = (*env)->GetFieldID(env, ia6h_class, "scope_id", "I");
+        CHECK_NULL(ia6_scopeidID);
+        ia6_cachedscopeidID = (*env)->GetFieldID(env, ia6_class, "cached_scope_id", "I");
+        CHECK_NULL(ia6_cachedscopeidID);
+        ia6_scopeidsetID = (*env)->GetFieldID(env, ia6h_class, "scope_id_set", "Z");
+        CHECK_NULL(ia6_scopeidsetID);
+        ia6_scopeifnameID = (*env)->GetFieldID(env, ia6h_class, "scope_ifname", "Ljava/net/NetworkInterface;");
+        CHECK_NULL(ia6_scopeifnameID);
+        ia6_ctrID = (*env)->GetMethodID(env, ia6_class, "<init>", "()V");
+        CHECK_NULL(ia6_ctrID);
+        ia6_initialized = 1;
+    }
 }
--- a/src/share/native/java/net/InetAddress.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/net/InetAddress.c	Tue Feb 04 16:24:39 2014 -0800
@@ -40,6 +40,8 @@
 jfieldID iac_hostNameID;
 jfieldID ia_preferIPv6AddressID;
 
+static int ia_initialized = 0;
+
 /*
  * Class:     java_net_InetAddress
  * Method:    init
@@ -47,21 +49,25 @@
  */
 JNIEXPORT void JNICALL
 Java_java_net_InetAddress_init(JNIEnv *env, jclass cls) {
-    jclass c = (*env)->FindClass(env,"java/net/InetAddress");
-    CHECK_NULL(c);
-    ia_class = (*env)->NewGlobalRef(env, c);
-    CHECK_NULL(ia_class);
-    c = (*env)->FindClass(env,"java/net/InetAddress$InetAddressHolder");
-    CHECK_NULL(c);
-    iac_class = (*env)->NewGlobalRef(env, c);
-    ia_holderID = (*env)->GetFieldID(env, ia_class, "holder", "Ljava/net/InetAddress$InetAddressHolder;");
-    CHECK_NULL(ia_holderID);
-    ia_preferIPv6AddressID = (*env)->GetStaticFieldID(env, ia_class, "preferIPv6Address", "Z");
-    CHECK_NULL(ia_preferIPv6AddressID);
+    if (!ia_initialized) {
+        jclass c = (*env)->FindClass(env,"java/net/InetAddress");
+        CHECK_NULL(c);
+        ia_class = (*env)->NewGlobalRef(env, c);
+        CHECK_NULL(ia_class);
+        c = (*env)->FindClass(env,"java/net/InetAddress$InetAddressHolder");
+        CHECK_NULL(c);
+        iac_class = (*env)->NewGlobalRef(env, c);
+        ia_holderID = (*env)->GetFieldID(env, ia_class, "holder", "Ljava/net/InetAddress$InetAddressHolder;");
+        CHECK_NULL(ia_holderID);
+        ia_preferIPv6AddressID = (*env)->GetStaticFieldID(env, ia_class, "preferIPv6Address", "Z");
+        CHECK_NULL(ia_preferIPv6AddressID);
 
-    iac_addressID = (*env)->GetFieldID(env, iac_class, "address", "I");
-    CHECK_NULL(iac_addressID);
-    iac_familyID = (*env)->GetFieldID(env, iac_class, "family", "I");
-    CHECK_NULL(iac_familyID);
-    iac_hostNameID = (*env)->GetFieldID(env, iac_class, "hostName", "Ljava/lang/String;");
+        iac_addressID = (*env)->GetFieldID(env, iac_class, "address", "I");
+        CHECK_NULL(iac_addressID);
+        iac_familyID = (*env)->GetFieldID(env, iac_class, "family", "I");
+        CHECK_NULL(iac_familyID);
+        iac_hostNameID = (*env)->GetFieldID(env, iac_class, "hostName", "Ljava/lang/String;");
+        CHECK_NULL(iac_hostNameID);
+        ia_initialized = 1;
+    }
 }
--- a/src/share/native/java/net/net_util.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/net/net_util.c	Tue Feb 04 16:24:39 2014 -0800
@@ -75,11 +75,14 @@
 
 static int initialized = 0;
 
-static void initInetAddrs(JNIEnv *env) {
+JNIEXPORT void JNICALL initInetAddressIDs(JNIEnv *env) {
     if (!initialized) {
         Java_java_net_InetAddress_init(env, 0);
+        JNU_CHECK_EXCEPTION(env);
         Java_java_net_Inet4Address_init(env, 0);
+        JNU_CHECK_EXCEPTION(env);
         Java_java_net_Inet6Address_init(env, 0);
+        JNU_CHECK_EXCEPTION(env);
         initialized = 1;
     }
 }
@@ -100,47 +103,32 @@
  * get_ methods that return objects return NULL on error.
  */
 jobject getInet6Address_scopeifname(JNIEnv *env, jobject iaObj) {
-    jobject holder;
-
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
     CHECK_NULL_RETURN(holder, NULL);
     return (*env)->GetObjectField(env, holder, ia6_scopeifnameID);
 }
 
 int setInet6Address_scopeifname(JNIEnv *env, jobject iaObj, jobject scopeifname) {
-    jobject holder;
-
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
     CHECK_NULL_RETURN(holder, JNI_FALSE);
     (*env)->SetObjectField(env, holder, ia6_scopeifnameID, scopeifname);
     return JNI_TRUE;
 }
 
 int getInet6Address_scopeid_set(JNIEnv *env, jobject iaObj) {
-    jobject holder;
-
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
     CHECK_NULL_RETURN(holder, -1);
     return (*env)->GetBooleanField(env, holder, ia6_scopeidsetID);
 }
 
 int getInet6Address_scopeid(JNIEnv *env, jobject iaObj) {
-    jobject holder;
-
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
     CHECK_NULL_RETURN(holder, -1);
     return (*env)->GetIntField(env, holder, ia6_scopeidID);
 }
 
 int setInet6Address_scopeid(JNIEnv *env, jobject iaObj, int scopeid) {
-    jobject holder;
-
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
     CHECK_NULL_RETURN(holder, JNI_FALSE);
     (*env)->SetIntField(env, holder, ia6_scopeidID, scopeid);
     if (scopeid > 0) {
@@ -154,7 +142,6 @@
     jobject holder, addr;
     jbyteArray barr;
 
-    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
     CHECK_NULL_RETURN(holder, JNI_FALSE);
     addr =  (*env)->GetObjectField(env, holder, ia6_ipaddressID);
@@ -167,7 +154,6 @@
     jobject holder;
     jbyteArray addr;
 
-    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
     CHECK_NULL_RETURN(holder, JNI_FALSE);
     addr =  (jbyteArray)(*env)->GetObjectField(env, holder, ia6_ipaddressID);
@@ -181,52 +167,38 @@
 }
 
 void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address) {
-    jobject holder;
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     (*env)->SetIntField(env, holder, iac_addressID, address);
 }
 
 void setInetAddress_family(JNIEnv *env, jobject iaObj, int family) {
-    jobject holder;
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     (*env)->SetIntField(env, holder, iac_familyID, family);
 }
 
 void setInetAddress_hostName(JNIEnv *env, jobject iaObj, jobject host) {
-    jobject holder;
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     (*env)->SetObjectField(env, holder, iac_hostNameID, host);
 }
 
 int getInetAddress_addr(JNIEnv *env, jobject iaObj) {
-    jobject holder;
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     return (*env)->GetIntField(env, holder, iac_addressID);
 }
 
 int getInetAddress_family(JNIEnv *env, jobject iaObj) {
-    jobject holder;
-
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     return (*env)->GetIntField(env, holder, iac_familyID);
 }
 
 jobject getInetAddress_hostName(JNIEnv *env, jobject iaObj) {
-    jobject holder;
-    initInetAddrs(env);
-    holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
+    jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     return (*env)->GetObjectField(env, holder, iac_hostNameID);
 }
 
 JNIEXPORT jobject JNICALL
 NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port) {
     jobject iaObj;
-    initInetAddrs(env);
 #ifdef AF_INET6
     if (him->sa_family == AF_INET6) {
         jbyteArray ipaddress;
@@ -238,31 +210,15 @@
         jbyte *caddr = (jbyte *)&(him6->sin6_addr);
         if (NET_IsIPv4Mapped(caddr)) {
             int address;
-            static jclass inet4Cls = 0;
-            if (inet4Cls == 0) {
-                jclass c = (*env)->FindClass(env, "java/net/Inet4Address");
-                CHECK_NULL_RETURN(c, NULL);
-                inet4Cls = (*env)->NewGlobalRef(env, c);
-                CHECK_NULL_RETURN(inet4Cls, NULL);
-                (*env)->DeleteLocalRef(env, c);
-            }
-            iaObj = (*env)->NewObject(env, inet4Cls, ia4_ctrID);
+            iaObj = (*env)->NewObject(env, ia4_class, ia4_ctrID);
             CHECK_NULL_RETURN(iaObj, NULL);
             address = NET_IPv4MappedToIPv4(caddr);
             setInetAddress_addr(env, iaObj, address);
             setInetAddress_family(env, iaObj, IPv4);
         } else {
-            static jclass inet6Cls = 0;
             jint scope;
             int ret;
-            if (inet6Cls == 0) {
-                jclass c = (*env)->FindClass(env, "java/net/Inet6Address");
-                CHECK_NULL_RETURN(c, NULL);
-                inet6Cls = (*env)->NewGlobalRef(env, c);
-                CHECK_NULL_RETURN(inet6Cls, NULL);
-                (*env)->DeleteLocalRef(env, c);
-            }
-            iaObj = (*env)->NewObject(env, inet6Cls, ia6_ctrID);
+            iaObj = (*env)->NewObject(env, ia6_class, ia6_ctrID);
             CHECK_NULL_RETURN(iaObj, NULL);
             ret = setInet6Address_ipaddress(env, iaObj, (char *)&(him6->sin6_addr));
             CHECK_NULL_RETURN(ret, NULL);
@@ -275,16 +231,7 @@
 #endif /* AF_INET6 */
         {
             struct sockaddr_in *him4 = (struct sockaddr_in *)him;
-            static jclass inet4Cls = 0;
-
-            if (inet4Cls == 0) {
-                jclass c = (*env)->FindClass(env, "java/net/Inet4Address");
-                CHECK_NULL_RETURN(c, NULL);
-                inet4Cls = (*env)->NewGlobalRef(env, c);
-                CHECK_NULL_RETURN(inet4Cls, NULL);
-                (*env)->DeleteLocalRef(env, c);
-            }
-            iaObj = (*env)->NewObject(env, inet4Cls, ia4_ctrID);
+            iaObj = (*env)->NewObject(env, ia4_class, ia4_ctrID);
             CHECK_NULL_RETURN(iaObj, NULL);
             setInetAddress_family(env, iaObj, IPv4);
             setInetAddress_addr(env, iaObj, ntohl(him4->sin_addr.s_addr));
--- a/src/share/native/java/net/net_util.h	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/net/net_util.h	Tue Feb 04 16:24:39 2014 -0800
@@ -55,6 +55,8 @@
 extern jfieldID iac_hostNameID;
 extern jfieldID ia_preferIPv6AddressID;
 
+JNIEXPORT void JNICALL initInetAddressIDs(JNIEnv *env);
+
 /** (Inet6Address accessors)
  * set_ methods return JNI_TRUE on success JNI_FALSE on error
  * get_ methods that return int/boolean, return -1 on error
--- a/src/share/native/java/util/zip/Deflater.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/util/zip/Deflater.c	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -49,13 +49,21 @@
 Java_java_util_zip_Deflater_initIDs(JNIEnv *env, jclass cls)
 {
     levelID = (*env)->GetFieldID(env, cls, "level", "I");
+    CHECK_NULL(levelID);
     strategyID = (*env)->GetFieldID(env, cls, "strategy", "I");
+    CHECK_NULL(strategyID);
     setParamsID = (*env)->GetFieldID(env, cls, "setParams", "Z");
+    CHECK_NULL(setParamsID);
     finishID = (*env)->GetFieldID(env, cls, "finish", "Z");
+    CHECK_NULL(finishID);
     finishedID = (*env)->GetFieldID(env, cls, "finished", "Z");
+    CHECK_NULL(finishedID);
     bufID = (*env)->GetFieldID(env, cls, "buf", "[B");
+    CHECK_NULL(bufID);
     offID = (*env)->GetFieldID(env, cls, "off", "I");
+    CHECK_NULL(offID);
     lenID = (*env)->GetFieldID(env, cls, "len", "I");
+    CHECK_NULL(lenID);
 }
 
 JNIEXPORT jlong JNICALL
@@ -132,14 +140,14 @@
         in_buf = (*env)->GetPrimitiveArrayCritical(env, this_buf, 0);
         if (in_buf == NULL) {
             // Throw OOME only when length is not zero
-            if (this_len != 0)
+            if (this_len != 0 && (*env)->ExceptionOccurred(env) == NULL)
                 JNU_ThrowOutOfMemoryError(env, 0);
             return 0;
         }
         out_buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
         if (out_buf == NULL) {
             (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
-            if (len != 0)
+            if (len != 0 && (*env)->ExceptionOccurred(env) == NULL)
                 JNU_ThrowOutOfMemoryError(env, 0);
             return 0;
         }
@@ -158,7 +166,7 @@
             this_off += this_len - strm->avail_in;
             (*env)->SetIntField(env, this, offID, this_off);
             (*env)->SetIntField(env, this, lenID, strm->avail_in);
-            return len - strm->avail_out;
+            return (jint) (len - strm->avail_out);
         case Z_BUF_ERROR:
             (*env)->SetBooleanField(env, this, setParamsID, JNI_FALSE);
             return 0;
--- a/src/share/native/java/util/zip/Inflater.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/util/zip/Inflater.c	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -50,10 +50,15 @@
 Java_java_util_zip_Inflater_initIDs(JNIEnv *env, jclass cls)
 {
     needDictID = (*env)->GetFieldID(env, cls, "needDict", "Z");
+    CHECK_NULL(needDictID);
     finishedID = (*env)->GetFieldID(env, cls, "finished", "Z");
+    CHECK_NULL(finishedID);
     bufID = (*env)->GetFieldID(env, cls, "buf", "[B");
+    CHECK_NULL(bufID);
     offID = (*env)->GetFieldID(env, cls, "off", "I");
+    CHECK_NULL(offID);
     lenID = (*env)->GetFieldID(env, cls, "len", "I");
+    CHECK_NULL(lenID);
 }
 
 JNIEXPORT jlong JNICALL
@@ -127,14 +132,14 @@
 
     in_buf  = (*env)->GetPrimitiveArrayCritical(env, this_buf, 0);
     if (in_buf == NULL) {
-        if (this_len != 0)
+        if (this_len != 0 && (*env)->ExceptionOccurred(env) == NULL)
             JNU_ThrowOutOfMemoryError(env, 0);
         return 0;
     }
     out_buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
     if (out_buf == NULL) {
         (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
-        if (len != 0)
+        if (len != 0 && (*env)->ExceptionOccurred(env) == NULL)
             JNU_ThrowOutOfMemoryError(env, 0);
         return 0;
     }
@@ -154,7 +159,7 @@
         this_off += this_len - strm->avail_in;
         (*env)->SetIntField(env, this, offID, this_off);
         (*env)->SetIntField(env, this, lenID, strm->avail_in);
-        return len - strm->avail_out;
+        return (jint) (len - strm->avail_out);
     case Z_NEED_DICT:
         (*env)->SetBooleanField(env, this, needDictID, JNI_TRUE);
         /* Might have consumed some input here! */
--- a/src/share/native/java/util/zip/ZipFile.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/java/util/zip/ZipFile.c	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, 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
@@ -71,11 +71,13 @@
     if (msg != NULL) {
         s = JNU_NewStringPlatform(env, msg);
     }
-    x = JNU_NewObjectByName(env,
+    if (s != NULL) {
+        x = JNU_NewObjectByName(env,
                             "java/util/zip/ZipException",
                             "(Ljava/lang/String;)V", s);
-    if (x != NULL) {
-        (*env)->Throw(env, x);
+        if (x != NULL) {
+            (*env)->Throw(env, x);
+        }
     }
 }
 
@@ -367,8 +369,10 @@
 
     /* If some names were found then build array of java strings */
     if (count > 0) {
-        jclass cls = (*env)->FindClass(env, "java/lang/String");
+        jclass cls = JNU_ClassString(env);
+        CHECK_NULL_RETURN(cls, NULL);
         result = (*env)->NewObjectArray(env, count, cls, 0);
+        CHECK_NULL_RETURN(result, NULL);
         if (result != 0) {
             for (i = 0; i < count; i++) {
                 jstring str = (*env)->NewStringUTF(env, zip->metanames[i]);
--- a/src/share/native/sun/management/DiagnosticCommandImpl.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/sun/management/DiagnosticCommandImpl.c	Tue Feb 04 16:24:39 2014 -0800
@@ -30,12 +30,12 @@
 
 JNIEXPORT void JNICALL Java_sun_management_DiagnosticCommandImpl_setNotificationEnabled
 (JNIEnv *env, jobject dummy, jboolean enabled) {
-    if(jmm_version > JMM_VERSION_1_2_2) {
-        jmm_interface->SetDiagnosticFrameworkNotificationEnabled(env, enabled);
-    } else {
+    if (jmm_version <= JMM_VERSION_1_2_2) {
         JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
                         "JMX interface to diagnostic framework notifications is not supported by this VM");
+        return;
     }
+    jmm_interface->SetDiagnosticFrameworkNotificationEnabled(env, enabled);
 }
 
 JNIEXPORT jobjectArray JNICALL
@@ -124,6 +124,7 @@
   result = (*env)->NewObjectArray(env, num_commands, dcmdInfoCls, NULL);
   if (result == NULL) {
       JNU_ThrowOutOfMemoryError(env, 0);
+      return NULL;
   }
   if (num_commands == 0) {
       /* Handle the 'zero commands' case specially to avoid calling 'malloc()' */
@@ -133,6 +134,7 @@
   dcmd_info_array = (dcmdInfo*) malloc(num_commands * sizeof(dcmdInfo));
   if (dcmd_info_array == NULL) {
       JNU_ThrowOutOfMemoryError(env, NULL);
+      return NULL;
   }
   jmm_interface->GetDiagnosticCommandInfo(env, commands, dcmd_info_array);
   for (i=0; i<num_commands; i++) {
@@ -142,6 +144,7 @@
       if (args == NULL) {
           free(dcmd_info_array);
           JNU_ThrowOutOfMemoryError(env, 0);
+          return NULL;
       }
       obj = JNU_NewObjectByName(env,
                                 "sun/management/DiagnosticCommandInfo",
@@ -157,6 +160,7 @@
       if (obj == NULL) {
           free(dcmd_info_array);
           JNU_ThrowOutOfMemoryError(env, 0);
+          return NULL;
       }
       (*env)->SetObjectArrayElement(env, result, i, obj);
   }
--- a/src/share/native/sun/misc/Version.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/sun/misc/Version.c	Tue Feb 04 16:24:39 2014 -0800
@@ -60,15 +60,15 @@
 
     (*func_p)(env, &info, sizeof(info));
     setStaticIntField(env, cls, "jvm_major_version", JVM_VERSION_MAJOR(info.jvm_version));
-    CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
+    JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
     setStaticIntField(env, cls, "jvm_minor_version", JVM_VERSION_MINOR(info.jvm_version));
-    CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
+    JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
     setStaticIntField(env, cls, "jvm_micro_version", JVM_VERSION_MICRO(info.jvm_version));
-    CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
+    JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
     setStaticIntField(env, cls, "jvm_build_number", JVM_VERSION_BUILD(info.jvm_version));
-    CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
+    JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
     setStaticIntField(env, cls, "jvm_update_version", info.update_version);
-    CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
+    JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
     jvm_special_version = info.special_update_version;
 
     return JNI_TRUE;
@@ -91,15 +91,15 @@
 
     JDK_GetVersionInfo0(&info, sizeof(info));
     setStaticIntField(env, cls, "jdk_major_version", JDK_VERSION_MAJOR(info.jdk_version));
-    CHECK_EXCEPTION(env);
+    JNU_CHECK_EXCEPTION(env);
     setStaticIntField(env, cls, "jdk_minor_version", JDK_VERSION_MINOR(info.jdk_version));
-    CHECK_EXCEPTION(env);
+    JNU_CHECK_EXCEPTION(env);
     setStaticIntField(env, cls, "jdk_micro_version", JDK_VERSION_MICRO(info.jdk_version));
-    CHECK_EXCEPTION(env);
+    JNU_CHECK_EXCEPTION(env);
     setStaticIntField(env, cls, "jdk_build_number", JDK_VERSION_BUILD(info.jdk_version));
-    CHECK_EXCEPTION(env);
+    JNU_CHECK_EXCEPTION(env);
     setStaticIntField(env, cls, "jdk_update_version", info.update_version);
-    CHECK_EXCEPTION(env);
+    JNU_CHECK_EXCEPTION(env);
     jdk_special_version = info.special_update_version;
 }
 
--- a/src/share/native/sun/security/ec/ECC_JNI.cpp	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/share/native/sun/security/ec/ECC_JNI.cpp	Tue Feb 04 16:24:39 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -41,7 +41,9 @@
 void ThrowException(JNIEnv *env, const char *exceptionName)
 {
     jclass exceptionClazz = env->FindClass(exceptionName);
-    env->ThrowNew(exceptionClazz, NULL);
+    if (exceptionClazz != NULL) {
+        env->ThrowNew(exceptionClazz, NULL);
+    }
 }
 
 /*
@@ -73,7 +75,7 @@
 JNICALL Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair
   (JNIEnv *env, jclass clazz, jint keySize, jbyteArray encodedParams, jbyteArray seed)
 {
-    ECPrivateKey *privKey;      /* contains both public and private values */
+    ECPrivateKey *privKey = NULL; /* contains both public and private values */
     ECParams *ecparams = NULL;
     SECKEYECParams params_item;
     jint jSeedLength;
@@ -85,6 +87,9 @@
     params_item.len = env->GetArrayLength(encodedParams);
     params_item.data =
         (unsigned char *) env->GetByteArrayElements(encodedParams, 0);
+    if (params_item.data == NULL) {
+        goto cleanup;
+    }
 
     // Fill a new ECParams using the supplied OID
     if (EC_DecodeParams(&params_item, &ecparams, 0) != SECSuccess) {
@@ -107,7 +112,14 @@
 
     jboolean isCopy;
     result = env->NewLongArray(2);
+    if (result == NULL) {
+        goto cleanup;
+    }
+
     resultElements = env->GetLongArrayElements(result, &isCopy);
+    if (resultElements == NULL) {
+        goto cleanup;
+    }
 
     resultElements[0] = (jlong) &(privKey->privateValue); // private big integer
     resultElements[1] = (jlong) &(privKey->publicValue); // encoded ec point
@@ -150,6 +162,9 @@
 {
     SECItem *s = (SECItem *)hSECItem;
     jbyteArray jEncodedBytes = env->NewByteArray(s->len);
+    if (jEncodedBytes == NULL) {
+        return NULL;
+    }
 
     // Copy bytes from a native SECItem buffer to Java byte array
     env->SetByteArrayRegion(jEncodedBytes, 0, s->len, (jbyte *)s->data);
@@ -195,6 +210,9 @@
     params_item.len = env->GetArrayLength(encodedParams);
     params_item.data =
         (unsigned char *) env->GetByteArrayElements(encodedParams, 0);
+    if (params_item.data == NULL) {
+        goto cleanup;
+    }
 
     // Fill a new ECParams using the supplied OID
     if (EC_DecodeParams(&params_item, &ecparams, 0) != SECSuccess) {
@@ -208,6 +226,9 @@
     privKey.privateValue.len = env->GetArrayLength(privateKey);
     privKey.privateValue.data =
         (unsigned char *) env->GetByteArrayElements(privateKey, 0);
+    if (privKey.privateValue.data == NULL) {
+        goto cleanup;
+    }
 
     // Prepare a buffer for the signature (twice the key length)
     pSignedDigestBuffer = new jbyte[ecparams->order.len * 2];
@@ -227,6 +248,9 @@
 
     // Create new byte array
     temp = env->NewByteArray(signature_item.len);
+    if (temp == NULL) {
+        goto cleanup;
+    }
 
     // Copy data from native buffer
     env->SetByteArrayRegion(temp, 0, signature_item.len, pSignedDigestBuffer);
@@ -294,6 +318,9 @@
     params_item.len = env->GetArrayLength(encodedParams);
     params_item.data =
         (unsigned char *) env->GetByteArrayElements(encodedParams, 0);
+    if (params_item.data == NULL) {
+        goto cleanup;
+    }
 
     // Fill a new ECParams using the supplied OID
     if (EC_DecodeParams(&params_item, &ecparams, 0) != SECSuccess) {
@@ -346,25 +373,34 @@
   (JNIEnv *env, jclass clazz, jbyteArray privateKey, jbyteArray publicKey, jbyteArray encodedParams)
 {
     jbyteArray jSecret = NULL;
+    ECParams *ecparams = NULL;
 
     // Extract private key value
     SECItem privateValue_item;
     privateValue_item.len = env->GetArrayLength(privateKey);
     privateValue_item.data =
             (unsigned char *) env->GetByteArrayElements(privateKey, 0);
+    if (privateValue_item.data == NULL) {
+        goto cleanup;
+    }
 
     // Extract public key value
     SECItem publicValue_item;
     publicValue_item.len = env->GetArrayLength(publicKey);
     publicValue_item.data =
         (unsigned char *) env->GetByteArrayElements(publicKey, 0);
+    if (publicValue_item.data == NULL) {
+        goto cleanup;
+    }
 
     // Initialize the ECParams struct
-    ECParams *ecparams = NULL;
     SECKEYECParams params_item;
     params_item.len = env->GetArrayLength(encodedParams);
     params_item.data =
         (unsigned char *) env->GetByteArrayElements(encodedParams, 0);
+    if (params_item.data == NULL) {
+        goto cleanup;
+    }
 
     // Fill a new ECParams using the supplied OID
     if (EC_DecodeParams(&params_item, &ecparams, 0) != SECSuccess) {
@@ -386,6 +422,9 @@
 
     // Create new byte array
     jSecret = env->NewByteArray(secret_item.len);
+    if (jSecret == NULL) {
+        goto cleanup;
+    }
 
     // Copy bytes from the SECItem buffer to a Java byte array
     env->SetByteArrayRegion(jSecret, 0, secret_item.len,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/Device.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,66 @@
+package checker;
+
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.Map;
+
+/**
+ * Represents the device configuration. The values are loaded from an XML file by JAXB.
+ */
+@XmlRootElement
+public class Device {
+
+    @XmlElement()
+    private Map<Module, Integer> supportedModules = new EnumMap<>(Module.class);
+
+    /**
+     * Returns map of supported modules. The map key is module. The map value is version.
+     *
+     * @return map of supported modules.
+     */
+    public Map<Module, Integer> getSupportedModules() {
+        return Collections.unmodifiableMap(supportedModules);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/Kettle.xml	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+    - Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    - Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+    - Neither the name of Oracle nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+  This source code is provided to illustrate the usage of a given feature
+  or technique and has been deliberately simplified. Additional steps
+  required for a production-quality application, such as security checks,
+  input validation and proper error handling, might not be present in
+  this sample code.
+
+  -->
+
+<device>
+    <supportedModules>
+        <entry>
+            <key>DISPLAY</key>
+            <value>2</value>
+        </entry>
+        <entry>
+            <key>THERMOMETER</key>
+            <value>1</value>
+        </entry>
+        <entry>
+            <key>CLOCK</key>
+            <value>4</value>
+        </entry>
+    </supportedModules>
+</device>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/Module.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,49 @@
+package checker;
+
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+
+
+/**
+ * Represents available modules.
+ */
+public enum Module {
+
+    DISPLAY, CLOCK, THERMOMETER, HEATER, SPEAKER, GSM, LED;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/PluginChecker.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+package checker;
+
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.TypeElement;
+import javax.tools.Diagnostic;
+import javax.xml.bind.JAXBContext;
+import java.io.File;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.bind.JAXBException;
+
+/**
+ * Reads the device configuration from the XML file specified by -Adevice=device.xml.
+ * For each class in a project, checks required modules. If the device doesn't have
+ * the required module, then a compilation error will be shown.
+ */
+@SupportedAnnotationTypes("checker.RequireContainer")
+@SupportedSourceVersion(SourceVersion.RELEASE_8)
+public class PluginChecker extends javax.annotation.processing.AbstractProcessor {
+
+    /**
+     * Name of the option to get the path to the xml with device configuration.
+     */
+    public static final String DEVICE_OPTION = "device";
+    private Device device;
+
+    /**
+     * Only the device option is supported.
+     *
+     * {@inheritDoc}
+     */
+    @Override
+    public Set<String> getSupportedOptions() {
+        return new HashSet<>(Arrays.asList(DEVICE_OPTION));
+    }
+
+    /**
+     * Initializes the processor by loading the device configuration.
+     *
+     * {@inheritDoc}
+     */
+    @Override
+    public synchronized void init(ProcessingEnvironment processingEnv) {
+        super.init(processingEnv);
+        try {
+            String deviceOption = processingEnv.getOptions().get(DEVICE_OPTION);
+            device = (Device) JAXBContext.newInstance(Device.class)
+                    .createUnmarshaller().unmarshal(new File(deviceOption));
+        } catch (JAXBException e) {
+            throw new RuntimeException(
+                    "Please specify device by -Adevice=device.xml\n"
+                    + e.toString(), e);
+        }
+    }
+
+    /**
+     * Processes @Require annotations and checks that Device meets requirements.
+     *
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean process(Set<? extends TypeElement> annotations,
+            RoundEnvironment roundEnv) {
+        for (Element el : roundEnv.getElementsAnnotatedWith(RequireContainer.class)) {
+            for (Require req : el.getAnnotationsByType(Require.class)) {
+                //for every Require annotation checks if device has module of required version.
+                Integer version = device.getSupportedModules().get(req.value());
+
+                if (version == null
+                        || version < req.minVersion()
+                        || version > req.maxVersion()) {
+                    //if module is optional then show only warning not error
+                    if (req.optional()) {
+                        processingEnv.getMessager()
+                                .printMessage(Diagnostic.Kind.WARNING,
+                                        "Plugin [" + el + "] requires " + req
+                                        + "\n but device " + (version == null
+                                        ? "doesn't have such module."
+                                        + " This module is optional."
+                                        + " So plugin will work but miss"
+                                        + " some functionality"
+                                        : "has " + version
+                                        + " version of that module"));
+                    } else {
+                        processingEnv.getMessager()
+                                .printMessage(Diagnostic.Kind.ERROR,
+                                        "Plugin [" + el + "] requires " + req
+                                        + "\n but device "
+                                        + (version == null
+                                        ? "doesn't have such module"
+                                        : "has " + version
+                                        + " version of that module"));
+                    }
+                }
+            }
+            return true;
+        }
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/Require.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+package checker;
+
+import java.lang.annotation.Repeatable;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Indicates that a plug-in depends on a module.
+ */
+@Retention(RetentionPolicy.CLASS)
+@Repeatable(RequireContainer.class)
+public @interface Require {
+
+    /**
+     * Returns the required module.
+     *
+     * @return required module.
+     */
+    Module value();
+
+    /**
+     * Returns the minimum supported version of a module.
+     *
+     * @return minimum supported version of a module.
+     */
+    int minVersion() default 1;
+
+    /**
+     * Returns the maximum supported version of a module.
+     *
+     * @return maximum supported version of a module.
+     */
+    int maxVersion() default Integer.MAX_VALUE;
+
+    /**
+     * Returns true if a module is optional. A module is optional if a system
+     * works without that module but is missing some functionality. Returns false if a system
+     * won't work without the specified module.
+     *
+     * @return true if module is optional. False otherwise.
+     */
+    boolean optional() default false;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/RequireContainer.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,51 @@
+package checker;
+
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * A container for the repeatable @Require annotation.
+ */
+@Retention(RetentionPolicy.CLASS)
+public @interface RequireContainer {
+
+    Require[] value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/DependencyChecker/Plugins/src/plugins/BoilerPlugin.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+package plugins;
+
+import checker.Module;
+import checker.Require;
+
+/**
+ * BoilerPlugin provides support for boiling water and keeping water warm.
+ */
+@Require(value = Module.CLOCK, maxVersion = 3)
+@Require(value = Module.THERMOMETER)
+@Require(value = Module.HEATER)
+@Require(value = Module.LED, optional = true) //will use if present
+public class BoilerPlugin {
+
+    /**
+     * Heats water up to 100 degrees Celsius.
+     */
+    public void boil() {
+        boil(100);
+    }
+
+    /**
+     * Heats water up to temperature.
+     *
+     * @param temperature - desired temperature of the water in the boiler
+     */
+    public void boil(int temperature) {
+        /*
+         * Turn on heater and wait while temperature reaches desired temperature
+         * in Celsius. Finally, turn off heater.
+         * If present, the LED light changes color according to the temperature.
+         */
+    }
+
+    /**
+     * Keeps desired temperature.
+     *
+     * @param temperature - desired temperature of the water in the boiler
+     * @param seconds - period of time for checking temperature in seconds
+     */
+    public void keepWarm(int temperature, int seconds) {
+        //Every n seconds check temperature and warm up, if necessary.
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/DependencyChecker/Plugins/src/plugins/ExtendedBoilerPlugin.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+package plugins;
+
+import checker.Module;
+import checker.Require;
+import java.util.Calendar;
+
+/**
+ * Introduces new features for BoilerPlugin. Features are boiling water by an
+ * SMS and boiling water by date with notification by a phone call.
+ */
+@Require(value = Module.SPEAKER)
+@Require(value = Module.GSM, minVersion = 3)
+@Require(value = Module.DISPLAY)
+public class ExtendedBoilerPlugin extends BoilerPlugin {
+
+    /**
+     * Boils water at the appointed time and wakes you up by a ring and phone
+     * call. Shows "Good morning" and a quote of the day from the Internet on the
+     * display.
+     *
+     * @param calendar - date and time when water should be boiled
+     * @param phoneNumber - phone number to call
+     */
+    public void boilAndWakeUp(Calendar calendar, int phoneNumber) {
+        //implementation
+    }
+
+    /**
+     * Boils water at the appointed time by getting an SMS of fixed format.
+     * Sends an SMS on finish.
+     *
+     * @param sms - text of SMS
+     */
+    public void boilBySMS(String sms) {
+        //implementation
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/DependencyChecker/Plugins/src/plugins/TimerPlugin.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+package plugins;
+
+import checker.Module;
+import checker.Require;
+
+/**
+ * Timer plug-in is used to support an alarm and a timer. It depends on Display and
+ * Clock modules.
+ */
+@Require(Module.DISPLAY)
+@Require(value = Module.CLOCK, maxVersion = 3)
+public class TimerPlugin {
+
+    /**
+     * Sets timer.
+     *
+     * @param time - the remaining time.
+     */
+    public void timer(long time) {
+        //start timer
+        //show the remaining time on display
+    }
+
+    /**
+     * Sets alarm.
+     *
+     * @param time - the alarm time.
+     */
+    public void alarm(long time) {
+        //start alarm
+        //show current time and alarm time on display
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/Validator/src/PositiveIntegerSupplier.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+import java.util.function.Supplier;
+
+/**
+ * Supplies a positive number.
+ */
+@Validate(value = Validator.INTEGER_NUMBER,
+        description = "It's not an Integer ")
+@Validate(value = Validator.POSITIVE_NUMBER,
+        description = "It's not a positive Number")
+public class PositiveIntegerSupplier implements Supplier<String> {
+
+    /**
+     * Returns a string representation of a positive integer.
+     *
+     * @return string representation of a positive integer.
+     */
+    @Override
+    public String get() {
+        return "20005"; //random number
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/Validator/src/SupplierValidator.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+import javax.xml.bind.ValidationException;
+import java.util.function.Supplier;
+
+/**
+ * Validates the supplier.
+ */
+public class SupplierValidator {
+
+    /**
+     * Validates the supplier.
+     *
+     * @param supplier - Supplier that needs to be validated.
+     * @return true if supplier has passed validation check. False otherwise.
+     */
+    public static boolean validate(Supplier<?> supplier) {
+        for (Validate annotation
+                : supplier.getClass().getAnnotationsByType(Validate.class)) {
+            try {
+                annotation.value().validate(supplier);
+            } catch (ValidationException e) {
+                System.out.println(annotation.description());
+                e.printStackTrace();
+                return false;
+            }
+        }
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/Validator/src/Validate.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+import java.lang.annotation.Repeatable;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Indicates that the class should be validated by the specified validator.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(ValidateContainer.class)
+public @interface Validate {
+
+    /**
+     * Returns the validator that should validate the annotated class.
+     *
+     * @return Validator that should validate annotated class.
+     */
+    Validator value();
+
+    /**
+     * Returns text to describe the failure of the validation check.
+     *
+     * @return text to describe the failure of the validation check.
+     */
+    String description() default "";
+}
+
+/**
+ * A container for the repeatable @Validate annotation.
+ *
+ * @author Andrey Nazarov
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@interface ValidateContainer {
+
+    Validate[] value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/Validator/src/Validator.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+import javax.xml.bind.ValidationException;
+import java.util.function.Supplier;
+
+/**
+ * Enum of Validator implementations.
+ */
+public enum Validator {
+
+    /**
+     * This validator checks that the string represents an integer.
+     */
+    INTEGER_NUMBER {
+                /**
+                 * Checks that the string represents an integer.
+                 *
+                 * @param string - a string supplier
+                 * @throws ValidationException if the validation check fails
+                 */
+                @Override
+                void validate(Supplier<?> string) throws ValidationException {
+                    try {
+                        Integer.parseInt((String) string.get());
+                    } catch (NumberFormatException ex) {
+                        throw new ValidationException("Error while validating "
+                                + string.get());
+                    }
+                }
+            },
+    /**
+     * This validator checks that the string represents a positive number.
+     */
+    POSITIVE_NUMBER {
+                /**
+                 * Checks that the string represents a positive number.
+                 *
+                 * @param string - an string supplier
+                 * @throws ValidationException if the validation check fails
+                 */
+                @Override
+                void validate(Supplier<?> string) throws ValidationException {
+                    try {
+                        if (Double.compare(0.0, Double.parseDouble(
+                                        (String) string.get())) > 0) {
+                            throw new Exception();
+                        }
+                    } catch (Exception ex) {
+                        throw new ValidationException("Error while validating "
+                                + string.get());
+                    }
+                }
+            };
+
+    /**
+     * Checks that the supplier is valid.
+     *
+     * @param string - a string supplier
+     * @throws ValidationException if validation check fails
+     */
+    abstract void validate(Supplier<?> string) throws ValidationException;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/annotations/index.html	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Repeating Annotations Demo</title>
+</head>
+<body>
+<h2>Repeating Annotations Demo</h2>
+
+<p>
+    This demo shows how to use repeating annotations at runtime and at compile time.
+</p>
+
+<ul>
+    <li><h3>Dependency checker.</h3>
+
+        <p>
+            Shows how to define repeating annotations and process them at compile time.
+            The problem domain is some code that performs useful operations on hardware devices.
+            The code relies on "modules" to be present on the devices. Applicability of the code to a particular
+            device is checked while compiling the code for a particular device.
+            A set of modules provided by a device is listed in an xml file that turns red during the compilation
+            phase and is compared with the required module set specified by annotations.
+            For instance, there is kettle with hardware modules: thermometer, display, and clock.
+            There is also a boiler plug-in that requires clock, thermometer, heater, and optionally an LED light.
+
+            Build the PluginChecker annotation processor first.
+            Then, run javac with the annotation processor against plug-in sources using the following command: </p>
+
+        <code>javac -cp "PluginChecker.jar" -processor checker.PluginChecker -Adevice=Kettle.xml -proc:only &lt;source
+            files&gt;</code>
+
+        <p>
+            where <code>PluginChecker.jar</code> - path to jar file that contains PluginChecker annotation processor
+            class. </br>
+            <code>Kettle.xml</code> - path to device descriptor Kettle.xml                                         </br>
+            <code>&lt;source files&gt;</code> - source files in Plugins/src
+        </p>
+        For more information, see the source files.
+        </p>
+        <ul>
+            <li>Annotation processor sources: <a href="DependencyChecker/PluginChecker/src/">DependencyChecker/PluginChecker/src</a>
+            <li>Processing of repeating annotations can be found in <a href="DependencyChecker/PluginChecker/src/checker/PluginChecker.java">PluginChecker.java</a>
+            <li>Usage of repeating annotation is shown in modules sources.<a href="DependencyChecker/Plugins/src">DependencyChecker/Plugins/src</a>
+        </ul>
+
+    <li><h3>Validator.</h3>
+
+        <p>
+            Shows how to define repeating annotations and process them at runtime.
+            A problem domain is code that needs to validate provided Suppliers for conformance to some criteria.
+            The criteria are implemented by the Validator class which is applied by using annotations that are placed in
+            the code whenever validation is needed. For more information, see the
+            source files.
+        </p>
+
+        <p>
+        <ul>
+            <li>Usage of repeating annotation is described in <a href="Validator/src/PositiveIntegerSupplier.java">PositiveIntegerSupplier.java</a>
+            <li> Example of how to define a repeating annotation type can be found in
+                <a href="Validator/src/Validate.java">Validate.java</a>
+            <li> Usages of the new reflective methods can be found in <a href="Validator/src/SupplierValidator.java">SupplierValidator.java</a>
+        </ul>
+        </p>
+        Sources: <a href="Validator/src/">Validator/src/</a>
+</ul>
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/BulkDataOperations/index.html	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Bulk Data Operations Demo</title>
+</head>
+<body>
+<h2>Bulk Data Operations Demo</h2>
+
+<p>
+    This demo shows how to use bulk data operations with the new JDK8
+    Collections API.
+    The demo also demonstrates new features of JDK8 such as lambda expressions
+    and method/constructor references.
+</p>
+
+<ul>
+    <li><h3>CSV Processor</h3>
+
+        <p>
+            Analyzes a CSV file, finds and collects useful information, computes
+            different statistics. For more information, see the source file.
+        </p>
+        Source: <a href="src/CSVProcessor.java">src/CSVProcessor.java</a>
+    <li><h3>Grep</h3>
+
+        <p>
+            Behaves like the standard Linux tool Grep. For more information, see
+            the source file.
+        </p>
+        Source: <a href="src/Grep.java">src/Grep.java</a>
+    <li><h3>PasswordGenerator</h3>
+
+        <p>
+            Produces a password of desired length. For more information see
+            source file.
+        </p>
+        Source: <a
+                href="src/PasswordGenerator.java">src/PasswordGenerator.java</a>
+    <li><h3>WC</h3>
+
+        <p>
+            Counts newlines, words, characters, and the maximum line length of a
+            text file. For more information, see the source
+            file.
+        </p>
+        Source: <a href="src/WC.java">src/WC.java</a>
+</ul>
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/BulkDataOperations/src/CSVProcessor.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation, and proper error handling, might not be present in
+ * this sample code.
+ */
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.*;
+import java.util.function.*;
+import java.util.regex.Pattern;
+import java.util.stream.Collector;
+import java.util.stream.Collectors;
+
+import static java.lang.Double.parseDouble;
+import static java.util.stream.Collectors.*;
+
+/**
+ * CSVProcessor is a tool for processing CSV files. There are several
+ * command-line options. Consult the {@link #printUsageAndExit} method for
+ * instructions and command line parameters. This sample shows examples of the
+ * following features:
+ * <ul>
+ * <li>Lambda and bulk operations. Working with streams: map(...), filter(...),
+ * sorted(...) methods. The collect(...) method with different collectors:
+ * Collectors.maxBy(...), Collectors.minBy(...), Collectors.toList(),
+ * Collectors.toCollection(...), Collectors.groupingBy(...),
+ * Collectors.toDoubleSummaryStatistics(...), and a custom Collector.</li>
+ * <li>Static method reference for printing values.</li>
+ * <li>Try-with-resources feature for closing files.</li>
+ * <li>Switch by String feature.</li>
+ * <li>Other new APIs: Pattern.asPredicate(), BinaryOperator
+ * BufferedReader.lines(), Collection.forEach(...), Comparator.comparing(...),
+ * Comparator.reversed(), Arrays.stream(...).</li>
+ * </ul>
+ *
+ */
+public class CSVProcessor {
+
+    //Number of characters that may be read
+    private static final int READ_AHEAD_LIMIT = 100_000_000;
+
+    /**
+     * The main method for the CSVProcessor program. Run the program with an
+     * empty argument list to see possible arguments.
+     *
+     * @param args the argument list for CSVProcessor.
+     */
+    public static void main(String[] args) {
+        if (args.length < 2) {
+            printUsageAndExit();
+        }
+        try (BufferedReader br = new BufferedReader(
+                Files.newBufferedReader(Paths.get(args[args.length - 1])))) {
+            //Assume that the first line contains column names.
+            List<String> header = Arrays.stream(br.readLine().split(","))
+                    .map(String::trim).collect(toList());
+            //Calculate an index of the column in question.
+            int column = getColumnNumber(header, args[1]);
+            switch (args[0]) {
+                case "sort":
+                    verifyArgumentNumber(args, 4);
+                    //Define the sort order.
+                    boolean isAsc;
+                    switch (args[2].toUpperCase()) {
+                        case "ASC":
+                            isAsc = true;
+                            break;
+                        case "DESC":
+                            isAsc = false;
+                            break;
+                        default:
+                            printUsageAndExit("Illegal argument" + args[2]);
+                            return;//Should not be reached.
+                    }
+                    /*
+                     * Create a comparator that compares lines by comparing
+                     * values in the specified column.
+                     */
+                    Comparator<String> cmp
+                            = Comparator.comparing(str -> getCell(str, column),
+                                    String.CASE_INSENSITIVE_ORDER);
+                    /*
+                     * sorted(...) is used to sort records.
+                     * forEach(...) is used to output sorted records.
+                     */
+                    br.lines().sorted(isAsc ? cmp : cmp.reversed())
+                            .forEach(System.out::println);
+                    break;
+                case "search":
+                    verifyArgumentNumber(args, 4);
+                    /*
+                     * Records are filtered by a regex.
+                     * forEach(...) is used to output filtered records.
+                     */
+                    Predicate<String> pattern
+                            = Pattern.compile(args[2]).asPredicate();
+                    br.lines().filter(str -> pattern.test(getCell(str, column)))
+                            .forEach(System.out::println);
+                    break;
+                case "groupby":
+                    verifyArgumentNumber(args, 3);
+                    /*
+                     * Group lines by values in the column with collect(...), and
+                     * print with forEach(...) for every distinct value within
+                     * the column.
+                     */
+                    br.lines().collect(
+                            Collectors.groupingBy(str -> getCell(str, column),
+                                    toCollection(TreeSet::new)))
+                            .forEach((str, set) -> {
+                                System.out.println(str + ":");
+                                set.forEach(System.out::println);
+                            });
+                    break;
+                case "stat":
+                    verifyArgumentNumber(args, 3);
+
+                    /*
+                     * BufferedReader will be read several times.
+                     * Mark this point to return here after each pass.
+                     * BufferedReader will be read right after the headers line
+                     * because it is already read.
+                     */
+                    br.mark(READ_AHEAD_LIMIT);
+
+                    /*
+                     * Statistics can be collected by a custom collector in one
+                     * pass. One pass is preferable.
+                     */
+                    System.out.println(
+                            br.lines().collect(new Statistics(column)));
+
+                    /*
+                     * Alternatively, statistics can be collected
+                     * by a built-in API in several passes.
+                     * This method demonstrates how separate operations can be
+                     * implemented using a built-in API.
+                     */
+                    br.reset();
+                    statInSeveralPasses(br, column);
+                    break;
+                default:
+                    printUsageAndExit("Illegal argument" + args[0]);
+            }
+        } catch (IOException e) {
+            printUsageAndExit(e.toString());
+        }
+    }
+
+    private static void statInSeveralPasses(BufferedReader br, int column)
+            throws IOException {
+        System.out.println("#-----Statistics in several passes-------#");
+        //Create a comparator to compare records by the column.
+        Comparator<String> comparator
+                = Comparator.comparing(
+                        (String str) -> parseDouble(getCell(str, column)));
+        //Find max record by using Collectors.maxBy(...)
+        System.out.println(
+                "Max: " + br.lines().collect(maxBy(comparator)).get());
+        br.reset();
+        //Find min record by using Collectors.minBy(...)
+        System.out.println(
+                "Min: " + br.lines().collect(minBy(comparator)).get());
+        br.reset();
+        //Compute the average value and sum with
+        //Collectors.toDoubleSummaryStatistics(...)
+        DoubleSummaryStatistics doubleSummaryStatistics
+                = br.lines().collect(summarizingDouble(
+                    str -> parseDouble(getCell(str, column))));
+        System.out.println("Average: " + doubleSummaryStatistics.getAverage());
+        System.out.println("Sum: " + doubleSummaryStatistics.getSum());
+    }
+
+    private static void verifyArgumentNumber(String[] args, int n) {
+        if (args.length != n) {
+            printUsageAndExit("Expected " + n + " arguments but was "
+                    + args.length);
+        }
+    }
+
+    private static int getColumnNumber(List<String> header, String name) {
+        int column = header.indexOf(name);
+        if (column == -1) {
+            printUsageAndExit("There is no column with name " + name);
+        }
+        return column;
+    }
+
+    private static String getCell(String record, int column) {
+        return record.split(",")[column].trim();
+    }
+
+    private static void printUsageAndExit(String... str) {
+        System.out.println("Usages:");
+
+        System.out.println("CSVProcessor sort COLUMN_NAME ASC|DESC FILE");
+        System.out.println("Sort lines by column COLUMN_NAME in CSV FILE\n");
+
+        System.out.println("CSVProcessor search COLUMN_NAME REGEX FILE");
+        System.out.println("Search for REGEX in column COLUMN_NAME in CSV FILE\n");
+
+        System.out.println("CSVProcessor groupby COLUMN_NAME FILE");
+        System.out.println("Split lines into different groups according to column "
+                + "COLUMN_NAME value\n");
+
+        System.out.println("CSVProcessor stat COLUMN_NAME FILE");
+        System.out.println("Compute max/min/average/sum  statistics by column "
+                + "COLUMN_NAME\n");
+
+        Arrays.asList(str).forEach(System.err::println);
+        System.exit(1);
+    }
+
+    /*
+     * This is a custom implementation of the Collector interface.
+     * Statistics are objects gather max,min,sum,average statistics.
+     */
+    private static class Statistics
+            implements Collector<String, Statistics, Statistics> {
+
+
+        /*
+         * This implementation does not need to be thread safe because
+         * the parallel implementation of
+         * {@link java.util.stream.Stream#collect Stream.collect()}
+         * provides the necessary partitioning and isolation for safe parallel
+         * execution.
+         */
+        private String maxRecord;
+        private String minRecord;
+
+        private double sum;
+        private int lineCount;
+        private final BinaryOperator<String> maxOperator;
+        private final BinaryOperator<String> minOperator;
+        private final int column;
+
+        public Statistics(int column) {
+            this.column = column;
+            Comparator<String> cmp = Comparator.comparing(
+                    (String str) -> parseDouble(getCell(str, column)));
+            maxOperator = BinaryOperator.maxBy(cmp);
+            minOperator = BinaryOperator.minBy(cmp);
+        }
+
+        /*
+         * Process line.
+         */
+        public Statistics accept(String line) {
+            maxRecord = maxRecord == null
+                    ? line : maxOperator.apply(maxRecord, line);
+            minRecord = minRecord == null
+                    ? line : minOperator.apply(minRecord, line);
+
+            sum += parseDouble(getCell(line, column));
+            lineCount++;
+            return this;
+        }
+
+
+        /*
+         * Merge two Statistics.
+         */
+        public Statistics combine(Statistics stat) {
+            maxRecord = maxOperator.apply(maxRecord, stat.getMaxRecord());
+            minRecord = minOperator.apply(minRecord, stat.getMinRecord());
+            sum += stat.getSum();
+            lineCount += stat.getLineCount();
+            return this;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("#------Statistics------#\n");
+            sb.append("Max: ").append(getMaxRecord()).append("\n");
+            sb.append("Min: ").append(getMinRecord()).append("\n");
+            sb.append("Sum = ").append(getSum()).append("\n");
+            sb.append("Average = ").append(average()).append("\n");
+            sb.append("#------Statistics------#\n");
+            return sb.toString();
+        }
+
+        @Override
+        public Supplier<Statistics> supplier() {
+            return () -> new Statistics(column);
+        }
+
+        @Override
+        public BiConsumer<Statistics, String> accumulator() {
+            return Statistics::accept;
+        }
+
+        @Override
+        public BinaryOperator<Statistics> combiner() {
+            return Statistics::combine;
+
+        }
+
+        @Override
+        public Function<Statistics, Statistics> finisher() {
+            return stat -> stat;
+        }
+
+        @Override
+        public Set<Characteristics> characteristics() {
+            return EnumSet.of(Characteristics.IDENTITY_FINISH);
+        }
+
+        private String getMaxRecord() {
+            return maxRecord;
+        }
+
+        private String getMinRecord() {
+            return minRecord;
+        }
+
+        private double getSum() {
+            return sum;
+        }
+
+        private double average() {
+            return sum / lineCount;
+        }
+
+        private int getLineCount() {
+            return lineCount;
+        }
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/BulkDataOperations/src/Grep.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation, and proper error handling, might not be present in
+ * this sample code.
+ */
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.List;
+import java.util.regex.Pattern;
+import java.util.stream.Stream;
+
+import static java.util.stream.Collectors.toList;
+
+/**
+ * Grep prints lines matching a regex. See {@link #printUsageAndExit(String...)}
+ * method for instructions and command line parameters. This sample shows
+ * examples of using next features:
+ * <ul>
+ * <li>Lambda and bulk operations. Working with streams:
+ * map(...),filter(...),flatMap(...),limit(...) methods.</li>
+ * <li>Static method reference for printing values.</li>
+ * <li>New Collections API forEach(...) method.</li>
+ * <li>Try-with-resources feature.</li>
+ * <li>new Files.walk(...), Files.lines(...) API.</li>
+ * <li>Streams that need to be closed.</li>
+ * </ul>
+ *
+ */
+public class Grep {
+
+    private static void printUsageAndExit(String... str) {
+        System.out.println("Usage: " + Grep.class.getSimpleName()
+                + " [OPTION]... PATTERN FILE...");
+        System.out.println("Search for PATTERN in each FILE. "
+                + "If FILE is a directory then whole file tree of the directory"
+                + " will be processed.");
+        System.out.println("Example: grep -m 100 'hello world' menu.h main.c");
+        System.out.println("Options:");
+        System.out.println("    -m NUM: stop analysis after NUM matches");
+        Arrays.asList(str).forEach(System.err::println);
+        System.exit(1);
+    }
+
+    /**
+     * The main method for the Grep program. Run program with empty argument
+     * list to see possible arguments.
+     *
+     * @param args the argument list for Grep.
+     * @throws java.io.IOException If an I/O error occurs.
+     */
+    public static void main(String[] args) throws IOException {
+        long maxCount = Long.MAX_VALUE;
+        if (args.length < 2) {
+            printUsageAndExit();
+        }
+        int i = 0;
+        //parse OPTIONS
+        while (args[i].startsWith("-")) {
+            switch (args[i]) {
+                case "-m":
+                    try {
+                        maxCount = Long.parseLong(args[++i]);
+                    } catch (NumberFormatException ex) {
+                        printUsageAndExit(ex.toString());
+                    }
+                    break;
+                default:
+                    printUsageAndExit("Unexpected option " + args[i]);
+            }
+            i++;
+        }
+        //parse PATTERN
+        Pattern pattern = Pattern.compile(args[i++]);
+        if (i == args.length) {
+            printUsageAndExit("There are no files for input");
+        }
+
+        try {
+            /*
+            * First obtain the list of all paths.
+            * For a small number of arguments there is little to be gained
+            * by producing this list in parallel. For one argument
+            * there will be no parallelism.
+            *
+            * File names are converted to paths. If a path is a directory then
+            * Stream is populated with whole file tree of the directory by
+            * flatMap() method. Files are filtered from directories.
+            */
+            List<Path> files = Arrays.stream(args, i, args.length)
+                    .map(Paths::get)
+                    // flatMap will ensure each I/O-based stream will be closed
+                    .flatMap(Grep::getPathStream)
+                    .filter(Files::isRegularFile)
+                    .collect(toList());
+            /*
+            * Then operate on that list in parallel.
+            * This is likely to give a more even distribution of work for
+            * parallel execution.
+            *
+            * Lines are extracted from files. Lines are filtered by pattern.
+            * Stream is limited by number of matches. Each remaining string is
+            * displayed in std output by method reference System.out::println.
+            */
+            files.parallelStream()
+                    // flatMap will ensure each I/O-based stream will be closed
+                    .flatMap(Grep::path2Lines)
+                    .filter(pattern.asPredicate())
+                    .limit(maxCount)
+                    .forEachOrdered(System.out::println);
+        } catch (UncheckedIOException ioe) {
+            printUsageAndExit(ioe.toString());
+        }
+    }
+
+    /**
+     * Flattens file system hierarchy into a stream. This code is not inlined
+     * for the reason of Files.walk() throwing a checked IOException that must
+     * be caught.
+     *
+     * @param path - the file or directory
+     * @return Whole file tree starting from path, a stream with one element -
+     * the path itself - if it is a file.
+     */
+    private static Stream<Path> getPathStream(Path path) {
+        try {
+            return Files.walk(path);
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+
+    /**
+     * Produces a stream of lines from a file. The result is a stream in order
+     * to close it later. This code is not inlined for the reason of
+     * Files.lines() throwing a checked IOException that must be caught.
+     *
+     * @param path - the file to read
+     * @return stream of lines from the file
+     */
+    private static Stream<String> path2Lines(Path path) {
+        try {
+            return Files.lines(path);
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/BulkDataOperations/src/PasswordGenerator.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation, and proper error handling, might not be present in
+ * this sample code.
+ */
+
+import java.security.SecureRandom;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.IntStream;
+
+/**
+ * Generates password of desired length. See {@link #usage} method
+ * for instructions and command line parameters. This sample shows usages of:
+ * <ul>
+ * <li>Method references.</li>
+ * <li>Lambda and bulk operations. A stream of random integers is mapped to
+ * chars, limited by desired length and printed in standard output as password
+ * string.</li>
+ * </ul>
+ *
+ */
+public class PasswordGenerator {
+
+    private static void usage() {
+        System.out.println("Usage: PasswordGenerator LENGTH");
+        System.out.println(
+                "Password Generator produces password of desired LENGTH.");
+    }
+
+    private static final List<Integer> PASSWORD_CHARS = new ArrayList<>();
+
+    //Valid symbols.
+    static {
+        IntStream.rangeClosed('0', '9').forEach(PASSWORD_CHARS::add);    // 0-9
+        IntStream.rangeClosed('A', 'Z').forEach(PASSWORD_CHARS::add);    // A-Z
+        IntStream.rangeClosed('a', 'z').forEach(PASSWORD_CHARS::add);    // a-z
+    }
+
+    /**
+     * The main method for the PasswordGenerator program. Run program with empty
+     * argument list to see possible arguments.
+     *
+     * @param args the argument list for PasswordGenerator.
+     */
+    public static void main(String[] args) {
+
+        if (args.length != 1) {
+            usage();
+            return;
+        }
+
+        long passwordLength;
+        try {
+            passwordLength = Long.parseLong(args[0]);
+            if (passwordLength < 1) {
+                printMessageAndUsage("Length has to be positive");
+                return;
+            }
+        } catch (NumberFormatException ex) {
+            printMessageAndUsage("Unexpected number format" + args[0]);
+            return;
+        }
+        /*
+         * Stream of random integers is created containing Integer values
+         * in range from 0 to PASSWORD_CHARS.size().
+         * The stream is limited by passwordLength.
+         * Valid chars are selected by generated index.
+         */
+        new SecureRandom().ints(passwordLength, 0, PASSWORD_CHARS.size())
+                .map(PASSWORD_CHARS::get)
+                .forEach(i -> System.out.print((char) i));
+    }
+
+    private static void printMessageAndUsage(String message) {
+        System.err.println(message);
+        usage();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/BulkDataOperations/src/WC.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation, and proper error handling, might not be present in
+ * this sample code.
+ */
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.function.Consumer;
+import java.util.regex.Pattern;
+
+/**
+ * WC - Prints newline, word, and character counts for each file. See
+ * the {@link #usage} method for instructions and command line parameters. This
+ * sample shows usages of:
+ * <ul>
+ * <li>Lambda and bulk operations. Shows how to create a custom collector to
+ * gather custom statistics. Implements the collection of statistics using a
+ * built-in API.</li>
+ * <li>Constructor reference.</li>
+ * <li>Try-with-resources feature.</li>
+ * </ul>
+ *
+ */
+public class WC {
+
+    //The number of characters that may be read.
+    private static final int READ_AHEAD_LIMIT = 100_000_000;
+
+    //The pattern for splitting strings by non word characters to get words.
+    private static final Pattern nonWordPattern = Pattern.compile("\\W");
+
+    /**
+     * The main method for the WC program. Run the program with an empty
+     * argument list to see possible arguments.
+     *
+     * @param args the argument list for WC
+     * @throws java.io.IOException If an input exception occurred.
+     */
+    public static void main(String[] args) throws IOException {
+
+        if (args.length != 1) {
+            usage();
+            return;
+        }
+
+        try (BufferedReader reader = new BufferedReader(
+                new FileReader(args[0]))) {
+            reader.mark(READ_AHEAD_LIMIT);
+            /*
+             * Statistics can be gathered in four passes using a built-in API.
+             * The method demonstrates how separate operations can be
+             * implemented using a built-in API.
+             */
+            collectInFourPasses(reader);
+            /*
+             * Usage of several passes to collect data is not the best way.
+             * Statistics can be gathered by a custom collector in one pass.
+             */
+            reader.reset();
+            collectInOnePass(reader);
+        } catch (FileNotFoundException e) {
+            usage();
+            System.err.println(e);
+        }
+    }
+
+    private static void collectInFourPasses(BufferedReader reader)
+            throws IOException {
+        /*
+         * Input is read as a stream of lines by lines().
+         * Every line is turned into a stream of chars by the flatMapToInt(...)
+         * method.
+         * Length of the stream is counted by count().
+         */
+        System.out.println("Character count = "
+                + reader.lines().flatMapToInt(String::chars).count());
+        /*
+         * Input is read as a stream of lines by lines().
+         * Every line is split by nonWordPattern into words by flatMap(...)
+         * method.
+         * Empty lines are removed by the filter(...) method.
+         * Length of the stream is counted by count().
+         */
+        reader.reset();
+        System.out.println("Word count = "
+                + reader.lines()
+                .flatMap(nonWordPattern::splitAsStream)
+                .filter(str -> !str.isEmpty()).count());
+
+        reader.reset();
+        System.out.println("Newline count = " + reader.lines().count());
+        /*
+         * Input is read as a stream of lines by lines().
+         * Every line is mapped to its length.
+         * Maximum of the lengths is calculated.
+         */
+        reader.reset();
+        System.out.println("Max line length = "
+                + reader.lines().mapToInt(String::length).max().getAsInt());
+    }
+
+    private static void collectInOnePass(BufferedReader reader) {
+        /*
+         * The collect() method has three parameters:
+         * The first parameter is the {@code WCStatistic} constructor reference.
+         * collect() will create {@code WCStatistics} instances, where
+         * statistics will be aggregated.
+         * The second parameter shows how {@code WCStatistics} will process
+         * String.
+         * The third parameter shows how to merge two {@code WCStatistic}
+         * instances.
+         *
+         * Also {@code Collector} can be used, which would be more reusable
+         * solution. See {@code CSVProcessor} example for how {@code Collector}
+         * can be implemented.
+         *
+         * Note that the any performance increase when going parallel will
+         * depend on the size of the input (lines) and the cost per-element.
+         */
+        WCStatistics wc = reader.lines().parallel()
+                .collect(WCStatistics::new,
+                        WCStatistics::accept,
+                        WCStatistics::combine);
+        System.out.println(wc);
+    }
+
+    private static void usage() {
+        System.out.println("Usage: " + WC.class.getSimpleName() + " FILE");
+        System.out.println("Print newline, word,"
+                + "  character counts and max line length for FILE.");
+    }
+
+    private static class WCStatistics implements Consumer<String> {
+        /*
+         * @implNote This implementation does not need to be thread safe because
+         * the parallel implementation of
+         * {@link java.util.stream.Stream#collect Stream.collect()}
+         * provides the necessary partitioning and isolation for safe parallel
+         * execution.
+         */
+
+        private long characterCount;
+        private long lineCount;
+        private long wordCount;
+        private long maxLineLength;
+
+
+        /*
+         * Processes line.
+         */
+        @Override
+        public void accept(String line) {
+            characterCount += line.length();
+            lineCount++;
+            wordCount += nonWordPattern.splitAsStream(line)
+                    .filter(str -> !str.isEmpty()).count();
+            maxLineLength = Math.max(maxLineLength, line.length());
+        }
+
+        /*
+         * Merges two WCStatistics.
+         */
+        public void combine(WCStatistics stat) {
+            wordCount += stat.wordCount;
+            lineCount += stat.lineCount;
+            characterCount += stat.characterCount;
+            maxLineLength = Math.max(maxLineLength, stat.maxLineLength);
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("#------WCStatistic------#\n");
+            sb.append("Character count = ").append(characterCount).append('\n');
+            sb.append("Word count = ").append(wordCount).append('\n');
+            sb.append("Newline count = ").append(lineCount).append('\n');
+            sb.append("Max line length = ").append(maxLineLength).append('\n');
+            return sb.toString();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/DefaultMethods/ArrayIterator.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * The code sample illustrates the usage of default methods in the JDK 8. Most
+ * implementations of {@link Iterator} don't provide a useful
+ * {@link Iterator#remove()} method, however,
+ * they still have to implement this method to throw
+ * an UnsupportedOperationException. With the default method, the same
+ * default behavior in interface Iterator itself can be provided.
+ */
+public class ArrayIterator {
+
+    /** Close the constructor because ArrayIterator is part of the utility
+     * class.
+     */
+    protected ArrayIterator() {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Returns an iterator that goes over the elements in the array.
+     *
+     * @param <E> type of an array element
+     * @param array source array to iterate over it
+     * @return an iterator that goes over the elements in the array
+     */
+    public static <E> Iterator<E> iterator(final E[] array) {
+        return new Iterator<E>() {
+            /**
+             * Index of the current position
+             *
+             */
+            private int index = 0;
+
+            /**
+             * Returns the next element in the iteration
+             *
+             * @return the next element in the iteration
+             * @throws NoSuchElementException if the iteration has no more
+             * elements
+             */
+            @Override
+            public boolean hasNext() {
+                return (index < array.length);
+            }
+
+            /**
+             * Returns {@code true} if the iteration has more elements. (In
+             * other words, returns {@code true} if {@link #next} returns
+             * an element, rather than throwing an exception.)
+             *
+             * @return {@code true} if the iteration has more elements
+             */
+            @Override
+            public E next() {
+                if (!hasNext()) {
+                    throw new NoSuchElementException();
+                }
+                return array[index++];
+            }
+
+            /**
+             * This method does not need to be overwritten in JDK 8.
+             */
+            //@Override
+            //public void remove() {
+            //    throw UnsupportedOperationException(
+            //            "Arrays don't support remove.")
+            //}
+        };
+    }
+
+    /**
+     * Sample usage of the ArrayIterator
+     *
+     * @param args command-line arguments
+     */
+    public static void main(final String[] args) {
+        Iterator<String> it = ArrayIterator.iterator(
+                new String[]{"one", "two", "three"});
+
+        while (it.hasNext()) {
+            System.out.println(it.next());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/DefaultMethods/DiamondInheritance.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * This sample diamond interface inheritance with <b>default methods</b>.
+ * If there's not already a unique method implementation to inherit,
+ * you must provide it. The inheritance diagram is similar to the following:
+ * <pre>
+ *                   Animal
+ *                    /   \
+ *                 Horse   Bird
+ *                    \   /
+ *                   Pegasus
+ * </pre>
+ *
+ * Both {@link Horse} and {@link Bird} interfaces implements the <code>go</code>
+ * method. The {@link Pegasus} class have to overrides the
+ * <code>go</code> method.
+ *
+ * The new syntax of super-call is used here:
+ * <pre>
+ *     &lt;interface_name&gt;.super.&lt;method&gt;(...);
+ *     For example:  Horse.super.go();
+ * </pre> So, Pegasus moves like a horse.
+ */
+public class DiamondInheritance {
+
+    /**
+     * Base interface to illustrate the diamond inheritance.
+     *
+     * @see DiamondInheritance
+     */
+    public interface Animal {
+
+        /**
+         * Return string representation of the "go" action for concrete animal
+         *
+         * @return string representation of the "go" action for concrete animal
+         */
+        String go();
+    }
+
+    /**
+     * Interface to illustrate the diamond inheritance.
+     *
+     * @see DiamondInheritance
+     */
+    public interface Horse extends Animal {
+
+        /**
+         * Return string representation of the "go" action for horse
+         *
+         * @return string representation of the "go" action for horse
+         */
+        @Override
+        default String go() {
+            return this.getClass().getSimpleName() + " walks on four legs";
+        }
+    }
+
+    /**
+     * Interface to illustrate the diamond inheritance.
+     *
+     * @see DiamondInheritance
+     */
+    public interface Bird extends Animal {
+
+        /**
+         * Return string representation of the "go" action for bird
+         *
+         * @return string representation of the "go" action for bird
+         */
+        @Override
+        default String go() {
+            return this.getClass().getSimpleName() + " walks on two legs";
+        }
+
+        /**
+         * Return string representation of the "fly" action for bird
+         *
+         * @return string representation of the "fly" action for bird
+         */
+        default String fly() {
+            return "I can fly";
+        }
+    }
+
+    /**
+     * Class to illustrate the diamond inheritance. Pegasus must mix horse and
+     * bird behavior.
+     *
+     * @see DiamondInheritance
+     */
+    public static class Pegasus implements Horse, Bird {
+
+        /**
+         * Return string representation of the "go" action for the fictitious
+         * creature Pegasus
+         *
+         * @return string representation of the "go" action for the fictitious
+         * creature Pegasus
+         */
+        @Override
+        public String go() {
+            return Horse.super.go();
+        }
+    }
+
+    /**
+     * Illustrate the behavior of the {@link Pegasus} class
+     *
+     * @param args command line arguments
+     */
+    public static void main(final String[] args) {
+        System.out.println(new Pegasus().go());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/DefaultMethods/Inheritance.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * The sample illustrates rules to resolve conflicts between inheritance
+ * candidates with <b>default methods</b>. There are two simple rules:
+ * <ul>
+ * <li>Class wins. If the superclass has a concrete or abstract declaration of
+ * this method, then it is preferred over all defaults.</li>
+ * <li>Subtype wins. If an interface extends another interface, and both provide
+ * a default, then the more specific interface wins. </li>
+ * </ul>
+ */
+public class Inheritance {
+
+    /**
+     * The behavior of an creature that can swim
+     */
+    public interface Swimable {
+
+        /**
+         * Return string representation of the swim action for a creature that
+         * can swim
+         *
+         * @return string representation of the swim action for a creature
+         * that can swim
+         */
+        default String swim() {
+            return "I can swim.";
+        }
+    }
+
+    /**
+     * The abstract class that overrides {@link #swim} method
+     */
+    public abstract static class Fish implements Swimable {
+
+        /**
+         * Return string representation of the swim action for a fish
+         *
+         * @return string representation of the swim action for a fish
+         */
+        @Override
+        public String swim() {
+            return this.getClass().getSimpleName() + " swims under water";
+        }
+    }
+
+    /**
+     * This class is used for the illustration rule of 1. See the source code
+     * of the {@link #main} method.
+     * <pre>
+     *      System.out.println(new Tuna().swim()); //"Tuna swims under water" output is suspected here
+     * </pre>
+     */
+    public static class Tuna extends Fish implements Swimable {
+    }
+
+    /**
+     * The behavior of an creature that can dive: the interface that overrides
+     * {@link #swim} method (subtype of {@link Swimable})
+     */
+    public interface Diveable extends Swimable {
+
+        /**
+         * Return string representation of the swim action for a creature that
+         * can dive
+         *
+         * @return string representation of the swim action for a creature
+         * that can dive
+         */
+        @Override
+        default String swim() {
+            return "I can swim on the surface of the water.";
+        }
+
+        /**
+         * Return string representation of the dive action for a creature that
+         * can dive
+         *
+         * @return string representation of the dive action for a creature
+         * that can dive
+         */
+        default String dive() {
+            return "I can dive.";
+        }
+    }
+
+    /**
+     * This class is used for the illustration of rule 2. See the source code
+     * of the {@link #main} method
+     * <pre>
+     *      //"I can swim on the surface of the water." output is suspected here
+     *      System.out.println(new Duck().swim());
+     * </pre>
+     */
+    public static class Duck implements Swimable, Diveable {
+    }
+
+    /**
+     * Illustrate behavior of the classes: {@link Tuna} and {@link Duck}
+     *
+     * @param args command line arguments
+     */
+    public static void main(final String[] args) {
+        // Illustrates rule 1. The Fish.swim() implementation wins
+        //"Tuna swims under water" is output
+        System.out.println(new Tuna().swim());
+
+        // Illustrates rule 2. The Diveable.swim() implementation wins
+        //"I can swim on the surface of the water." is output
+        System.out.println(new Duck().swim());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/DefaultMethods/MixIn.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+/**
+ * The example illustrates how to use the default method for mixin.
+ * @see BuildType
+ * @see Debuggable
+ */
+public class MixIn {
+
+    /**
+     * Implement this interface for a class that must be in debug print
+     */
+    public interface Debuggable {
+
+        /**
+         * Print the class name and all fields to a string. Uses reflection to
+         * obtain and access fields of this object.
+         *
+         * @return the string formatted like the following: <pre>
+         * State of the: &lt;Class Name&gt;
+         * &lt;member name&gt; : &lt;value&gt;
+         * ...
+         * </pre>
+         */
+        default String toDebugString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("State of the: ").append(
+                    this.getClass().getSimpleName()).append("\n");
+            for (Class cls = this.getClass();
+                    cls != null;
+                    cls = cls.getSuperclass()) {
+                for (Field f : cls.getDeclaredFields()) {
+                    try {
+                        f.setAccessible(true);
+                        sb.append(f.getName()).append(" : ").
+                                append(f.get(this)).append("\n");
+                    } catch (IllegalAccessException e) {
+                    }
+                }
+            }
+            return sb.toString();
+        }
+    }
+
+    /**
+     * Sample exception class to demonstrate mixin. This enum inherits the
+     * behavior of the {@link Debuggable}
+     */
+    public static enum BuildType implements Debuggable {
+
+        BUILD(0, "-build"),
+        PLAN(0, "-plan"),
+        EXCLUDE(1, "-exclude"),
+        TOTAL(2, "-total");
+
+        private final int compareOrder;
+        private final String pathSuffix;
+
+        private BuildType(int compareOrder, String pathSuffix) {
+            this.compareOrder = compareOrder;
+            this.pathSuffix = pathSuffix;
+        }
+
+        public int getCompareOrder() {
+            return compareOrder;
+        }
+
+        public String getPathSuffix() {
+            return pathSuffix;
+        }
+    }
+
+    /**
+     * Illustrate the behavior of the MixClass
+     *
+     * @param args command-line arguments
+     * @throws java.io.IOException internal demo error
+     */
+    public static void main(final String[] args) throws IOException {
+        System.out.println(BuildType.BUILD.toDebugString());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/DefaultMethods/Reflection.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.stream.Stream;
+
+/**
+ * The code sample illustrates changes in the reflection API linked
+ * <b>default methods</b>. Since Java SE 8, a new method is added into the class
+ * <b><code>java.lang.reflect.Method</code></b>, with which you can reflectively
+ * determine whether or not a default method provided by an interface
+ * (<b><code>Method.isDefault()</code></b>).
+ */
+public class Reflection {
+
+    /**
+     * Base interface to illustrate the new reflection API.
+     *
+     * @see Dog
+     */
+    public interface Animal {
+
+        /**
+         * Return string representation of the eat action for Animal
+         *
+         * @return string representation of the eat action for Animal
+         */
+        default String eat() {
+            return this.getClass().getSimpleName()
+                    + " eats like an ordinary animal";
+        }
+
+        /**
+         * Return string representation of the sleep action for Animal
+         *
+         * @return string representation of the sleep action for Animal
+         */
+        default String sleep() {
+            return this.getClass().getSimpleName()
+                    + " sleeps like an ordinary animal";
+        }
+
+        /**
+         * Return string representation of the go action for Animal
+         *
+         * @return string representation of the go action for Animal
+         */
+        String go();
+    }
+
+    /**
+     * Dog class to illustrate the new reflection API. You can see that:
+     * <ul>
+     * <li> the {@link #go} and {@link #sleep} methods are not default.
+     * {@link #go} is not the default implementation and the {@link #sleep}
+     * method implementation wins as subtype (according with {@link Inheritance}
+     * rule. 2) </li>
+     * <li> the {@link #eat} is a simple default method that is not overridden
+     * in this class.
+     * </li>
+     * </ul>
+     */
+    public static class Dog implements Animal {
+
+        /**
+         * Return string representation of the go action for Dog
+         *
+         * @return string representation of the go action for Dog
+         */
+        @Override
+        public String go() {
+            return "Dog walks on four legs";
+        }
+
+        /**
+         * Return string representation of the sleep action for Dog
+         *
+         * @return string representation of the sleep action for Dog
+         */
+        @Override
+        public String sleep() {
+            return "Dog sleeps";
+        }
+    }
+
+    /**
+     * Illustrate the usage of the method java.lang.reflect.Method.isDefault()
+     *
+     * @param args command-line arguments
+     * @throws NoSuchMethodException internal demo error
+     */
+    public static void main(final String[] args) throws NoSuchMethodException {
+        Dog dog = new Dog();
+        Stream.of(Dog.class.getMethod("eat"), Dog.class.getMethod("go"), Dog.class.getMethod("sleep"))
+                .forEach((m) -> {
+                    System.out.println("Method name:   " + m.getName());
+                    System.out.println("    isDefault: " + m.isDefault());
+                    System.out.print("    invoke:    ");
+                    try {
+                        m.invoke(dog);
+                    } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
+                    }
+                    System.out.println();
+                });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/lambda/DefaultMethods/SimplestUsage.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * The sample illustrates the simplest use case of the <b>default methods</b>.
+ */
+public class SimplestUsage {
+
+    /**
+     * The Animal interface provides the default implementation
+     * of the {@link #eat} method.
+     */
+    public interface Animal {
+
+        /**
+         * Return string representation of the eat action for Animal
+         *
+         * @return string representation of the eat action for Animal
+         */
+        default String eat() {
+            return this.getClass().getSimpleName()
+                    + " eats like an ordinary animal";
+        }
+    }
+
+    /**
+     * The Dog class doesn't have its own implementation of the {@link #eat}
+     * method and uses the default implementation.
+     */
+    public static class Dog implements Animal {
+    }
+
+    /**
+     * The Mosquito class implements {@link #eat} method, its own implementation
+     * overrides the default implementation.
+     *
+     */
+    public static class Mosquito implements Animal {
+
+        /**
+         * Return string representation of the eat action for Mosquito
+         *
+         * @return string representation of the eat action for Mosquito
+         */
+        @Override
+        public String eat() {
+            return "Mosquito consumes blood";
+        }
+    }
+
+    /**
+     * Illustrate behavior of the classes: {@link Dog} and {@link Mosquito}
+     *
+     * @param args command-line arguments
+     */
+    public static void main(String[] args) {
+        // "Dog eats like an ordinary animal" is output
+        System.out.println(new Dog().eat());
+
+        // "Mosquito consumes blood" is output
+        System.out.println(new Mosquito().eat());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/try-with-resources/index.html	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <title>Try-with-Resources Feature Demo</title>
+</head>
+<body>
+<h2>Try-with-Resources Feature Demo</h2>
+
+<p>
+    This demo shows how to use the try-with-resources feature introduced in JDK7.
+</p>
+
+<ul>
+    <li><h3>Custom AutoCloseable.</h3>
+
+        <p>
+            Shows how to use a custom resource with the try-with-resources construct.
+            For more information, see the source file.
+        </p>
+        Source: <a href="src/CustomAutoCloseableSample.java">src/CustomAutoCloseableSample.java</a>
+
+    <li><h3>Unzip</h3>
+
+        <p>
+            Extracts archived files. For more information, see the source file.
+        </p>
+        Source: <a href="src/Unzip.java">src/Unzip.java</a>
+    <li><h3>ZipCat</h3>
+
+        <p>Prints data about a specified file from an archive. For more information, see the source file.</p>
+        Source: <a href="src/ZipCat.java">src/ZipCat.java</a>
+
+</ul>
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/try-with-resources/src/CustomAutoCloseableSample.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation, and proper error handling, might not be present in
+ * this sample code.
+ */
+
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * This sample demonstrates the ability to create custom resource that
+ * implements the {@code AutoCloseable} interface. This resource can be used in
+ * the try-with-resources construct.
+ */
+public class CustomAutoCloseableSample {
+
+    /**
+     * The main method for the CustomAutoCloseableSample program.
+     *
+     * @param args is not used.
+     */
+    public static void main(String[] args) {
+        /*
+         * TeeStream will be closed automatically after the try block.
+         */
+        try (TeeStream teeStream = new TeeStream(System.out, Paths.get("out.txt"));
+             PrintStream out = new PrintStream(teeStream)) {
+            out.print("Hello, world");
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    /**
+     * Passes the output through to the specified output stream while copying it into a file.
+     * The TeeStream functionality is similar to the Unix tee utility.
+     * TeeStream implements AutoCloseable interface. See OutputStream for details.
+     */
+    public static class TeeStream extends OutputStream {
+
+        private final OutputStream fileStream;
+        private final OutputStream outputStream;
+
+        /**
+         * Creates a TeeStream.
+         *
+         * @param outputStream an output stream.
+         * @param outputFile   an path to file.
+         * @throws IOException If an I/O error occurs.
+         */
+        public TeeStream(OutputStream outputStream, Path outputFile) throws IOException {
+            this.fileStream = new BufferedOutputStream(Files.newOutputStream(outputFile));
+            this.outputStream = outputStream;
+        }
+
+        /**
+         * Writes the specified byte to the specified output stream
+         * and copies it to the file.
+         *
+         * @param b the byte to be written.
+         * @throws IOException If an I/O error occurs.
+         */
+        @Override
+        public void write(int b) throws IOException {
+            fileStream.write(b);
+            outputStream.write(b);
+        }
+
+        /**
+         * Flushes this output stream and forces any buffered output bytes
+         * to be written out.
+         * The <code>flush</code> method of <code>TeeStream</code> flushes
+         * the specified output stream and the file output stream.
+         *
+         * @throws IOException if an I/O error occurs.
+         */
+        @Override
+        public void flush() throws IOException {
+            outputStream.flush();
+            fileStream.flush();
+        }
+
+        /**
+         * Closes underlying streams and resources.
+         * The external output stream won't be closed.
+         * This method is the member of AutoCloseable interface and
+         * it will be invoked automatically after the try-with-resources block.
+         *
+         * @throws IOException If an I/O error occurs.
+         */
+        @Override
+        public void close() throws IOException {
+            try (OutputStream file = fileStream) {
+                flush();
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/try-with-resources/src/Unzip.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation, and proper error handling, might not be present in
+ * this sample code.
+ */
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.*;
+
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+
+/**
+ * Extract (unzip) a file to the current directory.
+ */
+public class Unzip {
+
+    /**
+     * The main method for the Unzip program. Run the program with an empty
+     * argument list to see possible arguments.
+     *
+     * @param args the argument list for {@code Unzip}.
+     */
+    public static void main(String[] args) {
+        if (args.length != 1) {
+            System.out.println("Usage: Unzip zipfile");
+        }
+        final Path destDir = Paths.get(".");
+        /*
+         * Create AutoCloseable FileSystem. It will be closed automatically
+         * after the try block.
+         */
+        try (FileSystem zipFileSystem = FileSystems.newFileSystem(Paths.get(args[0]), null)) {
+
+            Path top = zipFileSystem.getPath("/");
+            Files.walk(top).skip(1).forEach(file -> {
+                Path target = destDir.resolve(top.relativize(file).toString());
+                System.out.println("Extracting " + target);
+                try {
+                    Files.copy(file, target, REPLACE_EXISTING);
+                } catch (IOException e) {
+                    throw new UncheckedIOException(e);
+                }
+            });
+        } catch (UncheckedIOException | IOException e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/sample/try-with-resources/src/ZipCat.java	Tue Feb 04 16:24:39 2014 -0800
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation, and proper error handling, might not be present in
+ * this sample code.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+/**
+ * Prints data of the specified file to standard output from a zip archive.
+ */
+public class ZipCat {
+
+    /**
+     * The main method for the ZipCat program. Run the program with an empty
+     * argument list to see possible arguments.
+     *
+     * @param args the argument list for ZipCat
+     */
+    public static void main(String[] args) {
+        if (args.length != 2) {
+            System.out.println("Usage: ZipCat zipfile fileToPrint");
+        }
+        /*
+         * Creates AutoCloseable FileSystem and BufferedReader.
+         * They will be closed automatically after the try block.
+         * If reader initialization fails, then zipFileSystem will be closed
+         * automatically.
+         */
+        try (FileSystem zipFileSystem
+                = FileSystems.newFileSystem(Paths.get(args[0]),null);
+                InputStream input
+                = Files.newInputStream(zipFileSystem.getPath(args[1]))) {
+                    byte[] buffer = new byte[1024];
+                    int len;
+                    while ((len = input.read(buffer)) != -1) {
+                        System.out.write(buffer, 0, len);
+                    }
+
+        } catch (IOException e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+}
--- a/src/solaris/classes/java/lang/UNIXProcess.java.bsd	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/solaris/classes/java/lang/UNIXProcess.java.bsd	Tue Feb 04 16:24:39 2014 -0800
@@ -342,47 +342,39 @@
         ProcessPipeInputStream(int fd) {
             super(new FileInputStream(newFileDescriptor(fd)));
         }
-
-        private InputStream drainInputStream(InputStream in)
+        private static byte[] drainInputStream(InputStream in)
                 throws IOException {
             int n = 0;
             int j;
             byte[] a = null;
-            synchronized (closeLock) {
-                if (buf == null) // asynchronous close()?
-                    return null; // discard
-                j = in.available();
+            while ((j = in.available()) > 0) {
+                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
+                n += in.read(a, n, j);
             }
-            while (j > 0) {
-                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
-                synchronized (closeLock) {
-                    if (buf == null) // asynchronous close()?
-                        return null; // discard
-                    n += in.read(a, n, j);
-                    j = in.available();
-                }
-            }
-            return (a == null) ?
-                    ProcessBuilder.NullInputStream.INSTANCE :
-                    new ByteArrayInputStream(n == a.length ? a : Arrays.copyOf(a, n));
+            return (a == null || n == a.length) ? a : Arrays.copyOf(a, n);
         }
 
         /** Called by the process reaper thread when the process exits. */
         synchronized void processExited() {
-            try {
-                InputStream in = this.in;
-                if (in != null) {
-                    InputStream stragglers = drainInputStream(in);
-                    in.close();
-                    this.in = stragglers;
-                }
-            } catch (IOException ignored) { }
+            synchronized (closeLock) {
+                try {
+                    InputStream in = this.in;
+                    // this stream is closed if and only if: in == null
+                    if (in != null) {
+                        byte[] stragglers = drainInputStream(in);
+                        in.close();
+                        this.in = (stragglers == null) ?
+                            ProcessBuilder.NullInputStream.INSTANCE :
+                            new ByteArrayInputStream(stragglers);
+                    }
+                } catch (IOException ignored) {}
+            }
         }
 
         @Override
         public void close() throws IOException {
             // BufferedInputStream#close() is not synchronized unlike most other methods.
-            // Synchronizing helps avoid racing with drainInputStream().
+            // Synchronizing helps avoid race with processExited().
             synchronized (closeLock) {
                 super.close();
             }
--- a/src/solaris/classes/java/lang/UNIXProcess.java.linux	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/solaris/classes/java/lang/UNIXProcess.java.linux	Tue Feb 04 16:24:39 2014 -0800
@@ -344,47 +344,39 @@
         ProcessPipeInputStream(int fd) {
             super(new FileInputStream(newFileDescriptor(fd)));
         }
-
-        private InputStream drainInputStream(InputStream in)
+        private static byte[] drainInputStream(InputStream in)
                 throws IOException {
             int n = 0;
             int j;
             byte[] a = null;
-            synchronized (closeLock) {
-                if (buf == null) // asynchronous close()?
-                    return null; // discard
-                j = in.available();
+            while ((j = in.available()) > 0) {
+                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
+                n += in.read(a, n, j);
             }
-            while (j > 0) {
-                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
-                synchronized (closeLock) {
-                    if (buf == null) // asynchronous close()?
-                        return null; // discard
-                    n += in.read(a, n, j);
-                    j = in.available();
-                }
-            }
-            return (a == null) ?
-                    ProcessBuilder.NullInputStream.INSTANCE :
-                    new ByteArrayInputStream(n == a.length ? a : Arrays.copyOf(a, n));
+            return (a == null || n == a.length) ? a : Arrays.copyOf(a, n);
         }
 
         /** Called by the process reaper thread when the process exits. */
         synchronized void processExited() {
-            try {
-                InputStream in = this.in;
-                if (in != null) {
-                    InputStream stragglers = drainInputStream(in);
-                    in.close();
-                    this.in = stragglers;
-                }
-            } catch (IOException ignored) { }
+            synchronized (closeLock) {
+                try {
+                    InputStream in = this.in;
+                    // this stream is closed if and only if: in == null
+                    if (in != null) {
+                        byte[] stragglers = drainInputStream(in);
+                        in.close();
+                        this.in = (stragglers == null) ?
+                            ProcessBuilder.NullInputStream.INSTANCE :
+                            new ByteArrayInputStream(stragglers);
+                    }
+                } catch (IOException ignored) {}
+            }
         }
 
         @Override
         public void close() throws IOException {
             // BufferedInputStream#close() is not synchronized unlike most other methods.
-            // Synchronizing helps avoid racing with drainInputStream().
+            // Synchronizing helps avoid race with processExited().
             synchronized (closeLock) {
                 super.close();
             }
--- a/src/solaris/native/java/io/UnixFileSystem_md.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/solaris/native/java/io/UnixFileSystem_md.c	Tue Feb 04 16:24:39 2014 -0800
@@ -283,6 +283,10 @@
     struct dirent64 *result;
     int len, maxlen;
     jobjectArray rv, old;
+    jclass str_class;
+
+    str_class = JNU_ClassString(env);
+    CHECK_NULL_RETURN(str_class, NULL);
 
     WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
         dir = opendir(path);
@@ -299,7 +303,7 @@
     /* Allocate an initial String array */
     len = 0;
     maxlen = 16;
-    rv = (*env)->NewObjectArray(env, maxlen, JNU_ClassString(env), NULL);
+    rv = (*env)->NewObjectArray(env, maxlen, str_class, NULL);
     if (rv == NULL) goto error;
 
     /* Scan the directory */
@@ -309,8 +313,7 @@
             continue;
         if (len == maxlen) {
             old = rv;
-            rv = (*env)->NewObjectArray(env, maxlen <<= 1,
-                                        JNU_ClassString(env), NULL);
+            rv = (*env)->NewObjectArray(env, maxlen <<= 1, str_class, NULL);
             if (rv == NULL) goto error;
             if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error;
             (*env)->DeleteLocalRef(env, old);
@@ -329,7 +332,7 @@
 
     /* Copy the final results into an appropriately-sized array */
     old = rv;
-    rv = (*env)->NewObjectArray(env, len, JNU_ClassString(env), NULL);
+    rv = (*env)->NewObjectArray(env, len, str_class, NULL);
     if (rv == NULL) {
         return NULL;
     }
--- a/src/solaris/native/java/lang/ProcessEnvironment_md.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/solaris/native/java/lang/ProcessEnvironment_md.c	Tue Feb 04 16:24:39 2014 -0800
@@ -53,6 +53,7 @@
     jsize i, j;
     jobjectArray result;
     jclass byteArrCls = (*env)->FindClass(env, "[B");
+    CHECK_NULL_RETURN(byteArrCls, NULL);
 
     for (i = 0; environ[i]; i++) {
         /* Ignore corrupted environment variables */
@@ -61,7 +62,7 @@
     }
 
     result = (*env)->NewObjectArray(env, 2*count, byteArrCls, 0);
-    if (result == NULL) return NULL;
+    CHECK_NULL_RETURN(result, NULL);
 
     for (i = 0, j = 0; environ[i]; i++) {
         const char * varEnd = strchr(environ[i], '=');
@@ -72,9 +73,9 @@
             jsize varLength = varEnd - environ[i];
             jsize valLength = strlen(valBeg);
             var = (*env)->NewByteArray(env, varLength);
-            if (var == NULL) return NULL;
+            CHECK_NULL_RETURN(var, NULL);
             val = (*env)->NewByteArray(env, valLength);
-            if (val == NULL) return NULL;
+            CHECK_NULL_RETURN(val, NULL);
             (*env)->SetByteArrayRegion(env, var, 0, varLength,
                                        (jbyte*) environ[i]);
             (*env)->SetByteArrayRegion(env, val, 0, valLength,
--- a/src/solaris/native/java/lang/UNIXProcess_md.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/solaris/native/java/lang/UNIXProcess_md.c	Tue Feb 04 16:24:39 2014 -0800
@@ -206,6 +206,7 @@
 Java_java_lang_UNIXProcess_init(JNIEnv *env, jclass clazz)
 {
     parentPathv = effectivePathv(env);
+    CHECK_NULL(parentPathv);
     setSIGCHLDHandler(env);
 }
 
--- a/src/solaris/native/java/lang/java_props_md.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/solaris/native/java/lang/java_props_md.c	Tue Feb 04 16:24:39 2014 -0800
@@ -546,6 +546,9 @@
     sprops.display_country = sprops.country;
     sprops.display_variant = sprops.variant;
 
+    /* ParseLocale failed with OOME */
+    JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+
 #ifdef MACOSX
     sprops.sun_jnu_encoding = "UTF-8";
 #else
--- a/src/solaris/native/java/net/Inet4AddressImpl.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/solaris/native/java/net/Inet4AddressImpl.c	Tue Feb 04 16:24:39 2014 -0800
@@ -51,29 +51,6 @@
 #define HAS_GLIBC_GETHOSTBY_R   1
 #endif
 
-static jclass ni_iacls;
-static jclass ni_ia4cls;
-static jmethodID ni_ia4ctrID;
-
-static jboolean initializeInetClasses(JNIEnv *env)
-{
-    static int initialized = 0;
-    if (!initialized) {
-        ni_iacls = (*env)->FindClass(env, "java/net/InetAddress");
-        CHECK_NULL_RETURN(ni_iacls, JNI_FALSE);
-        ni_iacls = (*env)->NewGlobalRef(env, ni_iacls);
-        CHECK_NULL_RETURN(ni_iacls, JNI_FALSE);
-        ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address");
-        CHECK_NULL_RETURN(ni_ia4cls, JNI_FALSE);
-        ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls);
-        CHECK_NULL_RETURN(ni_ia4cls, JNI_FALSE);
-        ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "<init>", "()V");
-        CHECK_NULL_RETURN(ni_ia4ctrID, JNI_FALSE);
-        initialized = 1;
-    }
-    return JNI_TRUE;
-}
-
 
 #if defined(_ALLBSD_SOURCE) && !defined(HAS_GLIBC_GETHOSTBY_R)
 extern jobjectArray lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6);
@@ -147,8 +124,8 @@
     int error=0;
     struct addrinfo hints, *res, *resNew = NULL;
 
-    if (!initializeInetClasses(env))
-        return NULL;
+    initInetAddressIDs(env);
+    JNU_CHECK_EXCEPTION_RETURN(env, NULL);
 
     if (IS_NULL(host)) {
         JNU_ThrowNullPointerException(env, "host is null");
@@ -241,7 +218,7 @@
           goto cleanupAndReturn;
         }
 
-        ret = (*env)->NewObjectArray(env, retLen, ni_iacls, NULL);
+        ret = (*env)->NewObjectArray(env, retLen, ia_class, NULL);
         if (IS_NULL(ret)) {
             /* we may have memory to free at the end of this */
             goto cleanupAndReturn;
@@ -251,7 +228,7 @@
             /* We need 4 bytes to store ipv4 address; */
             int len = 4;
 
-            jobject iaObj = (*env)->NewObject(env, ni_ia4cls, ni_ia4ctrID);
+            jobject iaObj = (*env)->NewObject(env, ia4_class, ia4_ctrID);
             if (IS_NULL(iaObj)) {
                 /* we may have memory to free at the end of this */
                 ret = NULL;
@@ -407,8 +384,8 @@
     int error = 0;
     struct addrinfo hints, *res, *resNew = NULL;
 
-    if (!initializeInetClasses(env))
-        return NULL;
+    initInetAddressIDs(env);
+    JNU_CHECK_EXCEPTION_RETURN(env, NULL);
 
     if (IS_NULL(host)) {
         JNU_ThrowNullPointerException(env, "host is null");
@@ -486,7 +463,7 @@
         retLen = i;
         iterator = resNew;
 
-        ret = (*env)->NewObjectArray(env, retLen, ni_iacls, NULL);
+        ret = (*env)->NewObjectArray(env, retLen, ia_class, NULL);
 
         if (IS_NULL(ret)) {
             /* we may have memory to free at the end of this */
@@ -495,7 +472,7 @@
 
         i = 0;
         while (iterator != NULL) {
-            jobject iaObj = (*env)->NewObject(env, ni_ia4cls, ni_ia4ctrID);
+            jobject iaObj = (*env)->NewObject(env, ia4_class, ia4_ctrID);
             if (IS_NULL(iaObj)) {
                 ret = NULL;
                 goto cleanupAndReturn;
--- a/src/solaris/native/java/net/Inet6AddressImpl.c	Fri Jan 31 18:49:58 2014 +0400
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c	Tue Feb 04 16:24:39 2014 -0800
@@ -117,44 +117,6 @@
     return (*env)->NewStringUTF(env, hostname);
 }
 
-static jclass ni_iacls;
-static jclass ni_ia4cls;
-static jclass ni_ia6cls;
-static jmethodID ni_ia4ctrID;
-static jmethodID ni_ia6ctrID;
-static jboolean preferIPv6Address;
-
-static jboolean initializeInetClasses(JNIEnv *env)
-{
-    jfieldID ni_preferIPv6AddressID;
-    static int initialized = 0;
-    if (!initialized) {
-        ni_iacls = (*env)->FindClass(env, "java/net/InetAddress");
-        CHECK_NULL_RETURN(ni_iacls, JNI_FALSE);
-        ni_iacls = (*env)->NewGlobalRef(env, ni_iacls);
-        CHECK_NULL_RETURN(ni_iacls, JNI_FALSE);
-        ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address");
-        CHECK_NULL_RETURN(ni_ia4cls, JNI_FALSE);
-        ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls);
-        CHECK_NULL_RETURN(ni_ia4cls, JNI_FALSE);
-        ni_ia6cls = (*env)->FindClass(env, "java/net/Inet6Address");
-        CHECK_NULL_RETURN(ni_ia6cls, JNI_FALSE);
-        ni_ia6cls = (*env)->NewGlobalRef(env, ni_ia6cls);
-        CHECK_NULL_RETURN(ni_ia6cls, JNI_FALSE);
-        ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "<init>", "()V");
-        CHECK_NULL_RETURN(ni_ia4ctrID, JNI_FALSE);
-        ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "<init>", "()V");
-        CHECK_NULL_RETURN(ni_ia6ctrID, JNI_FALSE);
-        ni_preferIPv6AddressID =
-            (*env)->GetStaticFieldID(env, ni_iacls, "preferIPv6Address", "Z");
-        CHECK_NULL_RETURN(ni_preferIPv6AddressID, JNI_FALSE);
-        preferIPv6Address =
-            (*env)->GetStaticBooleanField(env, ia_class, ia_preferIPv6AddressID);
-        initialized = 1;
-    }
-    return JNI_TRUE;
-}
-
 #ifdef MACOSX
 /* also called from Inet4AddressImpl.c */
 __private_extern__ jobjectArray
@@ -169,9 +131,8 @@
     jboolean includeLoopback = JNI_FALSE;
     jobject name;
 
-    // Make sure static variables we need are set.
-    if (!initializeInetClasses(env))