changeset 7486:f93625257fbd

Merge
author mduigou
date Wed, 20 Feb 2013 10:16:45 -0800
parents 49f8ac4374ad 5ea0024ba765
children 1ca7473e08aa
files .hgtags make/Makefile make/common/shared/Sanity.gmk make/docs/CORE_PKGS.gmk make/java/java/FILES_java.gmk make/netbeans/common/architectures/arch-x86_64.properties make/netbeans/common/architectures/name-Macosx.properties make/netbeans/common/java-data-native.ent make/netbeans/common/java-data-no-native.ent make/netbeans/common/shared.xml makefiles/Setup.gmk src/macosx/classes/sun/lwawt/macosx/EventDispatchAccess.java src/share/classes/java/awt/EventDispatchThread.java src/share/classes/java/lang/Double.java src/share/classes/java/lang/Iterable.java src/share/classes/java/lang/annotation/ContainedBy.java src/share/classes/java/lang/annotation/ContainerFor.java src/share/classes/java/nio/file/DirectoryStream.java src/share/classes/java/time/PeriodParser.java src/share/classes/java/time/calendar/ChronoDateImpl.java src/share/classes/java/time/calendar/HijrahChrono.java src/share/classes/java/time/calendar/HijrahDate.java src/share/classes/java/time/calendar/HijrahDeviationReader.java src/share/classes/java/time/calendar/HijrahEra.java src/share/classes/java/time/calendar/JapaneseChrono.java src/share/classes/java/time/calendar/JapaneseDate.java src/share/classes/java/time/calendar/JapaneseEra.java src/share/classes/java/time/calendar/MinguoChrono.java src/share/classes/java/time/calendar/MinguoDate.java src/share/classes/java/time/calendar/MinguoEra.java src/share/classes/java/time/calendar/Ser.java src/share/classes/java/time/calendar/ThaiBuddhistChrono.java src/share/classes/java/time/calendar/ThaiBuddhistDate.java src/share/classes/java/time/calendar/ThaiBuddhistEra.java src/share/classes/java/time/calendar/package-info.java src/share/classes/java/time/format/DateTimeFormatters.java src/share/classes/java/time/format/DateTimePrintException.java src/share/classes/java/time/temporal/Chrono.java src/share/classes/java/time/temporal/ChronoLocalDate.java src/share/classes/java/time/temporal/ChronoLocalDateTime.java src/share/classes/java/time/temporal/ChronoLocalDateTimeImpl.java src/share/classes/java/time/temporal/ChronoZonedDateTime.java src/share/classes/java/time/temporal/ChronoZonedDateTimeImpl.java src/share/classes/java/time/temporal/Era.java src/share/classes/java/time/temporal/ISOChrono.java src/share/classes/java/time/temporal/ISOEra.java src/share/classes/java/time/temporal/ISOFields.java src/share/classes/java/time/temporal/MonthDay.java src/share/classes/java/time/temporal/OffsetDate.java src/share/classes/java/time/temporal/OffsetDateTime.java src/share/classes/java/time/temporal/OffsetTime.java src/share/classes/java/time/temporal/Ser.java src/share/classes/java/time/temporal/SimplePeriod.java src/share/classes/java/time/temporal/TemporalAdder.java src/share/classes/java/time/temporal/TemporalSubtractor.java src/share/classes/java/time/temporal/Year.java src/share/classes/java/time/temporal/YearMonth.java src/share/classes/java/util/Comparator.java src/share/classes/java/util/function/BinaryOperator.java src/share/classes/java/util/function/Consumer.java src/share/classes/java/util/function/DoubleBinaryOperator.java src/share/classes/java/util/function/DoubleConsumer.java src/share/classes/java/util/function/DoubleFunction.java src/share/classes/java/util/function/DoubleSupplier.java src/share/classes/java/util/function/DoubleUnaryOperator.java src/share/classes/java/util/function/Function.java src/share/classes/java/util/function/IntBinaryOperator.java src/share/classes/java/util/function/IntConsumer.java src/share/classes/java/util/function/IntFunction.java src/share/classes/java/util/function/IntSupplier.java src/share/classes/java/util/function/IntUnaryOperator.java src/share/classes/java/util/function/LongBinaryOperator.java src/share/classes/java/util/function/LongConsumer.java src/share/classes/java/util/function/LongFunction.java src/share/classes/java/util/function/LongSupplier.java src/share/classes/java/util/function/LongUnaryOperator.java src/share/classes/java/util/function/Predicate.java src/share/classes/java/util/function/Supplier.java src/share/classes/java/util/function/ToDoubleFunction.java src/share/classes/java/util/function/ToIntFunction.java src/share/classes/java/util/function/ToLongFunction.java src/share/classes/java/util/function/UnaryOperator.java src/share/classes/sun/util/calendar/TzIDOldMapping.java src/share/javavm/export/jvm.h src/share/native/common/check_code.c test/java/net/URL/abnormal_http_urls test/java/net/URL/ftp_urls test/java/net/URL/jar_urls test/java/net/URL/normal_http_urls test/java/net/URL/runconstructor.sh test/java/net/URL/share_file_urls test/java/net/URL/win32_file_urls test/java/time/META-INF/services/java.time.temporal.Chrono test/java/time/tck/java/time/calendar/CopticChrono.java test/java/time/tck/java/time/calendar/CopticDate.java test/java/time/tck/java/time/calendar/CopticEra.java test/java/time/tck/java/time/calendar/TestChronoLocalDate.java test/java/time/tck/java/time/calendar/TestChronoLocalDateTime.java test/java/time/tck/java/time/calendar/TestHijrahChrono.java test/java/time/tck/java/time/calendar/TestJapaneseChrono.java test/java/time/tck/java/time/calendar/TestMinguoChrono.java test/java/time/tck/java/time/calendar/TestServiceLoader.java test/java/time/tck/java/time/calendar/TestThaiBuddhistChrono.java test/java/time/tck/java/time/format/TCKDateTimePrintException.java test/java/time/tck/java/time/temporal/TCKISOFields.java test/java/time/tck/java/time/temporal/TCKMonthDay.java test/java/time/tck/java/time/temporal/TCKOffsetDate.java test/java/time/tck/java/time/temporal/TCKOffsetDateTime.java test/java/time/tck/java/time/temporal/TCKOffsetTime.java test/java/time/tck/java/time/temporal/TCKSimplePeriod.java test/java/time/tck/java/time/temporal/TCKYear.java test/java/time/tck/java/time/temporal/TCKYearMonth.java test/java/time/tck/java/time/temporal/TestChrono.java test/java/time/tck/java/time/temporal/TestISOChrono.java test/java/time/test/java/time/TestPeriodParser.java test/java/time/test/java/time/format/TestDateTimeFormatters.java test/java/time/test/java/time/format/TestDateTimePrintException.java test/java/time/test/java/time/format/TestPadParserDecorator.java test/java/time/test/java/time/format/TestZoneIdParser.java test/java/time/test/java/time/temporal/TestISOChronoImpl.java test/java/time/test/java/time/temporal/TestMonthDay.java test/java/time/test/java/time/temporal/TestOffsetDate.java test/java/time/test/java/time/temporal/TestOffsetDateTime.java test/java/time/test/java/time/temporal/TestOffsetDateTime_instants.java test/java/time/test/java/time/temporal/TestOffsetTime.java test/java/time/test/java/time/temporal/TestYear.java test/java/time/test/java/time/temporal/TestYearMonth.java test/sun/net/www/EncDec.doc test/sun/net/www/MarkResetTest.java test/sun/net/www/MarkResetTest.sh test/sun/security/util/Oid/S11N.sh test/sun/security/util/Oid/SerialTest.java
diffstat 651 files changed, 83790 insertions(+), 45866 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Feb 20 16:39:46 2013 +0100
+++ b/.hgtags	Wed Feb 20 10:16:45 2013 -0800
@@ -200,3 +200,6 @@
 32a57e645e012a1f0665c075969ca598e0dbb948 jdk8-b72
 733885f57e14cc27f5a5ff0dffe641d2fa3c704a jdk8-b73
 57d5d954462831ac353a1f40d3bb05ddb4620952 jdk8-b74
+4a67fdb752b7d6329d9be9c28d3f9d6cf7eb9a3c jdk8-b75
+3a263052866137b645ab86498a43693ff5c19e69 jdk8-b76
+b2fc8e31cecc35b76188e821d4c5dc0e0b74ac24 jdk8-b77
--- a/make/Makefile	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -237,6 +237,9 @@
 ifeq ($(PLATFORM), macosx)
   SUBDIRS += apple
 endif
+ifeq ($(PLATFORM), windows)
+  SUBDIRS += bridge
+endif
 SUBDIRS_tools = launchers
 SUBDIRS_misc  = org jpda
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/AccessBridgeJava/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,93 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for building AccessBridge
+#
+BUILDDIR = ../..
+PRODUCT = java
+PACKAGE = com.sun.java.accessibility
+
+include $(BUILDDIR)/common/Defs.gmk
+JARFILE = $(EXTDIR)/access-bridge$(ABSUFFIX).jar
+
+ifeq ($(ARCH_DATA_MODEL), 64)
+  ABPLATFORM = 64bit
+  ABSUFFIX = -64
+else
+ifeq ($(ARCH_DATA_MODEL), 32)
+ifdef ABLEGACY
+  ABSUFFIX = 
+  ABPLATFORM = legacy
+else
+  ABPLATFORM = 32bit
+  ABSUFFIX = -32
+endif
+endif
+endif
+
+#
+# Java files to compile.
+#
+FILES_java = com/sun/java/accessibility/AccessBridge.java
+
+#
+# Location for the newly built classfiles.
+#
+CLASSDESTDIR = $(TEMPDIR)/classes
+
+#
+# Rules
+#
+CLASSDESTDIR = $(TEMPDIR)/classes
+
+FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class)
+
+build: prebuild
+
+prebuild:
+	$(CP) $(CLOSED_PLATFORM_SRC)/classes/com/sun/java/accessibility/$(ABPLATFORM)/AccessBridge.java \
+		$(CLOSED_PLATFORM_SRC)/classes/com/sun/java/accessibility
+
+all : build $(JARFILE) 
+
+#
+# JAR file
+#
+$(JARFILE): \
+	$(FILES_class)
+	$(BOOT_JAR_CMD) -cf $(JARFILE) \
+	     -C $(CLASSDESTDIR) com \
+	     $(BOOT_JAR_JFLAGS)
+	@$(java-vm-cleanup)
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
+
+clean clobber::
+	$(RM) -r $(CLASSDESTDIR) \
+		 $(EXTDIR)/$(JARFILE)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/JAWTAccessBridge/Files_cpp.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Native files to compile.
+FILES_cpp = \
+	JAWTAccessBridge.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/JAWTAccessBridge/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for building JAWTAccessBridge
+#
+
+BUILDDIR = ../..
+LIBRARY = JAWTAccessBridge$(ABSUFFIX)
+include $(BUILDDIR)/common/Defs.gmk
+
+# Indicate we want the C++ compiler to do the linking.
+CPLUSPLUSLIBRARY=true
+
+ifeq ($(ARCH_DATA_MODEL), 64)
+  ABSUFFIX = -64
+  ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_64
+  ABRIDGE_MACHINE=X64
+else
+ifeq ($(ARCH_DATA_MODEL), 32)
+  ABRIDGE_MACHINE=I386
+ifdef ABLEGACY
+  ABSUFFIX = 
+  ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_LEGACY
+else
+  ABSUFFIX = -32
+  ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_32
+endif
+endif
+endif
+
+include FILES_cpp.gmk
+
+VERSIONINFO_RESOURCE = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeStatusWindow.rc
+
+OTHER_CPPFLAGS += -D$(ACCESSBRIDGE_ARCH) -I "$(INCLUDEDIR)" -I "$(PLATFORM_INCLUDE)"
+LDLIBS += kernel32.lib user32.lib gdi32.lib winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
+	uuid.lib odbc32.lib odbccp32.lib /subsystem:windows /dll /incremental:no /machine:$(ABRIDGE_MACHINE) \
+	/def:$(CLOSED_PLATFORM_SRC)/native/sun/bridge/JAWTAccessBridge.DEF  /libpath:"$(LIBDIR)"
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Library.gmk
+
+vpath %.cpp   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
+vpath %.RC   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/Jabswitch/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,63 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for building jabswitch.exe
+#
+
+BUILDDIR = ../..
+PROGRAM = jabswitch
+include $(BUILDDIR)/common/Defs.gmk
+
+# Indicate we want the C++ compiler to do the linking.
+CPLUSPLUSLIBRARY=true
+
+VERSIONINFO_RESOURCE = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeStatusWindow.rc
+VERSIONRES = $(TEMPDIR)/AccessBridgeStatusWindow.res
+
+JAB_EXE= $(TEMPDIR)/jabswitch.exe
+
+JAB_SRC = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/jabswitch.cpp
+
+JAB_MANIFEST_INP = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/jabswitch.manifest
+JAB_MANIFEST_OUT = $(TEMPDIR)/jabswitch.exe.intermediate.manifest
+
+RC_FLAGS += /fo "$(VERSIONRES)"
+OTHER_CPPFLAGS += /MD /Fo"$(TEMPDIR)/" /Fd"$(TEMPDIR)/" /analyze- /Od /Gd /nologo /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /RTC1 /W3 /ZI /Zc:wchar_t /EHsc 
+LDDFLAGS += Advapi32.lib Version.lib User32.lib
+
+all: buildexe copyfilejab
+
+buildexe : 
+	$(CD) $(TEMPDIR)  
+	$(RC) $(RC_FLAGS) $(VERSIONINFO_RESOURCE) 
+	$(CC) $(CPPFLAGS) $(JAB_SRC) $(LDDFLAGS) $(VERSIONRES) -o $(JAB_EXE) 
+	$(MT) /nologo /verbose /manifest $(JAB_MANIFEST_INP) /outputresource:$(JAB_EXE)  
+
+copyfilejab : 
+	$(CP) $(JAB_EXE) $(BINDIR)
+
+vpath %.cpp   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
+vpath %.rc   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/Jaccess/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,85 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for building jaccess
+#
+BUILDDIR = ../..
+PRODUCT = java
+PACKAGE = com.sun.java.accessibility.jaccess
+
+include $(BUILDDIR)/common/Defs.gmk
+JARFILE = $(EXTDIR)/jaccess.jar
+
+#
+# Java files to compile.
+#
+#AUTO_FILES_JAVA_DIRS = $(CLOSED_PLATFORM_SRC)/bridge
+FILES_java = \
+	com/sun/java/accessibility/util/AccessibilityEventMonitor.java \
+	com/sun/java/accessibility/util/AccessibilityListenerList.java \
+	com/sun/java/accessibility/util/AWTEventMonitor.java \
+	com/sun/java/accessibility/util/EventID.java \
+	com/sun/java/accessibility/util/EventQueueMonitor.java \
+	com/sun/java/accessibility/util/GUIInitializedListener.java \
+	com/sun/java/accessibility/util/GUIInitializedMulticaster.java \
+	com/sun/java/accessibility/util/SwingEventMonitor.java \
+	com/sun/java/accessibility/util/TopLevelWindowListener.java \
+	com/sun/java/accessibility/util/TopLevelWindowMulticaster.java \
+	com/sun/java/accessibility/util/Translator.java \
+	com/sun/java/accessibility/util/java/awt/ButtonTranslator.java \
+	com/sun/java/accessibility/util/java/awt/CheckboxTranslator.java \
+	com/sun/java/accessibility/util/java/awt/LabelTranslator.java \
+	com/sun/java/accessibility/util/java/awt/ListTranslator.java \
+	com/sun/java/accessibility/util/java/awt/TextComponentTranslator.java
+
+#
+# Rules
+#
+CLASSDESTDIR = $(TEMPDIR)/classes
+
+FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class)
+
+all : build $(JARFILE)
+
+#
+# JAR file
+#
+$(JARFILE): \
+	$(FILES_class)
+	$(BOOT_JAR_CMD) -cf $(JARFILE) \
+	     -C $(CLASSDESTDIR) com \
+	     $(BOOT_JAR_JFLAGS)
+	@$(java-vm-cleanup)
+
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
+
+clean clobber::
+	$(RM) -r $(CLASSDESTDIR) \
+		 $(EXTDIR)/$(JARFILE)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/JavaAccessBridge/Files_cpp.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Native files to compile.
+FILES_cpp = \
+	AccessBridgeATInstance.cpp \
+	AccessBridgeDebug.cpp \
+	AccessBridgeJavaEntryPoints.cpp \
+	AccessBridgeMessages.cpp \
+	JavaAccessBridge.cpp 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/JavaAccessBridge/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,90 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for building JavaAccessBridge.DLL
+#
+
+BUILDDIR = ../..
+LIBRARY = JavaAccessBridge$(ABSUFFIX)
+include $(BUILDDIR)/common/Defs.gmk
+
+# Indicate we want the C++ compiler to do the linking.
+CPLUSPLUSLIBRARY=true
+
+ifeq ($(ARCH_DATA_MODEL), 64)
+  ABSUFFIX = -64
+  ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_64
+  ABRIDGE_MACHINE=X64
+else
+ifeq ($(ARCH_DATA_MODEL), 32)
+  ABRIDGE_MACHINE=I386
+ifdef ABLEGACY
+  ABSUFFIX = 
+  ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_LEGACY
+else
+  ABSUFFIX = -32
+  ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_32
+endif
+endif
+endif
+
+include FILES_cpp.gmk
+
+PLATFORM_INCLUDE_BRIDGE = $(PLATFORM_INCLUDE)/bridge
+
+VERSIONINFO_RESOURCE = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeStatusWindow.rc
+
+OTHER_CPPFLAGS += -D$(ACCESSBRIDGE_ARCH) -I "$(INCLUDEDIR)" -I "$(PLATFORM_INCLUDE)"
+LDLIBS += kernel32.lib user32.lib gdi32.lib winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
+	odbc32.lib odbccp32.lib /subsystem:windows /dll /incremental:no /machine:$(ABRIDGE_MACHINE) \
+	/def:$(CLOSED_PLATFORM_SRC)/native/sun/bridge/JavaAccessBridge.DEF  /libpath:"$(LIBDIR)"
+
+all : build postbuild
+
+postbuild :
+	$(MKDIR) -p $(PLATFORM_INCLUDE_BRIDGE) 
+	$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/accessibility.properties $(LIBDIR)
+	$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeCallbacks.h $(PLATFORM_INCLUDE_BRIDGE)
+	$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeCalls.h $(PLATFORM_INCLUDE_BRIDGE)
+	$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgePackages.h $(PLATFORM_INCLUDE_BRIDGE)
+	$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeCalls.c $(PLATFORM_INCLUDE_BRIDGE)
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Library.gmk
+
+vpath %.cpp   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
+vpath %.DEF   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
+vpath %.rc   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
+vpath %.c   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
+vpath %.h   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
+
+#
+# Extra clean rule.
+#
+clean clobber::
+	$(RM) $(FILES_h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,65 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for building Java Access Bridge
+#
+
+BUILDDIR = ..
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+#
+ifndef OPENJDK
+ifeq ($(PLATFORM), windows)
+include $(BUILDDIR)/common/Subdirs.gmk
+
+#
+# build for 32 and 64 bit (new api)
+#
+SUBDIRS = Jaccess JavaAccessBridge WindowsAccessBridge JAWTAccessBridge AccessBridgeJava Jabswitch
+#
+# build for legacy
+#
+ifeq ($(ARCH_DATA_MODEL), 32)
+OTHERSUBDIRS_MAKEFLAGS += ABLEGACY=true
+OTHERSUBDIRS = JavaAccessBridge WindowsAccessBridge JAWTAccessBridge AccessBridgeJava
+endif
+
+ifeq ($(ARCH_DATA_MODEL), 32)
+all build clean clobber ::
+	$(SUBDIRS-loop)
+	$(OTHERSUBDIRS-loop)
+else
+all build clean clobber ::
+	$(SUBDIRS-loop)
+endif
+
+clean::
+	$(RM) -r $(CLASSBINDIR) $(CLASSBINDIR)
+
+endif # PLATFORM
+endif #OPENJDK
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/WindowsAccessBridge/Files_cpp.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Native files to compile.
+FILES_cpp = \
+	AccessBridgeJavaVMInstance.cpp \
+	AccessBridgeMessageQueue.cpp \
+	AccessBridgeMessages.cpp \
+	AccessBridgeWindowsEntryPoints.cpp \
+	WinAccessBridge.cpp \
+	AccessBridgeDebug.cpp \
+	AccessBridgeEventHandler.cpp 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bridge/WindowsAccessBridge/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for building WindowsAccessBridge.dll
+#
+
+BUILDDIR = ../..
+LIBRARY = WindowsAccessBridge$(ABSUFFIX)
+include $(BUILDDIR)/common/Defs.gmk
+
+# Indicate we want the C++ compiler to do the linking.
+CPLUSPLUSLIBRARY=true
+
+ifeq ($(ARCH_DATA_MODEL), 64)
+  ABSUFFIX = -64
+  ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_64
+  ABRIDGE_MACHINE=X64
+else
+ifeq ($(ARCH_DATA_MODEL), 32)
+  ABRIDGE_MACHINE=I386
+ifdef ABLEGACY
+  ABSUFFIX = 
+  ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_LEGACY
+else
+  ABSUFFIX = -32
+  ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_32
+endif
+endif
+endif
+
+include FILES_cpp.gmk
+
+VERSIONINFO_RESOURCE = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeStatusWindow.rc
+
+OTHER_CPPFLAGS += -MT -D$(ACCESSBRIDGE_ARCH) -I "$(INCLUDEDIR)" -I "$(PLATFORM_INCLUDE)"
+LDLIBS += kernel32.lib user32.lib gdi32.lib winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
+	ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /subsystem:windows /dll /incremental:no /machine:$(ABRIDGE_MACHINE) \
+	/def:$(CLOSED_PLATFORM_SRC)/native/sun/bridge/WinAccessBridge.DEF  /libpath:"$(LIBDIR)"
+
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Library.gmk
+
+vpath %.cpp   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
+vpath %.DEF   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
+vpath %.rc   $(CLOSED_PLATFORM_SRC)/native/sun/bridge
--- a/make/common/shared/Defs-solaris.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/common/shared/Defs-solaris.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -211,7 +211,9 @@
   MAPFILE_EXCEPTIONS = \
     (libjdgaSUNWafb|libjdgaSUNWcg6|libjdgaSUNWffb|libjdgaSUNWm64|libxinerama)
 else
-  MAPFILE_EXCEPTIONS = ()
+  # At present there are no exceptions for non
+  # SPARC.  Use a harmless value.
+  MAPFILE_EXCEPTIONS = (NO_EXCEPTIONS)
 endif
 
 # Macro to check it's input file for banned dependencies and verify the
--- a/make/common/shared/Sanity.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/common/shared/Sanity.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -1486,26 +1486,6 @@
 ######################################################
 sane-gcc-compiler:
 ifndef OPENJDK
-  ifeq ($(PLATFORM), solaris)
-	@if [ -r $(GCC_COMPILER_PATH) ]; then \
-	  if [ ! "$(GCC_VER)" = $(REQUIRED_GCC_VER) ]; then \
-	    $(ECHO) "ERROR: The Solaris GCC compiler version must be $(REQUIRED_GCC_VER). \n" \
-	      "      You are using the following compiler version: $(GCC_VER) \n" \
-	      "      The compiler was obtained from the following location: \n" \
-	      "          $(GCC_COMPILER_PATH) \n" \
-	      "      Please change your compiler. \n" \
-	      "" >> $(ERROR_FILE) ; \
-	fi \
-	else \
-	  $(ECHO) "ERROR: You do not have a valid GCC_COMPILER_PATH setting. \n" \
-	    "      Please check your access to \n" \
-	    "          $(GCC_COMPILER_PATH) \n" \
-	    "      and/or check your value of ALT_GCC_COMPILER_PATH. \n" \
-	    "      This will affect you if you build the plugin target. \n" \
-	    "" >> $(ERROR_FILE) ; \
-	fi
-  endif
-
   ifeq ($(PLATFORM), linux)
     ifeq ($(ARCH_DATA_MODEL), 32)
     ifdef ALT_GCC29_COMPILER_PATH
--- a/make/docs/CORE_PKGS.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/docs/CORE_PKGS.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -128,9 +128,9 @@
   java.text                                      \
   java.text.spi                                  \
   java.time                                      \
+  java.time.chrono                               \
+  java.time.format                               \
   java.time.temporal                             \
-  java.time.calendar                             \
-  java.time.format                               \
   java.time.zone                                 \
   java.util                                      \
   java.util.concurrent                           \
--- a/make/java/java/FILES_java.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/java/java/FILES_java.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -255,7 +255,6 @@
         java/util/SimpleTimeZone.java \
         sun/util/calendar/ZoneInfo.java \
         sun/util/calendar/ZoneInfoFile.java \
-        sun/util/calendar/TzIDOldMapping.java \
     java/util/TooManyListenersException.java \
     java/util/Comparator.java \
     java/util/Collections.java \
@@ -404,6 +403,7 @@
     java/util/concurrent/locks/ReadWriteLock.java \
     java/util/concurrent/locks/ReentrantLock.java \
     java/util/concurrent/locks/ReentrantReadWriteLock.java \
+    java/util/concurrent/locks/StampedLock.java \
     java/util/regex/Pattern.java \
     java/util/regex/Matcher.java \
     java/util/regex/MatchResult.java \
--- a/make/sun/Makefile	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/sun/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -70,7 +70,7 @@
 endif
 
 # nio need to be compiled before awt to have all charsets ready
-SUBDIRS            = jar security javazic misc net nio text util launcher cldr tzdb
+SUBDIRS            = jar security misc net nio text util launcher cldr tzdb
 
 ifdef BUILD_HEADLESS_ONLY
   DISPLAY_LIBS = awt $(HEADLESS_SUBDIR)
--- a/make/sun/javazic/Makefile	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/sun/javazic/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -33,11 +33,11 @@
 
 # Time zone data file creation
 TZDATA = ./tzdata/
-TZDATA_VER = `$(GREP) '^tzdata' $(TZDATA)VERSION`
+TZDATA_VER := $(shell $(GREP) '^tzdata' $(TZDATA)VERSION)
 TZFILE = \
     africa antarctica asia australasia europe northamerica \
     pacificnew southamerica backward \
-    etcetera solar87 solar88 solar89 systemv
+    etcetera systemv
 JDKTZDATA = ./tzdata_jdk/
 JDKTZFILES = gmt jdk11_backward
 TZFILES = \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/sun/javazic/tzdata/gmt	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2000, 2005, 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.
+#
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	GMT		0:00	-	GMT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/sun/javazic/tzdata/jdk11_backward	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 2000, 2006, 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.
+#
+# JDK 1.1.x compatible time zone IDs
+#
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	SystemV	min	1973	-	Apr	lastSun	2:00	1:00	D
+Rule	SystemV	min	1973	-	Oct	lastSun	2:00	0	S
+Rule	SystemV	1974	only	-	Jan	6	2:00	1:00	D
+Rule	SystemV	1974	only	-	Nov	lastSun	2:00	0	S
+Rule	SystemV	1975	only	-	Feb	23	2:00	1:00	D
+Rule	SystemV	1975	only	-	Oct	lastSun	2:00	0	S
+Rule	SystemV	1976	max	-	Apr	lastSun	2:00	1:00	D
+Rule	SystemV	1976	max	-	Oct	lastSun	2:00	0	S
+
+# Zone	NAME		GMTOFF	RULES/SAVE	FORMAT	[UNTIL]
+Zone	SystemV/AST4ADT	-4:00	SystemV		A%sT
+Zone	SystemV/EST5EDT	-5:00	SystemV		E%sT
+Zone	SystemV/CST6CDT	-6:00	SystemV		C%sT
+Zone	SystemV/MST7MDT	-7:00	SystemV		M%sT
+Zone	SystemV/PST8PDT	-8:00	SystemV		P%sT
+Zone	SystemV/YST9YDT	-9:00	SystemV		Y%sT
+Zone	SystemV/AST4	-4:00	-		AST
+Zone	SystemV/EST5	-5:00	-		EST
+Zone	SystemV/CST6	-6:00	-		CST
+Zone	SystemV/MST7	-7:00	-		MST
+Zone	SystemV/PST8	-8:00	-		PST
+Zone	SystemV/YST9	-9:00	-		YST
+Zone	SystemV/HST10	-10:00	-		HST
--- a/make/sun/tzdb/Makefile	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/sun/tzdb/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -43,9 +43,15 @@
 #
 TZDATA_DIR := ../javazic/tzdata
 TZDATA_VER := $(subst tzdata,,$(shell $(GREP) '^tzdata' $(TZDATA_DIR)/VERSION))
-TZFILE := africa antarctica asia australasia europe northamerica southamerica backward etcetera
+TZFILE := \
+    africa antarctica asia australasia europe northamerica \
+    pacificnew southamerica backward etcetera \
+    gmt jdk11_backward
+
 TZFILES := $(addprefix $(TZDATA_DIR)/,$(TZFILE))
 
+
+
 TZDB_JAR = tzdb.jar
 
 #
@@ -61,7 +67,7 @@
 $(LIBDIR)/$(TZDB_JAR): $(TZFILES)
 	$(prep-target)
 	echo build tzdb from version $(TZDATA_VER)
-	$(BOOT_JAVA_CMD) -jar $(BUILDTOOLJARDIR)/tzdb.jar -verbose \
+	$(BOOT_JAVA_CMD) -jar $(BUILDTOOLJARDIR)/tzdb.jar \
 	  -version $(TZDATA_VER) -srcdir $(TZDATA_DIR) -dstdir $(LIBDIR) $(TZFILE)
 
 clean clobber::
--- a/make/tools/Makefile	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/tools/Makefile	Wed Feb 20 10:16:45 2013 -0800
@@ -48,7 +48,6 @@
   hasher_classes            \
   jarreorder                \
   jarsplit                  \
-  javazic                   \
   jdwpgen                   \
   makeclasslist             \
   strip_properties          \
--- a/make/tools/src/build/tools/javazic/Zoneinfo.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/tools/src/build/tools/javazic/Zoneinfo.java	Wed Feb 20 10:16:45 2013 -0800
@@ -490,11 +490,16 @@
                                             tz.addUsedRec(rrec);
                                             usedZone = true;
                                         }
-                                    } else {
+                                    } else {  // fromTime == minTime
                                         int save = rrec.getSave();
-                                        tz.addTransition(fromTime,
+                                        tz.addTransition(minTime,
+                                                         tz.getOffsetIndex(gmtOffset),
+                                                         tz.getDstOffsetIndex(0));
+
+                                        tz.addTransition(transition,
                                                          tz.getOffsetIndex(gmtOffset+save),
                                                          tz.getDstOffsetIndex(save));
+
                                         tz.addUsedRec(rrec);
                                         usedZone = true;
                                     }
--- a/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java	Wed Feb 20 10:16:45 2013 -0800
@@ -227,6 +227,7 @@
         Map<String, SortedMap<String, ZoneRules>> allBuiltZones = new TreeMap<>();
         Set<String> allRegionIds = new TreeSet<String>();
         Set<ZoneRules> allRules = new HashSet<ZoneRules>();
+        Map<String, Map<String, String>> allLinks = new TreeMap<>();
 
         for (File srcDir : srcDirs) {
             // source files in this directory
@@ -242,7 +243,8 @@
             }
 
             // compile
-            String loopVersion = srcDir.getName();
+            String loopVersion = (srcDirs.size() == 1 && version != null)
+                                 ? version : srcDir.getName();
             TzdbZoneRulesCompiler compiler = new TzdbZoneRulesCompiler(loopVersion, srcFiles, verbose);
             try {
                 // compile
@@ -255,12 +257,13 @@
                 if (verbose) {
                     System.out.println("Outputting file: " + dstFile);
                 }
-                outputFile(dstFile, loopVersion, builtZones);
+                outputFile(dstFile, loopVersion, builtZones, compiler.links);
 
                 // create totals
                 allBuiltZones.put(loopVersion, builtZones);
                 allRegionIds.addAll(builtZones.keySet());
                 allRules.addAll(builtZones.values());
+                allLinks.put(loopVersion, compiler.links);
             } catch (Exception ex) {
                 System.out.println("Failed: " + ex.toString());
                 ex.printStackTrace();
@@ -274,7 +277,7 @@
             if (verbose) {
                 System.out.println("Outputting combined file: " + dstFile);
             }
-            outputFile(dstFile, allBuiltZones, allRegionIds, allRules);
+            outputFile(dstFile, allBuiltZones, allRegionIds, allRules, allLinks);
         }
     }
 
@@ -283,12 +286,15 @@
      */
     private static void outputFile(File dstFile,
                                    String version,
-                                   SortedMap<String, ZoneRules> builtZones) {
+                                   SortedMap<String, ZoneRules> builtZones,
+                                   Map<String, String> links) {
         Map<String, SortedMap<String, ZoneRules>> loopAllBuiltZones = new TreeMap<>();
         loopAllBuiltZones.put(version, builtZones);
         Set<String> loopAllRegionIds = new TreeSet<String>(builtZones.keySet());
         Set<ZoneRules> loopAllRules = new HashSet<ZoneRules>(builtZones.values());
-        outputFile(dstFile, loopAllBuiltZones, loopAllRegionIds, loopAllRules);
+        Map<String, Map<String, String>> loopAllLinks = new TreeMap<>();
+        loopAllLinks.put(version, links);
+        outputFile(dstFile, loopAllBuiltZones, loopAllRegionIds, loopAllRules, loopAllLinks);
     }
 
     /**
@@ -297,10 +303,10 @@
     private static void outputFile(File dstFile,
                                    Map<String, SortedMap<String, ZoneRules>> allBuiltZones,
                                    Set<String> allRegionIds,
-                                   Set<ZoneRules> allRules)
-    {
+                                   Set<ZoneRules> allRules,
+                                   Map<String, Map<String, String>> allLinks) {
         try (JarOutputStream jos = new JarOutputStream(new FileOutputStream(dstFile))) {
-            outputTZEntry(jos, allBuiltZones, allRegionIds, allRules);
+            outputTZEntry(jos, allBuiltZones, allRegionIds, allRules, allLinks);
         } catch (Exception ex) {
             System.out.println("Failed: " + ex.toString());
             ex.printStackTrace();
@@ -314,7 +320,8 @@
     private static void outputTZEntry(JarOutputStream jos,
                                       Map<String, SortedMap<String, ZoneRules>> allBuiltZones,
                                       Set<String> allRegionIds,
-                                      Set<ZoneRules> allRules) {
+                                      Set<ZoneRules> allRules,
+                                      Map<String, Map<String, String>> allLinks) {
         // this format is not publicly specified
         try {
             jos.putNextEntry(new ZipEntry("TZDB.dat"));
@@ -359,6 +366,16 @@
                      out.writeShort(rulesIndex);
                 }
             }
+            // alias-region
+            for (String version : allLinks.keySet()) {
+                out.writeShort(allLinks.get(version).size());
+                for (Map.Entry<String, String> entry : allLinks.get(version).entrySet()) {
+                     int aliasIndex = Arrays.binarySearch(regionArray, entry.getKey());
+                     int regionIndex = Arrays.binarySearch(regionArray, entry.getValue());
+                     out.writeShort(aliasIndex);
+                     out.writeShort(regionIndex);
+                }
+            }
             out.flush();
             jos.closeEntry();
         } catch (Exception ex) {
@@ -621,7 +638,8 @@
     private int parseYear(String str, int defaultYear) {
         if (YEAR.reset(str).matches()) {
             if (YEAR.group("min") != null) {
-                return YEAR_MIN_VALUE;
+                //return YEAR_MIN_VALUE;
+                return 1900;  // systemv has min
             } else if (YEAR.group("max") != null) {
                 return YEAR_MAX_VALUE;
             } else if (YEAR.group("only") != null) {
@@ -742,16 +760,20 @@
                 if (realRules == null) {
                     throw new IllegalArgumentException("Alias '" + aliasId + "' links to invalid zone '" + realId + "' for '" + version + "'");
                 }
+                links.put(aliasId, realId);
+
             }
             builtZones.put(aliasId, realRules);
         }
 
         // remove UTC and GMT
-        builtZones.remove("UTC");
-        builtZones.remove("GMT");
-        builtZones.remove("GMT0");
+        //builtZones.remove("UTC");
+        //builtZones.remove("GMT");
+        //builtZones.remove("GMT0");
         builtZones.remove("GMT+0");
         builtZones.remove("GMT-0");
+        links.remove("GMT+0");
+        links.remove("GMT-0");
     }
 
     //-----------------------------------------------------------------------
@@ -785,7 +807,6 @@
         boolean endOfDay;
         /** The time of the cutover. */
         TimeDefinition timeDefinition = TimeDefinition.WALL;
-
         void adjustToFowards(int year) {
             if (adjustForwards == false && dayOfMonth > 0) {
                 LocalDate adjustedDate = LocalDate.of(year, month, dayOfMonth).minusDays(6);
--- a/makefiles/CompileJavaClasses.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/CompileJavaClasses.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -59,6 +59,12 @@
       # This gets built on unix platforms implicitly in the old build even though
       # it's excluded in the closed build.
       EXCLUDES+=sun/java2d/pisces
+
+      # AccessBridge is compiled separately below.
+      EXFILES += AccessBridge.java \
+		 com/sun/java/accessibility/util/java/awt/ChoiceTranslator.java
+      # This seems to never be built
+      EXCLUDES += com/sun/java/accessibility/extensions
    endif
 
 endif
@@ -248,10 +254,8 @@
 # Now we have COPY_PATTERNS, COPY_FILES and COPY_EXTRA
 
 ifndef OPENJDK
-    CLOSED_SRC_DIRS:=$(JDK_TOPDIR)/src/closed/share/classes
-    ifneq ($(OPENJDK_TARGET_OS_API_DIR),windows)
-      CLOSED_SRC_DIRS += $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
-    endif
+    CLOSED_SRC_DIRS:=$(JDK_TOPDIR)/src/closed/share/classes \
+		     $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
 endif
 
 MACOSX_SRC_DIRS :=
@@ -364,8 +368,44 @@
 
 ##########################################################################################
 
-# copy with -a to preserve timestamps so dependencies down the line aren't messed up
+ifndef OPENJDK
+ifeq ($(OPENJDK_TARGET_OS), windows)
+ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
+    $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32,\
+		SETUP:=GENERATE_JDKBYTECODE,\
+		JAVAC_FLAGS:=-cp $(JDK_OUTPUTDIR)/classes,\
+		SRC:=$(JDK_OUTPUTDIR)/gensrc_ab/32bit,\
+		BIN:=$(JDK_OUTPUTDIR)/classes_ab/32bit))
+
+    $(BUILD_ACCESSBRIDGE_32): $(BUILD_JDK)
+
+    $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_LEGACY,\
+		SETUP:=GENERATE_JDKBYTECODE,\
+		JAVAC_FLAGS:=-cp $(JDK_OUTPUTDIR)/classes,\
+		SRC:=$(JDK_OUTPUTDIR)/gensrc_ab/legacy,\
+		BIN:=$(JDK_OUTPUTDIR)/classes_ab/legacy))
+
+    $(BUILD_ACCESSBRIDGE_LEGACY): $(BUILD_JDK)
+
+else
+
+    $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_64,\
+		SETUP:=GENERATE_JDKBYTECODE,\
+		JAVAC_FLAGS:=-cp $(JDK_OUTPUTDIR)/classes,\
+		SRC:=$(JDK_OUTPUTDIR)/gensrc_ab/64bit,\
+		BIN:=$(JDK_OUTPUTDIR)/classes_ab/64bit))
+
+    $(BUILD_ACCESSBRIDGE_64): $(BUILD_JDK)
+
+endif
+endif
+endif
+
+##########################################################################################
+
 all: $(BUILD_JDK) $(BUILD_ALTCLASSES) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
-	$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin
+	$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
+	$(BUILD_ACCESSBRIDGE_32) $(BUILD_ACCESSBRIDGE_64) \
+	$(BUILD_ACCESSBRIDGE_LEGACY)
 
 .PHONY: all
--- a/makefiles/CompileLaunchers.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/CompileLaunchers.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -591,6 +591,34 @@
 endif
 
 ##########################################################################################
+# jabswitch
+
+ifndef OPENJDK
+ifeq ($(OPENJDK_TARGET_OS),windows)
+
+    $(eval $(call SetupNativeCompilation,BUILD_JABSWITCH,\
+		SRC:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge,\
+		INCLUDE_FILES:=jabswitch.cpp,\
+		LANG:=C++,\
+		CFLAGS:=$(filter-out -Zc:wchar_t-,$(CFLAGS_JDKEXE)) -Zc:wchar_t \
+			-analyze- -Od -Gd -D_WINDOWS \
+			-D_UNICODE -DUNICODE -RTC1 -EHsc,\
+		LDFLAGS:=$(LDFLAGS_JDKEXE) \
+			 Advapi32.lib Version.lib User32.lib,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jabswitch,\
+		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/bin,\
+		PROGRAM:=jabswitch,\
+		DEBUG_SYMBOLS:=true,\
+		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/AccessBridgeStatusWindow.rc,\
+		RC_FLAGS:=$(RC_FLAGS),\
+		MANIFEST:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/jabswitch.manifest))
+
+    BUILD_LAUNCHERS += $(BUILD_JABSWITCH)
+
+endif
+endif
+
+##########################################################################################
 
 $(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk
 
--- a/makefiles/CompileNativeLibraries.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/CompileNativeLibraries.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -3296,6 +3296,97 @@
 
 ##########################################################################################
 
+ifndef OPENJDK
+ifeq ($(OPENJDK_TARGET_OS), windows)
+
+  ACCESSBRIDGE_SRCDIR:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
+
+  define SetupAccessBridge
+    # Parameter 1 Suffix
+    # Parameter 2 Machine
+    # Parameter 3 ACCESSBRIDGE_ARCH_ suffix
+
+    $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1,\
+		LIBRARY=JAWTAccessBridge$1,\
+		OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(ACCESSBRIDGE_SRCDIR),\
+		INCLUDE_FILES:=JAWTAccessBridge.cpp,\
+		LANG:=C++,\
+		OPTIMIZATION:=LOW,\
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+			-DACCESSBRIDGE_ARCH_$3,\
+		LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
+			 winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
+			 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
+			 -subsystem:windows -machine:$2 \
+			 -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF,\
+		VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
+		RC_FLAGS:=$(RC_FLAGS),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1,\
+		DEBUG_SYMBOLS:=true)
+
+    $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
+
+    $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1,\
+		LIBRARY=JavaAccessBridge$1,\
+		OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(ACCESSBRIDGE_SRCDIR),\
+		INCLUDE_FILES:=AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \
+			       AccessBridgeJavaEntryPoints.cpp \
+			       AccessBridgeMessages.cpp JavaAccessBridge.cpp,\
+		LANG:=C++,\
+		OPTIMIZATION:=LOW,\
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+			-DACCESSBRIDGE_ARCH_$3,\
+		LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
+			 winspool.lib comdlg32.lib advapi32.lib shell32.lib \
+			 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
+			 -subsystem:windows -machine:$2 \
+			 -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF,\
+		VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
+		RC_FLAGS:=$(RC_FLAGS),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1,\
+		DEBUG_SYMBOLS:=true)
+
+    $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1,\
+		LIBRARY=WindowsAccessBridge$1,\
+		OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(ACCESSBRIDGE_SRCDIR),\
+		INCLUDE_FILES:=AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \
+			       AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \
+			       WinAccessBridge.cpp AccessBridgeDebug.cpp \
+			       AccessBridgeEventHandler.cpp,\
+		LANG:=C++,\
+		OPTIMIZATION:=LOW,\
+		CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKLIB)) -MT \
+			-DACCESSBRIDGE_ARCH_$3,\
+		LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
+			 winspool.lib comdlg32.lib advapi32.lib shell32.lib \
+			 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
+			 -subsystem:windows -machine:$2 \
+			 -def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF,\
+		VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
+		RC_FLAGS:=$(RC_FLAGS),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1,\
+		DEBUG_SYMBOLS:=true)
+
+    BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \
+		       $$(BUILD_WINDOWSACCESSBRIDGE$1)
+
+  endef
+
+  ifeq ($(OPENJDK_TARGET_CPU_BITS),32)
+    $(eval $(call SetupAccessBridge,-32,I386,32))
+    $(eval $(call SetupAccessBridge,,I386,LEGACY))
+  else
+    $(eval $(call SetupAccessBridge,-64,X64,64))
+  endif
+endif
+endif
+
+
+##########################################################################################
+
 all: $(COPY_FILES) $(BUILD_LIBRARIES)
 
 .PHONY: all
--- a/makefiles/CopyFiles.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/CopyFiles.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -42,7 +42,7 @@
 		$(INCLUDEDIR)/jvmticmlr.h		\
 		$(INCLUDEDIR)/classfile_constants.h	\
 		$(INCLUDEDIR)/jawt.h			\
-		$(OPENJDK_TARGET_OS_INCLUDE)/jni_md.h		\
+		$(OPENJDK_TARGET_OS_INCLUDE)/jni_md.h	\
 		$(OPENJDK_TARGET_OS_INCLUDE)/jawt_md.h
 
 $(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h
@@ -59,6 +59,27 @@
 
 ##########################################################################################
 
+ifndef OPENJDK
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    COPY_FILES += $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCallbacks.h \
+		  $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.h \
+		  $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgePackages.h \
+		  $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.c \
+		  $(JDK_OUTPUTDIR)/lib/accessibility.properties
+
+    $(OPENJDK_TARGET_OS_INCLUDE)/bridge/%: \
+		$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/%
+	$(install-file)
+
+    $(JDK_OUTPUTDIR)/lib/accessibility.properties: \
+		$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/accessibility.properties
+	$(install-file)
+
+endif
+endif
+
+##########################################################################################
+
 LIBDIR = $(JDK_OUTPUTDIR)/lib
 SERVICETAG_LIBDIR = $(LIBDIR)/servicetag
 
@@ -267,10 +288,12 @@
 
 ifeq ($(OPENJDK_TARGET_OS),windows)
     MSVCR_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCR_DLL))
+    # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
     $(MSVCR_TARGET): $(MSVCR_DLL)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(CP) $< $@
+	$(CHMOD) a+rx $@
 
     COPY_FILES += $(MSVCR_TARGET)
 endif
--- a/makefiles/CreateJars.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/CreateJars.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -141,6 +141,7 @@
 	com/sun/crypto/provider \
 	com/sun/istack/internal/tools \
 	com/sun/jarsigner \
+	com/sun/java/accessibility \
 	com/sun/javadoc \
 	com/sun/jdi \
 	com/sun/net/ssl/internal/ssl \
@@ -835,7 +836,7 @@
 $(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
 	$(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
 	$(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
-	$(JAVA) $(JAVAC_JARS) \
+	$(JAVA) $(NEW_JAVAC) \
 	    -bootclasspath $(JDK_OUTPUTDIR)/classes \
 	    -XDprocess.packages -proc:only \
 	    -processor com.sun.tools.javac.sym.CreateSymbols \
@@ -941,6 +942,47 @@
 
 ##########################################################################################
 
+ifndef OPENJDK
+ifeq ($(OPENJDK_TARGET_OS), windows)
+
+    $(eval $(call SetupArchive,BUILD_JACCESS_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes,\
+		INCLUDES:=com/sun/java/accessibility/util,\
+		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar,\
+		SKIP_METAINF:=true))
+
+    JARS += $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar
+
+    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
+        $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_32_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes_ab/32bit $(JDK_OUTPUTDIR)/classes,\
+		INCLUDES:=com/sun/java/accessibility,\
+		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar,\
+		SKIP_METAINF:=true))
+
+        $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_LEGACY_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes_ab/legacy $(JDK_OUTPUTDIR)/classes,\
+		INCLUDES:=com/sun/java/accessibility,\
+		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar,\
+		SKIP_METAINF:=true))
+
+        JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar \
+		$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar
+    else
+        $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_64_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes_ab/64bit $(JDK_OUTPUTDIR)/classes,\
+		INCLUDES:=com/sun/java/accessibility,\
+		EXCLUDES:=com/sun/java/accessibility/util/java,\
+		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar,\
+		SKIP_METAINF:=true))
+
+        JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
+    endif
+endif
+endif
+
+##########################################################################################
+
 #
 # This is an empty jar (only contains manifest) and fits poorly into framework...
 #   create simple rule instead
--- a/makefiles/GendataTZDB.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/GendataTZDB.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -30,7 +30,7 @@
 #
 TZDATA_DIR := $(JDK_TOPDIR)/make/sun/javazic/tzdata
 TZDATA_VER := $(subst tzdata,,$(shell $(GREP) '^tzdata' $(TZDATA_DIR)/VERSION))
-TZDATA_TZFILE := africa antarctica asia australasia europe northamerica southamerica backward etcetera
+TZDATA_TZFILE := africa antarctica asia australasia europe northamerica pacificnew southamerica backward etcetera gmt jdk11_backward
 TZDATA_TZFILES := $(addprefix $(TZDATA_DIR)/,$(TZDATA_TZFILE))
 
 GENDATA_TZDB_DST := $(JDK_OUTPUTDIR)/lib
@@ -39,6 +39,6 @@
 $(GENDATA_TZDB_DST)/$(GENDATA_TZDB_JAR) : $(TZDATA_TZFILES)
 	$(RM) $(GENDATA_TZDB_DST)/$(GENDATA_TZDB_JAR)
 	echo building tzdb from version $(TZDATA_VER)
-	$(TOOL_TZDB) -verbose -version $(TZDATA_VER) -srcdir $(TZDATA_DIR) -dstdir $(GENDATA_TZDB_DST) $(TZDATA_TZFILE)
+	$(TOOL_TZDB) -version $(TZDATA_VER) -srcdir $(TZDATA_DIR) -dstdir $(GENDATA_TZDB_DST) $(TZDATA_TZFILE)
 
 GENDATA_TZDB += $(GENDATA_TZDB_DST)/$(GENDATA_TZDB_JAR)
--- a/makefiles/GendataTimeZone.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/GendataTimeZone.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -34,7 +34,7 @@
 TZFILE0 := \
     africa antarctica asia australasia europe northamerica \
     pacificnew southamerica backward \
-    etcetera solar87 solar88 solar89 systemv
+    etcetera systemv
 
 TZFILE1 := \
     gmt jdk11_backward
--- a/makefiles/GenerateData.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/GenerateData.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -44,9 +44,6 @@
 include GendataFontConfig.gmk
 GENDATA += $(GENDATA_FONT_CONFIG)
 
-include GendataTimeZone.gmk
-GENDATA += $(GENDATA_TIMEZONE)
-
 include GendataTZDB.gmk
 GENDATA += $(GENDATA_TZDB)
 
--- a/makefiles/GensrcMisc.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/GensrcMisc.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -190,3 +190,36 @@
 
 
 endif
+
+##########################################################################################
+
+ifndef OPENJDK
+ifeq ($(OPENJDK_TARGET_OS), windows)
+
+    AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
+    AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility
+
+    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
+         $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java: \
+			$(AB_SRC_DIR)/32bit/AccessBridge.java
+		$(install-file)
+
+         $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java: \
+			$(AB_SRC_DIR)/legacy/AccessBridge.java
+		$(install-file)
+
+        GENSRC_MISC += $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java \
+		       $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java
+
+    else
+         $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java: \
+			$(AB_SRC_DIR)/64bit/AccessBridge.java
+		$(install-file)
+
+         GENSRC_MISC += $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java
+
+    endif
+endif
+endif
+
+##########################################################################################
\ No newline at end of file
--- a/makefiles/GensrcSwing.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/GensrcSwing.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -71,7 +71,7 @@
 $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/SwingBeanInfoBase.java $(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS)
 	$(ECHO) Generating beaninfo
 	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing
-	$(JAVA) -Djava.awt.headless=true -jar $(JAVADOC_JARS) -doclet GenDocletBeanInfo \
+	$(JAVA) -Djava.awt.headless=true $(NEW_JAVADOC) -doclet GenDocletBeanInfo \
 	-x $(SWINGBEAN_DEBUG_FLAG) -d $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing \
 	-t $(DOCLETSRC_DIR)/SwingBeanInfo.template -docletpath $(JDK_OUTPUTDIR)/btclasses \
 	-XDignore.symbol.file=true \
--- a/makefiles/Setup.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/Setup.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -23,10 +23,6 @@
 # questions.
 #
 
-JAVAC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar
-JAVAH_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar
-JAVADOC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javadoc.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javadoc.jar
-
 DISABLE_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
 
 # The generate old bytecode javac setup uses the new compiler to compile for the
@@ -34,7 +30,7 @@
 # Thus we force the target bytecode to 7.
 $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\
      JVM:=$(JAVA),\
-     JAVAC:=$(JAVAC_JARS),\
+     JAVAC:=$(NEW_JAVAC),\
      FLAGS:=-source 7 -target 7 -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS),\
      SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
      SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
@@ -43,8 +39,7 @@
 # new jdk. This new bytecode might only be possible to run using the new jvm.
 $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE,\
      JVM:=$(JAVA),\
-     JAVAC:=$(JAVAC_JARS),\
-     JAVAH:=$(JAVAH_JARS),\
+     JAVAC:=$(NEW_JAVAC),\
      FLAGS:=-bootclasspath $(JDK_OUTPUTDIR)/classes -source 8 -target 8 -encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS),\
      SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
      SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
@@ -55,7 +50,7 @@
 # (it will be in "make images") therefore we use classes instead.
 $(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE,\
      JVM:=$(JAVA),\
-     JAVAC:=$(JAVAC_JARS),\
+     JAVAC:=$(NEW_JAVAC),\
      FLAGS:=-bootclasspath $(JDK_OUTPUTDIR)/classes $(DISABLE_WARNINGS),\
      SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
      SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
--- a/makefiles/Tools.gmk	Wed Feb 20 16:39:46 2013 +0100
+++ b/makefiles/Tools.gmk	Wed Feb 20 10:16:45 2013 -0800
@@ -103,9 +103,6 @@
 TOOL_JARSPLIT=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
 	build.tools.jarsplit.JarSplit
 
-TOOL_JAVAZIC=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
-	build.tools.javazic.Main
-
 TOOL_TZDB=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
 	build.tools.tzdb.TzdbZoneRulesCompiler
 
--- a/src/macosx/classes/com/apple/laf/AquaKeyBindings.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/com/apple/laf/AquaKeyBindings.java	Wed Feb 20 10:16:45 2013 -0800
@@ -142,6 +142,21 @@
         }));
     }
 
+    LateBoundInputMap getPasswordFieldInputMap() {
+        return new LateBoundInputMap(new SimpleBinding(getTextFieldInputMap().getBindings()),
+                // nullify all the bindings that may discover space characters in the text
+                new SimpleBinding(new String[] {
+                        "alt LEFT", null,
+                        "alt KP_LEFT", null,
+                        "alt RIGHT", null,
+                        "alt KP_RIGHT", null,
+                        "shift alt LEFT", null,
+                        "shift alt KP_LEFT", null,
+                        "shift alt RIGHT", null,
+                        "shift alt KP_RIGHT", null,
+                }));
+    }
+
     LateBoundInputMap getMultiLineTextInputMap() {
         return new LateBoundInputMap(new SimpleBinding(commonTextEditorBindings), new SimpleBinding(new String[] {
             "ENTER", DefaultEditorKit.insertBreakAction,
--- a/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Wed Feb 20 10:16:45 2013 -0800
@@ -697,7 +697,7 @@
             "Panel.foreground", black,
             "Panel.opaque", useOpaqueComponents,
 
-            "PasswordField.focusInputMap", aquaKeyBindings.getTextFieldInputMap(),
+            "PasswordField.focusInputMap", aquaKeyBindings.getPasswordFieldInputMap(),
             "PasswordField.font", controlFont,
             "PasswordField.background", textBackground,
             "PasswordField.foreground", textForeground,
--- a/src/macosx/classes/com/apple/laf/AquaPainter.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/com/apple/laf/AquaPainter.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -37,7 +37,6 @@
 import sun.java2d.*;
 import sun.print.*;
 import apple.laf.*;
-import apple.laf.JRSUIConstants.Widget;
 import apple.laf.JRSUIUtils.NineSliceMetricsProvider;
 
 abstract class AquaPainter <T extends JRSUIState> {
@@ -63,7 +62,7 @@
     }
 
     static <T extends JRSUIState> AquaPainter<T> create(final T state, final NineSliceMetricsProvider metricsProvider) {
-        return new AquaNineSlicingImagePainter<T>(state, metricsProvider);
+        return new AquaNineSlicingImagePainter<>(state, metricsProvider);
     }
 
     abstract void paint(final Graphics2D g, final T stateToPaint, final Component c);
@@ -71,7 +70,7 @@
     final Rectangle boundsRect = new Rectangle();
     final JRSUIControl control;
     T state;
-    public AquaPainter(final JRSUIControl control, final T state) {
+    AquaPainter(final JRSUIControl control, final T state) {
         this.control = control;
         this.state = state;
     }
@@ -94,14 +93,14 @@
         protected final HashMap<T, RecyclableJRSUISlicedImageControl> slicedControlImages;
         protected final NineSliceMetricsProvider metricsProvider;
 
-        public AquaNineSlicingImagePainter(final T state) {
+        AquaNineSlicingImagePainter(final T state) {
             this(state, null);
         }
 
-        public AquaNineSlicingImagePainter(final T state, final NineSliceMetricsProvider metricsProvider) {
+        AquaNineSlicingImagePainter(final T state, final NineSliceMetricsProvider metricsProvider) {
             super(new JRSUIControl(false), state);
             this.metricsProvider = metricsProvider;
-            slicedControlImages = new HashMap<T, RecyclableJRSUISlicedImageControl>();
+            slicedControlImages = new HashMap<>();
         }
 
         @Override
@@ -127,7 +126,7 @@
     }
 
     static class AquaSingleImagePainter<T extends JRSUIState> extends AquaPainter<T> {
-        public AquaSingleImagePainter(final T state) {
+        AquaSingleImagePainter(final T state) {
             super(new JRSUIControl(false), state);
         }
 
@@ -137,12 +136,12 @@
         }
 
         static void paintFromSingleCachedImage(final Graphics2D g, final JRSUIControl control, final JRSUIState controlState, final Component c, final Rectangle boundsRect) {
-            Rectangle clipRect = g.getClipBounds();
-            Rectangle intersection = boundsRect.intersection(clipRect);
+            final Rectangle clipRect = g.getClipBounds();
+            final Rectangle intersection = boundsRect.intersection(clipRect);
             if (intersection.width <= 0 || intersection.height <= 0) return;
 
-            int imgX1 = intersection.x - boundsRect.x;
-            int imgY1 = intersection.y - boundsRect.y;
+            final int imgX1 = intersection.x - boundsRect.x;
+            final int imgY1 = intersection.y - boundsRect.y;
 
             final GraphicsConfiguration config = g.getDeviceConfiguration();
             final ImageCache cache = ImageCache.getInstance();
@@ -150,20 +149,15 @@
             if (image == null) {
                 image = new BufferedImage(boundsRect.width, boundsRect.height, BufferedImage.TYPE_INT_ARGB_PRE);
                 cache.setImage(image, config, boundsRect.width, boundsRect.height, controlState);
-            } else {
-                g.drawImage(image, intersection.x, intersection.y, intersection.x + intersection.width, intersection.y + intersection.height,
-                        imgX1, imgY1, imgX1 + intersection.width, imgY1 + intersection.height, null);
-                return;
+                final WritableRaster raster = image.getRaster();
+                final DataBufferInt buffer = (DataBufferInt)raster.getDataBuffer();
+
+                control.set(controlState);
+                control.paint(SunWritableRaster.stealData(buffer, 0),
+                              image.getWidth(), image.getHeight(), 0, 0, boundsRect.width, boundsRect.height);
+                SunWritableRaster.markDirty(buffer);
             }
 
-            final WritableRaster raster = image.getRaster();
-            final DataBufferInt buffer = (DataBufferInt)raster.getDataBuffer();
-
-            control.set(controlState);
-            control.paint(SunWritableRaster.stealData(buffer, 0),
-                    image.getWidth(), image.getHeight(), 0, 0, boundsRect.width, boundsRect.height);
-            SunWritableRaster.markDirty(buffer);
-
             g.drawImage(image, intersection.x, intersection.y, intersection.x + intersection.width, intersection.y + intersection.height,
                     imgX1, imgY1, imgX1 + intersection.width, imgY1 + intersection.height, null);
         }
@@ -173,7 +167,7 @@
         final JRSUIControl control;
         final JRSUIState state;
 
-        public RecyclableJRSUISlicedImageControl(final JRSUIControl control, final JRSUIState state, final NineSliceMetrics metrics) {
+        RecyclableJRSUISlicedImageControl(final JRSUIControl control, final JRSUIState state, final NineSliceMetrics metrics) {
             super(metrics);
             this.control = control;
             this.state = state;
--- a/src/macosx/classes/com/apple/laf/ImageCache.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/com/apple/laf/ImageCache.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -30,6 +30,7 @@
 import java.util.*;
 import java.util.concurrent.locks.*;
 
+import apple.laf.JRSUIConstants;
 import apple.laf.JRSUIState;
 import com.apple.laf.AquaUtils.RecyclableSingleton;
 
@@ -38,9 +39,9 @@
  * SoftReferences so they will be dropped by the GC if heap memory gets tight. When our size hits max pixel count least
  * recently requested images are removed first.
  */
-class ImageCache {
+final class ImageCache {
     // Ordered Map keyed by args hash, ordered by most recent accessed entry.
-    private final LinkedHashMap<Integer, PixelCountSoftReference> map = new LinkedHashMap<Integer, PixelCountSoftReference>(16, 0.75f, true);
+    private final LinkedHashMap<Integer, PixelCountSoftReference> map = new LinkedHashMap<>(16, 0.75f, true);
 
     // Maximum number of pixels to cache, this is used if maxCount
     private final int maxPixelCount;
@@ -50,7 +51,7 @@
     // Lock for concurrent access to map
     private final ReadWriteLock lock = new ReentrantReadWriteLock();
     // Reference queue for tracking lost softreferences to images in the cache
-    private final ReferenceQueue<Image> referenceQueue = new ReferenceQueue<Image>();
+    private final ReferenceQueue<Image> referenceQueue = new ReferenceQueue<>();
 
     // Singleton Instance
     private static final RecyclableSingleton<ImageCache> instance = new RecyclableSingleton<ImageCache>() {
@@ -63,11 +64,11 @@
         return instance.get();
     }
 
-    public ImageCache(final int maxPixelCount) {
+    ImageCache(final int maxPixelCount) {
         this.maxPixelCount = maxPixelCount;
     }
 
-    public ImageCache() {
+    ImageCache() {
         this((8 * 1024 * 1024) / 4); // 8Mb of pixels
     }
 
@@ -99,10 +100,13 @@
      * @param config The graphics configuration, needed if cached image is a Volatile Image. Used as part of cache key
      * @param w      The image width, used as part of cache key
      * @param h      The image height, used as part of cache key
-     * @param args   Other arguments to use as part of the cache key
-     * @return true if the image could be cached or false if the image is too big
+     * @return true if the image could be cached, false otherwise.
      */
     public boolean setImage(final Image image, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
+        if (state.is(JRSUIConstants.Animating.YES)) {
+            return false;
+        }
+
         final int hash = hash(config, w, h, state);
 
         lock.writeLock().lock();
@@ -167,7 +171,7 @@
         private final int h;
         private final JRSUIState state;
 
-        public PixelCountSoftReference(final Image referent, final ReferenceQueue<? super Image> q, final int pixelCount, final int hash, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
+        PixelCountSoftReference(final Image referent, final ReferenceQueue<? super Image> q, final int pixelCount, final int hash, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
             super(referent, q);
             this.pixelCount = pixelCount;
             this.hash = hash;
--- a/src/macosx/classes/sun/awt/CGraphicsDevice.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/awt/CGraphicsDevice.java	Wed Feb 20 10:16:45 2013 -0800
@@ -30,6 +30,7 @@
 import java.awt.Window;
 import java.awt.AWTPermission;
 import java.awt.DisplayMode;
+import java.util.Objects;
 
 import sun.java2d.opengl.CGLGraphicsConfig;
 
@@ -122,12 +123,12 @@
         boolean fsSupported = isFullScreenSupported();
 
         if (fsSupported && old != null) {
-            // enter windowed mode (and restore original display mode)
-            exitFullScreenExclusive(old);
+            // restore original display mode and enter windowed mode.
             if (originalMode != null) {
                 setDisplayMode(originalMode);
                 originalMode = null;
             }
+            exitFullScreenExclusive(old);
         }
 
         super.setFullScreenWindow(w);
@@ -186,13 +187,20 @@
     }
 
     @Override
-    public void setDisplayMode(DisplayMode dm) {
+    public void setDisplayMode(final DisplayMode dm) {
         if (dm == null) {
             throw new IllegalArgumentException("Invalid display mode");
         }
-        nativeSetDisplayMode(displayID, dm.getWidth(), dm.getHeight(), dm.getBitDepth(), dm.getRefreshRate());
-        if (isFullScreenSupported() && getFullScreenWindow() != null) {
-            getFullScreenWindow().setSize(dm.getWidth(), dm.getHeight());
+        if (!Objects.equals(dm, getDisplayMode())) {
+            final Window w = getFullScreenWindow();
+            if (w != null) {
+                exitFullScreenExclusive(w);
+            }
+            nativeSetDisplayMode(displayID, dm.getWidth(), dm.getHeight(),
+                                 dm.getBitDepth(), dm.getRefreshRate());
+            if (isFullScreenSupported() && w != null) {
+                enterFullScreenExclusive(w);
+            }
         }
     }
 
--- a/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1226,7 +1226,7 @@
         sendEventToDelegate(e);
     }
 
-    private void sendEventToDelegate(final AWTEvent e) {
+    protected void sendEventToDelegate(final AWTEvent e) {
         synchronized (getDelegateLock()) {
             if (getDelegate() == null || !isShowing() || !isEnabled()) {
                 return;
--- a/src/macosx/classes/sun/lwawt/LWScrollPanePeer.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/LWScrollPanePeer.java	Wed Feb 20 10:16:45 2013 -0800
@@ -29,6 +29,7 @@
 import javax.swing.event.ChangeListener;
 import javax.swing.event.ChangeEvent;
 import java.awt.*;
+import java.awt.event.MouseWheelEvent;
 import java.awt.peer.ScrollPanePeer;
 import java.util.List;
 
@@ -52,6 +53,21 @@
     }
 
     @Override
+    public void handleEvent(AWTEvent e) {
+        if (e instanceof MouseWheelEvent) {
+            MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
+            //java.awt.ScrollPane consumes the event
+            // in case isWheelScrollingEnabled() is true,
+            // forcibly send the consumed event to the delegate
+            if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
+                sendEventToDelegate(wheelEvent);
+            }
+        } else {
+            super.handleEvent(e);
+        }
+    }
+
+    @Override
     public void stateChanged(final ChangeEvent e) {
         SwingUtilities.invokeLater(new Runnable() {
             @Override
--- a/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java	Wed Feb 20 10:16:45 2013 -0800
@@ -34,7 +34,7 @@
 import java.awt.event.FocusEvent;
 import java.awt.peer.TextFieldPeer;
 
-import javax.swing.JPasswordField;
+import javax.swing.*;
 import javax.swing.text.JTextComponent;
 
 final class LWTextFieldPeer
@@ -48,7 +48,7 @@
 
     @Override
     protected JPasswordField createDelegate() {
-        return new JTextAreaDelegate();
+        return new JPasswordFieldDelegate();
     }
 
     @Override
@@ -69,9 +69,18 @@
     public void setEchoChar(final char echoChar) {
         synchronized (getDelegateLock()) {
             getDelegate().setEchoChar(echoChar);
-            getDelegate().putClientProperty("JPasswordField.cutCopyAllowed",
-                                            getDelegate().echoCharIsSet()
-                                            ? Boolean.FALSE : Boolean.TRUE);
+            final boolean cutCopyAllowed;
+            final String focusInputMapKey;
+            if (echoChar != 0) {
+                cutCopyAllowed = false;
+                focusInputMapKey = "PasswordField.focusInputMap";
+            } else {
+                cutCopyAllowed = true;
+                focusInputMapKey = "TextField.focusInputMap";
+            }
+            getDelegate().putClientProperty("JPasswordField.cutCopyAllowed", cutCopyAllowed);
+            InputMap inputMap = (InputMap) UIManager.get(focusInputMapKey);
+            SwingUtilities.replaceUIInputMap(getDelegate(), JComponent.WHEN_FOCUSED, inputMap);
         }
     }
 
@@ -106,11 +115,11 @@
         super.handleJavaFocusEvent(e);
     }
 
-    private final class JTextAreaDelegate extends JPasswordField {
+    private final class JPasswordFieldDelegate extends JPasswordField {
 
         // Empty non private constructor was added because access to this
         // class shouldn't be emulated by a synthetic accessor method.
-        JTextAreaDelegate() {
+        JPasswordFieldDelegate() {
             super();
         }
 
--- a/src/macosx/classes/sun/lwawt/LWToolkit.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/LWToolkit.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -539,7 +539,7 @@
     @Override
     public void ungrab(Window w) {
         if (w.getPeer() != null) {
-            ((LWWindowPeer)w.getPeer()).ungrab();
+            ((LWWindowPeer)w.getPeer()).ungrab(false);
         }
     }
 }
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
 
     private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWWindowPeer");
 
-    private PlatformWindow platformWindow;
+    private final PlatformWindow platformWindow;
 
     // Window bounds reported by the native system (as opposed to
     // regular bounds inherited from LWComponentPeer which are
@@ -554,12 +554,14 @@
 
     /**
      * Called by the {@code PlatformWindow} when this window is moved/resized by
-     * user. There's no notifyReshape() in LWComponentPeer as the only
-     * components which could be resized by user are top-level windows.
+     * user or window insets are changed. There's no notifyReshape() in
+     * LWComponentPeer as the only components which could be resized by user are
+     * top-level windows.
      */
     public final void notifyReshape(int x, int y, int w, int h) {
         final boolean moved;
         final boolean resized;
+        final boolean invalid = updateInsets(platformWindow.getInsets());
         synchronized (getStateLock()) {
             moved = (x != sysX) || (y != sysY);
             resized = (w != sysW) || (h != sysH);
@@ -570,7 +572,7 @@
         }
 
         // Check if anything changed
-        if (!moved && !resized) {
+        if (!moved && !resized && !invalid) {
             return;
         }
         // First, update peer's bounds
@@ -584,10 +586,10 @@
         }
 
         // Third, COMPONENT_MOVED/COMPONENT_RESIZED/PAINT events
-        if (moved) {
+        if (moved || invalid) {
             handleMove(x, y, true);
         }
-        if (resized) {
+        if (resized || invalid) {
             handleResize(w, h, true);
             repaintPeer();
         }
@@ -999,27 +1001,21 @@
         }
     }
 
-    /*
-     * Request the window insets from the delegate and compares it
-     * with the current one. This method is mostly called by the
-     * delegate, e.g. when the window state is changed and insets
-     * should be recalculated.
-     *
+    /**
+     * Request the window insets from the delegate and compares it with the
+     * current one. This method is mostly called by the delegate, e.g. when the
+     * window state is changed and insets should be recalculated.
+     * <p/>
      * This method may be called on the toolkit thread.
      */
-    public boolean updateInsets(Insets newInsets) {
-        boolean changed = false;
+    public final boolean updateInsets(final Insets newInsets) {
         synchronized (getStateLock()) {
-            changed = (insets.equals(newInsets));
+            if (insets.equals(newInsets)) {
+                return false;
+            }
             insets = newInsets;
         }
-
-        if (changed) {
-            replaceSurfaceData();
-            repaintPeer();
-        }
-
-        return changed;
+        return true;
     }
 
     public static LWWindowPeer getWindowUnderCursor() {
@@ -1208,13 +1204,19 @@
         grabbingWindow = this;
     }
 
-    void ungrab() {
+    final void ungrab(boolean doPost) {
         if (isGrabbing()) {
             grabbingWindow = null;
-            postEvent(new UngrabEvent(getTarget()));
+            if (doPost) {
+                postEvent(new UngrabEvent(getTarget()));
+            }
         }
     }
 
+    void ungrab() {
+        ungrab(true);
+    }
+
     private boolean isGrabbing() {
         return this == grabbingWindow;
     }
--- a/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java	Wed Feb 20 10:16:45 2013 -0800
@@ -273,8 +273,31 @@
 
     @Override
     protected ByteArrayOutputStream convertFileListToBytes(ArrayList<String> fileList) throws IOException {
-        // TODO Auto-generated method stub
-        return null;
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        for (int i = 0; i < fileList.size(); i++)
+        {
+            byte[] bytes = fileList.get(i).getBytes();
+            bos.write(bytes, 0, bytes.length);
+            bos.write(0);
+        }
+        return bos;
+    }
+
+    @Override
+    protected boolean isURIListFormat(long format) {
+        String nat = getNativeForFormat(format);
+        if (nat == null) {
+            return false;
+        }
+        try {
+            DataFlavor df = new DataFlavor(nat);
+            if (df.getPrimaryType().equals("text") && df.getSubType().equals("uri-list")) {
+                return true;
+            }
+        } catch (Exception e) {
+            // Not a MIME format.
+        }
+        return false;
     }
 }
 
--- a/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Feb 20 10:16:45 2013 -0800
@@ -88,40 +88,25 @@
         DragGestureEvent trigger = getTrigger();
         InputEvent         triggerEvent = trigger.getTriggerEvent();
 
-        Point dragOrigin = trigger.getDragOrigin();
+        Point dragOrigin = new Point(trigger.getDragOrigin());
         int extModifiers = (triggerEvent.getModifiers() | triggerEvent.getModifiersEx());
         long timestamp   = triggerEvent.getWhen();
         int clickCount   = ((triggerEvent instanceof MouseEvent) ? (((MouseEvent) triggerEvent).getClickCount()) : 1);
 
-        // Get drag source component and its peer:
         Component component = trigger.getComponent();
-        Point componentOffset = new Point();
-        ComponentPeer peer = component.getPeer();
-
-        // For a lightweight component traverse up the hierarchy to the first heavyweight
-        // which will be used as the ComponentModel for the native drag source.
-        if (component.isLightweight()) {
-            Point loc = component.getLocation();
-            componentOffset.translate(loc.x, loc.y);
-
-            for (Component parent = component.getParent(); parent != null; parent = parent.getParent()) {
-                if (parent.isLightweight() == false) {
-                    peer = parent.getPeer();
-                    break;
-                }
-
-                loc = parent.getLocation();
-                componentOffset.translate(loc.x, loc.y);
-            }
+        // For a lightweight component traverse up the hierarchy to the root
+        Point loc = component.getLocation();
+        Component rootComponent = component;
+        while (!(rootComponent instanceof Window)) {
+            dragOrigin.translate(loc.x, loc.y);
+            rootComponent = rootComponent.getParent();
+            loc = rootComponent.getLocation();
         }
 
-        // Make sure the drop target is a ComponentModel:
-        if (!(peer instanceof LWComponentPeer))
-            throw new IllegalArgumentException("DragSource's peer must be a ComponentModel.");
-
-        // Get model pointer (CButton.m and such) and its native peer:
-        LWComponentPeer model = (LWComponentPeer) peer;
-        CPlatformWindow platformWindow = (CPlatformWindow) model.getPlatformWindow();
+        //It sure will be LWComponentPeer instance as rootComponent is a Window
+        LWComponentPeer peer = (LWComponentPeer)rootComponent.getPeer();
+        //Get a pointer to a native window
+        CPlatformWindow platformWindow = (CPlatformWindow) peer.getPlatformWindow();
         long nativeWindowPtr = platformWindow.getNSWindowPtr();
 
         // Get drag cursor:
@@ -155,7 +140,7 @@
         try {
             // Create native dragging source:
             final long nativeDragSource = createNativeDragSource(component, peer, nativeWindowPtr, transferable, triggerEvent,
-                (int) (dragOrigin.getX() + componentOffset.x), (int) (dragOrigin.getY() + componentOffset.y), extModifiers,
+                (int) (dragOrigin.getX()), (int) (dragOrigin.getY()), extModifiers,
                 clickCount, timestamp, cursor, fDragCImage, dragImageOffset.x, dragImageOffset.y,
                 getDragSourceContext().getSourceActions(), formats, formatMap);
 
@@ -165,8 +150,8 @@
             setNativeContext(nativeDragSource);
 
             CCursorManager.getInstance().startDrag(
-                    (int) (dragOrigin.getX() + componentOffset.x),
-                    (int) (dragOrigin.getY() + componentOffset.y));
+                    (int) (dragOrigin.getX()),
+                    (int) (dragOrigin.getY()));
         }
 
         catch (Exception e) {
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Wed Feb 20 10:16:45 2013 -0800
@@ -27,7 +27,6 @@
 
 import java.awt.*;
 import java.awt.geom.Rectangle2D;
-import java.awt.image.VolatileImage;
 
 import sun.awt.CGraphicsConfig;
 import sun.awt.CGraphicsEnvironment;
@@ -89,29 +88,8 @@
         return peer;
     }
 
-    public void enterFullScreenMode(final long nsWindowPtr) {
+    public void enterFullScreenMode() {
         CWrapper.NSView.enterFullScreenMode(ptr);
-
-        // REMIND: CGLSurfaceData expects top-level's size
-        // and therefore we need to account insets before
-        // recreating the surface data
-        Insets insets = peer.getInsets();
-
-        Rectangle screenBounds;
-        final long screenPtr = CWrapper.NSWindow.screen(nsWindowPtr);
-        try {
-            screenBounds = CWrapper.NSScreen.frame(screenPtr).getBounds();
-        } finally {
-            CWrapper.NSObject.release(screenPtr);
-        }
-
-        // the move/size notification from the underlying system comes
-        // but it contains a bounds smaller than the whole screen
-        // and therefore we need to create the synthetic notifications
-        peer.notifyReshape(screenBounds.x - insets.left,
-                           screenBounds.y - insets.bottom,
-                           screenBounds.width + insets.left + insets.right,
-                           screenBounds.height + insets.top + insets.bottom);
     }
 
     public void exitFullScreenMode() {
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Feb 20 10:16:45 2013 -0800
@@ -38,7 +38,6 @@
 import sun.java2d.SurfaceData;
 import sun.java2d.opengl.CGLSurfaceData;
 import sun.lwawt.*;
-import sun.lwawt.LWWindowPeer.PeerType;
 import sun.util.logging.PlatformLogger;
 
 import com.apple.laf.*;
@@ -58,7 +57,6 @@
     private static native void nativeRevalidateNSWindowShadow(long nsWindowPtr);
     private static native void nativeSetNSWindowMinimizedIcon(long nsWindowPtr, long nsImage);
     private static native void nativeSetNSWindowRepresentedFilename(long nsWindowPtr, String representedFilename);
-    private static native void nativeSetNSWindowSecurityWarningPositioning(long nsWindowPtr, double x, double y, float biasX, float biasY);
     private static native void nativeSetEnabled(long nsWindowPtr, boolean isEnabled);
     private static native void nativeSynthesizeMouseEnteredExitedEvents();
     private static native void nativeDispose(long nsWindowPtr);
@@ -197,7 +195,8 @@
     // 1) setting native bounds via nativeSetBounds() call
     // 2) getting notification from the native level via deliverMoveResizeEvent()
     private Rectangle nativeBounds = new Rectangle(0, 0, 0, 0);
-    private volatile boolean isFullScreenMode = false;
+    private volatile boolean isFullScreenMode;
+    private boolean isFullScreenAnimationOn;
 
     private Window target;
     private LWWindowPeer peer;
@@ -415,8 +414,10 @@
 
     @Override // PlatformWindow
     public Insets getInsets() {
-        final Insets insets = nativeGetNSWindowInsets(getNSWindowPtr());
-        return insets;
+        if (!isFullScreenMode) {
+            return nativeGetNSWindowInsets(getNSWindowPtr());
+        }
+        return new Insets(0, 0, 0, 0);
     }
 
     @Override // PlatformWindow
@@ -728,7 +729,19 @@
     @Override
     public void enterFullScreenMode() {
         isFullScreenMode = true;
-        contentView.enterFullScreenMode(getNSWindowPtr());
+        contentView.enterFullScreenMode();
+        // the move/size notification from the underlying system comes
+        // but it contains a bounds smaller than the whole screen
+        // and therefore we need to create the synthetic notifications
+        Rectangle screenBounds;
+        final long screenPtr = CWrapper.NSWindow.screen(getNSWindowPtr());
+        try {
+            screenBounds = CWrapper.NSScreen.frame(screenPtr).getBounds();
+        } finally {
+            CWrapper.NSObject.release(screenPtr);
+        }
+        peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width,
+                           screenBounds.height);
     }
 
     @Override
@@ -875,11 +888,10 @@
         final Rectangle oldB = nativeBounds;
         nativeBounds = new Rectangle(x, y, width, height);
         peer.notifyReshape(x, y, width, height);
-        if (byUser && !oldB.getSize().equals(nativeBounds.getSize())) {
+        if ((byUser && !oldB.getSize().equals(nativeBounds.getSize()))
+            || isFullScreenAnimationOn) {
             flushBuffers();
         }
-        //TODO validateSurface already called from notifyReshape
-        validateSurface();
     }
 
     private void deliverWindowClosingEvent() {
@@ -924,6 +936,10 @@
             return false;
         }
 
+        if (blocker instanceof CPrinterDialogPeer) {
+            return true;
+        }
+
         CPlatformWindow pWindow = (CPlatformWindow)blocker.getPlatformWindow();
 
         pWindow.orderAboveSiblings();
@@ -975,27 +991,19 @@
         orderAboveSiblings();
     }
 
-    private void updateDisplay() {
-        EventQueue.invokeLater(new Runnable() {
-            public void run() {
-                validateSurface();
-            }
-        });
+    private void windowWillEnterFullScreen() {
+        isFullScreenAnimationOn = true;
     }
 
-    private void updateWindowContent() {
-        ComponentEvent resizeEvent = new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED);
-        SunToolkit.postEvent(SunToolkit.targetToAppContext(target), resizeEvent);
+    private void windowDidEnterFullScreen() {
+        isFullScreenAnimationOn = false;
     }
 
-    private void windowWillEnterFullScreen() {
-        updateWindowContent();
+    private void windowWillExitFullScreen() {
+        isFullScreenAnimationOn = true;
     }
-    private void windowDidEnterFullScreen() {
-        updateDisplay();
+
+    private void windowDidExitFullScreen() {
+        isFullScreenAnimationOn = false;
     }
-    private void windowWillExitFullScreen() {
-        updateWindowContent();
-    }
-    private void windowDidExitFullScreen() {}
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Wed Feb 20 10:16:45 2013 -0800
@@ -30,6 +30,8 @@
 import java.awt.geom.Rectangle2D;
 import java.awt.image.BufferedImage;
 import java.awt.print.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import javax.print.*;
 import javax.print.attribute.PrintRequestAttributeSet;
@@ -47,6 +49,8 @@
 
     private static String sShouldNotReachHere = "Should not reach here.";
 
+    private volatile SecondaryLoop printingLoop;
+
     private boolean noDefaultPrinter = false;
 
     private static Font defaultFont;
@@ -160,11 +164,22 @@
 
     volatile boolean onEventThread;
 
+    @Override
+    protected void cancelDoc() throws PrinterAbortException {
+        super.cancelDoc();
+        if (printingLoop != null) {
+            printingLoop.exit();
+        }
+    }
+
     private void completePrintLoop() {
         Runnable r = new Runnable() { public void run() {
             synchronized(this) {
                 performingPrinting = false;
             }
+            if (printingLoop != null) {
+                printingLoop.exit();
+            }
         }};
 
         if (onEventThread) {
@@ -219,17 +234,21 @@
 
                 onEventThread = true;
 
+                printingLoop = AccessController.doPrivileged(new PrivilegedAction<SecondaryLoop>() {
+                    @Override
+                    public SecondaryLoop run() {
+                        return Toolkit.getDefaultToolkit()
+                                .getSystemEventQueue()
+                                .createSecondaryLoop();
+                    }
+                });
+
                 try {
                     // Fire off the print rendering loop on the AppKit thread, and don't have
                     //  it wait and block this thread.
                     if (printLoop(false, firstPage, lastPage)) {
-                        // Fire off the EventConditional that will what until the condition is met,
-                        //  but will still process AWTEvent's as they occur.
-                        new EventDispatchAccess() {
-                            public boolean evaluate() {
-                                return performingPrinting;
-                            }
-                        }.pumpEventsAndWait();
+                        // Start a secondary loop on EDT until printing operation is finished or cancelled
+                        printingLoop.enter();
                     }
                 } catch (Exception e) {
                     e.printStackTrace();
@@ -253,6 +272,9 @@
                 performingPrinting = false;
                 notify();
             }
+            if (printingLoop != null) {
+                printingLoop.exit();
+            }
         }
 
         // Normalize the collated, # copies, numPages, first/last pages. Need to
--- a/src/macosx/classes/sun/lwawt/macosx/EventDispatchAccess.java	Wed Feb 20 16:39:46 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 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.lwawt.macosx;
-
-// This exists strictly to work around the fact that java.awt.Conditional isn't a public class.
-// It uses java reflection to get the EventDispatchThread class and call a MacOSX only
-// method on it.
-//
-// NOTE: This uses reflection in its implementation, so it is not for performance critical code.
-//
-// See java.awt.EventDispatchThread and apple.awt.CPrintJob for more.
-//
-public abstract class EventDispatchAccess {
-    public native void pumpEventsAndWait();
-    public abstract boolean evaluate();
-}
--- a/src/macosx/lib/flavormap.properties	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/lib/flavormap.properties	Wed Feb 20 10:16:45 2013 -0800
@@ -1,7 +1,7 @@
 #
 # This properties file is used to initialize the default
-# java.awt.datatransfer.SystemFlavorMap. It contains the X11 platform-specific,
-# default mappings between common X11 selection atoms and platform-independent
+# java.awt.datatransfer.SystemFlavorMap. It contains the Mac OS X platform-specific,
+# default mappings between common Mac OS X selection atoms and platform-independent
 # MIME type strings, which will be converted into
 # java.awt.datatransfer.DataFlavors.
 #
@@ -76,3 +76,5 @@
 text/uri-list=application/x-java-file-list;class=java.util.List
 PNG=image/x-java-image;class=java.awt.Image
 JFIF=image/x-java-image;class=java.awt.Image
+RICH_TEXT=text/rtf
+HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1
--- a/src/macosx/native/jobjc/src/core/native/SEL.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/jobjc/src/core/native/SEL.m	Wed Feb 20 10:16:45 2013 -0800
@@ -34,7 +34,7 @@
     const char *selNameAsChars = (*env)->GetStringUTFChars(env, selName, JNI_FALSE);
     const SEL sel = sel_registerName(selNameAsChars);
     (*env)->ReleaseStringUTFChars(env, selName, selNameAsChars);
-    return ptr_to_jlong(sel);
+    return ptr_to_jlong((void*)sel);
 }
 
 JNIEXPORT jstring JNICALL Java_com_apple_jobjc_SEL_getSelectorName
--- a/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Wed Feb 20 10:16:45 2013 -0800
@@ -101,8 +101,7 @@
 JNF_COCOA_ENTER(env);
 
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-        
+
         CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
         surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
         CFRetain(surfaceLayers);
@@ -127,7 +126,6 @@
   AWTSurfaceLayers *surfaceLayers = OBJC(surfaceLayersPtr);
     
   [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
-      AWT_ASSERT_APPKIT_THREAD;
 
       CGRect rect = CGRectMake(x, y, width, height);
       [surfaceLayers setBounds: rect];
--- a/src/macosx/native/sun/awt/AWTView.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/AWTView.m	Wed Feb 20 10:16:45 2013 -0800
@@ -1243,8 +1243,7 @@
     jobject cPlatformView = (*env)->NewGlobalRef(env, obj);
 
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-                                           
+
         CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
         AWTView *view = [[AWTView alloc] initWithRect:rect
                                          platformView:cPlatformView
@@ -1274,8 +1273,7 @@
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);    
 
    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
-       AWT_ASSERT_APPKIT_THREAD;
-       
+
        if (toResize) {
            [view setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
        } else {
@@ -1308,8 +1306,7 @@
     NSWindow *window = [view window];
     
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-            AWT_ASSERT_APPKIT_THREAD;
-        
+
             ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
     }];
     
@@ -1336,8 +1333,7 @@
     
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);    
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-        
+
         NSRect viewBounds = [view bounds];
         NSRect frameInWindow = [view convertRect:viewBounds toView:nil];
         rect = [[view window] convertRectToScreen:frameInWindow];
@@ -1366,9 +1362,7 @@
 JNF_COCOA_ENTER(env);
     
     NSView *nsView = OBJC(viewPtr);
-   [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-       AWT_ASSERT_APPKIT_THREAD;
-       
+   [ThreadUtilities performOnMainThreadWaiting:YES block:^(){       
        NSPoint ptWindowCoords = [[nsView window] mouseLocationOutsideOfEventStream];
        NSPoint ptViewCoords = [nsView convertPoint:ptWindowCoords fromView:nil];
        underMouse = [nsView hitTest:ptViewCoords] != nil;
--- a/src/macosx/native/sun/awt/AWTWindow.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Wed Feb 20 10:16:45 2013 -0800
@@ -738,14 +738,12 @@
     __block AWTWindow *window = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     JNFWeakJObjectWrapper *platformWindow = [JNFWeakJObjectWrapper wrapperWithJObject:obj withEnv:env];
     NSView *contentView = OBJC(contentViewPtr);
     NSRect frameRect = NSMakeRect(x, y, w, h);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
 
         window = [[AWTWindow alloc] initWithPlatformWindow:platformWindow
                                                   styleBits:styleBits
@@ -770,11 +768,9 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jint mask, jint bits)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
@@ -807,21 +803,19 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jlong menuBarPtr)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     CMenuBar *menuBar = OBJC(menuBarPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
         if ([nsWindow isKeyWindow]) [window.javaMenuBar deactivate];
         window.javaMenuBar = menuBar;
 
-        // if ([self isKeyWindow]) {
-        [CMenuBar activate:window.javaMenuBar modallyDisabled:NO];
-        // }
+        if ([nsWindow isKeyWindow]) {
+            [CMenuBar activate:window.javaMenuBar modallyDisabled:NO];
+        }
     }];
 
 JNF_COCOA_EXIT(env);
@@ -838,14 +832,12 @@
     jobject ret = NULL;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     __block NSRect contentRect = NSZeroRect;
     __block NSRect frame = NSZeroRect;
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
 
         frame = [nsWindow frame];
         contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[nsWindow styleMask]];
@@ -873,14 +865,12 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jdouble originX, jdouble originY, jdouble width, jdouble height)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSRect jrect = NSMakeRect(originX, originY, width, height);
 
     // TODO: not sure we need displayIfNeeded message in our view
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
@@ -913,7 +903,6 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jdouble minW, jdouble minH, jdouble maxW, jdouble maxH)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     if (minW < 1) minW = 1;
     if (minH < 1) minH = 1;
@@ -921,8 +910,7 @@
     if (maxH < 1) maxH = 1;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
@@ -949,12 +937,9 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow orderBack:nil];
     }];
 
@@ -970,11 +955,9 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
 
         if (![nsWindow isKeyWindow]) {
             [nsWindow makeKeyAndOrderFront:nsWindow];
@@ -995,7 +978,6 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jstring jtitle)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     [nsWindow performSelectorOnMainThread:@selector(setTitle:)
@@ -1016,15 +998,9 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    if ([NSThread isMainThread]) {
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow invalidateShadow];
-    } else {
-        [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-            AWT_ASSERT_APPKIT_THREAD;
-
-            [nsWindow invalidateShadow];
-        }];
-    }
+    }];
 
 JNF_COCOA_EXIT(env);
 }
@@ -1060,13 +1036,10 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jlong nsImagePtr)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     NSImage *image = OBJC(nsImagePtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow setMiniwindowImage:image];
     }];
 
@@ -1082,13 +1055,10 @@
 (JNIEnv *env, jclass clazz, jlong windowPtr, jstring filename)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSWindow *nsWindow = OBJC(windowPtr);
     NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:JNFNormalizedNSStringForPath(env, filename)];
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow setRepresentedURL:url];
     }];
 
@@ -1097,22 +1067,6 @@
 
 /*
  * Class:     sun_lwawt_macosx_CPlatformWindow
- * Method:    nativeSetNSWindowSecurityWarningPositioning
- * Signature: (JDDFF)V
- */
-JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowSecurityWarningPositioning
-(JNIEnv *env, jclass clazz, jlong windowPtr, jdouble x, jdouble y, jfloat biasX, jfloat biasY)
-{
-JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
-
-    [JNFException raise:env as:kRuntimeException reason:"unimplemented"];
-
-JNF_COCOA_EXIT(env);
-}
-
-/*
- * Class:     sun_lwawt_macosx_CPlatformWindow
  * Method:    nativeGetTopmostPlatformWindowUnderMouse
  * Signature: (J)V
  */
@@ -1144,10 +1098,8 @@
 (JNIEnv *env, jclass clazz)
 {
     JNF_COCOA_ENTER(env);
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows];
     }];
 
@@ -1168,7 +1120,7 @@
     SEL toggleFullScreenSelector = @selector(toggleFullScreen:);
     if (![nsWindow respondsToSelector:toggleFullScreenSelector]) return;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow performSelector:toggleFullScreenSelector withObject:nil];
     }];
 
@@ -1181,7 +1133,7 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
         [window setEnabled: isEnabled];
@@ -1196,7 +1148,7 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         AWTWindow *window = (AWTWindow*)[nsWindow delegate];
 
         if ([AWTWindow lastKeyWindow] == window) {
--- a/src/macosx/native/sun/awt/ApplicationDelegate.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/ApplicationDelegate.m	Wed Feb 20 10:16:45 2013 -0800
@@ -515,10 +515,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt_Application_nativeInitializeApplicationDelegate
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
     // Force initialization to happen on AppKit thread!
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [ApplicationDelegate sharedDelegate];
     }];
 JNF_COCOA_EXIT(env);
@@ -532,10 +531,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeOpenCocoaAboutWindow
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [NSApp orderFrontStandardAboutPanel:nil];
     }];
 
@@ -550,10 +548,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeReplyToAppShouldTerminate
 (JNIEnv *env, jclass clz, jboolean doTerminate)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [NSApp replyToApplicationShouldTerminate:doTerminate];
     }];
 
@@ -568,7 +565,6 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeRegisterForNotification
 (JNIEnv *env, jclass clz, jint notificationType)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
     [ThreadUtilities performOnMainThread:@selector(_registerForNotification:)
                                 onObject:[ApplicationDelegate class]
@@ -586,13 +582,10 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockMenu
 (JNIEnv *env, jclass clz, jlong nsMenuPtr)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     NSMenu *menu = (NSMenu *)jlong_to_ptr(nsMenuPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [ApplicationDelegate sharedDelegate].fDockMenu = menu;
     }];
 
@@ -607,14 +600,13 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockIconImage
 (JNIEnv *env, jclass clz, jlong nsImagePtr)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     NSImage *_image = (NSImage *)jlong_to_ptr(nsImagePtr);
-    [JNFRunLoop performOnMainThread:@selector(_setDockIconImage:)
-                                 on:[ApplicationDelegate class]
-                         withObject:_image
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(_setDockIconImage:)
+                                      on:[ApplicationDelegate class]
+                              withObject:_image
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -629,12 +621,9 @@
 {
     __block NSImage *image = nil;
 
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         image = [ApplicationDelegate _dockIconImage];
         CFRetain(image);
     }];
@@ -652,13 +641,10 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockIconBadge
 (JNIEnv *env, jclass clz, jstring badge)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     NSString *badgeString = JNFJavaToNSString(env, badge);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSDockTile *dockTile = [NSApp dockTile];
         [dockTile setBadgeLabel:badgeString];
         [dockTile display];
@@ -675,12 +661,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeRequestActivation
 (JNIEnv *env, jclass clz, jboolean allWindows)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSApplicationActivationOptions options = allWindows ? NSApplicationActivateAllWindows : 0;
         options |= NSApplicationActivateIgnoringOtherApps; // without this, nothing happens!
         [[NSRunningApplication currentApplication] activateWithOptions:options];
@@ -697,12 +680,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeRequestUserAttention
 (JNIEnv *env, jclass clz, jboolean critical)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [NSApp requestUserAttention:critical ? NSCriticalRequest : NSInformationalRequest];
     }];
 
@@ -717,13 +697,12 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeOpenHelpViewer
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThread:@selector(showHelp:)
-                                 on:NSApp
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(showHelp:)
+                                      on:NSApp
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -736,7 +715,6 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeEnableSuddenTermination
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     [[NSProcessInfo processInfo] enableSuddenTermination]; // Foundation thread-safe
@@ -752,7 +730,6 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeDisableSuddenTermination
 (JNIEnv *env, jclass clz)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     [[NSProcessInfo processInfo] disableSuddenTermination]; // Foundation thread-safe
@@ -768,12 +745,9 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMenuBarHandler_nativeSetMenuState
 (JNIEnv *env, jclass clz, jint menuID, jboolean visible, jboolean enabled)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         ApplicationDelegate *delegate = [ApplicationDelegate sharedDelegate];
         switch (menuID) {
             case com_apple_eawt__AppMenuBarHandler_MENU_ABOUT:
@@ -796,12 +770,10 @@
 JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMenuBarHandler_nativeSetDefaultMenuBar
 (JNIEnv *env, jclass clz, jlong cMenuBarPtr)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     CMenuBar *menu = (CMenuBar *)jlong_to_ptr(cMenuBarPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [ApplicationDelegate sharedDelegate].fDefaultMenuBar = menu;
     }];
 
--- a/src/macosx/native/sun/awt/CClipboard.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CClipboard.m	Wed Feb 20 10:16:45 2013 -0800
@@ -109,7 +109,6 @@
 }
 
 - (void) javaDeclareTypes:(NSArray *)inTypes withOwner:(jobject)inClipboard jniEnv:(JNIEnv *)inEnv {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
     //NSLog(@"CClipboard javaDeclareTypes %@ withOwner", inTypes);
 
@@ -134,7 +133,6 @@
 
 
 - (NSArray *) javaGetTypes {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSMutableArray *args = [NSMutableArray arrayWithCapacity:1];
     [ThreadUtilities performOnMainThread:@selector(_nativeGetTypes:) onObject:self withObject:args waitUntilDone:YES awtMode:YES];
@@ -152,7 +150,6 @@
 }
 
 - (void) javaSetData:(NSData *)inData forType:(NSString *) inFormat {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
     CClipboardUpdate *newUpdate = [[CClipboardUpdate alloc] initWithData:inData withFormat:inFormat];
     [ThreadUtilities performOnMainThread:@selector(_nativeSetData:) onObject:self withObject:newUpdate waitUntilDone:YES awtMode:YES];
@@ -171,7 +168,6 @@
 }
 
 - (NSData *) javaGetDataForType:(NSString *) inFormat {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSMutableArray *args = [NSMutableArray arrayWithObject:inFormat];
     [ThreadUtilities performOnMainThread:@selector(_nativeGetDataForType:) onObject:self withObject:args waitUntilDone:YES awtMode:YES];
--- a/src/macosx/native/sun/awt/CCursorManager.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CCursorManager.m	Wed Feb 20 10:16:45 2013 -0800
@@ -74,7 +74,6 @@
 (JNIEnv *env, jclass class, jint type, jstring name)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSString *cursorName = JNFJavaToNSString(env, name);
     SEL cursorSelector = (type == sun_lwawt_macosx_CCursorManager_NAMED_CURSOR) ? lookupCursorSelectorForName(cursorName) : lookupCursorSelectorForType(type);
@@ -87,9 +86,7 @@
         [JNFException raise:env as:kNoSuchMethodException reason:"missing NSCursor selector"];
     }
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         setCursorOnAppKitThread([[NSCursor class] performSelector:cursorSelector]);
     }];
 
@@ -101,12 +98,9 @@
 (JNIEnv *env, jclass class, jlong imgPtr, jdouble x, jdouble y)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
     NSImage *image = (NSImage *)jlong_to_ptr(imgPtr);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSCursor *cursor = [[NSCursor alloc] initWithImage:image
                                                    hotSpot:(NSPoint){ x, y }];
         setCursorOnAppKitThread(cursor);
@@ -127,8 +121,6 @@
     __block NSPoint pt = NSZeroPoint;
     
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-            AWT_ASSERT_APPKIT_THREAD;
-        
             pt = ConvertNSScreenPoint(env, [NSEvent mouseLocation]);
     }];
     
@@ -144,13 +136,11 @@
 Java_sun_lwawt_macosx_CCursorManager_nativeSetAllowsCursorSetInBackground
 (JNIEnv *env, jclass class, jboolean allows)
 {
-
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     SEL allowsSetInBackground_SEL = @selector(javaSetAllowsCursorSetInBackground:);
     if ([[NSCursor class] respondsToSelector:allowsSetInBackground_SEL]) {
-        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+        [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
             NSMethodSignature *allowsSetInBackground_sig =
                 [[NSCursor class] methodSignatureForSelector:allowsSetInBackground_SEL];
             NSInvocation *invocation =
--- a/src/macosx/native/sun/awt/CDesktopPeer.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CDesktopPeer.m	Wed Feb 20 10:16:45 2013 -0800
@@ -36,8 +36,6 @@
 JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CDesktopPeer__1lsOpenURI
 (JNIEnv *env, jclass clz, jstring uri)
 {
-    // AWT_ASSERT_ANY_THREAD
-
     OSStatus status = noErr;
 JNF_COCOA_ENTER(env);
 
@@ -63,8 +61,6 @@
 JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CDesktopPeer__1lsOpenFile
 (JNIEnv *env, jclass clz, jstring jpath, jboolean print)
 {
-    // AWT_ASSERT_ANY_THREAD
-
     OSStatus status = noErr;
 JNF_COCOA_ENTER(env);
 
--- a/src/macosx/native/sun/awt/CDragSource.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CDragSource.m	Wed Feb 20 10:16:45 2013 -0800
@@ -443,9 +443,9 @@
     NSGraphicsContext* graphicsContext = [NSGraphicsContext graphicsContextWithWindow:window];
 
     // Convert mouse coordinates to NS:
-    NSPoint location = NSMakePoint(fDragPos.x, fDragPos.y);
-    NSPoint eventLocation = [fView convertPoint:location toView:nil];
-
+    NSPoint eventLocation = [fView convertPoint:NSMakePoint(fDragPos.x, fDragPos.y) toView:nil];
+    eventLocation.y = [[fView window] frame].size.height - eventLocation.y;
+    
     // Convert fTriggerEventTimeStamp to NS - AWTEvent.h defines UTC(nsEvent) as ((jlong)[event timestamp] * 1000):
     NSTimeInterval timeStamp = fTriggerEventTimeStamp / 1000;
 
@@ -497,12 +497,9 @@
     NSImage* dragImage = fDragImage;
 
     // Get drag origin and offset:
-    NSPoint dragOrigin;
-    dragOrigin.x = fDragPos.x;
-    dragOrigin.y = fDragPos.y;
-    dragOrigin = [view convertPoint:[dragEvent locationInWindow] fromView:nil];
+    NSPoint dragOrigin = [dragEvent locationInWindow];
     dragOrigin.x += fDragImageOffset.x;
-    dragOrigin.y += [dragImage size].height + fDragImageOffset.y;
+    dragOrigin.y -= fDragImageOffset.y + [dragImage size].height;
 
     // Drag offset values don't seem to matter:
     NSSize dragOffset = NSMakeSize(0, 0);
@@ -516,7 +513,6 @@
     DLog5(@"  - drag image: %f, %f (%f x %f)", fDragImageOffset.x, fDragImageOffset.y, [dragImage size].width, [dragImage size].height);
     DLog3(@"  - event point (window) %f, %f", [dragEvent locationInWindow].x, [dragEvent locationInWindow].y);
     DLog3(@"  - drag point (view) %f, %f", dragOrigin.x, dragOrigin.y);
-
     // Set up the fDragKeyModifier, so we know if the operation has changed
     // Set up the fDragMouseModifier, so we can |= it later (since CoreDrag doesn't tell us mouse states during a drag)
     fDragKeyModifiers = [DnDUtilities extractJavaExtKeyModifiersFromJavaExtModifiers:fModifiers];
--- a/src/macosx/native/sun/awt/CDragSourceContextPeer.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CDragSourceContextPeer.m	Wed Feb 20 10:16:45 2013 -0800
@@ -46,7 +46,7 @@
     __block CDragSource* dragSource = nil;
 
 JNF_COCOA_ENTER(env);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         dragSource = [[CDragSource alloc] init:jthis component:jcomponent peer:jpeer control:controlObj
             transferable:jtransferable triggerEvent:jtrigger dragPosX:jdragposx
             dragPosY:jdragposy modifiers:jextmodifiers clickCount:jclickcount timeStamp:jtimestamp
@@ -103,7 +103,7 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_setNativeCursor
   (JNIEnv *env, jobject jthis, jlong nativeDragSourceVal, jobject jcursor, jint jcursortype)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
+   //AWT_ASSERT_NOT_APPKIT_THREAD;
 
 //JNF_COCOA_ENTER(env);
 //    jobject gCursor = JNFNewGlobalRef(env, jcursor);
--- a/src/macosx/native/sun/awt/CImage.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CImage.m	Wed Feb 20 10:16:45 2013 -0800
@@ -108,7 +108,6 @@
     jlong result = 0L;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, width, height);
     if (imageRep) {
@@ -139,7 +138,6 @@
     jlong result = 0L;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     jsize num = (*env)->GetArrayLength(env, buffers);
     NSMutableArray * reps = [NSMutableArray arrayWithCapacity: num];
@@ -187,7 +185,6 @@
     NSImage *image = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     IconRef iconRef;
     if (noErr == GetIconRef(kOnSystemDisk, kSystemIconsCreator, selector, &iconRef)) {
@@ -212,7 +209,6 @@
     NSImage *image = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     NSString *path = JNFNormalizedNSStringForPath(env, file);
     image = [[NSImage alloc] initByReferencingFile:path];
@@ -234,10 +230,9 @@
     __block NSImage *image = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     NSString *path = JNFNormalizedNSStringForPath(env, file);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         image = [[NSWorkspace sharedWorkspace] iconForFile:path];
         [image setScalesWhenResized:TRUE];
         if (image) CFRetain(image); // GC
@@ -259,7 +254,6 @@
     NSImage *image = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     image = [NSImage imageNamed:JNFJavaToNSString(env, name)];
     if (image) CFRetain(image); // GC
@@ -278,7 +272,6 @@
 (JNIEnv *env, jclass klass, jlong nsImgPtr, jintArray buffer, jint w, jint h)
 {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     NSImage *img = (NSImage *)jlong_to_ptr(nsImgPtr);
     jint *dst = (*env)->GetPrimitiveArrayCritical(env, buffer, NULL);
@@ -301,7 +294,6 @@
     jobject size = NULL;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_ANY_THREAD;
 
     size = NSToJavaSize(env, [(NSImage *)jlong_to_ptr(nsImgPtr) size]);
 
--- a/src/macosx/native/sun/awt/CInputMethod.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CInputMethod.m	Wed Feb 20 10:16:45 2013 -0800
@@ -153,7 +153,7 @@
     __block NSString *keyboardInfo = NULL;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         keyboardInfo = [inputMethodController performSelector:@selector(currentInputMethodName)];
         [keyboardInfo retain];
     }];
@@ -177,7 +177,7 @@
 JNF_COCOA_ENTER(env);
     AWTView *view = (AWTView *)jlong_to_ptr(nativePeer);
     JNFJObjectWrapper *inputMethodWrapper = [[JNFJObjectWrapper alloc] initWithJObject:inputMethod withEnv:env];
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [CInputMethod _nativeNotifyPeerWithView:view inputMethod:inputMethodWrapper];
     }];
 
@@ -196,7 +196,7 @@
 JNF_COCOA_ENTER(env);
    AWTView *view = (AWTView *)jlong_to_ptr(nativePeer);
 
-   [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+   [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [CInputMethod _nativeEndComposition:view];
     }];
 
@@ -216,7 +216,7 @@
     __block NSString *isoAbbreviation;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         isoAbbreviation = (NSString *) [inputMethodController performSelector:@selector(currentInputMethodLocale)];
         [isoAbbreviation retain];
     }];
@@ -259,7 +259,7 @@
     NSString *localeStr = JNFJavaToNSString(env, locale);
     [localeStr retain];
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [CInputMethod setKeyboardLayout:localeStr];
     }];
 
@@ -293,7 +293,7 @@
     __block NSArray *selectableArray = nil;
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         selectableArray = (NSArray *)[inputMethodController performSelector:@selector(availableInputMethodLocales)];
         [selectableArray retain];
     }];
--- a/src/macosx/native/sun/awt/CMenu.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CMenu.m	Wed Feb 20 10:16:45 2013 -0800
@@ -55,12 +55,10 @@
 //- (void)finalize { [super finalize]; }
 
 - (void)addJavaSubmenu:(CMenu *)submenu {
-AWT_ASSERT_NOT_APPKIT_THREAD;
     [ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) onObject:self withObject:submenu waitUntilDone:YES awtMode:YES];
 }
 
 - (void)addJavaMenuItem:(CMenuItem *)theMenuItem {
-AWT_ASSERT_NOT_APPKIT_THREAD;
     [ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) onObject:self withObject:theMenuItem waitUntilDone:YES awtMode:YES];
 }
 
@@ -70,7 +68,6 @@
 }
 
 - (void)setJavaMenuTitle:(NSString *)title {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     if (title) {
         [ThreadUtilities performOnMainThread:@selector(setNativeMenuTitle_OnAppKitThread:) onObject:self withObject:title waitUntilDone:YES awtMode:YES];
@@ -95,7 +92,6 @@
 }
 
 - (void)deleteJavaItem:(jint)index {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     [ThreadUtilities performOnMainThread:@selector(deleteNativeJavaItem_OnAppKitThread:) onObject:self withObject:[NSNumber numberWithInt:index] waitUntilDone:YES awtMode:YES];
 }
--- a/src/macosx/native/sun/awt/CMenuComponent.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CMenuComponent.m	Wed Feb 20 10:16:45 2013 -0800
@@ -80,10 +80,10 @@
 {
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThread:@selector(disposer)
-                                 on:((id)jlong_to_ptr(menuItemObj))
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(disposer)
+                                      on:((id)jlong_to_ptr(menuItemObj))
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
--- a/src/macosx/native/sun/awt/CMenuItem.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CMenuItem.m	Wed Feb 20 10:16:45 2013 -0800
@@ -104,7 +104,6 @@
 }
 
 - (void) setJavaLabel:(NSString *)theLabel shortcut:(NSString *)theKeyEquivalent modifierMask:(jint)modifiers {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSUInteger modifierMask = 0;
 
@@ -126,8 +125,7 @@
         modifierMask = JavaModifiersToNsKeyModifiers(modifiers, NO);
     }
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [fMenuItem setKeyEquivalent:theKeyEquivalent];
         [fMenuItem setKeyEquivalentModifierMask:modifierMask];
         [fMenuItem setTitle:theLabel];
@@ -135,32 +133,23 @@
 }
 
 - (void) setJavaImage:(NSImage *)theImage {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [fMenuItem setImage:theImage];
     }];
 }
 
 - (void) setJavaToolTipText:(NSString *)theText {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [fMenuItem setToolTip:theText];
     }];
 }
 
 
 - (void)setJavaEnabled:(BOOL) enabled {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         @synchronized(self) {
             fIsEnabled = enabled;
 
@@ -173,7 +162,6 @@
 }
 
 - (BOOL)isEnabled {
-    // AWT_ASSERT_ANY_THREAD;
 
     BOOL enabled = NO;
     @synchronized(self) {
@@ -184,11 +172,8 @@
 
 
 - (void)setJavaState:(BOOL)newState {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [fMenuItem setState:(newState ? NSOnState : NSOffState)];
     }];
 }
--- a/src/macosx/native/sun/awt/CPopupMenu.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CPopupMenu.m	Wed Feb 20 10:16:45 2013 -0800
@@ -64,7 +64,7 @@
 
     jobject cPeerObjGlobal = JNFNewGlobalRef(env, peer);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         aCPopupMenu = [[CPopupMenu alloc] initWithPeer:cPeerObjGlobal];
         CFRetain(aCPopupMenu);
         [aCPopupMenu release];
@@ -82,7 +82,7 @@
 
     CPopupMenu* cPopupMenu = (CPopupMenu*)jlong_to_ptr(menuPtr);
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSPoint loc = ConvertNSScreenPoint(env, NSMakePoint(x, y));
 
         [[cPopupMenu menu] popUpMenuPositioningItem: nil
--- a/src/macosx/native/sun/awt/CPrinterJob.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CPrinterJob.m	Wed Feb 20 10:16:45 2013 -0800
@@ -384,31 +384,6 @@
 }
 
 /*
- * Class:     sun_lwawt_macosx_EventDispatchAccess
- * Method:    pumpEventsAndWait
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_sun_lwawt_macosx_EventDispatchAccess_pumpEventsAndWait
-(JNIEnv *env, jobject eda)
-{
-    static JNF_CLASS_CACHE(jc_Thread, "java/lang/Thread");
-    static JNF_STATIC_MEMBER_CACHE(jm_currentThread, jc_Thread, "currentThread", "()Ljava/lang/Thread;");
-    static JNF_CLASS_CACHE(jc_EventDispatchThread, "java/awt/EventDispatchThread");
-    static JNF_MEMBER_CACHE(jm_macosxGetConditional, jc_EventDispatchThread, "_macosxGetConditional", "(Ljava/lang/Object;)Ljava/awt/Conditional;");
-    static JNF_MEMBER_CACHE(jm_pumpEvents, jc_EventDispatchThread, "pumpEvents", "(Ljava/awt/Conditional;)V");
-
-JNF_COCOA_DURING(env);
-
-    jobject thread = JNFCallStaticObjectMethod(env, jm_currentThread);
-    jobject conditional = JNFCallObjectMethod(env, thread, jm_macosxGetConditional, eda);
-    if (conditional != NULL) {
-        JNFCallVoidMethod(env, thread, jm_pumpEvents, conditional);
-    }
-
-JNF_COCOA_HANDLE(env);
-}
-
-/*
  * Class:     sun_lwawt_macosx_CPrinterJob
  * Method:    abortDoc
  * Signature: ()V
--- a/src/macosx/native/sun/awt/CTrayIcon.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CTrayIcon.m	Wed Feb 20 10:16:45 2013 -0800
@@ -303,10 +303,9 @@
     __block AWTTrayIcon *trayIcon = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     jobject thePeer = JNFNewGlobalRef(env, peer);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         trayIcon = [[AWTTrayIcon alloc] initWithPeer:thePeer];
     }];
 
@@ -334,11 +333,10 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CTrayIcon_nativeSetToolTip
 (JNIEnv *env, jobject self, jlong model, jstring jtooltip) {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     AWTTrayIcon *icon = jlong_to_ptr(model);
     NSString *tooltip = JNFJavaToNSString(env, jtooltip);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [icon setTooltip:tooltip];
     }];
 
@@ -353,10 +351,9 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CTrayIcon_setNativeImage
 (JNIEnv *env, jobject self, jlong model, jlong imagePtr, jboolean autosize) {
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     AWTTrayIcon *icon = jlong_to_ptr(model);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [icon setImage:jlong_to_ptr(imagePtr) sizing:autosize];
     }];
 
@@ -369,13 +366,10 @@
     jobject jpt = NULL;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     __block NSPoint pt = NSZeroPoint;
     AWTTrayIcon *icon = jlong_to_ptr(model);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         NSPoint loc = [icon getLocationOnScreen];
         pt = ConvertNSScreenPoint(env, loc);
     }];
--- a/src/macosx/native/sun/awt/CWrapper.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/CWrapper.m	Wed Feb 20 10:16:45 2013 -0800
@@ -46,7 +46,7 @@
 JNF_COCOA_ENTER(env);
 
     id obj = (id)jlong_to_ptr(objectPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         CFRelease(obj);
     }];
 
@@ -66,10 +66,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(makeKeyAndOrderFront:)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(makeKeyAndOrderFront:)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -86,10 +86,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(makeKeyWindow)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(makeKeyWindow)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -106,10 +106,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(makeMainWindow)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(makeMainWindow)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -128,7 +128,7 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         canBecomeMainWindow = [window canBecomeMainWindow];
     }];
 
@@ -151,7 +151,7 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         isKeyWindow = [window isKeyWindow];
     }];
 
@@ -172,10 +172,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(orderFront:)
-                                 on:window
-                         withObject:window
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(orderFront:)
+                                      on:window
+                              withObject:window
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -192,10 +192,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(orderOut:)
-                                 on:window
-                         withObject:window
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(orderOut:)
+                                      on:window
+                              withObject:window
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -212,10 +212,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(orderFrontRegardless)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(orderFrontRegardless)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -233,7 +233,7 @@
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
     NSWindow *relativeTo = (NSWindow *)jlong_to_ptr(relativeToPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window orderWindow:(NSWindowOrderingMode)order relativeTo:[relativeTo windowNumber]];
     }];
 
@@ -267,7 +267,7 @@
         initLevels();
 
         NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-        [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+        [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
             [window setLevel: LEVELS[level]];
         }];
     } else {
@@ -290,7 +290,7 @@
 
     NSWindow *parent = (NSWindow *)jlong_to_ptr(parentPtr);
     NSWindow *child = (NSWindow *)jlong_to_ptr(childPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [parent addChildWindow:child ordered:order];
     }];
 
@@ -310,10 +310,10 @@
 
     AWTWindow *parent = (AWTWindow *)jlong_to_ptr(parentPtr);
     AWTWindow *child = (AWTWindow *)jlong_to_ptr(childPtr);
-    [JNFRunLoop performOnMainThread:@selector(removeChildWindow:)
-                                 on:parent
-                         withObject:child
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(removeChildWindow:)
+                                      on:parent
+                              withObject:child
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -331,7 +331,7 @@
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
     NSRect frame = NSMakeRect(x, y, w, h);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window setFrame:frame display:display];
     }];
 
@@ -350,7 +350,7 @@
 JNF_COCOA_ENTER(env);
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window setAlphaValue:(CGFloat)alpha];
     }];
 
@@ -369,7 +369,7 @@
 JNF_COCOA_ENTER(env);
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window setOpaque:(BOOL)opaque];
     }];
 
@@ -389,7 +389,7 @@
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
     NSColor *color = (NSColor *)jlong_to_ptr(colorPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window setBackgroundColor:color];
     }];
 
@@ -410,7 +410,7 @@
 JNF_COCOA_ENTER(env);
 
     AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         const NSScreen *screen = [window screen];
         CFRetain(screen); // GC
         screenPtr = ptr_to_jlong(screen);
@@ -432,10 +432,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(miniaturize:)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(miniaturize:)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -452,10 +452,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(deminiaturize:)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(deminiaturize:)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -472,10 +472,10 @@
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    [JNFRunLoop performOnMainThread:@selector(zoom:)
-                                 on:window
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(zoom:)
+                                      on:window
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -493,10 +493,10 @@
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
     NSResponder *responder = (NSResponder *)jlong_to_ptr(responderPtr);
-    [JNFRunLoop performOnMainThread:@selector(makeFirstResponder:)
-                                 on:window
-                         withObject:responder
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(makeFirstResponder:)
+                                      on:window
+                              withObject:responder
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -514,7 +514,7 @@
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
     NSView *subview = (NSView *)jlong_to_ptr(subviewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [view addSubview:subview];
     }];
 
@@ -533,10 +533,10 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThread:@selector(removeFromSuperview)
-                                 on:view
-                         withObject:nil
-                      waitUntilDone:NO];
+    [ThreadUtilities performOnMainThread:@selector(removeFromSuperview)
+                                      on:view
+                              withObject:nil
+                           waitUntilDone:NO];
 
 JNF_COCOA_EXIT(env);
 }
@@ -553,7 +553,7 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [view setFrame:NSMakeRect(x, y, w, h)];
     }];
 
@@ -576,7 +576,7 @@
     __block NSRect rect = NSZeroRect;
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         rect = [view frame];
     }];
 
@@ -599,7 +599,7 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         NSScreen *screen = [[view window] screen];
         NSDictionary *opts = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens, nil];
         [view enterFullScreenMode:screen withOptions:opts];
@@ -620,7 +620,7 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [view exitFullScreenModeWithOptions:nil];
     }];
 
@@ -641,7 +641,7 @@
 JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         windowPtr = ptr_to_jlong([view window]);
     }];
 
@@ -655,14 +655,14 @@
  * Method:    setHidden
  * Signature: (JZ)V
  */
-JNIEXPORT jlong JNICALL
+JNIEXPORT void JNICALL
 Java_sun_lwawt_macosx_CWrapper_00024NSView_setHidden
 (JNIEnv *env, jclass cls, jlong viewPtr, jboolean toHide)
 {    
     JNF_COCOA_ENTER(env);
     
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [view setHidden:(BOOL)toHide];
     }];
     
@@ -686,7 +686,7 @@
     __block NSRect rect = NSZeroRect;
 
     NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         rect = [screen frame];
     }];
 
@@ -713,7 +713,7 @@
     __block NSRect rect = NSZeroRect;
 
     NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         rect = [screen visibleFrame];
     }];
 
@@ -737,7 +737,7 @@
 
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         NSArray *screens = [NSScreen screens];
         for (NSScreen *screen in screens) {
             NSDictionary *screenInfo = [screen deviceDescription];
@@ -768,7 +768,7 @@
 
 JNF_COCOA_ENTER(env);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         clearColorPtr = ptr_to_jlong([NSColor clearColor]);
     }];
 
--- a/src/macosx/native/sun/awt/JavaComponentAccessibility.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/JavaComponentAccessibility.m	Wed Feb 20 10:16:45 2013 -0800
@@ -1147,7 +1147,6 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessibility_focusChanged
 (JNIEnv *env, jobject jthis)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 
 JNF_COCOA_ENTER(env);
     [ThreadUtilities performOnMainThread:@selector(postFocusChanged:) onObject:[JavaComponentAccessibility class] withObject:nil waitUntilDone:NO awtMode:NO];
@@ -1164,7 +1163,6 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_valueChanged
 (JNIEnv *env, jclass jklass, jlong element)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
     [ThreadUtilities performOnMainThread:@selector(postValueChanged) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO];
 JNF_COCOA_EXIT(env);
@@ -1178,7 +1176,6 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_selectionChanged
 (JNIEnv *env, jclass jklass, jlong element)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
     [ThreadUtilities performOnMainThread:@selector(postSelectionChanged) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO];
 JNF_COCOA_EXIT(env);
@@ -1193,7 +1190,6 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_unregisterFromCocoaAXSystem
 (JNIEnv *env, jclass jklass, jlong element)
 {
-    AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
     [ThreadUtilities performOnMainThread:@selector(unregisterFromCocoaAXSystem) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO];
 JNF_COCOA_EXIT(env);
--- a/src/macosx/native/sun/awt/LWCToolkit.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/LWCToolkit.m	Wed Feb 20 10:16:45 2013 -0800
@@ -415,13 +415,9 @@
 
 JNF_COCOA_ENTER(env);
 
-    if ([NSThread isMainThread]) {
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^() {
         active = (jboolean)[NSRunningApplication currentApplication].active;
-    } else {
-        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() {
-            active = (jboolean)[NSRunningApplication currentApplication].active;
-        }];
-    }
+    }];
 
 JNF_COCOA_EXIT(env);
 
--- a/src/macosx/native/sun/awt/awt.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/awt/awt.m	Wed Feb 20 10:16:45 2013 -0800
@@ -42,6 +42,15 @@
 // The symbol is defined in libosxapp.dylib (ThreadUtilities.m)
 extern JavaVM *jvm;
 
+// Indicates if AWT is running embedded (in SWT, FX, elsewhere)
+static BOOL isEmbedded = NO;
+
+// Indicates that the app has been started with -XstartOnFirstThread
+// (directly or via WebStart settings), and AWT should not run its
+// own event loop in this mode. Even if a loop isn't running yet,
+// we expect an embedder (e.g. SWT) to start it some time later.
+static BOOL forceEmbeddedMode = NO;
+
 static bool ShouldPrintVerboseDebugging() {
     static int debug = -1;
     if (debug == -1) {
@@ -63,31 +72,29 @@
 static CFRunLoopObserverRef busyObserver = NULL;
 static CFRunLoopObserverRef notBusyObserver = NULL;
 
-static void setUpAWTAppKit(BOOL swt_mode, BOOL headless) {
-AWT_ASSERT_APPKIT_THREAD;
+static void setUpAWTAppKit()
+{
     BOOL verbose = ShouldPrintVerboseDebugging();
     if (verbose) AWT_DEBUG_LOG(@"setting up busy observers");
 
-    JNIEnv *env = [ThreadUtilities getJNIEnv];
-
     // Add CFRunLoopObservers to call into AWT so that AWT knows that the
     //  AWT thread (which is the AppKit main thread) is alive. This way AWT
     //  will not automatically shutdown.
     busyObserver = CFRunLoopObserverCreate(
-                        NULL,                        // CFAllocator
-                        kCFRunLoopAfterWaiting,      // CFOptionFlags
-                        true,                        // repeats
-                        NSIntegerMax,                // order
-                        &BusyObserver,               // CFRunLoopObserverCallBack
-                        NULL);                       // CFRunLoopObserverContext
+            NULL,                        // CFAllocator
+            kCFRunLoopAfterWaiting,      // CFOptionFlags
+            true,                        // repeats
+            NSIntegerMax,                // order
+            &BusyObserver,               // CFRunLoopObserverCallBack
+            NULL);                       // CFRunLoopObserverContext
 
     notBusyObserver = CFRunLoopObserverCreate(
-                        NULL,                        // CFAllocator
-                        kCFRunLoopBeforeWaiting,     // CFOptionFlags
-                        true,                        // repeats
-                        NSIntegerMin,                // order
-                        &NotBusyObserver,            // CFRunLoopObserverCallBack
-                        NULL);                       // CFRunLoopObserverContext
+            NULL,                        // CFAllocator
+            kCFRunLoopBeforeWaiting,     // CFOptionFlags
+            true,                        // repeats
+            NSIntegerMin,                // order
+            &NotBusyObserver,            // CFRunLoopObserverCallBack
+            NULL);                       // CFRunLoopObserverContext
 
     CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
     CFRunLoopAddObserver(runLoop, busyObserver, kCFRunLoopDefaultMode);
@@ -95,29 +102,33 @@
 
     CFRelease(busyObserver);
     CFRelease(notBusyObserver);
-    
-    if (!headless) setBusy(YES);
+
+    setBusy(YES);
+}
+
+static void setUpAppKitThreadName()
+{
+    BOOL verbose = ShouldPrintVerboseDebugging();
+    JNIEnv *env = [ThreadUtilities getJNIEnv];
 
     // Set the java name of the AppKit main thread appropriately.
     jclass threadClass = NULL;
     jstring name = NULL;
     jobject curThread = NULL;
 
-    if (!swt_mode) {
-        threadClass = (*env)->FindClass(env, "java/lang/Thread");
-        if (threadClass == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
-        jmethodID currentThreadID = (*env)->GetStaticMethodID(env, threadClass, "currentThread", "()Ljava/lang/Thread;");
-        if (currentThreadID == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
-        jmethodID setName = (*env)->GetMethodID(env, threadClass, "setName", "(Ljava/lang/String;)V");
-        if (setName == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    threadClass = (*env)->FindClass(env, "java/lang/Thread");
+    if (threadClass == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    jmethodID currentThreadID = (*env)->GetStaticMethodID(env, threadClass, "currentThread", "()Ljava/lang/Thread;");
+    if (currentThreadID == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    jmethodID setName = (*env)->GetMethodID(env, threadClass, "setName", "(Ljava/lang/String;)V");
+    if (setName == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
 
-        curThread = (*env)->CallStaticObjectMethod(env, threadClass, currentThreadID); // AWT_THREADING Safe (known object)
-        if (curThread == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
-        name = (*env)->NewStringUTF(env, "AWT-AppKit");
-        if (name == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
-        (*env)->CallVoidMethod(env, curThread, setName, name); // AWT_THREADING Safe (known object)
-        if ((*env)->ExceptionCheck(env)) goto cleanup;
-    }
+    curThread = (*env)->CallStaticObjectMethod(env, threadClass, currentThreadID); // AWT_THREADING Safe (known object)
+    if (curThread == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    name = (*env)->NewStringUTF(env, "AWT-AppKit");
+    if (name == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
+    (*env)->CallVoidMethod(env, curThread, setName, name); // AWT_THREADING Safe (known object)
+    if ((*env)->ExceptionCheck(env)) goto cleanup;
 
 cleanup:
     if (threadClass != NULL) {
@@ -134,14 +145,10 @@
         (*env)->ExceptionClear(env);
     }
 
-    // Add the exception handler of last resort
-    NSSetUncaughtExceptionHandler(AWT_NSUncaughtExceptionHandler);
-
     if (verbose) AWT_DEBUG_LOG(@"finished setting thread name");
 }
 
 
-
 // Returns true if java believes it is running headless
 BOOL isHeadless(JNIEnv *env) {
     // Just access the property directly, instead of using GraphicsEnvironment.isHeadless.
@@ -200,7 +207,7 @@
 
 // This is an empty Obj-C object just so that -peformSelectorOnMainThread can be used.
 @interface AWTStarter : NSObject { }
-+ (void)start:(BOOL)headless swtMode:(BOOL)swtMode swtModeForWebStart:(BOOL)swtModeForWebStart;
++ (void)start:(BOOL)headless;
 - (void)starter:(NSArray*)args;
 + (void)appKitIsRunning:(id)arg;
 @end
@@ -242,7 +249,7 @@
     if (verbose) AWT_DEBUG_LOG(@"finished messaging AppKit started");
 }
 
-+ (void)start:(BOOL)headless swtMode:(BOOL)swtMode swtModeForWebStart:(BOOL)swtModeForWebStart
++ (void)start:(BOOL)headless
 {
     BOOL verbose = ShouldPrintVerboseDebugging();
 
@@ -258,7 +265,7 @@
     BOOL onMainThread = (pthread_main_np() != 0);
 
     if (verbose) {
-        NSString *msg = [NSString stringWithFormat:@"+[AWTStarter start headless:%d swtMode:%d swtModeForWebStart:%d] { onMainThread:%d }", headless, swtMode, swtModeForWebStart, onMainThread];
+        NSString *msg = [NSString stringWithFormat:@"+[AWTStarter start headless:%d] { onMainThread:%d }", headless, onMainThread];
         AWT_DEBUG_LOG(msg);
     }
 
@@ -280,9 +287,7 @@
 
     NSArray * args = [NSArray arrayWithObjects:
                       [NSNumber numberWithBool: onMainThread],
-                      [NSNumber numberWithBool: swtMode],
                       [NSNumber numberWithBool: headless],
-                      [NSNumber numberWithBool: swtModeForWebStart],
                       [NSNumber numberWithBool: verbose],
                       nil];
 
@@ -310,39 +315,38 @@
     // Don't set the delegate until the NSApplication has been created and
     // its finishLaunching has initialized it.
     //  ApplicationDelegate is the support code for com.apple.eawt.
-    void (^setDelegateBlock)() = ^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         OSXAPP_SetApplicationDelegate([ApplicationDelegate sharedDelegate]);
-    };
-    if (onMainThread) {
-        setDelegateBlock();
-    } else {
-        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:setDelegateBlock];
-    }
+    }];
 }
 
 - (void)starter:(NSArray*)args {
     NSAutoreleasePool *pool = [NSAutoreleasePool new];
 
     BOOL onMainThread = [[args objectAtIndex:0] boolValue];
-    BOOL swtMode = [[args objectAtIndex:1] boolValue];
-    BOOL headless = [[args objectAtIndex:2] boolValue];
-    BOOL swtModeForWebStart = [[args objectAtIndex:3] boolValue];
-    BOOL verbose = [[args objectAtIndex:4] boolValue];
+    BOOL headless = [[args objectAtIndex:1] boolValue];
+    BOOL verbose = [[args objectAtIndex:2] boolValue];
 
     BOOL wasOnMainThread = onMainThread;
 
-    setUpAWTAppKit(swtMode, headless);
+    // Add the exception handler of last resort
+    NSSetUncaughtExceptionHandler(AWT_NSUncaughtExceptionHandler);
 
     // Headless mode trumps either ordinary AWT or SWT-in-AWT mode.  Declare us a daemon and return.
     if (headless) {
-        BOOL didBecomeDaemon = [AWTStarter markAppAsDaemon];
+        if (!forceEmbeddedMode) {
+            setUpAppKitThreadName();
+        }
+        [AWTStarter markAppAsDaemon];
         return;
     }
 
-    if (swtMode || swtModeForWebStart) {
+    if (forceEmbeddedMode) {
         if (verbose) NSLog(@"in SWT or SWT/WebStart mode");
 
-        // The SWT should call NSApplicationLoad, but they don't know a priori that they will be using the AWT, so they don't.
+        // Init a default NSApplication instance instead of the NSApplicationAWT.
+        // Note that [NSApp isRunning] will return YES after that, though
+        // this behavior isn't specified anywhere. We rely on that.
         NSApplicationLoad();
     }
 
@@ -351,6 +355,13 @@
     //  and -[NSApplication isRunning] returns YES, AWT is embedded inside another
     //  AppKit Application.
     NSApplication *app = [NSApplicationAWT sharedApplication];
+    isEmbedded = ![NSApp isKindOfClass:[NSApplicationAWT class]];
+
+    if (!isEmbedded) {
+        // Install run loop observers and set the AppKit Java thread name
+        setUpAWTAppKit();
+        setUpAppKitThreadName();
+    }
 
     // AWT gets to this point BEFORE NSApplicationDidFinishLaunchingNotification is sent.
     if (![app isRunning]) {
@@ -360,17 +371,11 @@
         [NSApplicationAWT runAWTLoopWithApp: app];
     } else {
         // We're either embedded, or showing a splash screen
-        if (![NSApp isKindOfClass:[NSApplicationAWT class]]) {
+        if (isEmbedded) {
             if (verbose) AWT_DEBUG_LOG(@"running embedded");
 
-            // Since we're embedded, no need to be swamping the runloop with the observers.
-            CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
-            CFRunLoopRemoveObserver(runLoop, busyObserver, kCFRunLoopDefaultMode);
-            CFRunLoopRemoveObserver(runLoop, notBusyObserver, kCFRunLoopDefaultMode);
             // We don't track if the runloop is busy, so set it free to let AWT finish when it needs
             setBusy(NO);
-            busyObserver = NULL;
-            notBusyObserver = NULL;
         } else {
             if (verbose) AWT_DEBUG_LOG(@"running after showing a splash screen");
         }
@@ -408,49 +413,28 @@
         return JNI_VERSION_1_4;
     }
 
-    // The following is true when AWT is attempting to connect to the window server
-    // when it isn't set up properly to do so.
-    // BOOL AWTLoadFailure = YES;    For now we are skipping this check so i'm commenting out this variable as unused
 JNF_COCOA_ENTER(env);
 
-    // If -XstartOnFirstThread was used at invocation time, an environment variable will be set.
-    // (See java_md.c for the matching setenv call.) When that happens, we assume the SWT will be in use.
-    BOOL swt_compatible_mode = NO;
-
+    // Launcher sets this env variable if -XstartOnFirstThread is specified
     char envVar[80];
     snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
     if (getenv(envVar) != NULL) {
-        swt_compatible_mode = YES;
+        forceEmbeddedMode = YES;
         unsetenv(envVar);
     }
 
-    BOOL swt_in_webstart = isSWTInWebStart(env);
+    if (isSWTInWebStart(env)) {
+        forceEmbeddedMode = YES;
+    }
+
     BOOL headless = isHeadless(env);
 
-    // Make sure we're on the right thread.  If not, we still need the JNIEnv to throw an exception.
-    if (pthread_main_np() != 0 && !swt_compatible_mode && !headless) {
-        AWT_DEBUG_LOG(@"Apple AWT Java VM was loaded on first thread -- can't start AWT.");
-        [JNFException raise:env as:kInternalError reason:"Can't start the AWT because Java was started on the first thread.  Make sure StartOnFirstThread is "
-         "not specified in your application's Info.plist or on the command line"];
-        return JNI_VERSION_1_4;
-    }
-
     // We need to let Foundation know that this is a multithreaded application, if it isn't already.
     if (![NSThread isMultiThreaded]) {
         [NSThread detachNewThreadSelector:nil toTarget:nil withObject:nil];
     }
 
-//    if (swt_compatible_mode || headless || [AWTStarter isConnectedToWindowServer] || [AWTStarter isRemoteSession]) {
-// No need in this check - we will try to launch AWTStarter anyways - to be able to run GUI application remotely
-//        AWTLoadFailure = NO;
-
-    [AWTStarter start:headless swtMode:swt_compatible_mode swtModeForWebStart:swt_in_webstart];
-
-//    }
-
-/*    if (AWTLoadFailure) { // We will not reach this code anyways
-        [JNFException raise:env as:kInternalError reason:"Can't connect to window server - not enough permissions."];
-    } */
+    [AWTStarter start:headless];
 
 JNF_COCOA_EXIT(env);
 
--- a/src/macosx/native/sun/osxapp/ThreadUtilities.h	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/osxapp/ThreadUtilities.h	Wed Feb 20 10:16:45 2013 -0800
@@ -98,8 +98,6 @@
     }                                          \
 } while (0)
 
-#define AWT_ASSERT_ANY_THREAD
-
 #endif /* AWT_THREAD_ASSERTS_MESSAGES */
 
 #ifdef AWT_THREAD_ASSERTS_WAIT
@@ -114,15 +112,12 @@
     while (pthread_main_np() != 0) {} \
 } while (0)
 
-#define AWT_ASSERT_ANY_THREAD
-
 #endif /* AWT_THREAD_ASSERTS_WAIT */
 
 #else /* AWT_THREAD_ASSERTS */
 
 #define AWT_ASSERT_APPKIT_THREAD     do {} while (0)
 #define AWT_ASSERT_NOT_APPKIT_THREAD do {} while (0)
-#define AWT_ASSERT_ANY_THREAD
 
 #endif /* AWT_THREAD_ASSERTS */
 // --------------------------------------------------------------------------
@@ -139,7 +134,10 @@
 + (JNIEnv*)getJNIEnvUncached;
 
 + (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT;
+
+//Wrappers for the corresponding JNFRunLoop methods with a check for main thread
 + (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block;
++ (void)performOnMainThread:(SEL)aSelector on:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait;
 @end
 
 void OSXAPP_SetJavaVM(JavaVM *vm);
--- a/src/macosx/native/sun/osxapp/ThreadUtilities.m	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/macosx/native/sun/osxapp/ThreadUtilities.m	Wed Feb 20 10:16:45 2013 -0800
@@ -37,27 +37,13 @@
 static NSArray *sPerformModes = nil;
 static NSArray *sAWTPerformModes = nil;
 
-static BOOL sCocoaComponentCompatibility = NO;
-static NSTimeInterval sCocoaComponentCompatibilityTimeout = 0.5;
 static BOOL sLoggingEnabled = YES;
 
 #ifdef AWT_THREAD_ASSERTS_ENV_ASSERT
 int sAWTThreadAsserts = 0;
 #endif /* AWT_THREAD_ASSERTS_ENV_ASSERT */
 
-
-// This is for backward compatibility for those people using CocoaComponent
-// Since we've flipped the AWT threading model for Tiger (10.4), all the rules
-// for CocoaComponent are wrong.
-// So for existing CocoaComponent users, we can't be synchronous.
-// Making things totally asynchronous breaks a _lot_, so we try to be
-// synchronous and time out after a little bit.
-#define NOT_READY 0
-#define READY 1
-#define IN_PROGRESS 2
-
 BOOL sInPerformFromJava = NO;
-NSUInteger sPerformCount = 0;
 
 // This class is used so that performSelectorOnMainThread can be
 // controlled a little more easily by us.  It has 2 roles.
@@ -73,8 +59,6 @@
 
 - (id) initWithTarget:(id)target selector:(SEL)selector arg:(id)arg wait:(BOOL)wait;
 - (void) perform;
-- (void) performCompatible;
-- (void) _performCompatible:(NSConditionLock *)resultLock;
 @end
 
 
@@ -113,8 +97,6 @@
         sInPerformFromJava = YES;
     }
 
-    sPerformCount++;
-
     // Actually do the work (cheat to avoid a method call)
     @try {
         objc_msgSend(fTarget, fSelector, fArg);
@@ -128,69 +110,6 @@
         }
     }
 }
-
-- (void) performCompatible {
-    // We check if we are on the AppKit thread because frequently, apps
-    // using CocoaComponent are doing things on the wrong thread!
-    if (pthread_main_np()) {
-        [fTarget performSelector:fSelector withObject:fArg];
-    } else {
-        // Setup the lock
-        NSConditionLock *resultLock =
-            [[NSConditionLock alloc] initWithCondition:NOT_READY];
-
-        // Make sure that if we return early, nothing gets released out
-        // from under us
-        [resultLock retain];
-        [fTarget retain];
-        [fArg retain];
-        [self retain];
-        // Do an asynchronous perform to the main thread.
-        [self performSelectorOnMainThread:@selector(_performCompatible:)
-              withObject:resultLock waitUntilDone:NO modes:sAWTPerformModes];
-
-        // Wait for a little bit for it to finish
-        [resultLock lockWhenCondition:READY beforeDate:[NSDate dateWithTimeIntervalSinceNow:sCocoaComponentCompatibilityTimeout]];
-
-        // If the _performCompatible is actually in progress,
-        // we should let it finish
-        if ([resultLock condition] == IN_PROGRESS) {
-            [resultLock lockWhenCondition:READY];
-        }
-
-        if ([resultLock condition] == NOT_READY && sLoggingEnabled) {
-            NSLog(@"[Java CocoaComponent compatibility mode]: Operation timed out due to possible deadlock: selector '%@' on target '%@' with args '%@'", NSStringFromSelector(fSelector), fTarget, fArg);
-        }
-
-        [resultLock unlock];
-        [resultLock autorelease];
-    }
-}
-
-- (void) _performCompatible:(NSConditionLock *)resultLock {
-    // notify that the perform is in progress!
-    [resultLock lock];
-    [resultLock unlockWithCondition:IN_PROGRESS];
-
-    sPerformCount++;
-
-    // Actually do the work.
-    @try {
-        [fTarget performSelector:fSelector withObject:fArg];
-    } @catch (NSException *e) {
-        NSLog(@"*** CPerformer: ignoring exception '%@' raised during performCompatible of selector '%@' on target '%@' with args '%@'", e, NSStringFromSelector(fSelector), fTarget, fArg);
-    } @finally {
-        // notify done!
-        [resultLock lock];
-        [resultLock unlockWithCondition:READY];
-
-        // Clean up after ourselves
-        [resultLock autorelease];
-        [fTarget autorelease];
-        [fArg autorelease];
-        [self autorelease];
-    }
-}
 @end
 
 
@@ -236,13 +155,8 @@
 // java event thread without deadlocking. See CToolkit.invokeAndWait.
 + (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT {
     CPerformer *performer = [[CPerformer alloc] initWithTarget:target selector:aSelector arg:arg wait:wait];
-    if (sCocoaComponentCompatibility && wait && inAWT) {
-        [performer performCompatible];
-        [performer autorelease];
-    } else {
-        [performer performSelectorOnMainThread:@selector(perform) withObject:nil waitUntilDone:wait modes:((inAWT) ? sAWTPerformModes : sPerformModes)]; // AWT_THREADING Safe (cover method)
-        [performer release];
-    }
+    [performer performSelectorOnMainThread:@selector(perform) withObject:nil waitUntilDone:wait modes:((inAWT) ? sAWTPerformModes : sPerformModes)]; // AWT_THREADING Safe (cover method)
+    [performer release];
 }
 
 + (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block {
@@ -253,6 +167,14 @@
     }
 }
 
++ (void)performOnMainThread:(SEL)aSelector on:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait {
+    if ([NSThread isMainThread] && wait == YES) {
+        [target performSelector:aSelector withObject:arg];
+    } else {
+        [JNFRunLoop performOnMainThread:aSelector on:target withObject:arg waitUntilDone:wait];
+    }
+}
+
 @end
 
 
--- a/src/share/bin/parse_manifest.c	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/bin/parse_manifest.c	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -106,8 +106,9 @@
             *size_out = (int)entry->isize;
         }
         return (out);
-    } else
-        return (NULL);
+    }
+    free(in);
+    return (NULL);
 }
 
 static jboolean zip64_present = JNI_FALSE;
@@ -563,7 +564,7 @@
 
     if ((fd = open(jarfile, O_RDONLY
 #ifdef O_LARGEFILE
-        | O_LARGEFILE /* large file mode on solaris */
+        | O_LARGEFILE /* large file mode */
 #endif
 #ifdef O_BINARY
         | O_BINARY /* use binary mode on windows */
@@ -618,6 +619,9 @@
     void    *data = NULL;
 
     fd = open(jarfile, O_RDONLY
+#ifdef O_LARGEFILE
+        | O_LARGEFILE /* large file mode */
+#endif
 #ifdef O_BINARY
         | O_BINARY /* use binary mode on windows */
 #endif
@@ -661,6 +665,9 @@
     int     rc;
 
     if ((fd = open(jarfile, O_RDONLY
+#ifdef O_LARGEFILE
+        | O_LARGEFILE /* large file mode */
+#endif
 #ifdef O_BINARY
         | O_BINARY /* use binary mode on windows */
 #endif
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Wed Feb 20 10:16:45 2013 -0800
@@ -787,7 +787,6 @@
             "List.font", new FontLazyValue(Region.LIST),
             "List.rendererUseUIBorder", Boolean.FALSE,
 
-            "Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK},
             "Menu.arrowIcon", new GTKStyle.GTKLazyValue(
                               "com.sun.java.swing.plaf.gtk.GTKIconFactory",
                               "getMenuArrowIcon"),
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Wed Feb 20 10:16:45 2013 -0800
@@ -630,8 +630,10 @@
             "Menu.menuPopupOffsetY", new Integer(0),
             "Menu.submenuPopupOffsetX", new Integer(-2),
             "Menu.submenuPopupOffsetY", new Integer(3),
-            "Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK,
-                                            KeyEvent.META_MASK},
+            "Menu.shortcutKeys", new int[]{
+                SwingUtilities2.getSystemMnemonicKeyMask(),
+                KeyEvent.META_MASK
+            },
             "Menu.cancelMode", "hideMenuTree",
 
             "MenuBar.border", menuBarBorder,
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Wed Feb 20 10:16:45 2013 -0800
@@ -2619,13 +2619,15 @@
 
     private static class FocusColorProperty extends DesktopProperty {
         public FocusColorProperty () {
-            // Fallback value is never used bacause of the configureValue method doesn't return null
+            // Fallback value is never used because of the configureValue method doesn't return null
             super("win.3d.backgroundColor", Color.BLACK);
         }
 
         @Override
         protected Object configureValue(Object value) {
-            if (! ((Boolean)Toolkit.getDefaultToolkit().getDesktopProperty("win.highContrast.on")).booleanValue()){
+            Object highContrastOn = Toolkit.getDefaultToolkit().
+                    getDesktopProperty("win.highContrast.on");
+            if (highContrastOn == null || !((Boolean) highContrastOn).booleanValue()) {
                 return Color.BLACK;
             }
             return Color.BLACK.equals(value) ? Color.WHITE : Color.BLACK;
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java	Wed Feb 20 10:16:45 2013 -0800
@@ -93,6 +93,11 @@
                             counter = endRow;
                         }
                     }
+
+                    if (testRect == null) {
+                        return;
+                    }
+
                     tree.scrollRectToVisible(new Rectangle(visRect.x, beginY, 1,
                                                       testRect.y + testRect.height-
                                                       beginY));
--- a/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java	Wed Feb 20 10:16:45 2013 -0800
@@ -50,8 +50,6 @@
 import javax.management.NotCompliantMBeanException;
 
 import com.sun.jmx.remote.util.EnvHelp;
-import java.beans.BeanInfo;
-import java.beans.PropertyDescriptor;
 import java.lang.reflect.Array;
 import java.lang.reflect.InvocationTargetException;
 import javax.management.AttributeNotFoundException;
--- a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Wed Feb 20 10:16:45 2013 -0800
@@ -52,16 +52,19 @@
  * principal set and private credentials set are updated only when
  * <code>commit</code> is called.
  * When <code>commit</code> is called, the <code>KerberosPrincipal</code>
- * is added to the  <code>Subject</code>'s
- * principal set and <code>KerberosTicket</code> is
+ * is added to the <code>Subject</code>'s principal set (unless the
+ * <code>principal</code> is specified as "*"). If <code>isInitiator</code>
+ * is true, the <code>KerberosTicket</code> is
  * added to the <code>Subject</code>'s private credentials.
  *
  * <p> If the configuration entry for <code>KerberosLoginModule</code>
  * has the option <code>storeKey</code> set to true, then
- * <code>KerberosKey</code> will also be added to the
+ * <code>KerberosKey</code> or <code>KeyTab</code> will also be added to the
  * subject's private credentials. <code>KerberosKey</code>, the principal's
- * key will be either obtained from the keytab or
- * derived from user's password.
+ * key(s) will be derived from user's password, and <code>KeyTab</code> is
+ * the keytab used when <code>useKeyTab</code> is set to true. The
+ * <code>KeyTab</code> object is restricted to be used by the specified
+ * principal unless the principal value is "*".
  *
  * <p> This <code>LoginModule</code> recognizes the <code>doNotPrompt</code>
  * option. If set to true the user will not be prompted for the password.
@@ -75,8 +78,8 @@
  *
  * <p> The principal name can be specified in the configuration entry
  * by using the option <code>principal</code>. The principal name
- * can either be a simple user name or a service name such as
- * <code>host/mission.eng.sun.com</code>. The principal can also
+ * can either be a simple user name, a service name such as
+ * <code>host/mission.eng.sun.com</code>, or "*". The principal can also
  * be set using the system property <code>sun.security.krb5.principal</code>.
  * This property is checked during login. If this property is not set, then
  * the principal name from the configuration is used. In the
@@ -87,11 +90,10 @@
  *
  * <p> The following is a list of configuration options supported
  * for <code>Krb5LoginModule</code>:
- * <dl>
- * <blockquote><dt><b><code>refreshKrb5Config</code></b>:</dt>
+ * <blockquote><dl>
+ * <dt><b><code>refreshKrb5Config</code></b>:</dt>
  * <dd> Set this to true, if you want the configuration
  * to be refreshed before the <code>login</code> method is called.</dd>
- * <P>
  * <dt><b><code>useTicketCache</code></b>:</dt>
  * <dd>Set this to true, if you want the
  * TGT to be obtained
@@ -112,19 +114,16 @@
  * <code>ticketCache</code>.
  * For Windows, if a ticket cannot be retrieved from the file ticket cache,
  * it will use Local Security Authority (LSA) API to get the TGT.
- * <P>
  * <dt><b><code>ticketCache</code></b>:</dt>
  * <dd>Set this to the name of the ticket
  * cache that  contains user's TGT.
  * If this is set,  <code>useTicketCache</code>
  * must also be set to true; Otherwise a configuration error will
  * be returned.</dd>
- *  <P>
  * <dt><b><code>renewTGT</code></b>:</dt>
  * <dd>Set this to true, if you want to renew
  * the TGT. If this is set, <code>useTicketCache</code> must also be
  * set to true; otherwise a configuration error will be returned.</dd>
- * <p>
  * <dt><b><code>doNotPrompt</code></b>:</dt>
  * <dd>Set this to true if you do not want to be
  * prompted for the password
@@ -132,7 +131,6 @@
  * or through shared state.(Default is false)
  * If set to true, credential must be obtained through cache, keytab,
  * or shared state. Otherwise, authentication will fail.</dd>
- * <P>
  * <dt><b><code>useKeyTab</code></b>:</dt>
  * <dd>Set this to true if you
  * want the module to get the principal's key from the
@@ -144,15 +142,15 @@
  * If it is not specified in the Kerberos configuration file
  * then it will look for the file
  * <code>{user.home}{file.separator}</code>krb5.keytab.</dd>
- * <P>
  * <dt><b><code>keyTab</code></b>:</dt>
  * <dd>Set this to the file name of the
  * keytab to get principal's secret key.</dd>
- * <P>
  * <dt><b><code>storeKey</code></b>:</dt>
- * <dd>Set this to true to if you want the
- * principal's key to be stored in the Subject's private credentials. </dd>
- * <p>
+ * <dd>Set this to true to if you want the keytab or the
+ * principal's key to be stored in the Subject's private credentials.
+ * For <code>isInitiator</code> being false, if <code>principal</code>
+ * is "*", the {@link KeyTab} stored can be used by anyone, otherwise,
+ * it's restricted to be used by the specified principal only.</dd>
  * <dt><b><code>principal</code></b>:</dt>
  * <dd>The name of the principal that should
  * be used. The principal can be a simple username such as
@@ -165,8 +163,13 @@
  * <code>sun.security.krb5.principal</code>. In addition, if this
  * system property is defined, then it will be used. If this property
  * is not set, then the principal name from the configuration will be
- * used.</dd>
- * <P>
+ * used.
+ * The principal name can be set to "*" when <code>isInitiator</code> is false.
+ * In this case, the acceptor is not bound to a single principal. It can
+ * act as any principal an initiator requests if keys for that principal
+ * can be found. When <code>isInitiator</code> is true, the principal name
+ * cannot be set to "*".
+ * </dd>
  * <dt><b><code>isInitiator</code></b>:</dt>
  * <dd>Set this to true, if initiator. Set this to false, if acceptor only.
  * (Default is true).
@@ -177,18 +180,20 @@
  * <code>Configuration</code>
  * options that enable you to share username and passwords across different
  * authentication modules:
- * <pre>
+ * <blockquote><dl>
  *
- *    useFirstPass   if, true, this LoginModule retrieves the
+ *    <dt><b><code>useFirstPass</code></b>:</dt>
+ *                   <dd>if, true, this LoginModule retrieves the
  *                   username and password from the module's shared state,
  *                   using "javax.security.auth.login.name" and
  *                   "javax.security.auth.login.password" as the respective
  *                   keys. The retrieved values are used for authentication.
  *                   If authentication fails, no attempt for a retry
  *                   is made, and the failure is reported back to the
- *                   calling application.
+ *                   calling application.</dd>
  *
- *    tryFirstPass   if, true, this LoginModule retrieves the
+ *    <dt><b><code>tryFirstPass</code></b>:</dt>
+ *                   <dd>if, true, this LoginModule retrieves the
  *                   the username and password from the module's shared
  *                   state using "javax.security.auth.login.name" and
  *                   "javax.security.auth.login.password" as the respective
@@ -198,26 +203,28 @@
  *                   CallbackHandler to retrieve a new username
  *                   and password, and another attempt to authenticate
  *                   is made. If the authentication fails,
- *                   the failure is reported back to the calling application
+ *                   the failure is reported back to the calling application</dd>
  *
- *    storePass      if, true, this LoginModule stores the username and
+ *    <dt><b><code>storePass</code></b>:</dt>
+ *                   <dd>if, true, this LoginModule stores the username and
  *                   password obtained from the CallbackHandler in the
  *                   modules shared state, using
  *                   "javax.security.auth.login.name" and
  *                   "javax.security.auth.login.password" as the respective
  *                   keys.  This is not performed if existing values already
  *                   exist for the username and password in the shared
- *                   state, or if authentication fails.
+ *                   state, or if authentication fails.</dd>
  *
- *    clearPass      if, true, this LoginModule clears the
+ *    <dt><b><code>clearPass</code></b>:</dt>
+ *                   <dd>if, true, this LoginModule clears the
  *                   username and password stored in the module's shared
  *                   state  after both phases of authentication
- *                   (login and commit) have completed.
- * </pre>
+ *                   (login and commit) have completed.</dd>
+ * </dl></blockquote>
  * <p>If the principal system property or key is already provided, the value of
  * "javax.security.auth.login.name" in the shared state is ignored.
  * <p>When multiple mechanisms to retrieve a ticket or key is provided, the
- * preference order looks like this:
+ * preference order is:
  * <ol>
  * <li>ticket cache
  * <li>keytab
@@ -225,7 +232,7 @@
  * <li>user prompt
  * </ol>
  * <p>Note that if any step fails, it will fallback to the next step.
- * There's only one exception, it the shared state step fails and
+ * There's only one exception, if the shared state step fails and
  * <code>useFirstPass</code>=true, no user prompt is made.
  * <p>Examples of some configuration values for Krb5LoginModule in
  * JAAS config file and the results are:
@@ -318,7 +325,7 @@
  * <p> <code>useKeyTab</code> = true
  * <code>keyTab</code>=&lt;keytabname&gt;
  * <code>storeKey</code>=true
- * <code>doNotPrompt</code>=true;
+ * <code>doNotPrompt</code>=false;
  *</ul>
  * <p>The user will be prompted for the service principal name.
  * If the principal's
@@ -328,6 +335,14 @@
  * If successful the TGT will be added to the
  * Subject's private credentials set. Otherwise the authentication will
  * fail.
+ * <ul>
+ * <p> <code>isInitiator</code> = false <code>useKeyTab</code> = true
+ * <code>keyTab</code>=&lt;keytabname&gt;
+ * <code>storeKey</code>=true
+ * <code>principal</code>=*;
+ *</ul>
+ * <p>The acceptor will be an unbound acceptor and it can act as any principal
+ * as long that principal has keys in the keytab.
  *<ul>
  * <p>
  * <code>useTicketCache</code>=true
@@ -409,6 +424,7 @@
     private KerberosTicket kerbTicket = null;
     private KerberosKey[] kerbKeys = null;
     private StringBuffer krb5PrincName = null;
+    private boolean unboundServer = false;
     private char[] password = null;
 
     private static final String NAME = "javax.security.auth.login.name";
@@ -520,8 +536,6 @@
      */
     public boolean login() throws LoginException {
 
-        int len;
-        validateConfiguration();
         if (refreshKrb5Config) {
             try {
                 if (debug) {
@@ -544,6 +558,12 @@
             }
         }
 
+        validateConfiguration();
+
+        if (krb5PrincName != null && krb5PrincName.toString().equals("*")) {
+            unboundServer = true;
+        }
+
         if (tryFirstPass) {
             try {
                 attemptAuthentication(true);
@@ -698,9 +718,17 @@
                  * (encKeys == null) to check.
                  */
                 if (useKeyTab) {
-                    ktab = (keyTabName == null)
-                                ? KeyTab.getInstance()
-                                : KeyTab.getInstance(new File(keyTabName));
+                    if (!unboundServer) {
+                        KerberosPrincipal kp =
+                                new KerberosPrincipal(principal.getName());
+                        ktab = (keyTabName == null)
+                                ? KeyTab.getInstance(kp)
+                                : KeyTab.getInstance(kp, new File(keyTabName));
+                    } else {
+                        ktab = (keyTabName == null)
+                                ? KeyTab.getUnboundInstance()
+                                : KeyTab.getUnboundInstance(new File(keyTabName));
+                    }
                     if (isInitiator) {
                         if (Krb5Util.keysFromJavaxKeyTab(ktab, principal).length
                                 == 0) {
@@ -939,6 +967,13 @@
                 ("Configuration Error"
                  + " - either useTicketCache should be "
                  + " true or renewTGT should be false");
+        if (krb5PrincName != null && krb5PrincName.toString().equals("*")) {
+            if (isInitiator) {
+                throw new LoginException
+                    ("Configuration Error"
+                    + " - principal cannot be * when isInitiator is true");
+            }
+        }
     }
 
     private boolean isCurrent(Credentials creds)
@@ -1052,7 +1087,10 @@
             }
             // Let us add the kerbClientPrinc,kerbTicket and KeyTab/KerbKey (if
             // storeKey is true)
-            if (!princSet.contains(kerbClientPrinc)) {
+
+            // We won't add "*" as a KerberosPrincipal
+            if (!unboundServer &&
+                    !princSet.contains(kerbClientPrinc)) {
                 princSet.add(kerbClientPrinc);
             }
 
--- a/src/share/classes/com/sun/security/ntlm/Client.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/com/sun/security/ntlm/Client.java	Wed Feb 20 10:16:45 2013 -0800
@@ -138,8 +138,7 @@
             domain = domainFromServer;
         }
         if (domain == null) {
-            throw new NTLMException(NTLMException.NO_DOMAIN_INFO,
-                    "No domain info");
+            domain = "";
         }
 
         int flags = 0x88200 | (inputFlags & 3);
--- a/src/share/classes/com/sun/security/ntlm/NTLM.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/com/sun/security/ntlm/NTLM.java	Wed Feb 20 10:16:45 2013 -0800
@@ -136,10 +136,10 @@
 
         int readInt(int offset) throws NTLMException {
             try {
-                return internal[offset] & 0xff +
-                        (internal[offset+1] & 0xff << 8) +
-                        (internal[offset+2] & 0xff << 16) +
-                        (internal[offset+3] & 0xff << 24);
+                return (internal[offset] & 0xff) +
+                        ((internal[offset+1] & 0xff) << 8) +
+                        ((internal[offset+2] & 0xff) << 16) +
+                        ((internal[offset+3] & 0xff) << 24);
             } catch (ArrayIndexOutOfBoundsException ex) {
                 throw new NTLMException(NTLMException.PACKET_READ_ERROR,
                         "Input message incorrect size");
@@ -148,8 +148,8 @@
 
         int readShort(int offset) throws NTLMException {
             try {
-                return internal[offset] & 0xff +
-                        (internal[offset+1] & 0xff << 8);
+                return (internal[offset] & 0xff) +
+                        ((internal[offset+1] & 0xff << 8));
             } catch (ArrayIndexOutOfBoundsException ex) {
                 throw new NTLMException(NTLMException.PACKET_READ_ERROR,
                         "Input message incorrect size");
--- a/src/share/classes/java/awt/Button.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Button.java	Wed Feb 20 10:16:45 2013 -0800
@@ -300,7 +300,7 @@
      * @since 1.4
      */
     public synchronized ActionListener[] getActionListeners() {
-        return (ActionListener[]) (getListeners(ActionListener.class));
+        return getListeners(ActionListener.class);
     }
 
     /**
--- a/src/share/classes/java/awt/Checkbox.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Checkbox.java	Wed Feb 20 10:16:45 2013 -0800
@@ -470,7 +470,7 @@
      * @since 1.4
      */
     public synchronized ItemListener[] getItemListeners() {
-        return (ItemListener[]) (getListeners(ItemListener.class));
+        return getListeners(ItemListener.class);
     }
 
     /**
--- a/src/share/classes/java/awt/Choice.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Choice.java	Wed Feb 20 10:16:45 2013 -0800
@@ -85,7 +85,7 @@
      * @see #insert(String, int)
      * @see #remove(String)
      */
-    Vector pItems;
+    Vector<String> pItems;
 
     /**
      * The index of the current choice for this <code>Choice</code>
@@ -129,7 +129,7 @@
      */
     public Choice() throws HeadlessException {
         GraphicsEnvironment.checkHeadless();
-        pItems = new Vector();
+        pItems = new Vector<>();
     }
 
     /**
@@ -191,7 +191,7 @@
      * be called on the toolkit thread.
      */
     final String getItemImpl(int index) {
-        return (String)pItems.elementAt(index);
+        return pItems.elementAt(index);
     }
 
     /**
@@ -524,7 +524,7 @@
      * @since 1.4
      */
     public synchronized ItemListener[] getItemListeners() {
-        return (ItemListener[])(getListeners(ItemListener.class));
+        return getListeners(ItemListener.class);
     }
 
     /**
--- a/src/share/classes/java/awt/Component.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Component.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -7287,6 +7287,7 @@
     }
     final Set<AWTKeyStroke> getFocusTraversalKeys_NoIDCheck(int id) {
         // Okay to return Set directly because it is an unmodifiable view
+        @SuppressWarnings("unchecked")
         Set<AWTKeyStroke> keystrokes = (focusTraversalKeys != null)
             ? focusTraversalKeys[id]
             : null;
@@ -8993,7 +8994,10 @@
      *  to the individual objects which extend Component.
      */
 
-    AccessibleContext accessibleContext = null;
+    /**
+     * The {@code AccessibleContext} associated with this {@code Component}.
+     */
+    protected AccessibleContext accessibleContext = null;
 
     /**
      * Gets the <code>AccessibleContext</code> associated
@@ -9033,6 +9037,13 @@
         protected AccessibleAWTComponent() {
         }
 
+        /**
+         * Number of PropertyChangeListener objects registered. It's used
+         * to add/remove ComponentListener and FocusListener to track
+         * target Component's state.
+         */
+        private volatile transient int propertyListenersCount = 0;
+
         protected ComponentListener accessibleAWTComponentHandler = null;
         protected FocusListener accessibleAWTFocusHandler = null;
 
@@ -9097,10 +9108,12 @@
         public void addPropertyChangeListener(PropertyChangeListener listener) {
             if (accessibleAWTComponentHandler == null) {
                 accessibleAWTComponentHandler = new AccessibleAWTComponentHandler();
-                Component.this.addComponentListener(accessibleAWTComponentHandler);
             }
             if (accessibleAWTFocusHandler == null) {
                 accessibleAWTFocusHandler = new AccessibleAWTFocusHandler();
+            }
+            if (propertyListenersCount++ == 0) {
+                Component.this.addComponentListener(accessibleAWTComponentHandler);
                 Component.this.addFocusListener(accessibleAWTFocusHandler);
             }
             super.addPropertyChangeListener(listener);
@@ -9114,13 +9127,9 @@
          * @param listener  The PropertyChangeListener to be removed
          */
         public void removePropertyChangeListener(PropertyChangeListener listener) {
-            if (accessibleAWTComponentHandler != null) {
+            if (--propertyListenersCount == 0) {
                 Component.this.removeComponentListener(accessibleAWTComponentHandler);
-                accessibleAWTComponentHandler = null;
-            }
-            if (accessibleAWTFocusHandler != null) {
                 Component.this.removeFocusListener(accessibleAWTFocusHandler);
-                accessibleAWTFocusHandler = null;
             }
             super.removePropertyChangeListener(listener);
         }
--- a/src/share/classes/java/awt/Container.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Container.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -161,7 +161,7 @@
     private boolean focusTraversalPolicyProvider;
 
     // keeps track of the threads that are printing this component
-    private transient Set printingThreads;
+    private transient Set<Thread> printingThreads;
     // True if there is at least one thread that's printing this component
     private transient boolean printing = false;
 
@@ -275,7 +275,7 @@
      */
     public Container() {
     }
-
+    @SuppressWarnings({"unchecked","rawtypes"})
     void initializeFocusTraversalKeys() {
         focusTraversalKeys = new Set[4];
     }
@@ -2006,7 +2006,7 @@
             try {
                 synchronized (getObjectLock()) {
                     if (printingThreads == null) {
-                        printingThreads = new HashSet();
+                        printingThreads = new HashSet<>();
                     }
                     printingThreads.add(t);
                     printing = true;
@@ -2148,7 +2148,7 @@
      * @since 1.4
      */
     public synchronized ContainerListener[] getContainerListeners() {
-        return (ContainerListener[]) (getListeners(ContainerListener.class));
+        return getListeners(ContainerListener.class);
     }
 
     /**
@@ -2599,9 +2599,9 @@
         if (GraphicsEnvironment.isHeadless()) {
             throw new HeadlessException();
         }
-        PointerInfo pi = (PointerInfo)java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
-                public Object run() {
+        PointerInfo pi = java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<PointerInfo>() {
+                public PointerInfo run() {
                     return MouseInfo.getPointerInfo();
                 }
             }
@@ -2682,7 +2682,7 @@
                                                                  y - comp.y,
                                                                  ignoreEnabled);
                 } else {
-                    comp = comp.locate(x - comp.x, y - comp.y);
+                    comp = comp.getComponentAt(x - comp.x, y - comp.y);
                 }
                 if (comp != null && comp.visible &&
                     (ignoreEnabled || comp.enabled))
@@ -2700,7 +2700,7 @@
                                                                  y - comp.y,
                                                                  ignoreEnabled);
                 } else {
-                    comp = comp.locate(x - comp.x, y - comp.y);
+                    comp = comp.getComponentAt(x - comp.x, y - comp.y);
                 }
                 if (comp != null && comp.visible &&
                     (ignoreEnabled || comp.enabled))
@@ -3824,6 +3824,12 @@
             return Container.this.getAccessibleAt(p);
         }
 
+        /**
+         * Number of PropertyChangeListener objects registered. It's used
+         * to add/remove ContainerListener to track target Container's state.
+         */
+        private volatile transient int propertyListenersCount = 0;
+
         protected ContainerListener accessibleContainerHandler = null;
 
         /**
@@ -3859,11 +3865,27 @@
         public void addPropertyChangeListener(PropertyChangeListener listener) {
             if (accessibleContainerHandler == null) {
                 accessibleContainerHandler = new AccessibleContainerHandler();
+            }
+            if (propertyListenersCount++ == 0) {
                 Container.this.addContainerListener(accessibleContainerHandler);
             }
             super.addPropertyChangeListener(listener);
         }
 
+        /**
+         * Remove a PropertyChangeListener from the listener list.
+         * This removes a PropertyChangeListener that was registered
+         * for all properties.
+         *
+         * @param listener the PropertyChangeListener to be removed
+         */
+        public void removePropertyChangeListener(PropertyChangeListener listener) {
+            if (--propertyListenersCount == 0) {
+                Container.this.removeContainerListener(accessibleContainerHandler);
+            }
+            super.removePropertyChangeListener(listener);
+        }
+
     } // inner class AccessibleAWTContainer
 
     /**
@@ -4637,7 +4659,7 @@
     private void startListeningForOtherDrags() {
         //System.out.println("Adding AWTEventListener");
         java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
+            new java.security.PrivilegedAction<Object>() {
                 public Object run() {
                     nativeContainer.getToolkit().addAWTEventListener(
                         LightweightDispatcher.this,
@@ -4652,7 +4674,7 @@
     private void stopListeningForOtherDrags() {
         //System.out.println("Removing AWTEventListener");
         java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
+            new java.security.PrivilegedAction<Object>() {
                 public Object run() {
                     nativeContainer.getToolkit().removeAWTEventListener(LightweightDispatcher.this);
                     return null;
--- a/src/share/classes/java/awt/Dialog.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Dialog.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1047,9 +1047,9 @@
                     // if this dialog is toolkit-modal, the filter should be added
                     // to all EDTs (for all AppContexts)
                     if (modalityType == ModalityType.TOOLKIT_MODAL) {
-                        Iterator it = AppContext.getAppContexts().iterator();
+                        Iterator<AppContext> it = AppContext.getAppContexts().iterator();
                         while (it.hasNext()) {
-                            AppContext appContext = (AppContext)it.next();
+                            AppContext appContext = it.next();
                             if (appContext == showAppContext) {
                                 continue;
                             }
@@ -1084,9 +1084,9 @@
                     // if this dialog is toolkit-modal, its filter must be removed
                     // from all EDTs (for all AppContexts)
                     if (modalityType == ModalityType.TOOLKIT_MODAL) {
-                        Iterator it = AppContext.getAppContexts().iterator();
+                        Iterator<AppContext> it = AppContext.getAppContexts().iterator();
                         while (it.hasNext()) {
-                            AppContext appContext = (AppContext)it.next();
+                            AppContext appContext = it.next();
                             if (appContext == showAppContext) {
                                 continue;
                             }
@@ -1396,7 +1396,7 @@
             if (d.shouldBlock(this)) {
                 Window w = d;
                 while ((w != null) && (w != this)) {
-                    w = (Window)(w.getOwner_NoClientCode());
+                    w = w.getOwner_NoClientCode();
                 }
                 if ((w == this) || !shouldBlock(d) || (modalityType.compareTo(d.getModalityType()) < 0)) {
                     blockers.add(d);
@@ -1611,7 +1611,7 @@
             setModal(modal);
         }
 
-        blockedWindows = new IdentityArrayList();
+        blockedWindows = new IdentityArrayList<>();
     }
 
     /*
--- a/src/share/classes/java/awt/EventDispatchThread.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/EventDispatchThread.java	Wed Feb 20 10:16:45 2013 -0800
@@ -107,34 +107,6 @@
         }
     }
 
-    // MacOSX change:
-    //  This was added because this class (and java.awt.Conditional) are package private.
-    //  There are certain instances where classes in other packages need to block the
-    //  AWTEventQueue while still allowing it to process events. This uses reflection
-    //  to call back into the caller in order to remove dependencies.
-    //
-    // NOTE: This uses reflection in its implementation, so it is not for performance critical code.
-    //
-    //  cond is an instance of sun.lwawt.macosx.EventDispatchAccess
-    //
-    private Conditional _macosxGetConditional(final Object cond) {
-        try {
-            return new Conditional() {
-                final Method evaluateMethod = Class.forName("sun.lwawt.macosx.EventDispatchAccess").getMethod("evaluate", (Class[]) null);
-                public boolean evaluate() {
-                    try {
-                        return ((Boolean)evaluateMethod.invoke(cond, (Object[]) null)).booleanValue();
-                    } catch (Exception e) {
-                        return false;
-                    }
-                }
-            };
-        } catch (Exception e) {
-            return new Conditional() { public boolean evaluate() { return false; } };
-        }
-    }
-
-
     void pumpEvents(Conditional cond) {
         pumpEvents(ANY_EVENT, cond);
     }
--- a/src/share/classes/java/awt/Frame.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Frame.java	Wed Feb 20 10:16:45 2013 -0800
@@ -353,7 +353,7 @@
      * @serial
      * @see java.awt.Window#ownedWindowList
      */
-    Vector ownedWindows;
+    Vector<Window> ownedWindows;
 
     private static final String base = "frame";
     private static int nameCounter = 0;
@@ -1242,7 +1242,7 @@
       //
       if (ownedWindows != null) {
           for (int i = 0; i < ownedWindows.size(); i++) {
-              connectOwnedWindow((Window) ownedWindows.elementAt(i));
+              connectOwnedWindow(ownedWindows.elementAt(i));
           }
           ownedWindows = null;
       }
--- a/src/share/classes/java/awt/KeyboardFocusManager.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/KeyboardFocusManager.java	Wed Feb 20 10:16:45 2013 -0800
@@ -416,7 +416,7 @@
         }
     }
 
-    static Set initFocusTraversalKeysSet(String value, Set targetSet) {
+    static Set<AWTKeyStroke> initFocusTraversalKeysSet(String value, Set<AWTKeyStroke> targetSet) {
         StringTokenizer tokens = new StringTokenizer(value, ",");
         while (tokens.hasMoreTokens()) {
             targetSet.add(AWTKeyStroke.getAWTKeyStroke(tokens.nextToken()));
--- a/src/share/classes/java/awt/Scrollbar.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Scrollbar.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1012,7 +1012,7 @@
      * @since 1.4
      */
     public synchronized AdjustmentListener[] getAdjustmentListeners() {
-        return (AdjustmentListener[])(getListeners(AdjustmentListener.class));
+        return getListeners(AdjustmentListener.class);
     }
 
     /**
--- a/src/share/classes/java/awt/TextArea.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/TextArea.java	Wed Feb 20 10:16:45 2013 -0800
@@ -123,7 +123,7 @@
      * Cache the Sets of forward and backward traversal keys so we need not
      * look them up each time.
      */
-    private static Set forwardTraversalKeys, backwardTraversalKeys;
+    private static Set<AWTKeyStroke> forwardTraversalKeys, backwardTraversalKeys;
 
     /*
      * JDK 1.1 serialVersionUID
@@ -143,10 +143,10 @@
         }
         forwardTraversalKeys = KeyboardFocusManager.initFocusTraversalKeysSet(
             "ctrl TAB",
-            new HashSet());
+            new HashSet<AWTKeyStroke>());
         backwardTraversalKeys = KeyboardFocusManager.initFocusTraversalKeysSet(
             "ctrl shift TAB",
-            new HashSet());
+            new HashSet<AWTKeyStroke>());
     }
 
     /**
--- a/src/share/classes/java/awt/TextComponent.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/TextComponent.java	Wed Feb 20 10:16:45 2013 -0800
@@ -606,7 +606,7 @@
      * @since 1.4
      */
     public synchronized TextListener[] getTextListeners() {
-        return (TextListener[])(getListeners(TextListener.class));
+        return getListeners(TextListener.class);
     }
 
     /**
--- a/src/share/classes/java/awt/TextField.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/TextField.java	Wed Feb 20 10:16:45 2013 -0800
@@ -507,7 +507,7 @@
      * @since 1.4
      */
     public synchronized ActionListener[] getActionListeners() {
-        return (ActionListener[])(getListeners(ActionListener.class));
+        return getListeners(ActionListener.class);
     }
 
     /**
--- a/src/share/classes/java/awt/Toolkit.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Toolkit.java	Wed Feb 20 10:16:45 2013 -0800
@@ -863,7 +863,7 @@
                         new java.security.PrivilegedAction<Void>() {
                     public Void run() {
                         String nm = null;
-                        Class cls = null;
+                        Class<?> cls = null;
                         try {
                             nm = System.getProperty("awt.toolkit");
                             try {
--- a/src/share/classes/java/awt/Window.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/awt/Window.java	Wed Feb 20 10:16:45 2013 -0800
@@ -441,7 +441,7 @@
     transient Object anchor = new Object();
     static class WindowDisposerRecord implements sun.java2d.DisposerRecord {
         final WeakReference<Window> owner;
-        final WeakReference weakThis;
+        final WeakReference<Window> weakThis;
         final WeakReference<AppContext> context;
         WindowDisposerRecord(AppContext context, Window victim) {
             owner = new WeakReference<Window>(victim.getOwner());
@@ -1542,6 +1542,7 @@
     private static Window[] getWindows(AppContext appContext) {
         synchronized (Window.class) {
             Window realCopy[];
+            @SuppressWarnings("unchecked")
             Vector<WeakReference<Window>> windowList =
                 (Vector<WeakReference<Window>>)appContext.get(Window.class);
             if (windowList != null) {
@@ -1866,7 +1867,7 @@
      * @since 1.4
      */
     public synchronized WindowListener[] getWindowListeners() {
-        return (WindowListener[])(getListeners(WindowListener.class));
+        return getListeners(WindowListener.class);
     }
 
     /**
@@ -1882,7 +1883,7 @@
      * @since 1.4
      */
     public synchronized WindowFocusListener[] getWindowFocusListeners() {
-        return (WindowFocusListener[])(getListeners(WindowFocusListener.class));
+        return getListeners(WindowFocusListener.class);
     }
 
     /**
@@ -1898,7 +1899,7 @@
      * @since 1.4
      */
     public synchronized WindowStateListener[] getWindowStateListeners() {
-        return (WindowStateListener[])(getListeners(WindowStateListener.class));
+        return getListeners(WindowStateListener.class);
     }
 
 
@@ -2014,7 +2015,6 @@
                     break;
                 case WindowEvent.WINDOW_STATE_CHANGED:
                     processWindowStateEvent((WindowEvent)e);
-                default:
                     break;
             }
             return;
@@ -2382,12 +2382,14 @@
      *         KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
      * @since 1.4
      */
+    @SuppressWarnings("unchecked")
     public Set<AWTKeyStroke> getFocusTraversalKeys(int id) {
         if (id < 0 || id >= KeyboardFocusManager.TRAVERSAL_KEY_LENGTH) {
             throw new IllegalArgumentException("invalid focus traversal key identifier");
         }
 
         // Okay to return Set directly because it is an unmodifiable view
+        @SuppressWarnings("rawtypes")
         Set keystrokes = (focusTraversalKeys != null)
             ? focusTraversalKeys[id]
             : null;
@@ -2765,7 +2767,7 @@
    /*
     * Support for tracking all windows owned by this window
     */
-    void addOwnedWindow(WeakReference weakWindow) {
+    void addOwnedWindow(WeakReference<Window> weakWindow) {
         if (weakWindow != null) {
             synchronized(ownedWindowList) {
                 // this if statement should really be an assert, but we don't
@@ -2777,7 +2779,7 @@
         }
     }
 
-    void removeOwnedWindow(WeakReference weakWindow) {
+    void removeOwnedWindow(WeakReference<Window> weakWindow) {
         if (weakWindow != null) {
             // synchronized block not required since removeElement is
             // already synchronized
@@ -2792,6 +2794,7 @@
 
     private void addToWindowList() {
         synchronized (Window.class) {
+            @SuppressWarnings("unchecked")
             Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>)appContext.get(Window.class);
             if (windowList == null) {
                 windowList = new Vector<WeakReference<Window>>();
@@ -2801,8 +2804,9 @@
         }
     }
 
-    private static void removeFromWindowList(AppContext context, WeakReference weakThis) {
+    private static void removeFromWindowList(AppContext context, WeakReference<Window> weakThis) {
         synchronized (Window.class) {
+            @SuppressWarnings("unchecked")
             Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>)context.get(Window.class);
             if (windowList != null) {
                 windowList.remove(weakThis);
@@ -2945,7 +2949,7 @@
         // Deserialized Windows are not yet visible.
         visible = false;
 
-        weakThis = new WeakReference(this);
+        weakThis = new WeakReference<>(this);
 
         anchor = new Object();
         sun.java2d.Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this));
@@ -2956,7 +2960,7 @@
 
     private void deserializeResources(ObjectInputStream s)
         throws ClassNotFoundException, IOException, HeadlessException {
-            ownedWindowList = new Vector();
+            ownedWindowList = new Vector<>();
 
             if (windowSerializedDataVersion < 2) {
                 // Translate old-style focus tracking to new model. For 1.4 and
--- a/src/share/classes/java/io/Closeable.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/io/Closeable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
  *
  * @since 1.5
  */
-
+@FunctionalInterface
 public interface Closeable extends AutoCloseable {
 
     /**
--- a/src/share/classes/java/io/FileFilter.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/io/FileFilter.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
  *
  * @since 1.2
  */
+@FunctionalInterface
 public interface FileFilter {
 
     /**
@@ -46,5 +47,4 @@
      *          should be included
      */
     boolean accept(File pathname);
-
 }
--- a/src/share/classes/java/io/FilenameFilter.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/io/FilenameFilter.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,8 +39,8 @@
  * @see     java.io.File#list(java.io.FilenameFilter)
  * @since   JDK1.0
  */
-public
-interface FilenameFilter {
+@FunctionalInterface
+public interface FilenameFilter {
     /**
      * Tests if a specified file should be included in a file list.
      *
--- a/src/share/classes/java/io/Flushable.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/io/Flushable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
  *
  * @since 1.5
  */
-
+@FunctionalInterface
 public interface Flushable {
 
     /**
--- a/src/share/classes/java/lang/AutoCloseable.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/AutoCloseable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
  * @author Josh Bloch
  * @since 1.7
  */
+@FunctionalInterface
 public interface AutoCloseable {
     /**
      * Closes this resource, relinquishing any underlying resources.
--- a/src/share/classes/java/lang/Class.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/Class.java	Wed Feb 20 10:16:45 2013 -0800
@@ -29,12 +29,14 @@
 import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.Member;
 import java.lang.reflect.Field;
+import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.AnnotatedType;
 import java.lang.ref.SoftReference;
 import java.io.InputStream;
 import java.io.ObjectStreamField;
@@ -2325,6 +2327,11 @@
 
     // Annotations handling
     private native byte[] getRawAnnotations();
+    // Since 1.8
+    native byte[] getRawTypeAnnotations();
+    static byte[] getExecutableTypeAnnotationBytes(Executable ex) {
+        return getReflectionFactory().getExecutableTypeAnnotationBytes(ex);
+    }
 
     native ConstantPool getConstantPool();
 
@@ -3068,28 +3075,20 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.5
      */
+    @SuppressWarnings("unchecked")
     public <A extends Annotation> A getAnnotation(Class<A> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
         initAnnotationsIfNecessary();
-        return AnnotationSupport.getOneAnnotation(annotations, annotationClass);
-    }
-
-    /**
-     * @throws NullPointerException {@inheritDoc}
-     * @since 1.5
-     */
-    public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
-        Objects.requireNonNull(annotationClass);
-
-        return getAnnotation(annotationClass) != null;
+        return (A) annotations.get(annotationClass);
     }
 
     /**
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
-    public <A extends Annotation> A[] getAnnotations(Class<A> annotationClass) {
+    @Override
+    public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
         initAnnotationsIfNecessary();
@@ -3101,25 +3100,28 @@
      */
     public Annotation[] getAnnotations() {
         initAnnotationsIfNecessary();
-        return AnnotationSupport.unpackToArray(annotations);
+        return AnnotationParser.toArray(annotations);
     }
 
     /**
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
+    @Override
+    @SuppressWarnings("unchecked")
     public <A extends Annotation> A getDeclaredAnnotation(Class<A> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
         initAnnotationsIfNecessary();
-        return AnnotationSupport.getOneAnnotation(declaredAnnotations, annotationClass);
+        return (A) declaredAnnotations.get(annotationClass);
     }
 
     /**
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
-    public <A extends Annotation> A[] getDeclaredAnnotations(Class<A> annotationClass) {
+    @Override
+    public <A extends Annotation> A[] getDeclaredAnnotationsByType(Class<A> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
         initAnnotationsIfNecessary();
@@ -3131,17 +3133,7 @@
      */
     public Annotation[] getDeclaredAnnotations()  {
         initAnnotationsIfNecessary();
-        return AnnotationSupport.unpackToArray(declaredAnnotations);
-    }
-
-    /** Returns one "directly" present annotation or null */
-    <A extends Annotation> A getDirectDeclaredAnnotation(Class<A> annotationClass) {
-        Objects.requireNonNull(annotationClass);
-
-        initAnnotationsIfNecessary();
-        @SuppressWarnings("unchecked") // TODO check safe
-        A ret = (A)declaredAnnotations.get(annotationClass);
-        return ret;
+        return AnnotationParser.toArray(declaredAnnotations);
     }
 
     // Annotations cache
@@ -3196,4 +3188,53 @@
      * Maintained by the ClassValue class.
      */
     transient ClassValue.ClassValueMap classValueMap;
+
+    /**
+     * Returns an AnnotatedType object that represents the use of a type to specify
+     * the superclass of the entity represented by this Class. (The <em>use</em> of type
+     * Foo to specify the superclass in '... extends Foo' is distinct from the
+     * <em>declaration</em> of type Foo.)
+     *
+     * If this Class represents a class type whose declaration does not explicitly
+     * indicate an annotated superclass, the return value is null.
+     *
+     * If this Class represents either the Object class, an interface type, an
+     * array type, a primitive type, or void, the return value is null.
+     *
+     * @since 1.8
+     */
+    public AnnotatedType getAnnotatedSuperclass() {
+         return TypeAnnotationParser.buildAnnotatedSuperclass(getRawTypeAnnotations(), getConstantPool(), this);
 }
+
+    /**
+     * Returns an array of AnnotatedType objects that represent the use of types to
+     * specify superinterfaces of the entity represented by this Class. (The <em>use</em>
+     * of type Foo to specify a superinterface in '... implements Foo' is
+     * distinct from the <em>declaration</em> of type Foo.)
+     *
+     * If this Class represents a class, the return value is an array
+     * containing objects representing the uses of interface types to specify
+     * interfaces implemented by the class. The order of the objects in the
+     * array corresponds to the order of the interface types used in the
+     * 'implements' clause of the declaration of this Class.
+     *
+     * If this Class represents an interface, the return value is an array
+     * containing objects representing the uses of interface types to specify
+     * interfaces directly extended by the interface. The order of the objects in
+     * the array corresponds to the order of the interface types used in the
+     * 'extends' clause of the declaration of this Class.
+     *
+     * If this Class represents a class or interface whose declaration does not
+     * explicitly indicate any annotated superinterfaces, the return value is an
+     * array of length 0.
+     *
+     * If this Class represents either the Object class, an array type, a
+     * primitive type, or void, the return value is an array of length 0.
+     *
+     * @since 1.8
+     */
+    public AnnotatedType[] getAnnotatedInterfaces() {
+         return TypeAnnotationParser.buildAnnotatedInterfaces(getRawTypeAnnotations(), getConstantPool(), this);
+    }
+}
--- a/src/share/classes/java/lang/Comparable.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/Comparable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,7 @@
  * @see java.util.Comparator
  * @since 1.2
  */
-
+@FunctionalInterface
 public interface Comparable<T> {
     /**
      * Compares this object with the specified object for order.  Returns a
--- a/src/share/classes/java/lang/Double.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/Double.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -289,7 +289,7 @@
             return Double.toString(d);
         else {
             // Initialized to maximum size of output.
-            StringBuffer answer = new StringBuffer(24);
+            StringBuilder answer = new StringBuilder(24);
 
             if (Math.copySign(1.0, d) == -1.0)    // value is negative,
                 answer.append("-");                  // so append sign info
@@ -300,8 +300,7 @@
 
             if(d == 0.0) {
                 answer.append("0.0p0");
-            }
-            else {
+            } else {
                 boolean subnormal = (d < DoubleConsts.MIN_NORMAL);
 
                 // Isolate significand bits and OR in a high-order bit
@@ -324,13 +323,14 @@
                               "0":
                               signif.replaceFirst("0{1,12}$", ""));
 
+                answer.append('p');
                 // If the value is subnormal, use the E_min exponent
                 // value for double; otherwise, extract and report d's
                 // exponent (the representation of a subnormal uses
                 // E_min -1).
-                answer.append("p" + (subnormal ?
-                               DoubleConsts.MIN_EXPONENT:
-                               Math.getExponent(d) ));
+                answer.append(subnormal ?
+                              DoubleConsts.MIN_EXPONENT:
+                              Math.getExponent(d));
             }
             return answer.toString();
         }
--- a/src/share/classes/java/lang/Iterable.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/Iterable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,7 @@
  *
  * @since 1.5
  */
+@FunctionalInterface
 public interface Iterable<T> {
     /**
      * Returns an iterator over elements of type {@code T}.
--- a/src/share/classes/java/lang/Package.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/Package.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -387,19 +387,11 @@
 
     /**
      * @throws NullPointerException {@inheritDoc}
-     * @since 1.5
-     */
-    public boolean isAnnotationPresent(
-        Class<? extends Annotation> annotationClass) {
-        return getPackageInfo().isAnnotationPresent(annotationClass);
-    }
-
-    /**
-     * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
-    public  <A extends Annotation> A[] getAnnotations(Class<A> annotationClass) {
-        return getPackageInfo().getAnnotations(annotationClass);
+    @Override
+    public  <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationClass) {
+        return getPackageInfo().getAnnotationsByType(annotationClass);
     }
 
     /**
@@ -413,6 +405,7 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
+    @Override
     public <A extends Annotation> A getDeclaredAnnotation(Class<A> annotationClass) {
         return getPackageInfo().getDeclaredAnnotation(annotationClass);
     }
@@ -421,8 +414,9 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
-    public <A extends Annotation> A[] getDeclaredAnnotations(Class<A> annotationClass) {
-        return getPackageInfo().getDeclaredAnnotations(annotationClass);
+    @Override
+    public <A extends Annotation> A[] getDeclaredAnnotationsByType(Class<A> annotationClass) {
+        return getPackageInfo().getDeclaredAnnotationsByType(annotationClass);
     }
 
     /**
--- a/src/share/classes/java/lang/Readable.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/Readable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
  *
  * @since 1.5
  */
-
+@FunctionalInterface
 public interface Readable {
 
     /**
@@ -51,5 +51,4 @@
      * @throws java.nio.ReadOnlyBufferException if cb is a read only buffer
      */
     public int read(java.nio.CharBuffer cb) throws IOException;
-
 }
--- a/src/share/classes/java/lang/Runnable.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/Runnable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,8 +52,8 @@
  * @see     java.util.concurrent.Callable
  * @since   JDK1.0
  */
-public
-interface Runnable {
+@FunctionalInterface
+public interface Runnable {
     /**
      * When an object implementing interface <code>Runnable</code> is used
      * to create a thread, starting the thread causes the object's
--- a/src/share/classes/java/lang/System.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/System.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 package java.lang;
 
 import java.io.*;
-import java.lang.annotation.Annotation;
+import java.lang.reflect.Executable;
 import java.util.Properties;
 import java.util.PropertyPermission;
 import java.util.StringTokenizer;
@@ -1196,8 +1196,11 @@
             public AnnotationType getAnnotationType(Class<?> klass) {
                 return klass.getAnnotationType();
             }
-            public <A extends Annotation> A getDirectDeclaredAnnotation(Class<?> klass, Class<A> anno) {
-                return klass.getDirectDeclaredAnnotation(anno);
+            public byte[] getRawClassTypeAnnotations(Class<?> klass) {
+                return klass.getRawTypeAnnotations();
+            }
+            public byte[] getRawExecutableTypeAnnotations(Executable executable) {
+                return Class.getExecutableTypeAnnotationBytes(executable);
             }
             public <E extends Enum<E>>
                     E[] getEnumConstantsShared(Class<E> klass) {
--- a/src/share/classes/java/lang/Thread.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/Thread.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1851,6 +1851,7 @@
      * @see ThreadGroup#uncaughtException
      * @since 1.5
      */
+    @FunctionalInterface
     public interface UncaughtExceptionHandler {
         /**
          * Method invoked when the given thread terminates due to the
--- a/src/share/classes/java/lang/annotation/ContainedBy.java	Wed Feb 20 16:39:46 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-package java.lang.annotation;
-
-/**
- * The annotation type {@code java.lang.annotation.ContainedBy} is
- * used to indicate that the annotation type whose declaration it
- * (meta-)annotates is <em>repeatable</em>. The value of
- * {@code @ContainedBy} indicates the <em>containing annotation
- * type</em> for the repeatable annotation type.
- *
- * <p>The pair of annotation types {@code @ContainedBy} and
- * {@link java.lang.annotation.ContainerFor @ContainerFor} are used to
- * indicate that annotation types are repeatable. Specifically:
- *
- * <ul>
- * <li>The annotation type {@code @ContainedBy} is used on the
- * declaration of a repeatable annotation type (JLS 9.6) to indicate
- * its containing annotation type.
- *
- * <li>The annotation type {@code @ContainerFor} is used on the
- * declaration of a containing annotation type (JLS 9.6) to indicate
- * the repeatable annotation type for which it serves as the
- * containing annotation type.
- * </ul>
- *
- * <p>
- * An inconsistent pair of {@code @ContainedBy} and
- * {@code @ContainerFor} annotations on a repeatable annotation type
- * and its containing annotation type (JLS 9.6) will lead to
- * compile-time errors and runtime exceptions when using reflection to
- * read annotations of a repeatable type.
- *
- * @see java.lang.annotation.ContainerFor
- * @since 1.8
- * @jls 9.6 Annotation Types
- * @jls 9.7 Annotations
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.ANNOTATION_TYPE)
-public @interface ContainedBy {
-    /**
-     * Indicates the <em>containing annotation type</em> for the
-     * repeatable annotation type.
-     */
-    Class<? extends Annotation> value();
-}
--- a/src/share/classes/java/lang/annotation/ContainerFor.java	Wed Feb 20 16:39:46 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-package java.lang.annotation;
-
-/**
- * The annotation type {@code java.lang.annotation.ContainerFor} is
- * used to indicate that the annotation type whose declaration it
- * (meta-)annotates is a <em>containing annotation type</em>. The
- * value of {@code @ContainerFor} indicates the <em>repeatable
- * annotation type</em> for the containing annotation type.
- *
- * <p>The pair of annotation types {@link
- * java.lang.annotation.ContainedBy @ContainedBy} and
- * {@code @ContainerFor} are used to indicate that annotation types
- * are repeatable. Specifically:
- *
- * <ul>
- * <li>The annotation type {@code @ContainedBy} is used on the
- * declaration of a repeatable annotation type (JLS 9.6) to indicate
- * its containing annotation type.
- *
- * <li>The annotation type {@code @ContainerFor} is used on the
- * declaration of a containing annotation type (JLS 9.6) to indicate
- * the repeatable annotation type for which it serves as the
- * containing annotation type.
- * </ul>
- *
- * <p>
- * An inconsistent pair of {@code @ContainedBy} and
- * {@code @ContainerFor} annotations on a repeatable annotation type
- * and its containing annotation type (JLS 9.6) will lead to
- * compile-time errors and runtime exceptions when using reflection to
- * read annotations of a repeatable type.
- *
- * @see java.lang.annotation.ContainedBy
- * @since 1.8
- * @jls 9.6 Annotation Types
- * @jls 9.7 Annotations
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.ANNOTATION_TYPE)
-public @interface ContainerFor {
-
-    /**
-     * Indicates the repeatable annotation type for the containing
-     * annotation type.
-     */
-    Class<? extends Annotation> value();
-}
--- a/src/share/classes/java/lang/annotation/InvalidContainerAnnotationError.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/annotation/InvalidContainerAnnotationError.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,10 +27,9 @@
 import java.util.Objects;
 
 /**
- * Thrown to indicate that an annotation type whose declaration is
- * (meta-)annotated with a {@link ContainerFor} annotation is not, in
- * fact, the <em>containing annotation type of the type named by {@link
- * ContainerFor}</em>.
+ * Thrown to indicate that an annotation type expected to act as a
+ * container for another annotation type by virture of an @Repeatable
+ * annotation, does not act as a container.
  *
  * @see   java.lang.reflect.AnnotatedElement
  * @since 1.8
--- a/src/share/classes/java/lang/reflect/AccessibleObject.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/AccessibleObject.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -182,17 +182,10 @@
 
     /**
      * @throws NullPointerException {@inheritDoc}
-     * @since 1.5
-     */
-    public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
-        return getAnnotation(annotationClass) != null;
-    }
-
-    /**
-     * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
-    public <T extends Annotation> T[] getAnnotations(Class<T> annotationClass) {
+    @Override
+    public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
         throw new AssertionError("All subclasses should override this method");
     }
 
@@ -207,6 +200,7 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
+    @Override
     public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) {
         // Only annotations on classes are inherited, for all other
         // objects getDeclaredAnnotation is the same as
@@ -218,11 +212,12 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
-    public <T extends Annotation> T[] getDeclaredAnnotations(Class<T> annotationClass) {
+    @Override
+    public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass) {
         // Only annotations on classes are inherited, for all other
-        // objects getDeclaredAnnotations is the same as
-        // getAnnotations.
-        return getAnnotations(annotationClass);
+        // objects getDeclaredAnnotationsByType is the same as
+        // getAnnotationsByType.
+        return getAnnotationsByType(annotationClass);
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/reflect/AnnotatedArrayType.java	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.reflect;
+
+
+/**
+ * AnnotatedArrayType represents the use of an array type, whose component
+ * type may itself represent the annotated use of a type.
+ *
+ * @since 1.8
+ */
+public interface AnnotatedArrayType extends AnnotatedType {
+
+    /**
+     * Returns the annotated generic component type of this array type.
+     *
+     * @return the annotated generic component type of this array type
+     */
+    AnnotatedType  getAnnotatedGenericComponentType();
+}
--- a/src/share/classes/java/lang/reflect/AnnotatedElement.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/AnnotatedElement.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,45 @@
  * arrays returned by accessors for array-valued enum members; it will
  * have no affect on the arrays returned to other callers.
  *
+ * <p>The {@link #getAnnotationsByType(Class)} and {@link
+ * #getDeclaredAnnotationsByType(Class)} methods support multiple
+ * annotations of the same type on an element. If the argument to either method
+ * is a repeatable annotation type (JLS 9.6), then the method will "look
+ * through" a container annotation (JLS 9.7) which was generated at
+ * compile-time to wrap multiple annotations of the argument type.
+ *
+ * <p>The terms <em>directly present</em> and <em>present</em> are used
+ * throughout this interface to describe precisely which annotations are
+ * returned by methods:
+ *
+ * <ul>
+ * <li>An annotation A is <em>directly present</em> on an element E if E is
+ * associated with a RuntimeVisibleAnnotations or
+ * RuntimeVisibleParameterAnnotations attribute, and:
+ *
+ * <ul>
+ * <li>for an invocation of {@code get[Declared]Annotation(Class<T>)} or
+ * {@code get[Declared]Annotations()}, the attribute contains A.
+ *
+ * <li>for an invocation of {@code get[Declared]AnnotationsByType(Class<T>)}, the
+ * attribute either contains A or, if the type of A is repeatable, contains
+ * exactly one annotation whose value element contains A and whose type is the
+ * containing annotation type of A's type (JLS 9.6).
+ * </ul>
+ *
+ * <p>
+ * <li>An annotation A is <em>present</em> on an element E if either:
+ *
+ * <ul>
+ * <li>A is <em>directly present</em> on E; or
+ *
+ * <li>A is not <em>directly present</em> on E, and E is a class, and A's type
+ * is inheritable (JLS 9.6.3.3), and A is <em>present</em> on the superclass of
+ * E.
+ * </ul>
+ *
+ * </ul>
+ *
  * <p>If an annotation returned by a method in this interface contains
  * (directly or indirectly) a {@link Class}-valued member referring to
  * a class that is not accessible in this VM, attempting to read the class
@@ -50,7 +89,7 @@
  * containing annotation type of T will result in an
  * InvalidContainerAnnotationError.
  *
- * <p>Finally, Attempting to read a member whose definition has evolved
+ * <p>Finally, attempting to read a member whose definition has evolved
  * incompatibly will result in a {@link
  * java.lang.annotation.AnnotationTypeMismatchException} or an
  * {@link java.lang.annotation.IncompleteAnnotationException}.
@@ -70,6 +109,12 @@
      * is present on this element, else false.  This method
      * is designed primarily for convenient access to marker annotations.
      *
+     * <p>The truth value returned by this method is equivalent to:
+     * {@code getAnnotation(annotationClass) != null}
+     *
+     * <p>The body of the default method is specified to be the code
+     * above.
+     *
      * @param annotationClass the Class object corresponding to the
      *        annotation type
      * @return true if an annotation for the specified annotation
@@ -77,7 +122,9 @@
      * @throws NullPointerException if the given annotation class is null
      * @since 1.5
      */
-     boolean isAnnotationPresent(Class<? extends Annotation> annotationClass);
+    default boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
+        return getAnnotation(annotationClass) != null;
+    }
 
    /**
      * Returns this element's annotation for the specified type if
@@ -93,12 +140,19 @@
     <T extends Annotation> T getAnnotation(Class<T> annotationClass);
 
     /**
-     * Returns an array of all this element's annotations for the
-     * specified type if one or more of such annotation is present,
-     * else an array of length zero.
+     * Returns annotations that are <em>present</em> on this element.
      *
-     * The caller of this method is free to modify the returned array;
-     * it will have no effect on the arrays returned to other callers.
+     * If there are no annotations <em>present</em> on this element, the return
+     * value is an array of length 0.
+     *
+     * The difference between this method and {@link #getAnnotation(Class)}
+     * is that this method detects if its argument is a <em>repeatable
+     * annotation type</em> (JLS 9.6), and if so, attempts to find one or
+     * more annotations of that type by "looking through" a container
+     * annotation.
+     *
+     * The caller of this method is free to modify the returned array; it will
+     * have no effect on the arrays returned to other callers.
      *
      * @param annotationClass the Class object corresponding to the
      *        annotation type
@@ -107,15 +161,18 @@
      * @throws NullPointerException if the given annotation class is null
      * @since 1.8
      */
-    <T extends Annotation> T[] getAnnotations(Class<T> annotationClass);
+    <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass);
 
     /**
-     * Returns all annotations present on this element.  (Returns an array
-     * of length zero if this element has no annotations.)  The caller of
-     * this method is free to modify the returned array; it will have no
-     * effect on the arrays returned to other callers.
+     * Returns annotations that are <em>present</em> on this element.
      *
-     * @return all annotations present on this element
+     * If there are no annotations <em>present</em> on this element, the return
+     * value is an array of length 0.
+     *
+     * The caller of this method is free to modify the returned array; it will
+     * have no effect on the arrays returned to other callers.
+     *
+     * @return annotations present on this element
      * @since 1.5
      */
     Annotation[] getAnnotations();
@@ -136,16 +193,21 @@
      */
     <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass);
 
-   /**
-     * Returns an array of all this element's annotations for the
-     * specified type if one or more of such annotation is directly
-     * present, else an array of length zero.
+    /**
+     * Returns annotations that are <em>directly present</em> on this element.
+     * This method ignores inherited annotations.
      *
-     * This method ignores inherited annotations. (Returns
-     * an array of length zero if no annotations are directly present
-     * on this element.)  The caller of this method is free to modify
-     * the returned array; it will have no effect on the arrays
-     * returned to other callers.
+     * If there are no annotations <em>directly present</em> on this element,
+     * the return value is an array of length 0.
+     *
+     * The difference between this method and {@link
+     * #getDeclaredAnnotation(Class)} is that this method detects if its
+     * argument is a <em>repeatable annotation type</em> (JLS 9.6), and if so,
+     * attempts to find one or more annotations of that type by "looking
+     * through" a container annotation.
+     *
+     * The caller of this method is free to modify the returned array; it will
+     * have no effect on the arrays returned to other callers.
      *
      * @param annotationClass the Class object corresponding to the
      *        annotation type
@@ -154,17 +216,19 @@
      * @throws NullPointerException if the given annotation class is null
      * @since 1.8
      */
-    <T extends Annotation> T[] getDeclaredAnnotations(Class<T> annotationClass);
+    <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass);
 
     /**
-     * Returns all annotations that are directly present on this
-     * element. This method ignores inherited annotations. (Returns
-     * an array of length zero if no annotations are directly present
-     * on this element.)  The caller of this method is free to modify
-     * the returned array; it will have no effect on the arrays
-     * returned to other callers.
+     * Returns annotations that are <em>directly present</em> on this element.
+     * This method ignores inherited annotations.
      *
-     * @return All annotations directly present on this element
+     * If there are no annotations <em>directly present</em> on this element,
+     * the return value is an array of length 0.
+     *
+     * The caller of this method is free to modify the returned array; it will
+     * have no effect on the arrays returned to other callers.
+     *
+     * @return annotations directly present on this element
      * @since 1.5
      */
     Annotation[] getDeclaredAnnotations();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/reflect/AnnotatedParameterizedType.java	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.reflect;
+
+/**
+ * AnnotatedParameterizedType represents the use of a parameterized type,
+ * whose type arguments may themselves represent annotated uses of types.
+ *
+ * @since 1.8
+ */
+public interface AnnotatedParameterizedType extends AnnotatedType {
+
+    /**
+     * Returns the annotated actual type arguments of this parameterized type.
+     *
+     * @return the annotated actual type arguments of this parameterized type
+     */
+    AnnotatedType[] getAnnotatedActualTypeArguments();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/reflect/AnnotatedType.java	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.reflect;
+
+/**
+ * AnnotatedType represents the annotated use of a type in the program
+ * currently running in this VM. The use may be of any type in the Java
+ * programming language, including an array type, a parameterized type, a type
+ * variable, or a wildcard type.
+ *
+ * @since 1.8
+ */
+public interface AnnotatedType extends AnnotatedElement {
+
+    /**
+     * Returns the underlying type that this annotated type represents.
+     *
+     * @return the type this annotated type represents
+     */
+    public Type getType();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/reflect/AnnotatedTypeVariable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.reflect;
+
+/**
+ * AnnotatedTypeVariable represents the use of a type variable, whose
+ * declaration may have bounds which themselves represent annotated uses of
+ * types.
+ *
+ * @since 1.8
+ */
+public interface AnnotatedTypeVariable extends AnnotatedType {
+
+    /**
+     * Returns the annotated bounds of this type variable.
+     *
+     * @return the annotated bounds of this type variable
+     */
+    AnnotatedType[] getAnnotatedBounds();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/reflect/AnnotatedWildcardType.java	Wed Feb 20 10:16:45 2013 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.reflect;
+
+/**
+ * AnnotatedWildcardType represents the use of a wildcard type argument, whose
+ * upper or lower bounds may themselves represent annotated uses of types.
+ *
+ * @since 1.8
+ */
+public interface AnnotatedWildcardType extends AnnotatedType {
+
+    /**
+     * Returns the annotated lower bounds of this wildcard type.
+     *
+     * @return the annotated lower bounds of this wildcard type
+     */
+    AnnotatedType[] getAnnotatedLowerBounds();
+
+    /**
+     * Returns the annotated upper bounds of this wildcard type.
+     *
+     * @return the annotated upper bounds of this wildcard type
+     */
+    AnnotatedType[] getAnnotatedUpperBounds();
+}
--- a/src/share/classes/java/lang/reflect/Constructor.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/Constructor.java	Wed Feb 20 10:16:45 2013 -0800
@@ -154,6 +154,10 @@
     byte[] getAnnotationBytes() {
         return annotations;
     }
+    @Override
+    byte[] getTypeAnnotationBytes() {
+        return typeAnnotations;
+    }
 
     /**
      * {@inheritDoc}
@@ -523,4 +527,12 @@
             }
         }
     }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.8
+     */
+    public AnnotatedType getAnnotatedReturnType() {
+        return getAnnotatedReturnType0(getDeclaringClass());
+    }
 }
--- a/src/share/classes/java/lang/reflect/Executable.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/Executable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,11 +26,12 @@
 package java.lang.reflect;
 
 import java.lang.annotation.*;
-import java.util.Collections;
 import java.util.Map;
 import java.util.Objects;
 import sun.reflect.annotation.AnnotationParser;
 import sun.reflect.annotation.AnnotationSupport;
+import sun.reflect.annotation.TypeAnnotationParser;
+import sun.reflect.annotation.TypeAnnotation;
 import sun.reflect.generics.repository.ConstructorRepository;
 
 /**
@@ -50,6 +51,7 @@
      * Accessor method to allow code sharing
      */
     abstract byte[] getAnnotationBytes();
+    abstract byte[] getTypeAnnotationBytes();
 
     /**
      * Does the Executable have generic information.
@@ -276,6 +278,10 @@
      * this object.  Returns an array of length 0 if the executable
      * has no parameters.
      *
+     * The parameters of the underlying executable do not necessarily
+     * have unique names, or names that are legal identifiers in the
+     * Java programming language (JLS 3.8).
+     *
      * @return an array of {@code Parameter} objects representing all
      * the parameters to the executable this object represents
      */
@@ -435,8 +441,7 @@
      */
     public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
-
-        return AnnotationSupport.getOneAnnotation(declaredAnnotations(), annotationClass);
+        return annotationClass.cast(declaredAnnotations().get(annotationClass));
     }
 
     /**
@@ -444,7 +449,8 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
-    public <T extends Annotation> T[] getAnnotations(Class<T> annotationClass) {
+    @Override
+    public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
         return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass);
@@ -454,7 +460,7 @@
      * {@inheritDoc}
      */
     public Annotation[] getDeclaredAnnotations()  {
-        return AnnotationSupport.unpackToArray(declaredAnnotations());
+        return AnnotationParser.toArray(declaredAnnotations());
     }
 
     private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations;
@@ -470,4 +476,86 @@
         return declaredAnnotations;
     }
 
+
+    /* Helper for subclasses of Executable.
+     *
+     * Returns an AnnotatedType object that represents the use of a type to
+     * specify the return type of the method/constructor represented by this
+     * Executable.
+     *
+     * @since 1.8
+     */
+    AnnotatedType getAnnotatedReturnType0(Type returnType) {
+        return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes(),
+                                                       sun.misc.SharedSecrets.getJavaLangAccess().
+                                                           getConstantPool(getDeclaringClass()),
+                                                       this,
+                                                       getDeclaringClass(),
+                                                       returnType,
+                                                       TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN_TYPE);
+    }
+
+    /**
+     * Returns an AnnotatedType object that represents the use of a type to
+     * specify the receiver type of the method/constructor represented by this
+     * Executable. The receiver type of a method/constructor is available only
+     * if the method/constructor declares a formal parameter called 'this'.
+     *
+     * Returns null if this Executable represents a constructor or instance
+     * method that either declares no formal parameter called 'this', or
+     * declares a formal parameter called 'this' with no annotations on its
+     * type.
+     *
+     * Returns null if this Executable represents a static method.
+     *
+     * @since 1.8
+     */
+    public AnnotatedType getAnnotatedReceiverType() {
+        return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes(),
+                                                       sun.misc.SharedSecrets.getJavaLangAccess().
+                                                           getConstantPool(getDeclaringClass()),
+                                                       this,
+                                                       getDeclaringClass(),
+                                                       getDeclaringClass(),
+                                                       TypeAnnotation.TypeAnnotationTarget.METHOD_RECEIVER_TYPE);
+    }
+
+    /**
+     * Returns an array of AnnotatedType objects that represent the use of
+     * types to specify formal parameter types of the method/constructor
+     * represented by this Executable. The order of the objects in the array
+     * corresponds to the order of the formal parameter types in the
+     * declaration of the method/constructor.
+     *
+     * Returns an array of length 0 if the method/constructor declares no
+     * parameters.
+     *
+     * @since 1.8
+     */
+    public AnnotatedType[] getAnnotatedParameterTypes() {
+        throw new UnsupportedOperationException("Not yet");
+    }
+
+    /**
+     * Returns an array of AnnotatedType objects that represent the use of
+     * types to specify the declared exceptions of the method/constructor
+     * represented by this Executable. The order of the objects in the array
+     * corresponds to the order of the exception types in the declaration of
+     * the method/constructor.
+     *
+     * Returns an array of length 0 if the method/constructor declares no
+     * exceptions.
+     *
+     * @since 1.8
+     */
+    public AnnotatedType[] getAnnotatedExceptionTypes() {
+        return TypeAnnotationParser.buildAnnotatedTypes(getTypeAnnotationBytes(),
+                                                        sun.misc.SharedSecrets.getJavaLangAccess().
+                                                            getConstantPool(getDeclaringClass()),
+                                                        this,
+                                                        getDeclaringClass(),
+                                                        getGenericExceptionTypes(),
+                                                        TypeAnnotation.TypeAnnotationTarget.THROWS);
+    }
+
 }
--- a/src/share/classes/java/lang/reflect/Field.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/Field.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,8 @@
 import java.util.Objects;
 import sun.reflect.annotation.AnnotationParser;
 import sun.reflect.annotation.AnnotationSupport;
-
+import sun.reflect.annotation.TypeAnnotation;
+import sun.reflect.annotation.TypeAnnotationParser;
 
 /**
  * A {@code Field} provides information about, and dynamic access to, a
@@ -1020,8 +1021,7 @@
      */
     public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
-
-        return AnnotationSupport.getOneAnnotation(declaredAnnotations(), annotationClass);
+        return annotationClass.cast(declaredAnnotations().get(annotationClass));
     }
 
     /**
@@ -1029,7 +1029,8 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
-    public <T extends Annotation> T[] getAnnotations(Class<T> annotationClass) {
+    @Override
+    public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
         return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass);
@@ -1039,7 +1040,7 @@
      * {@inheritDoc}
      */
     public Annotation[] getDeclaredAnnotations()  {
-        return AnnotationSupport.unpackToArray(declaredAnnotations());
+        return AnnotationParser.toArray(declaredAnnotations());
     }
 
     private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations;
@@ -1053,4 +1054,20 @@
         }
         return declaredAnnotations;
     }
+
+    /**
+     * Returns an AnnotatedType object that represents the use of a type to specify
+     * the declared type of the field represented by this Field.
+     *
+     * @since 1.8
+     */
+    public AnnotatedType getAnnotatedType() {
+        return TypeAnnotationParser.buildAnnotatedType(typeAnnotations,
+                                                       sun.misc.SharedSecrets.getJavaLangAccess().
+                                                           getConstantPool(getDeclaringClass()),
+                                                       this,
+                                                       getDeclaringClass(),
+                                                       getGenericType(),
+                                                       TypeAnnotation.TypeAnnotationTarget.FIELD_TYPE);
 }
+}
--- a/src/share/classes/java/lang/reflect/Method.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/Method.java	Wed Feb 20 10:16:45 2013 -0800
@@ -165,6 +165,10 @@
     byte[] getAnnotationBytes() {
         return annotations;
     }
+    @Override
+    byte[] getTypeAnnotationBytes() {
+        return typeAnnotations;
+    }
 
     /**
      * {@inheritDoc}
@@ -621,6 +625,14 @@
         return sharedGetParameterAnnotations(parameterTypes, parameterAnnotations);
     }
 
+    /**
+     * {@inheritDoc}
+     * @since 1.8
+     */
+    public AnnotatedType getAnnotatedReturnType() {
+        return getAnnotatedReturnType0(getGenericReturnType());
+    }
+
     @Override
     void handleParameterNumberMismatch(int resultLength, int numParameters) {
         throw new AnnotationFormatError("Parameter annotations don't match number of parameters");
--- a/src/share/classes/java/lang/reflect/Modifier.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/Modifier.java	Wed Feb 20 10:16:45 2013 -0800
@@ -342,13 +342,13 @@
     static final int SYNTHETIC = 0x00001000;
     static final int ANNOTATION  = 0x00002000;
     static final int ENUM      = 0x00004000;
-    static final int SYNTHESIZED = 0x00010000;
+    static final int MANDATED  = 0x00008000;
     static boolean isSynthetic(int mod) {
       return (mod & SYNTHETIC) != 0;
     }
 
-    static boolean isSynthesized(int mod) {
-      return (mod & SYNTHESIZED) != 0;
+    static boolean isMandated(int mod) {
+      return (mod & MANDATED) != 0;
     }
 
     /**
--- a/src/share/classes/java/lang/reflect/Parameter.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/Parameter.java	Wed Feb 20 10:16:45 2013 -0800
@@ -44,7 +44,7 @@
     private final String name;
     private final int modifiers;
     private final Executable executable;
-    private int index;
+    private final int index;
 
     /**
      * Package-private constructor for {@code Parameter}.
@@ -95,9 +95,14 @@
     }
 
     /**
-     * Returns a string representation of the parameter's modifiers,
-     * its attributes, its type, its name, and a trailing ... if it is
-     * a variadic parameter.
+     * Returns a string describing this parameter.  The format is the
+     * modifiers for the parameter, if any, in canonical order as
+     * recommended by <cite>The Java&trade; Language
+     * Specification</cite>, followed by the fully- qualified type of
+     * the parameter (excluding the last [] if the parameter is
+     * variable arity), followed by "..." if the parameter is variable
+     * arity, followed by a space, followed by the name of the
+     * parameter.
      *
      * @return A string representation of the parameter and associated
      * information.
@@ -118,7 +123,7 @@
             sb.append(typename);
 
         sb.append(" ");
-        sb.append(name);
+        sb.append(getName());
 
         return sb.toString();
     }
@@ -143,11 +148,23 @@
     }
 
     /**
-     * Returns the name of the parameter represented by this
-     * {@code Parameter} object.
+     * Returns the name of the parameter.  The names of the parameters
+     * of a single executable must all the be distinct.  When names
+     * from the originating source are available, they are returned.
+     * Otherwise, an implementation of this method is free to create a
+     * name of this parameter, subject to the unquiness requirments.
      */
     public String getName() {
-        return name;
+        // As per the spec, if a parameter has no name, return argX,
+        // where x is the index.
+        //
+        // Note: spec updates now outlaw empty strings as parameter
+        // names.  The .equals("") is for compatibility with current
+        // JVM behavior.  It may be removed at some point.
+        if(name == null || name.equals(""))
+            return "arg" + index;
+        else
+            return name;
     }
 
     /**
@@ -190,20 +207,21 @@
     private transient volatile Class<?> parameterClassCache = null;
 
     /**
-     * Returns {@code true} if this parameter is a synthesized
-     * construct; returns {@code false} otherwise.
+     * Returns {@code true} if this parameter is implicitly declared
+     * in source code; returns {@code false} otherwise.
      *
-     * @return true if and only if this parameter is a synthesized
-     * construct as defined by
-     * <cite>The Java&trade; Language Specification</cite>.
+     * @return true if and only if this parameter is implicitly
+     * declared as defined by <cite>The Java&trade; Language
+     * Specification</cite>.
      */
-    public boolean isSynthesized() {
-        return Modifier.isSynthesized(getModifiers());
+    public boolean isImplicit() {
+        return Modifier.isMandated(getModifiers());
     }
 
     /**
-     * Returns {@code true} if this parameter is a synthetic
-     * construct; returns {@code false} otherwise.
+     * Returns {@code true} if this parameter is neither implicitly
+     * nor explicitly declared in source code; returns {@code false}
+     * otherwise.
      *
      * @jls 13.1 The Form of a Binary
      * @return true if and only if this parameter is a synthetic
@@ -233,15 +251,15 @@
      */
     public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
-
-        return AnnotationSupport.getOneAnnotation(declaredAnnotations(), annotationClass);
+        return annotationClass.cast(declaredAnnotations().get(annotationClass));
     }
 
     /**
      * {@inheritDoc}
      * @throws NullPointerException {@inheritDoc}
      */
-    public <T extends Annotation> T[] getAnnotations(Class<T> annotationClass) {
+    @Override
+    public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
         return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass);
@@ -267,11 +285,12 @@
     /**
      * @throws NullPointerException {@inheritDoc}
      */
-    public <T extends Annotation> T[] getDeclaredAnnotations(Class<T> annotationClass) {
+    @Override
+    public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass) {
         // Only annotations on classes are inherited, for all other
         // objects getDeclaredAnnotations is the same as
         // getAnnotations.
-        return getAnnotations(annotationClass);
+        return getAnnotationsByType(annotationClass);
     }
 
     /**
@@ -281,14 +300,6 @@
         return getDeclaredAnnotations();
     }
 
-    /**
-     * @throws NullPointerException {@inheritDoc}
-     */
-    public boolean isAnnotationPresent(
-        Class<? extends Annotation> annotationClass) {
-        return getAnnotation(annotationClass) != null;
-    }
-
     private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations;
 
     private synchronized Map<Class<? extends Annotation>, Annotation> declaredAnnotations() {
--- a/src/share/classes/java/lang/reflect/ReflectAccess.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/ReflectAccess.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -128,6 +128,10 @@
         return c.getRawParameterAnnotations();
     }
 
+    public byte[] getExecutableTypeAnnotationBytes(Executable ex) {
+        return ex.getTypeAnnotationBytes();
+    }
+
     //
     // Copying routines, needed to quickly fabricate new Field,
     // Method, and Constructor objects from templates
--- a/src/share/classes/java/lang/reflect/TypeVariable.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/lang/reflect/TypeVariable.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,4 +86,16 @@
      * @return the name of this type variable, as it appears in the source code
      */
     String getName();
+
+    /**
+     * Returns an array of AnnotatedType objects that represent the use of
+     * types to denote the upper bounds of the type parameter represented by
+     * this TypeVariable. The order of the objects in the array corresponds to
+     * the order of the bounds in the declaration of the type parameter.
+     *
+     * Returns an array of length 0 if the type parameter declares no bounds.
+     *
+     * @since 1.8
+     */
+     AnnotatedType[] getAnnotatedBounds();
 }
--- a/src/share/classes/java/math/BigDecimal.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/math/BigDecimal.java	Wed Feb 20 10:16:45 2013 -0800
@@ -3537,13 +3537,25 @@
             else
                 return expandBigIntegerTenPowers(n);
         }
-        // BigInteger.pow is slow, so make 10**n by constructing a
-        // BigInteger from a character string (still not very fast)
-        char tenpow[] = new char[n + 1];
-        tenpow[0] = '1';
-        for (int i = 1; i <= n; i++)
-            tenpow[i] = '0';
-        return new BigInteger(tenpow,1, tenpow.length);
+
+        if (n < 1024*524288) {
+            // BigInteger.pow is slow, so make 10**n by constructing a
+            // BigInteger from a character string (still not very fast)
+            // which occupies no more than 1GB (!) of memory.
+            char tenpow[] = new char[n + 1];
+            tenpow[0] = '1';
+            for (int i = 1; i <= n; i++) {
+                tenpow[i] = '0';
+            }
+            return new BigInteger(tenpow, 1, tenpow.length);
+        }
+
+        if ((n & 0x1) == 0x1) {
+            return BigInteger.TEN.multiply(bigTenToThe(n - 1));
+        } else {
+            BigInteger tmp = bigTenToThe(n/2);
+            return tmp.multiply(tmp);
+        }
     }
 
     /**
--- a/src/share/classes/java/nio/file/DirectoryStream.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/nio/file/DirectoryStream.java	Wed Feb 20 10:16:45 2013 -0800
@@ -122,8 +122,7 @@
  */
 
 public interface DirectoryStream<T>
-    extends Closeable, Iterable<T>
-{
+    extends Closeable, Iterable<T> {
     /**
      * An interface that is implemented by objects that decide if a directory
      * entry should be accepted or filtered. A {@code Filter} is passed as the
@@ -135,6 +134,7 @@
      *
      * @since 1.7
      */
+    @FunctionalInterface
     public static interface Filter<T> {
         /**
          * Decides if the given directory entry should be accepted or filtered.
--- a/src/share/classes/java/nio/file/PathMatcher.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/nio/file/PathMatcher.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
  * @see FileSystem#getPathMatcher
  * @see Files#newDirectoryStream(Path,String)
  */
-
+@FunctionalInterface
 public interface PathMatcher {
     /**
      * Tells if given path matches this matcher's pattern.
--- a/src/share/classes/java/security/KeyStore.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/security/KeyStore.java	Wed Feb 20 10:16:45 2013 -0800
@@ -219,6 +219,150 @@
     }
 
     /**
+     * Configuration data that specifies the keystores in a keystore domain.
+     * A keystore domain is a collection of keystores that are presented as a
+     * single logical keystore. The configuration data is used during
+     * {@code KeyStore}
+     * {@link #load(KeyStore.LoadStoreParameter) load} and
+     * {@link #store(KeyStore.LoadStoreParameter) store} operations.
+     * <p>
+     * The following syntax is supported for configuration data:
+     * <pre>
+     *
+     *     domain <domainName> [<property> ...] {
+     *         keystore <keystoreName> [<property> ...] ;
+     *         ...
+     *     };
+     *     ...
+     *
+     * </pre>
+     * where {@code domainName} and {@code keystoreName} are identifiers
+     * and {@code property} is a key/value pairing. The key and value are
+     * separated by an 'equals' symbol and the value is enclosed in double
+     * quotes. A property value may be either a printable string or a binary
+     * string of colon-separated pairs of hexadecimal digits. Multi-valued
+     * properties are represented as a comma-separated list of values,
+     * enclosed in square brackets.
+     * See {@link Arrays#toString(java.lang.Object[])}.
+     * <p>
+     * To ensure that keystore entries are uniquely identified, each
+     * entry's alias is prefixed by its {@code keystoreName} followed
+     * by the entry name separator and each {@code keystoreName} must be
+     * unique within its domain. Entry name prefixes are omitted when
+     * storing a keystore.
+     * <p>
+     * Properties are context-sensitive: properties that apply to
+     * all the keystores in a domain are located in the domain clause,
+     * and properties that apply only to a specific keystore are located
+     * in that keystore's clause.
+     * Unless otherwise specified, a property in a keystore clause overrides
+     * a property of the same name in the domain clause. All property names
+     * are case-insensitive. The following properties are supported:
+     * <dl>
+     * <dt> {@code keystoreType="<type>"} </dt>
+     *     <dd> The keystore type. </dd>
+     * <dt> {@code keystoreURI="<url>"} </dt>
+     *     <dd> The keystore location. </dd>
+     * <dt> {@code keystoreProviderName="<name>"} </dt>
+     *     <dd> The name of the keystore's JCE provider. </dd>
+     * <dt> {@code keystorePasswordEnv="<environment-variable>"} </dt>
+     *     <dd> The environment variable that stores a keystore password.
+     *          Alternatively, passwords may be supplied to the constructor
+     *          method in a {@code Map<String, ProtectionParameter>}. </dd>
+     * <dt> {@code entryNameSeparator="<separator>"} </dt>
+     *     <dd> The separator between a keystore name prefix and an entry name.
+     *          When specified, it applies to all the entries in a domain.
+     *          Its default value is a space. </dd>
+     * </dl>
+     * <p>
+     * For example, configuration data for a simple keystore domain
+     * comprising three keystores is shown below:
+     * <pre>
+     *
+     * domain app1 {
+     *     keystore app1-truststore
+     *         keystoreURI="file:///app1/etc/truststore.jks"
+     *
+     *     keystore system-truststore
+     *         keystoreURI="${java.home}/lib/security/cacerts"
+     *
+     *     keystore app1-keystore
+     *         keystoreType="PKCS12"
+     *         keystoreURI="file:///app1/etc/keystore.p12"
+     * };
+     *
+     * </pre>
+     * @since 1.8
+     */
+    public static final class DomainLoadStoreParameter
+        implements LoadStoreParameter {
+
+        private final URI configuration;
+        private final Map<String,ProtectionParameter> protectionParams;
+
+        /**
+         * Constructs a DomainLoadStoreParameter for a keystore domain with
+         * the parameters used to protect keystore data.
+         *
+         * @param configuration identifier for the domain configuration data.
+         *     The name of the target domain should be specified in the
+         *     {@code java.net.URI} fragment component when it is necessary
+         *     to distinguish between several domain configurations at the
+         *     same location.
+         *
+         * @param protectionParams the map from keystore name to the parameter
+         *     used to protect keystore data.
+         *     A {@code java.util.Collections.EMPTY_MAP} should be used
+         *     when protection parameters are not required or when they have
+         *     been specified by properties in the domain configuration data.
+         *     It is cloned to prevent subsequent modification.
+         *
+         * @exception NullPointerExcetion if {@code configuration} or
+         *     {@code protectionParams} is {@code null}
+         */
+        public DomainLoadStoreParameter(URI configuration,
+            Map<String,ProtectionParameter> protectionParams) {
+            if (configuration == null || protectionParams == null) {
+                throw new NullPointerException("invalid null input");
+            }
+            this.configuration = configuration;
+            this.protectionParams =
+                Collections.unmodifiableMap(new HashMap<>(protectionParams));
+        }
+
+        /**
+         * Gets the identifier for the domain configuration data.
+         *
+         * @return the identifier for the configuration data
+         */
+        public URI getConfiguration() {
+            return configuration;
+        }
+
+        /**
+         * Gets the keystore protection parameters for keystores in this
+         * domain.
+         *
+         * @return an unmodifiable map of keystore names to protection
+         *     parameters
+         */
+        public Map<String,ProtectionParameter> getProtectionParams() {
+            return protectionParams;
+        }
+
+        /**
+         * Gets the keystore protection parameters for this domain.
+         * Keystore domains do not support a protection parameter.
+         *
+         * @return always returns {@code null}
+         */
+        @Override
+        public KeyStore.ProtectionParameter getProtectionParameter() {
+            return null;
+        }
+    }
+
+    /**
      * A marker interface for keystore protection parameters.
      *
      * <p> The information stored in a <code>ProtectionParameter</code>
--- a/src/share/classes/java/sql/Date.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/sql/Date.java	Wed Feb 20 10:16:45 2013 -0800
@@ -25,6 +25,9 @@
 
 package java.sql;
 
+import java.time.Instant;
+import java.time.LocalDate;
+
 /**
  * <P>A thin wrapper around a millisecond value that allows
  * JDBC to identify this as an SQL <code>DATE</code> value.  A
@@ -113,7 +116,6 @@
         int firstDash;
         int secondDash;
         Date d = null;
-
         if (s == null) {
             throw new java.lang.IllegalArgumentException();
         }
@@ -255,4 +257,50 @@
     * compatibility.
     */
     static final long serialVersionUID = 1511598038487230103L;
+
+    /**
+     * Obtains an instance of {@code Date} from a {@link LocalDate} object
+     * with the same year, month and day of month value as the given
+     * {@code LocalDate}.
+     * <p>
+     * The provided {@code LocalDate} is interpreted as the local date
+     * in the local time zone.
+     *
+     * @param date a {@code LocalDate} to convert
+     * @return a {@code Date} object
+     * @exception NullPointerException if {@code date} is null
+     * @since 1.8
+     */
+    @SuppressWarnings("deprecation")
+    public static Date valueOf(LocalDate date) {
+        return new Date(date.getYear() - 1900, date.getMonthValue() -1,
+                        date.getDayOfMonth());
+    }
+
+    /**
+     * Converts this {@code Date} object to a {@code LocalDate}
+     * <p>
+     * The conversion creates a {@code LocalDate} that represents the same
+     * date value as this {@code Date} in local time zone
+     *
+     * @return a {@code LocalDate} object representing the same date value
+     *
+     * @since 1.8
+     */
+    @SuppressWarnings("deprecation")
+    public LocalDate toLocalDate() {
+        return LocalDate.of(getYear() + 1900, getMonth() + 1, getDate());
+    }
+
+   /**
+    * This method always throws an UnsupportedOperationException and should
+    * not be used because SQL {@code Date} values do not have a time
+    * component.
+    *
+    * @exception java.lang.UnsupportedOperationException if this method is invoked
+    */
+    @Override
+    public Instant toInstant() {
+        throw new java.lang.UnsupportedOperationException();
+    }
 }
--- a/src/share/classes/java/sql/JDBCType.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/sql/JDBCType.java	Wed Feb 20 10:16:45 2013 -0800
@@ -190,7 +190,17 @@
     /**
      * Identifies the generic SQL type {@code REF_CURSOR}.
      */
-    REF_CURSOR(Types.REF_CURSOR);
+    REF_CURSOR(Types.REF_CURSOR),
+
+    /**
+     * Identifies the generic SQL type {@code TIME_WITH_TIMEZONE}.
+     */
+    TIME_WITH_TIMEZONE(Types.TIME_WITH_TIMEZONE),
+
+    /**
+     * Identifies the generic SQL type {@code TIMESTAMP_WITH_TIMEZONE}.
+     */
+    TIMESTAMP_WITH_TIMEZONE(Types.TIMESTAMP_WITH_TIMEZONE);
 
     /**
      * The Integer value for the JDBCType.  It maps to a value in
--- a/src/share/classes/java/sql/SQLInput.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/sql/SQLInput.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -421,4 +421,38 @@
      */
     RowId readRowId() throws SQLException;
 
+    //--------------------------JDBC 4.2 -----------------------------
+
+    /**
+     * Reads the next attribute in the stream and returns it as an
+     * {@code Object} in the Java programming language. The
+     * actual type of the object returned is determined by the specified
+     * Java data type, and any customizations present in this
+     * stream's type map.
+     *
+     * <P>A type map is registered with the stream by the JDBC driver before the
+     * stream is passed to the application.
+     *
+     * <P>When the attribute at the head of the stream is an SQL {@code NULL}
+     * the method returns {@code null}. If the attribute is an SQL
+     * structured or distinct
+     * type, it determines the SQL type of the attribute at the head of the stream.
+     * If the stream's type map has an entry for that SQL type, the driver
+     * constructs an object of the appropriate class and calls the method
+     * {@code SQLData.readSQL} on that object, which reads additional data from the
+     * stream, using the protocol described for that method.
+     *<p>
+     * The default implementation will throw {@code SQLFeatureNotSupportedException}
+     *
+     * @param type Class representing the Java data type to convert the attribute to.
+     * @return the attribute at the head of the stream as an {@code Object} in the
+     * Java programming language;{@code null} if the attribute is SQL {@code NULL}
+     * @exception SQLException if a database access error occurs
+     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
+     * this method
+     * @since 1.8
+     */
+    default <T> T readObject(Class<T> type) throws SQLException {
+       throw new SQLFeatureNotSupportedException();
+    }
 }
--- a/src/share/classes/java/sql/SQLOutput.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/sql/SQLOutput.java	Wed Feb 20 10:16:45 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -272,7 +272,7 @@
    * Otherwise, it calls the <code>SQLData.writeSQL</code>
    * method of the given object, which
    * writes the object's attributes to the stream.
-   * The implementation of the method <code>SQLData.writeSQ</code>
+   * The implementation of the method <code>SQLData.writeSQL</code>
    * calls the appropriate <code>SQLOutput</code> writer method(s)
    * for writing each of the object's attributes in order.
    * The attributes must be read from an <code>SQLInput</code>
@@ -433,5 +433,43 @@
    */
   void writeSQLXML(SQLXML x) throws SQLException;
 
+  //--------------------------JDBC 4.2 -----------------------------
+
+  /**
+   * Writes to the stream the data contained in the given object. The
+   * object will be converted to the specified targetSqlType
+   * before being sent to the stream.
+   *<p>
+   * When the {@code object} is {@code null}, this
+   * method writes an SQL {@code NULL} to the stream.
+   * <p>
+   * If the object has a custom mapping (is of a class implementing the
+   * interface {@code SQLData}),
+   * the JDBC driver should call the method {@code SQLData.writeSQL} to
+   * write it to the SQL data stream.
+   * If, on the other hand, the object is of a class implementing
+   * {@code Ref}, {@code Blob}, {@code Clob},  {@code NClob},
+   *  {@code Struct}, {@code java.net.URL},
+   * or {@code Array}, the driver should pass it to the database as a
+   * value of the corresponding SQL type.
+   *<P>
+   * The default implementation will throw {@code SQLFeatureNotSupportedException}
+   *
+   * @param x the object containing the input parameter value
+   * @param targetSqlType the SQL type to be sent to the database.
+   * @exception SQLException if a database access error occurs  or
+   *            if the Java Object specified by x is an InputStream
+   *            or Reader object and the value of the scale parameter is less
+   *            than zero
+   * @exception SQLFeatureNotSupportedException if
+   * the JDBC driver does not support this data type
+   * @see JDBCType
+   * @see SQLType
+   * @since 1.8
+   */
+  default void writeObject(Object x, SQLType targetSqlType) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+  }
 
 }
+
--- a/src/share/classes/java/sql/Time.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/sql/Time.java	Wed Feb 20 10:16:45 2013 -0800
@@ -25,6 +25,9 @@
 
 package java.sql;
 
+import java.time.Instant;
+import java.time.LocalTime;
+
 /**
  * <P>A thin wrapper around the <code>java.util.Date</code> class that allows the JDBC
  * API to identify this as an SQL <code>TIME</code> value. The <code>Time</code>
@@ -246,4 +249,45 @@
     * compatibility.
     */
     static final long serialVersionUID = 8397324403548013681L;
+
+    /**
+     * Obtains an instance of {@code Time} from a {@link LocalTime} object
+     * with the same hour, minute and second time value as the given
+     * {@code LocalTime}.
+     *
+     * @param time a {@code LocalTime} to convert
+     * @return a {@code Time} object
+     * @exception NullPointerException if {@code time} is null
+     * @since 1.8
+     */
+    @SuppressWarnings("deprecation")
+    public static Time valueOf(LocalTime time) {
+        return new Time(time.getHour(), time.getMinute(), time.getSecond());
+    }
+
+    /**
+     * Converts this {@code Time} object to a {@code LocalTime}.
+     * <p>
+     * The conversion creates a {@code LocalTime} that represents the same
+     * hour, minute, and second time value as this {@code Time}.
+     *
+     * @return a {@code LocalTime} object representing the same time value
+     * @since 1.8
+     */
+    @SuppressWarnings("deprecation")
+    public LocalTime toLocalTime() {
+        return LocalTime.of(getHours(), getMinutes(), getSeconds());
+    }
+
+   /**
+    * This method always throws an UnsupportedOperationException and should
+    * not be used because SQL {@code Time} values do not have a date
+    * component.
+    *
+    * @exception java.lang.UnsupportedOperationException if this method is invoked
+    */
+    @Override
+    public Instant toInstant() {
+        throw new java.lang.UnsupportedOperationException();
+    }
 }
--- a/src/share/classes/java/sql/Timestamp.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/sql/Timestamp.java	Wed Feb 20 10:16:45 2013 -0800
@@ -25,6 +25,8 @@
 
 package java.sql;
 
+import java.time.Instant;
+import java.time.LocalDateTime;
 import java.util.StringTokenizer;
 
 /**
@@ -485,7 +487,6 @@
             }
         }
         return i;
-
     }
 
     /**
@@ -530,4 +531,89 @@
 
     static final long serialVersionUID = 2745179027874758501L;
 
+    private static final int MILLIS_PER_SECOND = 1000;
+
+    /**
+     * Obtains an instance of {@code Timestamp} from a {@code LocalDateTime}
+     * object, with the same year, month, day of month, hours, minutes,
+     * seconds and nanos date-time value as the provided {@code LocalDateTime}.
+     * <p>
+     * The provided {@code LocalDateTime} is interpreted as the local
+     * date-time in the local time zone.
+     *
+     * @param dateTime a {@code LocalDateTime} to convert
+     * @return a {@code Timestamp} object
+     * @exception NullPointerException if {@code dateTime} is null.
+     * @since 1.8
+     */
+    @SuppressWarnings("deprecation")
+    public static Timestamp valueOf(LocalDateTime dateTime) {
+        return new Timestamp(dateTime.getYear() - 1900,
+                             dateTime.getMonthValue() - 1,
+                             dateTime.getDayOfMonth(),
+                             dateTime.getHour(),
+                             dateTime.getMinute(),
+                             dateTime.getSecond(),
+                             dateTime.getNano());
+    }
+
+    /**
+     * Converts this {@code Timestamp} object to a {@code LocalDateTime}.
+     * <p>
+     * The conversion creates a {@code LocalDateTime} that represents the
+     * same year, month, day of month, hours, minutes, seconds and nanos
+     * date-time value as this {@code Timestamp} in the local time zone.
+     *
+     * @return a {@code LocalDateTime} object representing the same date-time value
+     * @since 1.8
+     */
+    @SuppressWarnings("deprecation")
+    public LocalDateTime toLocalDateTime() {
+        return LocalDateTime.of(getYear() + 1900,
+                                getMonth() + 1,
+                                getDate(),
+                                getHours(),
+                                getMinutes(),
+                                getSeconds(),
+                                getNanos());
+    }
+
+    /**
+     * Obtains an instance of {@code Timestamp} from an {@link Instant} object.
+     * <p>
+     * {@code Instant} can store points on the time-line further in the future
+     * and further in the past than {@code Date}. In this scenario, this method
+     * will throw an exception.
+     *
+     * @param instant  the instant to convert
+     * @return an {@code Timestamp} representing the same point on the time-line as
+     *  the provided instant
+     * @exception NullPointerException if {@code instant} is null.
+     * @exception IllegalArgumentException if the instant is too large to
+     *  represent as a {@code Timesamp}
+     * @since 1.8
+     */
+    public static Timestamp from(Instant instant) {
+        try {
+            Timestamp stamp = new Timestamp(instant.getEpochSecond() * MILLIS_PER_SECOND);
+            stamp.nanos = instant.getNano();
+            return stamp;
+        } catch (ArithmeticException ex) {
+            throw new IllegalArgumentException(ex);
+        }
+    }
+
+    /**
+     * Converts this {@code Timestamp} object to an {@code Instant}.
+     * <p>
+     * The conversion creates an {@code Instant} that represents the same
+     * point on the time-line as this {@code Timestamp}.
+     *
+     * @return an instant representing the same point on the time-line
+     * @since 1.8
+     */
+    @Override
+    public Instant toInstant() {
+        return Instant.ofEpochSecond(super.getTime() / MILLIS_PER_SECOND, nanos);
+    }
 }
--- a/src/share/classes/java/sql/Types.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/sql/Types.java	Wed Feb 20 10:16:45 2013 -0800
@@ -319,6 +319,24 @@
      */
     public static final int REF_CURSOR = 2012;
 
+    /**
+     * The constant in the Java programming language, sometimes referred to
+     * as a type code, that identifies the generic SQL type
+     * {@code TIME WITH TIMEZONE}.
+     *
+     * @since 1.8
+     */
+    public static final int TIME_WITH_TIMEZONE = 2013;
+
+    /**
+     * The constant in the Java programming language, sometimes referred to
+     * as a type code, that identifies the generic SQL type
+     * {@code TIMESTAMP WITH TIMEZONE}.
+     *
+     * @since 1.8
+     */
+    public static final int TIMESTAMP_WITH_TIMEZONE = 2014;
+
     // Prevent instantiation
     private Types() {}
 }
--- a/src/share/classes/java/time/Clock.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/time/Clock.java	Wed Feb 20 10:16:45 2013 -0800
@@ -377,60 +377,57 @@
      * an instant on the time-line rather than a raw millisecond value.
      * This method is provided to allow the use of the clock in high performance use cases
      * where the creation of an object would be unacceptable.
+     * <p>
+     * The default implementation currently calls {@link #instant}.
      *
      * @return the current millisecond instant from this clock, measured from
      *  the Java epoch of 1970-01-01T00:00 UTC, not null
      * @throws DateTimeException if the instant cannot be obtained, not thrown by most implementations
      */
-    public abstract long millis();
+    public long millis() {
+        return instant().toEpochMilli();
+    }
 
     //-----------------------------------------------------------------------
     /**
      * Gets the current instant of the clock.
      * <p>
      * This returns an instant representing the current instant as defined by the clock.
-     * <p>
-     * The default implementation currently calls {@link #millis}.
      *
      * @return the current instant from this clock, not null
      * @throws DateTimeException if the instant cannot be obtained, not thrown by most implementations
      */
-    public Instant instant() {
-        return Instant.ofEpochMilli(millis());
-    }
+    public abstract Instant instant();
 
     //-----------------------------------------------------------------------
     /**
      * Checks if this clock is equal to another clock.
      * <p>
-     * Clocks must compare equal based on their state and behavior.
+     * Clocks should override this method to compare equals based on
+     * their state and to meet the contract of {@link Object#equals}.
+     * If not overridden, the behavior is defined by {@link Object#equals}
      *
      * @param obj  the object to check, null returns false
      * @return true if this is equal to the other clock
      */
     @Override
-    public abstract boolean equals(Object obj);
+    public boolean equals(Object obj) {
+        return super.equals(obj);
+    }
 
     /**
      * A hash code for this clock.
+     * <p>
+     * Clocks should override this method based on
+     * their state and to meet the contract of {@link Object#hashCode}.
+     * If not overridden, the behavior is defined by {@link Object#hashCode}
      *
      * @return a suitable hash code
      */
     @Override
-    public abstract int hashCode();
-
-    //-----------------------------------------------------------------------
-    /**
-     * Returns a string describing this clock.
-     * <p>
-     * Clocks must have a string representation based on their state and behavior.
-     * For example, 'System[Europe/Paris]' could be used to represent the System
-     * clock in the 'Europe/Paris' time-zone.
-     *
-     * @return a string representation of this clock, not null
-     */
-    @Override
-    public abstract String toString();
+    public  int hashCode() {
+        return super.hashCode();
+    }
 
     //-----------------------------------------------------------------------
     /**
@@ -460,6 +457,10 @@
             return System.currentTimeMillis();
         }
         @Override
+        public Instant instant() {
+            return Instant.ofEpochMilli(millis());
+        }
+        @Override
         public boolean equals(Object obj) {
             if (obj instanceof SystemClock) {
                 return zone.equals(((SystemClock) obj).zone);
--- a/src/share/classes/java/time/DayOfWeek.java	Wed Feb 20 16:39:46 2013 +0100
+++ b/src/share/classes/java/time/DayOfWeek.java	Wed Feb 20 10:16:45 2013 -0800
@@ -170,8 +170,9 @@
     /**
      * Obtains an instance of {@code DayOfWeek} from a temporal object.
      * <p>
-     * A {@code TemporalAccessor} represents some form of date and time information.
-     * This factory converts the arbitrary temporal object to an instance of {@code DayOfWeek}.
+     * This obtains a day-of-week based on the specified temporal.
+     * A {@code TemporalAccessor} represents an arbitrary set of date and time information,
+     * which this factory converts to an instance of {@code DayOfWeek}.
      * <p>
      * The conversion extracts the {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} field.
      * <p>
@@ -206,8 +207,9 @@
     /**
      * Gets the textual representation, such as 'Mon' or 'Friday'.
      * <p>
-     * This returns the textual name used to identify the day-of-week.
-     * The parameters control the length of the returned text and the locale.
+     * This returns the textual name used to identify the day-of-week,
+     * suitable for presentation to the user.
+     * The parameters control the style of the returned text and the locale.
      * <p>
      * If no textual mapping is found then the {@link #getValue() numeric value} is returned.
      *
@@ -215,8 +217,8 @@
      * @param locale  the locale to use, not null
      * @return the text value of the day-of-week, not null
      */
-    public String getText(TextStyle style, Locale locale) {
-        return new DateTimeFormatterBuilder().appendText(DAY_OF_WEEK, style).toFormatter(locale).print(this);
+    public String getDisplayName(TextStyle style, Locale locale) {
+        return new DateTimeFormatterBuilder().appendText(DAY_OF_WEEK, style).toFormatter(locale).format(this);
     }
 
     //-----------------------------------------------------------------------
@@ -232,7 +234,7 @@
      * All other {@code ChronoField} instances will return false.
      * <p>
      * If the field is not a {@code ChronoField}, then the result of this method
-     * is obtained by invoking {@code TemporalField.doIsSupported(TemporalAccessor)}
+     * is obtained by invoking {@code TemporalField.isSupportedBy(TemporalAccessor)}
      * passing {@code this} as the argument.
      * Whether the field is supported is determined by the field.
      *
@@ -244,7 +246,7 @@
         if (field instanceof ChronoField) {
             return field == DAY_OF_WEEK;
         }
-        return field != null && field.doIsSupported(this);
+        return field != null && field.isSupportedBy(this);
     }
 
     /**
@@ -260,7 +262,7 @@
      * All other {@code ChronoField} instances will throw a {@code DateTimeException}.
      * <p>
      * If the field is not a {@code ChronoField}, then the result of this method